From patchwork Thu Feb 16 20:05:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 58219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp503617wrn; Thu, 16 Feb 2023 12:06:18 -0800 (PST) X-Google-Smtp-Source: AK7set/4hrDtg209/PhAp7MEcpJuV2I5P1hdTIFzCBSMye9XDbFjryI6DyldUcpd3SoNXJWoySEL X-Received: by 2002:a17:906:230f:b0:8b1:3131:76e9 with SMTP id l15-20020a170906230f00b008b1313176e9mr7816853eja.46.1676577978233; Thu, 16 Feb 2023 12:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676577978; cv=none; d=google.com; s=arc-20160816; b=xawPzJLmquQ2u76np8DPLqqSXHwlp0bwQNf74kdwEtzp5Z1yzZlxCsf006ix6rA+X/ 5Dly9NpVZc54pGdl4FS+RnNlsG+WpduyMzXqsYqCacXxNF6NmjDWrRoGSuCTDpVOaUMo z7dk4Rq1LICAvV+jrH5YVAmhqvq/aAXPdm/9rzcAiJkGXr3e7C8qO5LtI5OnuffxnZ+J dEuvYfLn7bV/Jat13qJlNkujejpqAeQiBX+ESoMoQBpb6lYAHp1GfRVrAYDPQkriTfZG JZkHnWSfmRNu4O1JE/tSPd235EZKUvj6ZnPylVWtPxJLBTG1RZKgDpn4Cb0LQbUInKkQ QRUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=Ezq79aXC0cXC9yGMXg6YANGlNx/rq7PqFgOawh4tEHE=; b=w1GnQqCHDyKxCiajpqbhOJCuFzajSonnmkQL+nCPuAVlR7L1Vos5Edpa/dPKkdkPn0 cd/xu1pl0J51kkg2n/FFoxP336NP9SbR75I0Ppgh3rKOVnApRGTx6QMEyCFhw2alFqRN TjxCE1WXW086qWQtWdppkc1HuD6C576n69VgyxVTvq+St0QknDjzwvXHaMeIoB5g8NC4 b9xwOUwJ8BwcdjgH4iyLUuO6dj9nypp8tqQJUC8q/ulv8GF3/sQyI1rYiRQRjF7v3eVu nSbFnvhO/8VsymKipV8BL8DAggzalQgNH7vVk9y/oIQur0aCbhZxAtgCw3gIJq+WKqTb y0XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W6m86nU3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id fs37-20020a170907602500b008b13d0a7fccsi2723490ejc.52.2023.02.16.12.06.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 12:06:18 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=W6m86nU3; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 00E67385800A for ; Thu, 16 Feb 2023 20:06:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00E67385800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676577977; bh=Ezq79aXC0cXC9yGMXg6YANGlNx/rq7PqFgOawh4tEHE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=W6m86nU3gvjM8MPku4zw3GkjpQBnzbX7Qq0HOTCW408FGhJyTszlugskdTQHHlmA5 bqfTcZ5HoGv1HkB+weNnQ3PPlHvQSEWZtwoOAtDqddz2O2gIgzGVyJ2glgitLJRo33 NCxs1vEswuxmUFi/hEeO8GbJMLsaxpaGgEK8BU1c= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 73D573858D33; Thu, 16 Feb 2023 20:05:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73D573858D33 To: , Subject: [PATCH] testsuite: Tweak gcc.dg/attr-aligned.c for CRIS MIME-Version: 1.0 Message-ID: <20230216200529.AC55F2042C@pchp3.se.axis.com> Date: Thu, 16 Feb 2023 21:05:29 +0100 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, 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 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-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758019429883165225?= X-GMAIL-MSGID: =?utf-8?q?1758019429883165225?= Asking for the lines outside the "#if __CRIS__" part. Ok to commit? -- >8 -- tm.texi says for BIGGEST_ALIGNMENT (from which __BIGGEST_ALIGNMENT__ is derived): "Biggest alignment that any data type can require on this machine, in bits." That is, using that value might be too strict for alignment of *functions* and CRIS requires at least 16-bit alignment for functions. But, one purpose of the test is to test that alignment can be set to a large but valid value, so pick 512, which has some use as a historically required alignment for certain I/O descriptors. * gcc.dg/attr-aligned.c: Adjust comment for ALIGN_MAX_STATIC. (ALIGN_MAX_STATIC): Set to 512 for CRIS. --- gcc/testsuite/gcc.dg/attr-aligned.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/attr-aligned.c b/gcc/testsuite/gcc.dg/attr-aligned.c index 887bdd0f3799..4f0c885dc812 100644 --- a/gcc/testsuite/gcc.dg/attr-aligned.c +++ b/gcc/testsuite/gcc.dg/attr-aligned.c @@ -18,6 +18,10 @@ # else # define ALIGN_MAX_STATIC ALIGN_MAX_HARD # endif +#elif __CRIS__ +/* __BIGGEST_ALIGNMENT__ doesn't cover functions (16 bits for CRIS). */ +# define ALIGN_MAX_STATIC 512 +# define ALIGN_TOO_BIG_OFILE (ALIGN_MAX_HARD << 1) #elif pdp11 # define ALIGN_MAX_STATIC 2 /* Work around a pdp11 ICE (see PR target/87821). */ @@ -29,7 +33,9 @@ /* Is this processor- or operating-system specific? */ # define ALIGN_MAX_STATIC ALIGN_MAX_HARD #else - /* Guaranteed to be accepted regardless of the target. */ + /* Guaranteed to be accepted regardless of the target for objects. + This might not be true for alignment of functions though, so + may need to be set to a target-specific value above. */ # define ALIGN_MAX_STATIC __BIGGEST_ALIGNMENT__ /* Guaranteed to be rejected regardless of the target. */ # define ALIGN_TOO_BIG_OFILE (ALIGN_MAX_HARD << 1)