public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans
@ 2017-02-16 17:47 Segher Boessenkool
  2017-02-16 23:13 ` Jeff Law
  2017-02-20 19:30 ` Jakub Jelinek
  0 siblings, 2 replies; 4+ messages in thread
From: Segher Boessenkool @ 2017-02-16 17:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool

The testcases pr59833.c and pr61441.c check whether signaling NaNs as
input to some operation result in quiet NaNs.  Without -fsignaling-nans
this is not guaranteed to happen.  So, this patch add this option to
these testcases.

Tested on powerpc64-linux {-m32,-m64}, on aarch64-linux, and on
x86_64-linux (where there is no issignaling, huh -- I tested on gcc20).

Is this okay for trunk?


Segher


2017-02-16  Segher Boessenkool  <seher@kernel.crashing.org>

gcc/testsuite/
	* gcc.dg/pr59833.c: Add -fsignaling-nans to options.
	* gcc.dg/pr61441.c: Ditto.

---
 gcc/testsuite/gcc.dg/pr59833.c | 2 +-
 gcc/testsuite/gcc.dg/pr61441.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr59833.c b/gcc/testsuite/gcc.dg/pr59833.c
index 45fcf7f..c75efde 100644
--- a/gcc/testsuite/gcc.dg/pr59833.c
+++ b/gcc/testsuite/gcc.dg/pr59833.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target { *-*-linux* *-*-gnu* } } } */
-/* { dg-options "-O0 -lm" } */
+/* { dg-options "-O0 -lm -fsignaling-nans" } */
 /* { dg-add-options ieee } */
 /* { dg-require-effective-target issignaling } */
 
diff --git a/gcc/testsuite/gcc.dg/pr61441.c b/gcc/testsuite/gcc.dg/pr61441.c
index 1b0f181..9408e85 100644
--- a/gcc/testsuite/gcc.dg/pr61441.c
+++ b/gcc/testsuite/gcc.dg/pr61441.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target { *-*-linux* *-*-gnu* } } } */
-/* { dg-options "-O1 -lm -fexcess-precision=standard" } */
+/* { dg-options "-O1 -lm -fexcess-precision=standard -fsignaling-nans" } */
 /* { dg-require-effective-target issignaling } */
 
 #define _GNU_SOURCE
