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 1A3953858C20 for ; Tue, 22 Nov 2022 11:21:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A3953858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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 436901FB; Tue, 22 Nov 2022 03:22:05 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3709A3F587; Tue, 22 Nov 2022 03:21:58 -0800 (PST) From: Richard Sandiford To: Richard Earnshaw via Gcc-patches Mail-Followup-To: Richard Earnshaw via Gcc-patches ,Christophe Lyon , Richard Earnshaw , richard.sandiford@arm.com Cc: Christophe Lyon , Richard Earnshaw Subject: Re: [PATCH] aarch64: Fix test_dfp_17.c for big-endian [PR 107604] References: <20221122090114.38090-1-christophe.lyon@arm.com> Date: Tue, 22 Nov 2022 11:21:56 +0000 In-Reply-To: (Richard Earnshaw via Gcc-patches's message of "Tue, 22 Nov 2022 11:09:43 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-40.0 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,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: 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