public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105549] aarch64: Wrong va_arg alignment handling with packed bitfields and alignment Date: Thu, 12 Jan 2023 13:44:41 +0000 [thread overview] Message-ID: <bug-105549-4-nzEFm4sUTd@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105549-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105549 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>: https://gcc.gnu.org/g:6610daa1cfb75b72500c22ae97988ec2a48b85c6 commit r13-5124-g6610daa1cfb75b72500c22ae97988ec2a48b85c6 Author: Christophe Lyon <christophe.lyon@arm.com> Date: Fri Nov 25 13:35:11 2022 +0000 aarch64: Fix bit-field alignment in param passing [PR105549] 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. 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.
next prev parent reply other threads:[~2023-01-12 13:44 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-10 13:26 [Bug target/105549] New: aarch64: Wrong va_arg alignment handling clyon at gcc dot gnu.org 2022-05-10 13:27 ` [Bug target/105549] " clyon at gcc dot gnu.org 2022-05-10 14:55 ` clyon at gcc dot gnu.org 2022-10-28 20:24 ` [Bug target/105549] aarch64: Wrong va_arg alignment handling with packed bitfields and alignment pinskia at gcc dot gnu.org 2023-01-12 13:44 ` cvs-commit at gcc dot gnu.org 2023-01-12 13:44 ` cvs-commit at gcc dot gnu.org [this message] 2023-01-12 13:50 ` clyon at gcc dot gnu.org 2023-01-25 14:24 ` cvs-commit at gcc dot gnu.org 2023-01-25 14:26 ` cvs-commit at gcc dot gnu.org 2023-01-25 14:28 ` cvs-commit at gcc dot gnu.org 2023-01-25 14:31 ` clyon at gcc dot gnu.org 2023-01-25 16:36 ` pinskia at gcc dot gnu.org
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=bug-105549-4-nzEFm4sUTd@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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: linkBe 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).