From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 051B83858024 for ; Tue, 22 Jun 2021 07:05:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 051B83858024 Received: from [IPv6:240e:35a:10ed:f500:dc73:854d:832e:3] (unknown [IPv6:240e:35a:10ed:f500:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 1FCED65A5D; Tue, 22 Jun 2021 03:05:45 -0400 (EDT) Message-ID: <8f047551a4694778606d615bd22ef619006d044e.camel@mengyan1223.wang> Subject: [PATCH] testsuite: mips: use noinline attribute instead of -fno-inline From: Xi Ruoyao Reply-To: xry111@mengyan1223.wang To: gcc-patches@gcc.gnu.org Cc: Matthew Fortune , xry111@mengyan1223.wang Date: Tue, 22 Jun 2021 15:05:38 +0800 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3039.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 22 Jun 2021 07:05:54 -0000 mips.exp does not support -fno-inline, causing the tests return "ERROR: Unrecognised option: -fno-inline for dg-options ... ". Use noinline attribute like other mips target tests, to workaround it. gcc/testsuite/ * gcc.target/mips/cfgcleanup-jalr2.c: Remove -fno-inline and add __attribute__((noinline)). * gcc.target/mips/cfgcleanup-jalr3.c: Likewise. --- gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c | 11 ++++++++--- gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c index bf22f064288..6a9f86a3be0 100644 --- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c +++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c @@ -1,10 +1,15 @@ /* { dg-do compile } */ -/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */ +/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fipa-ra -mcompact-branches=never" } */ /* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */ -static int foo (void* p) { __asm__ (""::"r"(p):"$t0"); return 0; } +static int __attribute__((noinline)) +foo (void* p) +{ + __asm__ (""::"r"(p):"$t0"); + return 0; +} -static int bar (void* p) { return 1; } +__attribute__((noinline)) static int bar (void* p) { return 1; } int test (void* p) diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c index 805b31af9f0..50937412827 100644 --- a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c +++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c @@ -1,10 +1,10 @@ /* { dg-do compile } */ -/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fno-inline -fipa-ra -mcompact-branches=never" } */ +/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips -fipa-ra -mcompact-branches=never" } */ /* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */ -static int foo (void* p) { return 0; } +__attribute__((noinline)) static int foo (void* p) { return 0; } -static int bar (void* p) { return 1; } +__attribute__((noinline)) static int bar (void* p) { return 1; } int test (void* p) -- 2.32.0