-- 
1.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans
  2017-02-16 17:47 [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans Segher Boessenkool
@ 2017-02-16 23:13 ` Jeff Law
  2017-02-20 19:30 ` Jakub Jelinek
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Law @ 2017-02-16 23:13 UTC (permalink / raw)
  To: Segher Boessenkool, gcc-patches

On 02/16/2017 10:46 AM, Segher Boessenkool wrote:
> The testcases pr59833.c and pr61441.c check whether signaling NaNs as
> input to some operation result in quiet NaNs.  Without -fsignaling-nans
> this is not guaranteed to happen.  So, this patch add this option to
> these testcases.
>
> Tested on powerpc64-linux {-m32,-m64}, on aarch64-linux, and on
> x86_64-linux (where there is no issignaling, huh -- I tested on gcc20).
>
> Is this okay for trunk?
>
>
> Segher
>
>
> 2017-02-16  Segher Boessenkool  <seher@kernel.crashing.org>
>
> gcc/testsuite/
> 	* gcc.dg/pr59833.c: Add -fsignaling-nans to options.
> 	* gcc.dg/pr61441.c: Ditto.
OK.
jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans
  2017-02-16 17:47 [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans Segher Boessenkool
  2017-02-16 23:13 ` Jeff Law
@ 2017-02-20 19:30 ` Jakub Jelinek
  2017-02-20 20:35   ` Jakub Jelinek
  1 sibling, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2017-02-20 19:30 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches

On Thu, Feb 16, 2017 at 05:46:30PM +0000, Segher Boessenkool wrote:
> The testcases pr59833.c and pr61441.c check whether signaling NaNs as
> input to some operation result in quiet NaNs.  Without -fsignaling-nans
> this is not guaranteed to happen.  So, this patch add this option to
> these testcases.
> 
> Tested on powerpc64-linux {-m32,-m64}, on aarch64-linux, and on
> x86_64-linux (where there is no issignaling, huh -- I tested on gcc20).

pr61441.c now fails since your change on i?86-linux (and x86_64-linux -m32).
Before combine we have:
(insn 6 5 7 2 (set (reg:DF 89 [ x ])
        (float_extend:DF (mem/u/c:SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [1  S4 A32]))) "pr61441.c":12 152 {*extendsfdf2}
     (expr_list:REG_EQUAL (const_double:DF +SNaN [+SNaN])
        (nil)))
(insn 7 6 8 2 (set (mem:DF (pre_dec:SI (reg/f:SI 7 sp)) [2  S8 A64])
        (reg:DF 89 [ x ])) "pr61441.c":13 119 {*pushdf}
     (expr_list:REG_DEAD (reg:DF 89 [ x ])
        (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
            (nil))))
(not sure if that REG_EQUAL is not already invalid for -fsignaling-nans),
and combine turns that into:
(insn 7 6 8 2 (set (mem:DF (pre_dec:SI (reg/f:SI 7 sp)) [2  S8 A64])
        (const_double:DF +SNaN [+SNaN])) "pr61441.c":13 119 {*pushdf}
     (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
        (nil)))
which doesn't drop the signal bit.

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans
  2017-02-20 19:30 ` Jakub Jelinek
@ 2017-02-20 20:35   ` Jakub Jelinek
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Jelinek @ 2017-02-20 20:35 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches

On Mon, Feb 20, 2017 at 07:24:50PM +0100, Jakub Jelinek wrote:
> On Thu, Feb 16, 2017 at 05:46:30PM +0000, Segher Boessenkool wrote:
> > The testcases pr59833.c and pr61441.c check whether signaling NaNs as
> > input to some operation result in quiet NaNs.  Without -fsignaling-nans
> > this is not guaranteed to happen.  So, this patch add this option to
> > these testcases.
> > 
> > Tested on powerpc64-linux {-m32,-m64}, on aarch64-linux, and on
> > x86_64-linux (where there is no issignaling, huh -- I tested on gcc20).
> 
> pr61441.c now fails since your change on i?86-linux (and x86_64-linux -m32).
> Before combine we have:
> (insn 6 5 7 2 (set (reg:DF 89 [ x ])
>         (float_extend:DF (mem/u/c:SF (symbol_ref/u:SI ("*.LC0") [flags 0x2]) [1  S4 A32]))) "pr61441.c":12 152 {*extendsfdf2}
>      (expr_list:REG_EQUAL (const_double:DF +SNaN [+SNaN])
>         (nil)))
> (insn 7 6 8 2 (set (mem:DF (pre_dec:SI (reg/f:SI 7 sp)) [2  S8 A64])
>         (reg:DF 89 [ x ])) "pr61441.c":13 119 {*pushdf}
>      (expr_list:REG_DEAD (reg:DF 89 [ x ])
>         (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
>             (nil))))
> (not sure if that REG_EQUAL is not already invalid for -fsignaling-nans),
> and combine turns that into:
> (insn 7 6 8 2 (set (mem:DF (pre_dec:SI (reg/f:SI 7 sp)) [2  S8 A64])
>         (const_double:DF +SNaN [+SNaN])) "pr61441.c":13 119 {*pushdf}
>      (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
>         (nil)))
> which doesn't drop the signal bit.

I have a patch, I'll bootstrap/regtest it and post afterwards.

	Jakub

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-20 19:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 17:47 [PATCH] testsuite: pr59833.c and pr61441.c should use -fsignaling-nans Segher Boessenkool
2017-02-16 23:13 ` Jeff Law
2017-02-20 19:30 ` Jakub Jelinek
2017-02-20 20:35   ` 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).