[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)
commit1f0a44e6626f8ecb9814818f1c6f9738b447737f
treed1cfc7aed84e0f78787c499b4739461e0c13828f
parentf3470cc979c7314e5d5d0cae16d2eb24f0cf11e0
[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

llvm-svn: 222996
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
llvm/test/CodeGen/PowerPC/stack-realign.ll