Do not try to further refine a VR_UNDEFINED result when intersecting
authorAldy Hernandez <aldyh@redhat.com>
Thu, 11 Jul 2019 07:50:58 +0000 (07:50 +0000)
committerAldy Hernandez <aldyh@gcc.gnu.org>
Thu, 11 Jul 2019 07:50:58 +0000 (07:50 +0000)
value_ranges.

From-SVN: r273377

gcc/ChangeLog
gcc/tree-vrp.c

index ee70694afebc52affe6de0c58bb5ccbead4ed84b..f1718532e456d2c197ca5105eccc283aa34ebc65 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-11  Aldy Hernandez  <aldyh@redhat.com>
+
+       * tree-vrp.c (intersect_ranges): If we know the intersection is
+       empty, there is no need to conservatively add anything else to
+       the set.
+
 2019-07-11  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/91131
index dc7f825efc89da72b085d97d7e201854ddcda0f8..594ee9adc17d6a904bc44a4bcecb909aa8f524c7 100644 (file)
@@ -5977,6 +5977,11 @@ intersect_ranges (enum value_range_kind *vr0type,
        gcc_unreachable ();
     }
 
+  /* If we know the intersection is empty, there's no need to
+     conservatively add anything else to the set.  */
+  if (*vr0type == VR_UNDEFINED)
+    return;
+
   /* As a fallback simply use { *VRTYPE, *VR0MIN, *VR0MAX } as
      result for the intersection.  That's always a conservative
      correct estimate unless VR1 is a constant singleton range