Process unsigned overflow relations for plus and minus is range-ops.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 23 Aug 2022 14:17:02 +0000 (10:17 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 29 Sep 2022 22:34:18 +0000 (18:34 -0400)
commit7ea258a13a115e9e73d60f59369d16892ed07435
treeb4b6a91902b2930dd8dfb2483a067681afb32913
parent67166c9ec35d58efd0225b74730983aa480a88f1
Process unsigned overflow relations for plus and minus is range-ops.

If a relation is available, calculate overflow and normal ranges. Then
apply as appropriate.

gcc/
* range-op.cc (plus_minus_ranges): New.
(adjust_op1_for_overflow): New.
(operator_plus::op1_range): Use new adjustment.
(operator_plus::op2_range): Ditto.
(operator_minus::op1_range): Ditto.
* value-relation.h (relation_lt_le_gt_ge_p): New.

gcc/testsuite/
* gcc.dg/tree-ssa/pr79095.c: Test evrp pass rather than vrp1.
gcc/range-op.cc
gcc/testsuite/gcc.dg/tree-ssa/pr79095.c
gcc/value-relation.h