Allocate bitmap before copying
authorKugan Vivekanandarajah <kuganv@linaro.org>
Mon, 10 Oct 2016 22:03:09 +0000 (22:03 +0000)
committerKugan Vivekanandarajah <kugan@gcc.gnu.org>
Mon, 10 Oct 2016 22:03:09 +0000 (22:03 +0000)
Allocate bitmap before copying
gcc/ChangeLog:

2016-10-11  Kugan Vivekanandarajah  <kuganv@linaro.org>

* tree-vrp.c (vrp_intersect_ranges_1): Allocate bitmap before
  copying.

From-SVN: r240950

gcc/ChangeLog
gcc/tree-vrp.c

index d5de3c3c3c267205be3bd3bb35bc16457bb15d9f..cb330201c1913b406b91c02b0ae6b4bcbd1e88c2 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-11  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+       * tree-vrp.c (vrp_intersect_ranges_1): Allocate bitmap before
+         copying.
+
 2016-10-10  Andreas Tobler  <andreast@gcc.gnu.org>
 
        * config.gcc: Add aarch64-*-freebsd* support.
index 4e7043122dec1f2dfbf5ee919ed4eeabd8b03456..e82dffe6999470ea3e22de024f0301e999f4a4a1 100644 (file)
@@ -8622,7 +8622,10 @@ vrp_intersect_ranges_1 (value_range *vr0, value_range *vr1)
   if (vr0->equiv && vr1->equiv && vr0->equiv != vr1->equiv)
     bitmap_ior_into (vr0->equiv, vr1->equiv);
   else if (vr1->equiv && !vr0->equiv)
-    bitmap_copy (vr0->equiv, vr1->equiv);
+    {
+      vr0->equiv = BITMAP_ALLOC (&vrp_equiv_obstack);
+      bitmap_copy (vr0->equiv, vr1->equiv);
+    }
 }
 
 void