diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2023-03-24 11:21:20 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2023-03-28 09:32:40 -0400 |
commit | dd63bba0c8dc3a6ae06cfdc084bca7c68b8bbd39 (patch) | |
tree | 82687825d14c3850b6bcb16dba5a7e3bb17243cf /gcc/value-relation.h | |
parent | 2b9d76c1af189b918a9970f471e6d2e2c08f7e7d (diff) | |
download | gcc-dd63bba0c8dc3a6ae06cfdc084bca7c68b8bbd39.zip gcc-dd63bba0c8dc3a6ae06cfdc084bca7c68b8bbd39.tar.gz gcc-dd63bba0c8dc3a6ae06cfdc084bca7c68b8bbd39.tar.bz2 |
Fix compute_operand when op1 == op2 symbolically.
First, class value_relation should not sanitize records. just create
what is asked.
Second., if there is not a relation record, compute_operand was
creating one for op1 == op2 if op1 and op2 were the same symbol. This
is not the correct way to communicate the information, as that record
will continue to be passed along the GORI unwind chain.
Instead, simply pass that information locally to the opX_range routine
for only the current statement.
PR tree-optimization/109265
PR tree-optimization/109274
gcc/
* gimple-range-gori.cc (gori_compute::compute_operand_range): Do
not create a relation record is op1 and op2 are the same symbol.
(gori_compute::compute_operand1_range): Pass op1 == op2 to the
handler for this stmt, but create a new record only if this statement
generates a relation based on the ranges.
(gori_compute::compute_operand2_range): Ditto.
* value-relation.h (value_relation::set_relation): Always create the
record that is requested.
gcc/testsuite/
* gcc.dg/pr109274.c: New.
* gfortran.dg/pr109265.f90: New.
Diffstat (limited to 'gcc/value-relation.h')
-rw-r--r-- | gcc/value-relation.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/gcc/value-relation.h b/gcc/value-relation.h index 36a7586..3177ecb 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -445,13 +445,6 @@ value_relation::set_relation (relation_kind r, tree n1, tree n2) { gcc_checking_assert (TREE_CODE (n1) == SSA_NAME && TREE_CODE (n2) == SSA_NAME); - if (n1 == n2 && r != VREL_EQ) - { - related = VREL_VARYING; - name1 = NULL_TREE; - name2 = NULL_TREE; - return; - } related = r; name1 = n1; name2 = n2; |