Message ID | 20230127114627.243812-1-xry111@xry111.site |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32F903858408 for <patchwork@sourceware.org>; Fri, 27 Jan 2023 11:47:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32F903858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674820047; bh=BrPlohQ/u0q9NlpzWLZxHhfJFQLoA2iqDUMx9AlKUKw=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=FF1AwASVzajYAFhlbQ4jcjx4E8L3K5AmXvP/TUrlJ71nguiEA521TQkLCRF/AHXUs eLRJlUvDEvWH9/xC2+pBSBCi994bm/G91WerThOhLpoAn6pxq7kPbJJDYBroJKkLnX nCxUhHTgB+s15q2S93jPJnIA8LF693g+8KgON1B8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 2E0DB3858C74 for <gcc-patches@gcc.gnu.org>; Fri, 27 Jan 2023 11:46:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E0DB3858C74 Received: from xry111-x57s1.. (unknown [IPv6:240e:358:11ca:f700:dc73:854d:832e:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 0C35E6688D; Fri, 27 Jan 2023 06:46:53 -0500 (EST) To: gcc-patches@gcc.gnu.org Cc: Richard Biener <rguenther@suse.de>, Jakub Jelinek <jakub@redhat.com>, Xi Ruoyao <xry111@xry111.site> Subject: [PATCH] testsuite: Use noipa and noinline attributes for pr95115 test Date: Fri, 27 Jan 2023 19:46:27 +0800 Message-Id: <20230127114627.243812-1-xry111@xry111.site> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, FROM_SUSPICIOUS_NTLD_FP, GIT_PATCH_0, LIKELY_SPAM_FROM, SPF_HELO_PASS, SPF_PASS, TXREP, T_PDS_OTHER_BAD_TLD 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Xi Ruoyao via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Xi Ruoyao <xry111@xry111.site> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
testsuite: Use noipa and noinline attributes for pr95115 test
|
|
Commit Message
Xi Ruoyao
Jan. 27, 2023, 11:46 a.m. UTC
They prevent the compiler from deeming the NaN result "unused" and remove the calculation raising INVALID exception. See the discussion in PR107608 for details. Tested on x86_64-linux-gnu where the change fixes the test failure. Ok for trunk? gcc/testsuite/ChangeLog: * gcc.dg/pr95115.c (x): Add noipa and noinline attributes. --- gcc/testsuite/gcc.dg/pr95115.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Jan 27, 2023 at 07:46:27PM +0800, Xi Ruoyao wrote: > They prevent the compiler from deeming the NaN result "unused" and > remove the calculation raising INVALID exception. See the discussion > in PR107608 for details. > > Tested on x86_64-linux-gnu where the change fixes the test failure. > Ok for trunk? > > gcc/testsuite/ChangeLog: > > * gcc.dg/pr95115.c (x): Add noipa and noinline attributes. noipa implies noinline, so unless one targets both very old gcc versions which didn't have noipa attribute in addition to current ones, it is sufficient to specify just noipa. Otherwise LGTM. > diff --git a/gcc/testsuite/gcc.dg/pr95115.c b/gcc/testsuite/gcc.dg/pr95115.c > index 69c4f83250c..11620acccae 100644 > --- a/gcc/testsuite/gcc.dg/pr95115.c > +++ b/gcc/testsuite/gcc.dg/pr95115.c > @@ -6,7 +6,7 @@ > #include <fenv.h> > #include <stdlib.h> > > -double > +__attribute__ ((noipa, noinline)) double > x (void) > { > double d = __builtin_inf (); > -- > 2.39.1 Jakub
On Fri, 2023-01-27 at 12:50 +0100, Jakub Jelinek wrote: > On Fri, Jan 27, 2023 at 07:46:27PM +0800, Xi Ruoyao wrote: > > They prevent the compiler from deeming the NaN result "unused" and > > remove the calculation raising INVALID exception. See the discussion > > in PR107608 for details. > > > > Tested on x86_64-linux-gnu where the change fixes the test failure. > > Ok for trunk? > > > > gcc/testsuite/ChangeLog: > > > > * gcc.dg/pr95115.c (x): Add noipa and noinline attributes. > > noipa implies noinline, so unless one targets both very old gcc > versions > which didn't have noipa attribute in addition to current ones, it is > sufficient to specify just noipa. > > Otherwise LGTM. Pushed with only noipa. I must have some flawed memory abort the interaction between noipa and noinline. Thanks for pointing that out!
On Fri, Jan 27, 2023 at 08:08:26PM +0800, Xi Ruoyao via Gcc-patches wrote: > On Fri, 2023-01-27 at 12:50 +0100, Jakub Jelinek wrote: > > On Fri, Jan 27, 2023 at 07:46:27PM +0800, Xi Ruoyao wrote: > > > They prevent the compiler from deeming the NaN result "unused" and > > > remove the calculation raising INVALID exception. See the discussion > > > in PR107608 for details. > > > > > > Tested on x86_64-linux-gnu where the change fixes the test failure. > > > Ok for trunk? > > > > > > gcc/testsuite/ChangeLog: > > > > > > * gcc.dg/pr95115.c (x): Add noipa and noinline attributes. > > > > noipa implies noinline, so unless one targets both very old gcc > > versions > > which didn't have noipa attribute in addition to current ones, it is > > sufficient to specify just noipa. > > > > Otherwise LGTM. > > Pushed with only noipa. I must have some flawed memory abort the > interaction between noipa and noinline. Thanks for pointing that out! /* A "noipa" function attribute implies "noinline", "noclone" and "no_icf" for those targets that support it. */ if (TREE_CODE (*node) == FUNCTION_DECL && attributes && lookup_attribute ("noipa", attributes) != NULL && lookup_attribute_spec (get_identifier ("noipa"))) { if (lookup_attribute ("noinline", attributes) == NULL) attributes = tree_cons (get_identifier ("noinline"), NULL, attributes); if (lookup_attribute ("noclone", attributes) == NULL) attributes = tree_cons (get_identifier ("noclone"), NULL, attributes); if (lookup_attribute ("no_icf", attributes) == NULL) attributes = tree_cons (get_identifier ("no_icf"), NULL, attributes); } plus various spots check just for "noipa", so noipa isn't just equivalent to noinline, noclone, no_icf. Jakub
diff --git a/gcc/testsuite/gcc.dg/pr95115.c b/gcc/testsuite/gcc.dg/pr95115.c index 69c4f83250c..11620acccae 100644 --- a/gcc/testsuite/gcc.dg/pr95115.c +++ b/gcc/testsuite/gcc.dg/pr95115.c @@ -6,7 +6,7 @@ #include <fenv.h> #include <stdlib.h> -double +__attribute__ ((noipa, noinline)) double x (void) { double d = __builtin_inf ();