summaryrefslogtreecommitdiff
path: root/lib/Target/XCore/XCoreTargetObjectFile.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-21 07:04:30 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-21 07:04:30 +0000
commit072ebe59e2b05af9e67a691163273b9ab2b96b3b (patch)
treec743b0b007f62af9799dd37e37a9f35f4fbfc10a /lib/Target/XCore/XCoreTargetObjectFile.cpp
parent6079f00035e029f12e4be0281aa2cbfbb4817141 (diff)
downloadllvm-072ebe59e2b05af9e67a691163273b9ab2b96b3b.tar.gz
llvm-072ebe59e2b05af9e67a691163273b9ab2b96b3b.tar.bz2
llvm-072ebe59e2b05af9e67a691163273b9ab2b96b3b.tar.xz
The basic problem is that some mainstream programs cannot deal with the way
clang optimizes tail calls, as in this example: int foo(void); int bar(void) { return foo(); } where the call is transformed to: calll .L0$pb .L0$pb: popl %eax .Ltmp0: addl $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax movl foo@GOT(%eax), %eax popl %ebp jmpl *%eax # TAILCALL However, the GOT references must all be resolved at dlopen() time, and so this approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which usually populates the PLT with stubs that perform the actual resolving. This patch changes X86TargetLowering::LowerCall() to skip tail call optimization, if the called function is a global or external symbol. Patch by Dimitry Andric! PR15086 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreTargetObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions