This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/25145] missed VRP opportunity



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-11-29 00:38 -------
Note this was the simple fix which exposes those latent bugs as far as I can
see that should work, we get the correct range but the rest of VRP goes
bonkers:
Index: tree-vrp.c
===================================================================
--- tree-vrp.c  (revision 107604)
+++ tree-vrp.c  (working copy)
@@ -1226,7 +1226,14 @@ extract_range_from_binary_expr (value_ra
       || symbolic_range_p (&vr0)
       || symbolic_range_p (&vr1))
     {
-      set_value_range_to_varying (vr);
+      if ((code != PLUS_EXPR
+           && code != MINUS_EXPR)
+          || !is_gimple_min_invariant (op1))
+       set_value_range_to_varying (vr);
+      else
+       {
+         set_value_range (vr, VR_RANGE, expr, expr, NULL);
+       }
       return;
     }



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25145


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]