This was broken long ago in D12208, which failed to account for the fact that 64-bit SPARC uses a stack bias of 2047, and it is the *unbiased* value which should be aligned, not the biased one. This was seen to be an issue with Rust.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Can you please add a test for this? There is already a test in stack-align.ll that covers 32bit stack realignment, you can probably modify that testcase to cover 64bit also.
Hopefully someone with more SPARC V9 knowledge can chip in to verify the correctness of the patch.
Comment Actions
I've added a 64-bit test to CodeGen/SPARC/stack-align.ll, and fixed the comment in SparcFrameLowering.cpp for the final instruction (%g1 and %o6 were round the wrong way in the comment).