diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-09-27 08:26:18 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-09-27 08:26:18 +0200 |
commit | cb8f25c5dc9f6d5207c826c2dafe25f68458ceaf (patch) | |
tree | c7ab87b57ebd3b25a66ca32d85a0661ad37020ba /gcc/d/expr.cc | |
parent | 4790fe99f236c7f1b617722403e682ba2f82485f (diff) | |
download | gcc-cb8f25c5dc9f6d5207c826c2dafe25f68458ceaf.zip gcc-cb8f25c5dc9f6d5207c826c2dafe25f68458ceaf.tar.gz gcc-cb8f25c5dc9f6d5207c826c2dafe25f68458ceaf.tar.bz2 |
reassoc: Handle OFFSET_TYPE like POINTER_TYPE in optimize_range_tests_cmp_bitwise [PR107029[
As the testcase shows, OFFSET_TYPE needs the same treatment as
POINTER_TYPE/REFERENCE_TYPE, otherwise we fail the same during the
newly added verification. OFFSET_TYPE is signed though, so unlike
POINTER_TYPE/REFERENCE_TYPE it can also trigger with the
x < 0 && y < 0 && z < 0 to (x | y | z) < 0
optimization.
2022-09-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/107029
* tree-ssa-reassoc.cc (optimize_range_tests_cmp_bitwise): Treat
OFFSET_TYPE like POINTER_TYPE, except that OFFSET_TYPE may be
signed and so can trigger even the (b % 4) == 3 case.
* g++.dg/torture/pr107029.C: New test.
Diffstat (limited to 'gcc/d/expr.cc')
0 files changed, 0 insertions, 0 deletions