diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-27 16:21:48 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-07-27 16:21:48 +0000 |
commit | 98ab8375b04ae1edeb6e56f9ee3f1a41f5aa6563 (patch) | |
tree | ca21c19cd3ac54482070c4eb934ecff0d6f86fc4 /gcc | |
parent | 7ec5e827daf5f8321966d4c4d937f6f43e3b3a1a (diff) | |
download | gcc-98ab8375b04ae1edeb6e56f9ee3f1a41f5aa6563.tar.gz |
* tree-vrp.c (vrp_meet): Intersect the equivalency sets when
meeting a VR_ANTI_RANGE with a VR_RANGE. When intersecting
equivalency sets, correctly handle the case were vr0 has an
equivalency set, but vr1 does not.
* gcc.c-torture/execute/pr22630.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102432 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr22630.c | 23 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 11 |
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f5218b7e2d..968809f6d49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-07-27 Jeff Law <law@redhat.com> + + * tree-vrp.c (vrp_meet): Intersect the equivalency sets when + meeting a VR_ANTI_RANGE with a VR_RANGE. When intersecting + equivalency sets, correctly handle the case were vr0 has an + equivalency set, but vr1 does not. + 2005-07-27 Dorit Nuzman <dorit@il.ibm.com> PR tree-optimization/23073 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cffece4810e..e01e8c5a026 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-07-27 Jeff Law <law@redhat.com> + + * gcc.c-torture/execute/pr22630.c: New test. + 2005-07-27 Dorit Nuzman <dorit@il.ibm.com> PR tree-optimization/23073 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr22630.c b/gcc/testsuite/gcc.c-torture/execute/pr22630.c new file mode 100644 index 00000000000..d3a564999ba --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr22630.c @@ -0,0 +1,23 @@ +void abort (void); + +int j; + +void bla (int *r) +{ + int *p, *q; + + p = q = r; + if (!p) + p = &j; + + if (p != q) + j = 1; +} + +int main (void) +{ + bla (0); + if (!j) + abort (); + return 0; +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index e7d877d7d58..58fb7ef017f 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -3297,6 +3297,8 @@ vrp_meet (value_range_t *vr0, value_range_t *vr1) the two sets. */ if (vr0->equiv && vr1->equiv && vr0->equiv != vr1->equiv) bitmap_and_into (vr0->equiv, vr1->equiv); + else if (vr0->equiv && !vr1->equiv) + bitmap_clear (vr0->equiv); set_value_range (vr0, vr0->type, min, max, vr0->equiv); } @@ -3314,6 +3316,8 @@ vrp_meet (value_range_t *vr0, value_range_t *vr1) the two sets. */ if (vr0->equiv && vr1->equiv && vr0->equiv != vr1->equiv) bitmap_and_into (vr0->equiv, vr1->equiv); + else if (vr0->equiv && !vr1->equiv) + bitmap_clear (vr0->equiv); } else goto no_meet; @@ -3329,6 +3333,13 @@ vrp_meet (value_range_t *vr0, value_range_t *vr1) { if (vr1->type == VR_ANTI_RANGE) copy_value_range (vr0, vr1); + + /* The resulting set of equivalences is the intersection of + the two sets. */ + if (vr0->equiv && vr1->equiv && vr0->equiv != vr1->equiv) + bitmap_and_into (vr0->equiv, vr1->equiv); + else if (vr0->equiv && !vr1->equiv) + bitmap_clear (vr0->equiv); } else goto no_meet; |