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 A585F3858C1F for ; Tue, 22 Nov 2022 11:33:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A585F3858C1F 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 CDC5C1477; Tue, 22 Nov 2022 03:33:27 -0800 (PST) Received: from [10.2.78.76] (unknown [10.2.78.76]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C42EE3F73B; Tue, 22 Nov 2022 03:33:20 -0800 (PST) Message-ID: <2f19640b-6900-5062-472f-5896f55bc6f7@foss.arm.com> Date: Tue, 22 Nov 2022 11:33:19 +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] Content-Language: en-GB To: Richard Earnshaw via Gcc-patches , Christophe Lyon , richard.sandiford@arm.com References: <20221122090114.38090-1-christophe.lyon@arm.com> From: Richard Earnshaw In-Reply-To: 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 11:21, Richard Sandiford wrote: > Richard Earnshaw via Gcc-patches writes: >> 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? > > Yes, but PARM_BOUNDARY (64) sets a minimum alignment for all stack arguments. > > Richard Ah, OK. I wonder if we should have a new macro in the tests, something like ANON_PADDED to describe this case and that works things out more automagically for big-endian. I notice the new ANON definition is not correctly indented. R.