]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/108209 - typo in genmatch.cc:commutative_op
authorRichard Biener <rguenther@suse.de>
Mon, 9 Jan 2023 13:28:03 +0000 (14:28 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 9 Jan 2023 14:07:49 +0000 (15:07 +0100)
The early out for user-id handling indicated commutative
rather than not commutative.

PR middle-end/108209
* genmatch.cc (commutative_op): Fix return value for
user-id with non-commutative first replacement.

gcc/genmatch.cc

index fb9e37ae434d66c39d154113ee7a4320273cb25d..d4cb439a851e5dc692c439cbc95e19743962b3bd 100644 (file)
@@ -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;