diff options
author | Richard Biener <rguenther@suse.de> | 2018-11-30 10:37:39 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2018-11-30 10:37:39 +0000 |
commit | 45b97a09afcb101426a88ad1cd41740df9f6ca37 (patch) | |
tree | bb9b7b3ed13f7ab06c5590001437a679e5616271 /gcc/tree-vrp.c | |
parent | 518a3a2106e4e8172a1c7628b79b63635857fec3 (diff) | |
download | gcc-45b97a09afcb101426a88ad1cd41740df9f6ca37.zip gcc-45b97a09afcb101426a88ad1cd41740df9f6ca37.tar.gz gcc-45b97a09afcb101426a88ad1cd41740df9f6ca37.tar.bz2 |
re PR tree-optimization/88274 (ICE in check, at tree-vrp.c:188)
2018-11-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/88274
* tree-vrp.c (ranges_from_anti_range): Fix handling of
TYPE_MIN/MAX_VALUE.
From-SVN: r266659
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index eb4d5b0..aa6309e 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1249,14 +1249,14 @@ ranges_from_anti_range (const value_range_base *ar, || !vrp_val_max (type)) return false; - if (!vrp_val_is_min (ar->min ())) - *vr0 = value_range (VR_RANGE, - vrp_val_min (type), - wide_int_to_tree (type, wi::to_wide (ar->min ()) - 1)); - if (!vrp_val_is_max (ar->max ())) - *vr1 = value_range (VR_RANGE, - wide_int_to_tree (type, wi::to_wide (ar->max ()) + 1), - vrp_val_max (type)); + if (tree_int_cst_lt (vrp_val_min (type), ar->min ())) + vr0->set (VR_RANGE, + vrp_val_min (type), + wide_int_to_tree (type, wi::to_wide (ar->min ()) - 1)); + if (tree_int_cst_lt (ar->max (), vrp_val_max (type))) + vr1->set (VR_RANGE, + wide_int_to_tree (type, wi::to_wide (ar->max ()) + 1), + vrp_val_max (type)); if (vr0->undefined_p ()) { *vr0 = *vr1; |