]> granicus.if.org Git - llvm/commit
[AVR] Fix a bug where the frame pointer is clobbered
authorDylan McKay <me@dylanmckay.io>
Tue, 2 May 2017 00:11:34 +0000 (00:11 +0000)
committerDylan McKay <me@dylanmckay.io>
Tue, 2 May 2017 00:11:34 +0000 (00:11 +0000)
commitb0cacfc25f613529b8aaba24b6db7baef589612d
tree0ad4d3a0570a4906baf04e4196dc96cb2f0c6d70
parent4d11ee489b797f39652fb39a5ec70762aaf57501
[AVR] Fix a bug where the frame pointer is clobbered

Because it was a callee-saved register, we automatically generated code
to spill and unspill its original value so that it is restored after the
function returns.

The problem is that this code was being generated before the epilogue.
The epilogue itself uses the Y register, which could be prematurely
restored by the CSR restoration process.

This removes R29R28 from the CSR list and changes the prologue/epilogue
code to handle it explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301887 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AVR/AVRFrameLowering.cpp