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

Reply via email to