diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2020-10-21 09:33:06 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2020-10-21 10:44:10 +0200 |
commit | 878315ae489ebf92e97470d7019da91f1c57436d (patch) | |
tree | 2609df0f07f28aa2ed18cfac9f7a6a048c6e33bb /gcc/vr-values.c | |
parent | 121a8812c45b3155ccbd268b000ad00a778e81e8 (diff) | |
download | gcc-878315ae489ebf92e97470d7019da91f1c57436d.zip gcc-878315ae489ebf92e97470d7019da91f1c57436d.tar.gz gcc-878315ae489ebf92e97470d7019da91f1c57436d.tar.bz2 |
Adjust overflow for invariants in bounds_of_var_in_loop.
Invariants returned from SCEV can have TREE_OVERFLOW set. Clear the
overflow as we do with the rest of the values returned from this
function.
gcc/ChangeLog:
* gimple-range.cc (gimple_ranger::range_of_ssa_name_with_loop_info):
Remove TREE_OVERFLOW special case.
* vr-values.c (bounds_of_var_in_loop): Adjust overflow for
invariants.
Diffstat (limited to 'gcc/vr-values.c')
-rw-r--r-- | gcc/vr-values.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/vr-values.c b/gcc/vr-values.c index cc0ddca..7a0e70e 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -1844,7 +1844,7 @@ bounds_of_var_in_loop (tree *min, tree *max, range_query *query, if (is_gimple_min_invariant (chrec)) { *min = *max = chrec; - return true; + goto fix_overflow; } if (TREE_CODE (chrec) != POLYNOMIAL_CHREC) @@ -1964,6 +1964,7 @@ bounds_of_var_in_loop (tree *min, tree *max, range_query *query, else *min = init; + fix_overflow: /* 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. */ |