tree-vrp.c (set_value_range): Do not reference vrp_equiv_obstack.
authorJeff Law <law@redhat.com>
Thu, 9 Nov 2017 22:57:18 +0000 (15:57 -0700)
committerJeff Law <law@gcc.gnu.org>
Thu, 9 Nov 2017 22:57:18 +0000 (15:57 -0700)
* tree-vrp.c (set_value_range): Do not reference vrp_equiv_obstack.
Get it from the existing bitmap instead.
(vrp_intersect_ranges_1): Likewise.

From-SVN: r254611

gcc/ChangeLog
gcc/tree-vrp.c

index 0dc2057..16bec6e 100644 (file)
@@ -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
index 2b7d962..8e86b06 100644 (file)
@@ -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);
     }
 }