From 435a6d9580fa1675537a4d2a3151802a15064d3d Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 11 Jul 2019 07:50:58 +0000 Subject: [PATCH] Do not try to further refine a VR_UNDEFINED result when intersecting value_ranges. From-SVN: r273377 --- gcc/ChangeLog | 6 ++++++ gcc/tree-vrp.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee70694afeb..f1718532e45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-11 Aldy Hernandez + + * 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 PR middle-end/91131 diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index dc7f825efc8..594ee9adc17 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -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 -- 2.30.2