]> git.ipfire.org Git - people/ms/gcc.git/commit
aarch64: Don't emit -Wpsabi note when ABI was never affected [PR91710]
authorJakub Jelinek <jakub@redhat.com>
Fri, 16 Apr 2021 18:49:33 +0000 (20:49 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 16 Apr 2021 18:49:33 +0000 (20:49 +0200)
commit49813aad3292f7f2bef69206274da78a9a7116ed
treea539db71a7c6c3444101ad4372dd2a48f6788f0d
parent4a1493f0603262a7dc1114d9827353e9810e63dc
aarch64: Don't emit -Wpsabi note when ABI was never affected [PR91710]

As the following testcase shows, we emit a -Wpsabi note about argument
passing change since GCC 9, but in reality the ABI didn't change.
The alignment is 8 bits in GCC < 9 and 32 bits in GCC >= 9 and
the aarch64_function_arg_alignment returns in that case:
return MIN (MAX (alignment, PARM_BOUNDARY), STACK_BOUNDARY);
so when both the old and new alignment are smaller or equal to PARM_BOUNDARY
(or both are larger than STACK_BOUNDARY, just in theory), even when the new
one is bigger, it doesn't change the argument passing.

So, the following patch changes aarch64_function_arg_alignment to tell the
callers the exact old alignmentm so that they can test it if needed.
The other aarch64_function_arg_alignment callers either check the
alignment for equality against 16-byte alignment (when old alignment was
smaller than that and the new one is 16-byte, we want to emit -Wpsabi
in all the cases) or the va_arg case which I think is ok now too.

2021-04-16  Jakub Jelinek  <jakub@redhat.com>

PR target/91710
* config/aarch64/aarch64.c (aarch64_function_arg_alignment): Change
abi_break argument from bool * to unsigned *, store there the pre-GCC 9
alignment.
(aarch64_layout_arg, aarch64_gimplify_va_arg_expr): Adjust callers.
(aarch64_function_arg_regno_p): Likewise.  Only emit -Wpsabi note if
the old and new alignment after applying MIN/MAX to it is different.

* gcc.target/aarch64/pr91710.c: New test.
gcc/config/aarch64/aarch64.c
gcc/testsuite/gcc.target/aarch64/pr91710.c [new file with mode: 0644]