[Bug tree-optimization/25145] missed VRP opportunity
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Nov 29 00:38:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list