* [PATCH] testsuite: Use noipa and noinline attributes for pr95115 test @ 2023-01-27 11:46 Xi Ruoyao 2023-01-27 11:50 ` Jakub Jelinek 0 siblings, 1 reply; 4+ messages in thread From: Xi Ruoyao @ 2023-01-27 11:46 UTC (permalink / raw) To: gcc-patches; +Cc: Richard Biener, Jakub Jelinek, Xi Ruoyao 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(-) 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] testsuite: Use noipa and noinline attributes for pr95115 test 2023-01-27 11:46 [PATCH] testsuite: Use noipa and noinline attributes for pr95115 test Xi Ruoyao @ 2023-01-27 11:50 ` Jakub Jelinek 2023-01-27 12:08 ` Pushed: [PATCH] testsuite: Use noipa attribute " Xi Ruoyao 0 siblings, 1 reply; 4+ messages in thread From: Jakub Jelinek @ 2023-01-27 11:50 UTC (permalink / raw) To: Xi Ruoyao; +Cc: gcc-patches, Richard Biener 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Pushed: [PATCH] testsuite: Use noipa attribute for pr95115 test 2023-01-27 11:50 ` Jakub Jelinek @ 2023-01-27 12:08 ` Xi Ruoyao 2023-01-27 12:14 ` Jakub Jelinek 0 siblings, 1 reply; 4+ messages in thread From: Xi Ruoyao @ 2023-01-27 12:08 UTC (permalink / raw) To: Jakub Jelinek; +Cc: gcc-patches, Richard Biener 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! -- Xi Ruoyao <xry111@xry111.site> School of Aerospace Science and Technology, Xidian University ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Pushed: [PATCH] testsuite: Use noipa attribute for pr95115 test 2023-01-27 12:08 ` Pushed: [PATCH] testsuite: Use noipa attribute " Xi Ruoyao @ 2023-01-27 12:14 ` Jakub Jelinek 0 siblings, 0 replies; 4+ messages in thread From: Jakub Jelinek @ 2023-01-27 12:14 UTC (permalink / raw) To: Xi Ruoyao; +Cc: gcc-patches, Richard Biener 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-27 12:14 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-01-27 11:46 [PATCH] testsuite: Use noipa and noinline attributes for pr95115 test Xi Ruoyao 2023-01-27 11:50 ` Jakub Jelinek 2023-01-27 12:08 ` Pushed: [PATCH] testsuite: Use noipa attribute " Xi Ruoyao 2023-01-27 12:14 ` Jakub Jelinek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).