[PowerPC] Fix unwind info with dynamic stack realignment
authorJay Foad <jay.foad@gmail.com>
Mon, 1 Dec 2014 09:42:32 +0000 (09:42 +0000)
committerJay Foad <jay.foad@gmail.com>
Mon, 1 Dec 2014 09:42:32 +0000 (09:42 +0000)
commit8b9cea42db8ecd0903079732294fb216fabfe208
tree60406dfcc395fea2e3f415e74972b527154f9a0d
parent5e6e75a48ea3587ae3795506ee14356d9762f815
[PowerPC] Fix unwind info with dynamic stack realignment

Summary:
PowerPC DWARF unwind info defined CFA as SP + offset even in a function
where the stack had been dynamically realigned. This clearly doesn't
work because the offset from SP to CFA is not a constant. Fix it by
defining CFA as BP instead.

This was causing the AddressSanitizer null_deref test to fail 50% of
the time, depending on whether SP happened to be 32-byte aligned on
entry to a particular function or not.

Reviewers: willschm, uweigand, hfinkel

Reviewed By: hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6410

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222996 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCFrameLowering.cpp
test/CodeGen/PowerPC/stack-realign.ll