[committed] handle VR_UNDEFINED in normalize_addresses
diff mbox series

Message ID b40ca845-9983-a58e-ae61-27229927e4e6@redhat.com
State New
Headers show
Series
  • [committed] handle VR_UNDEFINED in normalize_addresses
Related show

Commit Message

Aldy Hernandez Nov. 4, 2019, 7:48 p.m. UTC
We are currently ICEing when calling normalize_address on an undefined 
range because undefines do not have types.

Committed as obvious.

Patch
diff mbox series

commit 12cdfbe483c8981ba724582c1faa1432e762b549
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Mon Nov 4 12:16:37 2019 +0100

    Handle VR_UNDEFINED in value_range_base::normalize_addresses().

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d00348891bd..407470f0ed6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-11-04  Aldy Hernandez  <aldyh@redhat.com>
+
+	* tree-vrp.c (value_range_base::normalize_addresses): Handle
+	VR_UNDEFINED.
+
 2019-11-04  Aldy Hernandez  <aldyh@redhat.com>
 
 	* tree-vrp.c (dump_assert_info): New.
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 7c35802dacc..c0c1e87a259 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -6130,6 +6130,9 @@  value_range::union_ (const value_range *other)
 value_range_base
 value_range_base::normalize_addresses () const
 {
+  if (undefined_p ())
+    return *this;
+
   if (!POINTER_TYPE_P (type ()) || range_has_numeric_bounds_p (this))
     return *this;