diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2020-08-04 07:13:44 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2020-08-04 07:23:43 +0200 |
commit | 70be5895658d9da5135957bd9af7b14ba4a82a70 (patch) | |
tree | eede7f20cc52a429ef73b9e170633f6bb435f795 /gcc | |
parent | 92877ab81bf07ba732a3ac3263bcf3ecd45ec266 (diff) | |
download | gcc-70be5895658d9da5135957bd9af7b14ba4a82a70.zip gcc-70be5895658d9da5135957bd9af7b14ba4a82a70.tar.gz gcc-70be5895658d9da5135957bd9af7b14ba4a82a70.tar.bz2 |
Adjust simplify_conversion_using_ranges for irange API.
gcc/ChangeLog:
* vr-values.c (simplify_conversion_using_ranges): Convert to irange API.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/vr-values.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/vr-values.c b/gcc/vr-values.c index e78b255..38c9a65 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -3969,11 +3969,14 @@ simplify_conversion_using_ranges (gimple_stmt_iterator *gsi, gimple *stmt) /* Get the value-range of the inner operand. Use get_range_info in case innerop was created during substitute-and-fold. */ wide_int imin, imax; - if (!INTEGRAL_TYPE_P (TREE_TYPE (innerop)) - || get_range_info (innerop, &imin, &imax) != VR_RANGE) + value_range vr; + if (!INTEGRAL_TYPE_P (TREE_TYPE (innerop))) return false; - innermin = widest_int::from (imin, TYPE_SIGN (TREE_TYPE (innerop))); - innermax = widest_int::from (imax, TYPE_SIGN (TREE_TYPE (innerop))); + get_range_info (innerop, vr); + if (vr.undefined_p () || vr.varying_p ()) + return false; + innermin = widest_int::from (vr.lower_bound (), TYPE_SIGN (TREE_TYPE (innerop))); + innermax = widest_int::from (vr.upper_bound (), TYPE_SIGN (TREE_TYPE (innerop))); /* Simulate the conversion chain to check if the result is equal if the middle conversion is removed. */ |