diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-07-25 17:43:07 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-07-26 09:52:38 -0700 |
commit | 9fe53beacfc5c01e24690dc70d7599db084cc8b4 (patch) | |
tree | 4f25cc1b5fca1638468057b417db2d5571a2526d /gcc/expr.cc | |
parent | db74887097272a8390e33eba47c6fb8f50b64f5c (diff) | |
download | gcc-9fe53beacfc5c01e24690dc70d7599db084cc8b4.zip gcc-9fe53beacfc5c01e24690dc70d7599db084cc8b4.tar.gz gcc-9fe53beacfc5c01e24690dc70d7599db084cc8b4.tar.bz2 |
isel: Don't duplicate comparisons for -O0 nor -fno-tree-ter [PR116101]
While doing cleanups on this code I noticed that we do the duplicate
of comparisons at -O0. For C and C++ code this makes no difference as
the gimplifier never produces COND_EXPR. But it could make a difference
for other front-ends.
Oh and for -fno-tree-ter, duplicating the comparison is just a waste
as it is never used for expand.
I also decided to add a few testcases so this is checked in the future.
Even added one for the duplication itself.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR tree-optimization/116101
gcc/ChangeLog:
* gimple-isel.cc (maybe_duplicate_comparison): Don't
do anything for -O0 or -fno-tree-ter.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/dup_compare_cond-1.c: New test.
* gcc.dg/tree-ssa/dup_compare_cond-2.c: New test.
* gcc.dg/tree-ssa/dup_compare_cond-3.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions