* tree-vrp.c (extract_range_from_binary_expr): Cope with
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Jan 2006 16:53:48 +0000 (16:53 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Jan 2006 16:53:48 +0000 (16:53 +0000)
vrp_int_const_binop returning non-constant nodes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109754 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-vrp.c

index 2e3bedb..61e005c 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree-vrp.c (extract_range_from_binary_expr): Cope with
+       vrp_int_const_binop returning non-constant nodes.
+
 2006-01-16  Paul Brook  <paul@codesourcery.com>
 
        * config/m68k/m68k.c (output_move_const_into_data_reg):
index 6bd4725..7fcd62d 100644 (file)
@@ -1412,12 +1412,13 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
       max = val[0];
       for (i = 1; i < 4; i++)
        {
-         if (TREE_OVERFLOW (min) || TREE_OVERFLOW (max))
+         if (!is_gimple_min_invariant (min) || TREE_OVERFLOW (min)
+             || !is_gimple_min_invariant (max) || TREE_OVERFLOW (max))
            break;
 
          if (val[i])
            {
-             if (TREE_OVERFLOW (val[i]))
+             if (!is_gimple_min_invariant (val[i]) || TREE_OVERFLOW (val[i]))
                {
                  /* If we found an overflowed value, set MIN and MAX
                     to it so that we set the resulting range to
@@ -1484,7 +1485,8 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
 
   /* If either MIN or MAX overflowed, then set the resulting range to
      VARYING.  */
-  if (TREE_OVERFLOW (min) || TREE_OVERFLOW (max))
+  if (!is_gimple_min_invariant (min) || TREE_OVERFLOW (min)
+      || !is_gimple_min_invariant (max) || TREE_OVERFLOW (max))
     {
       set_value_range_to_varying (vr);
       return;