diff mbox series

Match: Fix ordered and nonequal: Fix 'gcc.dg/opt-ordered-and-nonequal-1.c' re 'LOGICAL_OP_NON_SHORT_CIRCUIT' [PR116635] (was: [PATCH] Match: Fix ordered and nonequal)

Message ID 87h6apqq4f.fsf@euler.schwinge.ddns.net
State New
Headers show
Series Match: Fix ordered and nonequal: Fix 'gcc.dg/opt-ordered-and-nonequal-1.c' re 'LOGICAL_OP_NON_SHORT_CIRCUIT' [PR116635] (was: [PATCH] Match: Fix ordered and nonequal) | expand

Commit Message

Thomas Schwinge Sept. 9, 2024, 6:48 a.m. UTC
Hi!

On 2024-09-04T13:43:45+0800, "Hu, Lin1" <lin1.hu@intel.com> wrote:
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c
> @@ -0,0 +1,49 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-tree-forwprop1-details" } */
> +
> +int is_ordered_and_nonequal_sh_1 (float a, float b)
> +{
> +  return !__builtin_isunordered (a, b) && (a != b);
> +}
> +
> +[...]
> +
> +/* { dg-final { scan-tree-dump-times "gimple_simplified to\[^\n\r]*<>" 9 "forwprop1" } } */

OK to push
"Match: Fix ordered and nonequal: Fix 'gcc.dg/opt-ordered-and-nonequal-1.c' re 'LOGICAL_OP_NON_SHORT_CIRCUIT' [PR116635]",
see attached?


Grüße
 Thomas

Comments

Richard Biener Sept. 9, 2024, 7:23 a.m. UTC | #1
On Mon, Sep 9, 2024 at 8:48 AM Thomas Schwinge <tschwinge@baylibre.com> wrote:
>
> Hi!
>
> On 2024-09-04T13:43:45+0800, "Hu, Lin1" <lin1.hu@intel.com> wrote:
> > --- /dev/null
> > +++ b/gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c
> > @@ -0,0 +1,49 @@
> > +/* { dg-do compile } */
> > +/* { dg-options "-O2 -fdump-tree-forwprop1-details" } */
> > +
> > +int is_ordered_and_nonequal_sh_1 (float a, float b)
> > +{
> > +  return !__builtin_isunordered (a, b) && (a != b);
> > +}
> > +
> > +[...]
> > +
> > +/* { dg-final { scan-tree-dump-times "gimple_simplified to\[^\n\r]*<>" 9 "forwprop1" } } */
>
> OK to push
> "Match: Fix ordered and nonequal: Fix 'gcc.dg/opt-ordered-and-nonequal-1.c' re 'LOGICAL_OP_NON_SHORT_CIRCUIT' [PR116635]",
> see attached?

OK

>
> Grüße
>  Thomas
>
>
diff mbox series

Patch

From 3e85cb373fb86db5fad86a452a69e713c7050f16 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Mon, 9 Sep 2024 08:39:10 +0200
Subject: [PATCH] Match: Fix ordered and nonequal: Fix
 'gcc.dg/opt-ordered-and-nonequal-1.c' re 'LOGICAL_OP_NON_SHORT_CIRCUIT'
 [PR116635]

Fix up to make 'gcc.dg/opt-ordered-and-nonequal-1.c' of
commit 91421e21e8f0f05f440174b8de7a43a311700e08
"Match: Fix ordered and nonequal" work for default
'LOGICAL_OP_NON_SHORT_CIRCUIT == false' configurations.

	PR testsuite/116635
	gcc/testsuite/
	* gcc.dg/opt-ordered-and-nonequal-1.c: Fix re
	'LOGICAL_OP_NON_SHORT_CIRCUIT'.
---
 gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c b/gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c
index 6d102c2bd0c..d61c3322214 100644
--- a/gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c
+++ b/gcc/testsuite/gcc.dg/opt-ordered-and-nonequal-1.c
@@ -1,5 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-forwprop1-details" } */
+/* Make this work for default 'LOGICAL_OP_NON_SHORT_CIRCUIT == false' configurations:
+   { dg-additional-options "--param logical-op-non-short-circuit=1" } */
 
 int is_ordered_and_nonequal_sh_1 (float a, float b)
 {
-- 
2.34.1