Add relation between op1 & op2 to lhs_opN_relation API.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 15 Feb 2022 15:17:26 +0000 (10:17 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Fri, 13 May 2022 14:20:15 +0000 (10:20 -0400)
commitcf2141a0c640fc9b1c497db3f4d5b270f4b8252a
tree7a2d27079325d796a225a21adf13ea5b89907c08
parent0ee9a62ef4b718ce7a66051f768c2bf5e1b62263
Add relation between op1 & op2 to lhs_opN_relation API.

We use the relation between op1 and op2 to help fold a statement, but
it was not provided to the lhs_op1_relation and lhs_op2_relation routines
to determine if is also creates a relation between the LHS and either operand.

gcc/
PR tree-optimization/104547
* gimple-range-fold.cc (fold_using_range::range_of_range_op): Add
the op1/op2 relation to the relation call.
* range-op.cc (*::lhs_op1_relation): Add param.
(*::lhs_op2_relation): Ditto.
(operator_minus::lhs_op1_relation): New.
(range_relational_tests): Add relation param.
* range-op.h (lhs_op1_relation, lhs_op2_relation): Adjust prototype.

gcc/testsuite/
* g++.dg/pr104547.C: New.
gcc/gimple-range-fold.cc
gcc/range-op.cc
gcc/range-op.h
gcc/testsuite/g++.dg/pr104547.C [new file with mode: 0644]