From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 197533858C00; Wed, 25 Jan 2023 14:24:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 197533858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674656665; bh=vFYK2xOKyIAcEougqU5wxRZOVqyAi/zzEneDyDegnA0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EjkQDP0lyzzwtUPtuTSviRjkZtziy07PI4ixn4fYlvmiYPGTCz/ACXNdF4RILsaDA FZAcqwQTq1icl6Q1IPzXzhFWqZw8PmF5EStUj5dPmms3Zg0Jw/F2NWX1t6q6UQBIwu IUJS3CmlE1Q2AwgXejfLl3oAcsp+Fe772BacRhXo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105549] aarch64: Wrong va_arg alignment handling with packed bitfields and alignment Date: Wed, 25 Jan 2023 14:24:22 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: clyon at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105549 --- Comment #6 from CVS Commits --- The releases/gcc-10 branch has been updated by Christophe Lyon : https://gcc.gnu.org/g:fea013065580084578b1b78d8f727c0323f2a9a0 commit r10-11174-gfea013065580084578b1b78d8f727c0323f2a9a0 Author: Christophe Lyon Date: Tue Jan 24 09:46:30 2023 +0000 [PATCH] aarch64: fix warning emission for ABI break since GCC 9.1 While looking at PR 105549, which is about fixing the ABI break introduced in GCC 9.1 in parameter alignment with bit-fields, we noticed that the GCC 9.1 warning is not emitted in all the cases where it should be. This patch fixes that and the next patch in the series fixes the GCC 9.1 break. We split this into two patches since patch #2 introduces a new ABI break starting with GCC 13.1. This way, patch #1 can be back-ported to release branches if needed to fix the GCC 9.1 warning issue. The main idea is to add a new global boolean that indicates whether we're expanding the start of a function, so that aarch64_layout_arg can emit warnings for callees as well as callers. This removes the need for aarch64_function_arg_boundary to warn (with its incomplete information). However, in the first patch there are still cases where we emit warnings were we should not; this is fixed in patch #2 where we can distinguish between GCC 9.1 and GCC.13.1 ABI breaks properly. The fix in aarch64_function_arg_boundary (replacing & with &&) looks like an oversight of a previous commit in this area which changed 'abi_break' from a boolean to an integer. We also take the opportunity to fix the comment above aarch64_function_arg_alignment since the value of the abi_break parameter was changed in a previous commit, no longer matching the description. 2022-11-28 Christophe Lyon Richard Sandiford gcc/ChangeLog: * config/aarch64/aarch64.c (aarch64_function_arg_alignment): Fix comment. (aarch64_layout_arg): Factorize warning conditions. (aarch64_function_arg_boundary): Fix typo. * function.c (currently_expanding_function_start): New variable. (expand_function_start): Handle currently_expanding_function_start. * function.h (currently_expanding_function_start): Declare. gcc/testsuite/ChangeLog: * gcc.target/aarch64/bitfield-abi-warning-align16-O2.c: New tes= t. * gcc.target/aarch64/bitfield-abi-warning-align16-O2-extra.c: N= ew test. * gcc.target/aarch64/bitfield-abi-warning-align32-O2.c: New tes= t. * gcc.target/aarch64/bitfield-abi-warning-align32-O2-extra.c: N= ew test. * gcc.target/aarch64/bitfield-abi-warning-align8-O2.c: New test. * gcc.target/aarch64/bitfield-abi-warning.h: New test. * g++.target/aarch64/bitfield-abi-warning-align16-O2.C: New tes= t. * g++.target/aarch64/bitfield-abi-warning-align16-O2-extra.C: N= ew test. * g++.target/aarch64/bitfield-abi-warning-align32-O2.C: New tes= t. * g++.target/aarch64/bitfield-abi-warning-align32-O2-extra.C: N= ew test. * g++.target/aarch64/bitfield-abi-warning-align8-O2.C: New test. * g++.target/aarch64/bitfield-abi-warning.h: New test. (cherry picked from commit 3df1a115be22caeab3ffe7afb12e71adb54ff132)=