summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authordnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-15 14:30:36 +0000
committerdnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-10-15 14:30:36 +0000
commit835cdeeda57b46c2c55778f7a0638534ba979835 (patch)
treee93d789fc90c9149fee14d5a02bbc1646291a9e8 /gcc/tree-vrp.c
parent5cdd0289116a17f2fac32afaeb1308bcf2ab96f4 (diff)
downloadgcc-835cdeeda57b46c2c55778f7a0638534ba979835.tar.gz
PR 23141
PR 23142 * tree-vrp.c (vrp_meet): Fix the intersection of equivalence sets VR0->EQUIV and VR1->EQUIV when meeting a range and an anti-range. (vrp_visit_phi_node): Only prevent infinite iterations when the previous result and the new result are both VR_RANGEs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105436 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index e9d6c81c7d4..7642ced2863 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3497,8 +3497,11 @@ vrp_meet (value_range_t *vr0, value_range_t *vr1)
&& !symbolic_range_p (vr1)
&& !value_ranges_intersect_p (vr0, vr1))
{
+ /* Copy most of VR1 into VR0. Don't copy VR1's equivalence
+ set. We need to compute the intersection of the two
+ equivalence sets. */
if (vr1->type == VR_ANTI_RANGE)
- copy_value_range (vr0, vr1);
+ set_value_range (vr0, vr1->type, vr1->min, vr1->max, vr0->equiv);
/* The resulting set of equivalences is the intersection of
the two sets. */
@@ -3609,7 +3612,7 @@ vrp_visit_phi_node (tree phi)
/* To prevent infinite iterations in the algorithm, derive ranges
when the new value is slightly bigger or smaller than the
previous one. */
- if (lhs_vr->type == VR_RANGE)
+ if (lhs_vr->type == VR_RANGE && vr_result.type == VR_RANGE)
{
if (!POINTER_TYPE_P (TREE_TYPE (lhs)))
{