[llvm] 9936455 - Reapply D70800: Fix AArch64 AAPCS frame record chain

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 09:49:40 PDT 2020



> On Aug 27, 2020, at 4:13 AM, Martin Storsjö <martin at martin.st> wrote:
> 
> On Thu, 27 Aug 2020, Owen Anderson wrote:
> 
>> 
>>      On Aug 27, 2020, at 12:02 AM, Owen Anderson <resistor at mac.com>
>>      wrote:
>> 
>>      On Aug 26, 2020, at 11:43 PM, Martin Storsjö
>>      <martin at martin.st> wrote:
>> 
>>      On Wed, 26 Aug 2020, Owen Anderson via llvm-commits wrote:
>> 
>>            Author: Owen Anderson
>>            Date: 2020-08-26T19:38:38Z
>>            New Revision:
>>            9936455204fd6ab72715cc9d67385ddc93e072ed
>> 
>>            URL:https://github.com/llvm/llvm-project/commit/9936455204fd6ab72715cc9d67385dd
>>            c93e072ed
>>            DIFF:https://github.com/llvm/llvm-project/commit/9936455204fd6ab72715cc9d67385dd
>>            c93e072ed.diff
>> 
>>            LOG: Reapply D70800: Fix AArch64 AAPCS frame
>>            record chain
>> 
>>      This commit caused failed assertions, so I went ahead and
>>      reverted it - see the revert commit message for a reduced
>>      reproduction case.
>> Thank you for the test case, I’ll track down the issue.
>> After debugging this test case, it looks like the assertion in question is
>> simply erroneous.  A non-multiple-of-16 stack adjustment *is* required in
>> this test case.
>> Can you try disabling that assertion and seeing if whatever code you
>> extracted this test from now works?
> 
> It sure looks like the code works fine with that assertion removed, and indeed, "sub sp, x29, #8" should be quite valid.
> 
> Although I'm not sure if AAPCS or anything else says that x29 should stay aligned to 16 bytes just like the stack pointer itself? (In that case, we should make sure to push the x29,x30 pair on the stack at an aligned location.) Out of the two - x29 not pointing at the x29,x30 pair, or x29 not being 16 byte aligned - the latter does sound like less of an issue.

I double-checked the AAPCS spec and it does not specify anything regarding the alignment of the frame record on the stack.  If we find a reason to require it to be aligned, we should be able to fix that separately in the future.

My proposed solution is to relax the assertion to require 8 byte alignment, which is still true after this change.

—Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/f8180988/attachment.html>


More information about the llvm-commits mailing list