]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Restore can_be_invalidated_p semantics to before refactoring
authorRichard Biener <rguenther@suse.de>
Fri, 26 Nov 2021 07:50:24 +0000 (08:50 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 29 Nov 2021 08:20:09 +0000 (09:20 +0100)
This restores the semantics of can_be_invalidated_p to the original
semantics of the function this was split out from tree-ssa-uninit.c.
The current semantics only ever look at the first predicate which
cannot be correct.

2021-11-26  Richard Biener  <rguenther@suse.de>

* gimple-predicate-analysis.cc (can_be_invalidated_p):
Restore semantics to the one before the split from
tree-ssa-uninit.c.

gcc/gimple-predicate-analysis.cc

index 6dde020384103821d8aa392be1751ca15d74db4c..da6adc9a3e2d64308828dd53881926eaa3724c42 100644 (file)
@@ -1199,14 +1199,16 @@ can_be_invalidated_p (const pred_chain_union &preds, const pred_chain &guard)
   for (unsigned i = 0; i < preds.length (); ++i)
     {
       const pred_chain &chain = preds[i];
-      for (unsigned j = 0; j < chain.length (); ++j)
+      unsigned j;
+      for (j = 0; j < chain.length (); ++j)
        if (can_be_invalidated_p (chain[j], guard))
-         return true;
+         break;
 
       /* If we were unable to invalidate any predicate in C, then there
         is a viable path from entry to the PHI where the PHI takes
         an interesting value and continues to a use of the PHI.  */
-      return false;
+      if (j == chain.length ())
+       return false;
     }
   return true;
 }