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

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 04:13:49 PDT 2020


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.

// Martin


More information about the llvm-commits mailing list