From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 366683858405 for ; Wed, 30 Mar 2022 12:10:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 366683858405 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B37C823A; Wed, 30 Mar 2022 05:10:28 -0700 (PDT) Received: from [10.57.40.209] (unknown [10.57.40.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3C9A03F718; Wed, 30 Mar 2022 05:10:28 -0700 (PDT) Message-ID: Date: Wed, 30 Mar 2022 13:10:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [wwwdocs] Document zero width bit-field passing ABI changes in gcc-12/changes.html [PR104796] Content-Language: en-GB To: Jakub Jelinek , gcc-patches@gcc.gnu.org References: From: Richard Earnshaw In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3497.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2022 12:10:30 -0000 Doesn't this need the anchor that the compiler links to? #zero_width_bitfields R. On 30/03/2022 11:07, Jakub Jelinek via Gcc-patches wrote: > Hi! > > This patch documents the PR102024 ABI changes. > The x86-64, ARM and AArch64 backends refer to this in their -Wpsabi > diagnostics. > Ok for wwwdocs? > > diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html > index 689feeba..dc0e4074 100644 > --- a/htdocs/gcc-12/changes.html > +++ b/htdocs/gcc-12/changes.html > @@ -28,6 +28,31 @@ a work-in-progress.

> >

Caveats

>
    > +
  • > + An ABI incompatibility between C and > + C++ when passing or returning by value certain aggregates with zero > + width bit-fields has been discovered on various targets. > + As mentioned in PR102024, > + since the PR42217 fix in > + GCC 4.5 the C++ front-end has been removing zero width bit-fields > + from the internal representation of the aggregates after the layout of those > + aggregates, but the C front-end kept them, so passing e.g. > + struct S { float a; int : 0; float b; } or > + struct T { float c; int : 0; } by value could differ > + between C and C++. Starting with GCC 12 the C++ front-end no longer > + removes those bit-fields from the internal representation and > + per clarified psABI some targets have been changed, so that they > + either ignore those bit-fields in the argument passing by value > + decisions in both C and C++, or they always take them into account. > + x86-64, ARM and AArch64 will always ignore them (so there is > + a C ABI incompatibility between GCC 11 and earlier with GCC 12 or > + later), PowerPC64 ELFv2 and S/390 always take them into account > + (so there is a C++ ABI incompatibility, GCC 4.4 and earlier compatible > + with GCC 12 or later, incompatible with GCC 4.5 through GCC 11). > + RISC-V has changed the handling of these already starting with GCC 10. > + GCC 12 on the above targets will report such incompatibilities as > + warnings or other diagnostics unless -Wno-psabi is used. > +
  • >
  • > C: > Computed gotos require a pointer type now. > > Jakub >