From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 74D163857C49 for ; Tue, 29 Mar 2022 16:36:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 74D163857C49 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-541-H-LJviGYPhmPCDmPg150IQ-1; Tue, 29 Mar 2022 12:36:15 -0400 X-MC-Unique: H-LJviGYPhmPCDmPg150IQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 150C891BD94; Tue, 29 Mar 2022 16:36:15 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CB98D54EC61; Tue, 29 Mar 2022 16:36:14 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 22TGa2qK2595184 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 29 Mar 2022 18:36:12 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 22TGa0aI2595183; Tue, 29 Mar 2022 18:36:00 +0200 Date: Tue, 29 Mar 2022 18:36:00 +0200 From: Jakub Jelinek To: Richard Earnshaw Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 2/2] aarch64: correctly handle zero-sized bit-fields in AAPCS64 [PR102024] Message-ID: Reply-To: Jakub Jelinek References: <20220329153211.110702-1-rearnsha@arm.com> <20220329153211.110702-2-rearnsha@arm.com> MIME-Version: 1.0 In-Reply-To: <20220329153211.110702-2-rearnsha@arm.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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: Tue, 29 Mar 2022 16:36:24 -0000 On Tue, Mar 29, 2022 at 04:32:11PM +0100, Richard Earnshaw wrote: > > On aarch64 the AAPCS64 states that an HFA is determined by the 'shape' of > the object after layout has been completed, so anything that adds no > members and does not cause the layout to be modified should be ignored > for the purposes of determining which registers are used for parameter > passing. > > A zero-sized bit-field falls into this category. This was not handled > correctly for C structs and in G++-11 only handled correctly because > such fields were eliminated early by the front end. > > gcc/ChangeLog: > > PR target/102024 > * config/aarch64/aarch64.cc (aapcs_vfp_sub_candidate): Handle > zero-sized bit-fields. Detect cases where a warning may be needed. > (aarch64_vfp_is_call_or_return_candidate): Emit a note if a > zero-sized bit-field has caused parameter passing to change. > > gcc/testsuite/ChangeLog: > > * gcc.target/aarch64/aapcs64/test_28.c: New test. > --- > gcc/config/aarch64/aarch64.cc | 35 +++++++++++++++++-- > .../gcc.target/aarch64/aapcs64/test_28.c | 28 +++++++++++++++ > 2 files changed, 60 insertions(+), 3 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/aarch64/aapcs64/test_28.c > > @@ -19711,8 +19734,10 @@ aarch64_vfp_is_call_or_return_candidate (machine_mode mode, > && ((alt = aapcs_vfp_sub_candidate (type, &new_mode, NULL)) > != ag_count)) > { > - const char *url > + const char *url10 > = CHANGES_ROOT_URL "gcc-10/changes.html#empty_base"; > + const char *url12 > + = CHANGES_ROOT_URL "gcc-12/changes.html#empty_base"; Again, #zero_width_bitfields Otherwise LGTM. Jakub