* [committed][PATCH] Avoid references to vrp_equiv_obstack
@ 2017-11-09 23:21 Jeff Law
0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2017-11-09 23:21 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
This was broken out of the first tree-vrp refactoring patch. This patch
avoids a couple references to vrp_equiv_obstack. This makes the
subsequent refactoring work easier.
Richi approved this as part of the larger patch. But since I had it
pulled out, I'm going to commit it individually. I'm posting the patch
here for archival purposes.
Bootstrapped and regression tested on x86_64.
Jeff
[-- Attachment #2: P --]
[-- Type: text/plain, Size: 2001 bytes --]
commit f5b45b9dac2b7b793998d2b70ce8f5b7a1cffbf4
Author: Jeff Law <law@torsion.usersys.redhat.com>
Date: Wed Nov 8 11:59:54 2017 -0500
* tree-vrp.c (set_value_range): Do not reference vrp_equiv_obstack.
Get it from the existing bitmap instead.
(vrp_intersect_ranges_1): Likewise.
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0dc2057c08d..16bec6ec00b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-09 Jeff Law <law@redhat.com>
+
+ * tree-vrp.c (set_value_range): Do not reference vrp_equiv_obstack.
+ Get it from the existing bitmap instead.
+ (vrp_intersect_ranges_1): Likewise.
+
2017-11-09 Jakub Jelinek <jakub@redhat.com>
* gimple-ssa-store-merging.c (struct store_immediate_info): Add
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 2b7d9622f69..8e86b060ae7 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -272,10 +272,13 @@ set_value_range (value_range *vr, enum value_range_type t, tree min,
vr->max = max;
/* Since updating the equivalence set involves deep copying the
- bitmaps, only do it if absolutely necessary. */
+ bitmaps, only do it if absolutely necessary.
+
+ All equivalence bitmaps are allocated from the same obstack. So
+ we can use the obstack associated with EQUIV to allocate vr->equiv. */
if (vr->equiv == NULL
&& equiv != NULL)
- vr->equiv = BITMAP_ALLOC (&vrp_equiv_obstack);
+ vr->equiv = BITMAP_ALLOC (equiv->obstack);
if (equiv != vr->equiv)
{
@@ -8828,7 +8831,9 @@ vrp_intersect_ranges_1 (value_range *vr0, value_range *vr1)
bitmap_ior_into (vr0->equiv, vr1->equiv);
else if (vr1->equiv && !vr0->equiv)
{
- vr0->equiv = BITMAP_ALLOC (&vrp_equiv_obstack);
+ /* All equivalence bitmaps are allocated from the same obstack. So
+ we can use the obstack associated with VR to allocate vr0->equiv. */
+ vr0->equiv = BITMAP_ALLOC (vr1->equiv->obstack);
bitmap_copy (vr0->equiv, vr1->equiv);
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-09 22:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 23:21 [committed][PATCH] Avoid references to vrp_equiv_obstack Jeff Law
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).