This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/64853] [5 Regression] wrong code at -Os and above on x86_64-linux-gnu
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Jan 2015 09:49:19 +0000
- Subject: [Bug tree-optimization/64853] [5 Regression] wrong code at -Os and above on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-64853-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64853
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/tree-vrp.c.jj 2015-01-28 08:39:51.000000000 +0100
+++ gcc/tree-vrp.c 2015-01-29 10:44:37.395688127 +0100
@@ -7093,14 +7093,14 @@ vrp_valueize_1 (tree name)
if (TREE_CODE (name) == SSA_NAME)
{
value_range_t *vr = get_value_range (name);
- if (range_int_cst_singleton_p (vr))
- return vr->min;
/* If the definition may be simulated again we cannot follow
this SSA edge as the SSA propagator does not necessarily
re-visit the use. */
gimple def_stmt = SSA_NAME_DEF_STMT (name);
if (prop_simulate_again_p (def_stmt))
return NULL_TREE;
+ if (range_int_cst_singleton_p (vr))
+ return vr->min;
}
return name;
}
fixes this, even when a VR is singleton, it might be singleton just because it
is singleton only in the first iteration and not afterwards.
That said, I'd worry that this patch might degrade VRP folding too much.