middle-end/108209 - typo in genmatch.cc:commutative_op

Message ID 20230109140727.78A9C13583@imap2.suse-dmz.suse.de
State Repeat Merge
Headers
Series middle-end/108209 - typo in genmatch.cc:commutative_op |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Richard Biener Jan. 9, 2023, 2:07 p.m. UTC
  The early out for user-id handling indicated commutative
rather than not commutative.

Bootstrapped and tested on x86_64-unkown-linux-gnu, pushed.

	PR middle-end/108209
	* genmatch.cc (commutative_op): Fix return value for
	user-id with non-commutative first replacement.
---
 gcc/genmatch.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
index fb9e37ae434..d4cb439a851 100644
--- a/gcc/genmatch.cc
+++ b/gcc/genmatch.cc
@@ -496,7 +496,7 @@  commutative_op (id_base *id)
     {
       int res = commutative_op (uid->substitutes[0]);
       if (res < 0)
-	return 0;
+	return -1;
       for (unsigned i = 1; i < uid->substitutes.length (); ++i)
 	if (res != commutative_op (uid->substitutes[i]))
 	  return -1;