From: Richard Sandiford <richard.sandiford@arm.com>
To: Christophe Lyon <christophe.lyon@arm.com>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v3 2/2] aarch64: Fix bit-field alignment in param passing [PR105549]
Date: Thu, 12 Jan 2023 13:19:49 +0000 [thread overview]
Message-ID: <mptlem7x53e.fsf@arm.com> (raw)
In-Reply-To: <20230111141806.258233-2-christophe.lyon@arm.com> (Christophe Lyon's message of "Wed, 11 Jan 2023 15:18:06 +0100")
Christophe Lyon <christophe.lyon@arm.com> writes:
> While working on enabling DFP for AArch64, I noticed new failures in
> gcc.dg/compat/struct-layout-1.exp (t028) which were not actually
> caused by DFP types handling. These tests are generated during 'make
> check' and enabling DFP made generation different (not sure if new
> non-DFP tests are generated, or if existing ones are generated
> differently, the tests in question are huge and difficult to compare).
>
> Anyway, I reduced the problem to what I attach at the end of the new
> gcc.target/aarch64/aapcs64/va_arg-17.c test and rewrote it in the same
> scheme as other va_arg* AArch64 tests. Richard Sandiford further
> reduced this to a non-vararg function, added as a second testcase.
>
> This is a tough case mixing bit-fields and alignment, where
> aarch64_function_arg_alignment did not follow what its descriptive
> comment says: we want to use the natural alignment of the bit-field
> type only if the user didn't reduce the alignment for the bit-field
> itself.
>
> The patch also adds a comment and assert that would help someone who
> has to look at this area again.
>
> The fix would be very small, except that this introduces a new ABI
> break, and we have to warn about that. Since this actually fixes a
> problem introduced in GCC 9.1, we keep the old computation to detect
> when we now behave differently.
>
> This patch adds two new tests (va_arg-17.c and
> pr105549.c). va_arg-17.c contains the reduced offending testcase from
> struct-layout-1.exp for reference. We update some tests introduced by
> the previous patch, where parameters with bit-fields and packed
> attribute now emit a different warning.
>
> v2->v3: testcase update
>
> 2022-11-28 Christophe Lyon <christophe.lyon@arm.com>
> Richard Sandiford <richard.sandiford@arm.com>
>
> gcc/
> PR target/105549
> * config/aarch64/aarch64.cc (aarch64_function_arg_alignment):
> Check DECL_PACKED for bitfield.
> (aarch64_layout_arg): Warn when parameter passing ABI changes.
> (aarch64_function_arg_boundary): Do not warn here.
> (aarch64_gimplify_va_arg_expr): Warn when parameter passing ABI
> changes.
>
> gcc/testsuite/
> PR target/105549
> * gcc.target/aarch64/bitfield-abi-warning-align16-O2.c: Update.
> * gcc.target/aarch64/bitfield-abi-warning-align16-O2-extra.c: Update.
> * gcc.target/aarch64/bitfield-abi-warning-align32-O2.c: Update.
> * gcc.target/aarch64/bitfield-abi-warning-align32-O2-extra.c: Update.
> * gcc.target/aarch64/aapcs64/va_arg-17.c: New test.
> * gcc.target/aarch64/pr105549.c: New test.
> * g++.target/aarch64/bitfield-abi-warning-align16-O2.C: Update.
> * g++.target/aarch64/bitfield-abi-warning-align16-O2-extra.C: Update.
> * g++.target/aarch64/bitfield-abi-warning-align32-O2.C: Update.
> * g++.target/aarch64/bitfield-abi-warning-align32-O2-extra.C: Update.
> ---
> gcc/config/aarch64/aarch64.cc | 148 ++++++++++++++----
> .../bitfield-abi-warning-align16-O2-extra.C | 64 ++++----
> .../aarch64/bitfield-abi-warning-align16-O2.C | 48 +++---
> .../bitfield-abi-warning-align32-O2-extra.C | 131 +++++++---------
> .../aarch64/bitfield-abi-warning-align32-O2.C | 132 ++++++++--------
> .../gcc.target/aarch64/aapcs64/va_arg-17.c | 105 +++++++++++++
> .../bitfield-abi-warning-align16-O2-extra.c | 64 ++++----
> .../aarch64/bitfield-abi-warning-align16-O2.c | 48 +++---
> .../bitfield-abi-warning-align32-O2-extra.c | 131 +++++++---------
> .../aarch64/bitfield-abi-warning-align32-O2.c | 132 ++++++++--------
> gcc/testsuite/gcc.target/aarch64/pr105549.c | 12 ++
> 11 files changed, 587 insertions(+), 428 deletions(-)
> create mode 100644 gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-17.c
> create mode 100644 gcc/testsuite/gcc.target/aarch64/pr105549.c
> [...]
> @@ -68,14 +62,14 @@
> /* { dg-note {parameter passing for argument of type 'S4' changed in GCC 9.1} "" { target *-*-* } 103 } f4_stdarg */
> /* { dg-note {parameter passing for argument of type 'S8' changed in GCC 9.1} "" { target *-*-* } 104 } f8_stdarg */
>
> -/* Parameter passing for these should not have changed in GCC 9.1 (PR 105549).
> +/* FIXME Parameter passing for these should not have changed in GCC 9.1 (PR 105549).
> Fortunately we warn. Note the discrepancy with lines 120-124 below: we warn
> in the callee, but not in the caller. */
Looks like a stray change. Same for the C test.
OK otherwise, thanks.
Richard
next prev parent reply other threads:[~2023-01-12 13:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 14:18 [PATCH v3 1/2] aarch64: fix warning emission for ABI break since GCC 9.1 Christophe Lyon
2023-01-11 14:18 ` [PATCH v3 2/2] aarch64: Fix bit-field alignment in param passing [PR105549] Christophe Lyon
2023-01-12 13:19 ` Richard Sandiford [this message]
2023-01-12 13:38 ` Christophe Lyon
2023-01-13 15:38 ` Jakub Jelinek
2023-01-13 19:25 ` Jakub Jelinek
2023-01-13 19:50 ` Jakub Jelinek
2023-01-15 16:54 ` Christophe Lyon
2023-01-17 12:43 ` Christophe Lyon
2023-01-17 12:48 ` Jakub Jelinek
2023-01-17 12:50 ` Christophe Lyon
2023-01-12 13:03 ` [PATCH v3 1/2] aarch64: fix warning emission for ABI break since GCC 9.1 Richard Sandiford
2023-01-12 13:39 ` Christophe Lyon
2023-01-25 14:30 ` Christophe Lyon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mptlem7x53e.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=christophe.lyon@arm.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).