Mark the return address stack slot as mutable when moving the return address
authorArnold Schwaighofer <arnold.schwaighofer@gmail.com>
Mon, 22 Feb 2010 16:18:09 +0000 (16:18 +0000)
committerArnold Schwaighofer <arnold.schwaighofer@gmail.com>
Mon, 22 Feb 2010 16:18:09 +0000 (16:18 +0000)
commit9265275a9a5d80ce7005d4f6af134efce52a66af
treef4299c0c70de8631393f3f5fa8fe970bb5e5fd1e
parent3591b908432430f83963aa12e086092b27a85967
Mark the return address stack slot as mutable when moving the return address
during a tail call. A parameter might overwrite this stack slot during the tail
call.

The sequence during a tail call is:
1.) load return address to temp reg
2.) move parameters (might involve storing to return address stack slot)
3.) store return address to new location from temp reg

If the stack location is marked immutable CodeGen can colocate load (1) with the
store (3).

This fixes bug 6225.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96783 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll [new file with mode: 0644]