diff options
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index f2c948c..7001190 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -4323,6 +4323,17 @@ adjust_range_with_scev (value_range *vr, struct loop *loop, && is_positive_overflow_infinity (max))) return; + /* Even for valid range info, sometimes overflow flag will leak in. + As GIMPLE IL should have no constants with TREE_OVERFLOW set, we + drop them except for +-overflow_infinity which still need special + handling in vrp pass. */ + if (TREE_OVERFLOW_P (min) + && ! is_negative_overflow_infinity (min)) + min = drop_tree_overflow (min); + if (TREE_OVERFLOW_P (max) + && ! is_positive_overflow_infinity (max)) + max = drop_tree_overflow (max); + set_value_range (vr, VR_RANGE, min, max, vr->equiv); } |