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 8A5DB38582AB for ; Tue, 22 Nov 2022 11:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A5DB38582AB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com 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 BDAF41FB; Tue, 22 Nov 2022 03:09:51 -0800 (PST) Received: from [10.2.78.76] (e126323.cambridge.arm.com [10.2.78.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CED083F587; Tue, 22 Nov 2022 03:09:44 -0800 (PST) Message-ID: Date: Tue, 22 Nov 2022 11:09:43 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] aarch64: Fix test_dfp_17.c for big-endian [PR 107604] To: Christophe Lyon , gcc-patches@gcc.gnu.org References: <20221122090114.38090-1-christophe.lyon@arm.com> Content-Language: en-GB From: Richard Earnshaw In-Reply-To: <20221122090114.38090-1-christophe.lyon@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3495.8 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 22/11/2022 09:01, Christophe Lyon via Gcc-patches wrote: > gcc.target/aarch64/aapcs64/test_dfp_17.c has been failing on > big-endian, because the _Decimal32 on-stack argument is not padded in > the same direction depending on endianness. > > This patch fixes the testcase so that it expects the argument in the > right stack location, similarly to what other tests do in the same > directory. > > gcc/testsuite/ChangeLog: > > PR target/107604 > * gcc.target/aarch64/aapcs64/test_dfp_17.c: Fix for big-endian. > --- > gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c > index 22dc462bf7c..3c45f715cf7 100644 > --- a/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c > +++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/test_dfp_17.c > @@ -32,6 +32,10 @@ struct z b = { 9.0dd, 10.0dd, 11.0dd, 12.0dd }; > ANON(struct z, a, D1) > ANON(struct z, b, STACK) > ANON(int , 5, W0) > +#ifndef __AAPCS64_BIG_ENDIAN__ > ANON(_Decimal32, f1, STACK+32) /* Note: no promotion to _Decimal64. */ > +#else > + ANON(_Decimal32, f1, STACK+36) /* Note: no promotion to _Decimal64. */ > +#endif > LAST_ANON(_Decimal64, 0.5dd, STACK+40) > #endif Why would a Decimal32 change stack placement based on the endianness? Isn't it a 4-byte object?