https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126536

--- Comment #5 from Andrew Macleod <amacleod at redhat dot com> ---
if invert() fails to produce a valid value and returns false now, is this the
correct fix to check the return value?  I drew it from the next variation of
unswitch_predicate, but don't know the code.  

Or is there something else that should be done?


--- a/gcc/tree-ssa-loop-unswitch.cc
+++ b/gcc/tree-ssa-loop-unswitch.cc
@@ -116,7 +116,13 @@ struct unswitch_predicate
     false_range = true_range;
     if (!false_range.varying_p ()
        && !false_range.undefined_p ())
-      false_range.invert ();
+      {
+       if (!false_range.invert ())
+         {
+           true_range.set_varying (TREE_TYPE (lhs));
+           false_range.set_varying (TREE_TYPE (lhs));
+         }
+      }
     count = e->count ();
     num = predicates->length ();
     predicates->safe_push (this);

Reply via email to