This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/25145] missed VRP opportunity
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2005 00:38:09 -0000
- Subject: [Bug tree-optimization/25145] missed VRP opportunity
- References: <bug-25145-6528@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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