diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-04-19 08:47:53 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-04-19 08:47:53 +0200 |
commit | 9f295847a9c32081bdd0fe908ffba58e830a24fb (patch) | |
tree | 1f476375a8c0c85eab3b07e2157b67c8447c400a /mkdep | |
parent | 36f4c8a9ac8f71fc21fcb169c7913e8fef30d15c (diff) | |
download | gcc-9f295847a9c32081bdd0fe908ffba58e830a24fb.zip gcc-9f295847a9c32081bdd0fe908ffba58e830a24fb.tar.gz gcc-9f295847a9c32081bdd0fe908ffba58e830a24fb.tar.bz2 |
rtlanal: Fix set_noop_p for volatile loads or stores [PR114768]
On the following testcase, combine propagates the mem/v load into mem store
with the same address and then removes it, because noop_move_p says it is a
no-op move. If it was the other way around, i.e. mem/v store and mem load,
or both would be mem/v, it would be kept.
The problem is that rtx_equal_p never checks any kind of flags on the rtxes
(and I think it would be quite dangerous to change it at this point), and
set_noop_p checks side_effects_p on just one of the operands, not both.
In the MEM <- MEM set, it only checks it on the destination, in
store to ZERO_EXTRACT only checks it on the source.
The following patch adds the missing side_effects_p checks.
2024-04-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/114768
* rtlanal.cc (set_noop_p): Don't return true for MEM <- MEM
sets if src has side-effects or for stores into ZERO_EXTRACT
if ZERO_EXTRACT operand has side-effects.
* gcc.dg/pr114768.c: New test.
Diffstat (limited to 'mkdep')
0 files changed, 0 insertions, 0 deletions