[X86][ELF] Fix PR20243 - leaf frame pointer bug with TLS access
authorDario Domizioli <dario.domizioli@gmail.com>
Tue, 11 Nov 2014 18:44:49 +0000 (18:44 +0000)
committerDario Domizioli <dario.domizioli@gmail.com>
Tue, 11 Nov 2014 18:44:49 +0000 (18:44 +0000)
commit949d328beef578474e3a8ab6eb790fb3b305aa2d
treee6fcdbf1e3f77a13bafa5e1b143fb7c13e11e33b
parent659b1491b81709e9ca4a35997865a61f5c0afd9d
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221695 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/tls-addr-non-leaf-function.ll [new file with mode: 0644]