]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix VEC_COND_EXPR matching with inverted compare
authorRichard Biener <rguenther@suse.de>
Mon, 15 Jun 2026 08:40:10 +0000 (10:40 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 15 Jun 2026 10:57:16 +0000 (12:57 +0200)
The following fixes detecting of VEC_COND_EXPR <cmp, {0,..}, {-1,...}>
which we recognize in ovce_extract_ops by inverting 'cmp'.  But
after checking that the false value is {-1,...} we then continue
verifying it is also {0,...} which it of course is not.  Fixed
by checking the true value in that case.

* tree-ssa-reassoc.cc (ovce_extract_ops): Fixup
false value matching for the inverted comparison case.

gcc/tree-ssa-reassoc.cc

index 924742878ea6680814ed108711eddf360706067d..dec64883891158908e800071aea46532fcebcda7 100644 (file)
@@ -4207,7 +4207,7 @@ ovce_extract_ops (tree var, gassign **rets, bool *reti, tree *type,
     }
   else
     return ERROR_MARK;
-  if (!integer_zerop (f))
+  if (!integer_zerop (inv ? t : f))
     return ERROR_MARK;
 
   /* Success!  */