summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDario Domizioli <dario.domizioli@gmail.com>2014-11-11 18:44:49 +0000
committerDario Domizioli <dario.domizioli@gmail.com>2014-11-11 18:44:49 +0000
commite904e85faf52e179eea69043c3a150700f8bd040 (patch)
tree1f02a8826581933d27ef7bb0a65b538a4b27cd1a /llvm/lib/Target
parent590e943a818dc372c966ffec25c919382d741b76 (diff)
downloadbcm5719-llvm-e904e85faf52e179eea69043c3a150700f8bd040.tar.gz
bcm5719-llvm-e904e85faf52e179eea69043c3a150700f8bd040.zip
[X86][ELF] Fix PR20243 - leaf frame pointer bug with TLS access
The ISel lowering for global TLS access in PIC mode was creating a pseudo instruction that is later expanded to a call, but the code was not setting the hasCalls flag in the MachineFrameInfo alongside the adjustsStack flag. This caused some functions to be mistakenly recognized as leaf functions, and this in turn affected the decision to eliminate the frame pointer. With the fix, hasCalls is properly set and the leaf frame pointer is correctly preserved. llvm-svn: 221695
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 8fe82118c4e..8f03707f170 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -12792,6 +12792,7 @@ GetTLSADDR(SelectionDAG &DAG, SDValue Chain, GlobalAddressSDNode *GA,
// TLSADDR will be codegen'ed as call. Inform MFI that function has calls.
MFI->setAdjustsStack(true);
+ MFI->setHasCalls(true);
SDValue Flag = Chain.getValue(1);
return DAG.getCopyFromReg(Chain, dl, ReturnReg, PtrVT, Flag);
OpenPOWER on IntegriCloud