aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorAlex Coplan <alex.coplan@arm.com>2024-09-20 17:39:39 +0100
committerAlex Coplan <alex.coplan@arm.com>2024-10-21 13:30:08 +0100
commitc0e54ce1999ccf2241f74c5188b11b92e5aedc1f (patch)
tree085ab2a6cf01998dc8db2e6c24ca19bf93795691 /gcc/fortran
parentd0d99fc6b6c4f1c3fa8a9427f461103c78ab457b (diff)
downloadgcc-c0e54ce1999ccf2241f74c5188b11b92e5aedc1f.zip
gcc-c0e54ce1999ccf2241f74c5188b11b92e5aedc1f.tar.gz
gcc-c0e54ce1999ccf2241f74c5188b11b92e5aedc1f.tar.bz2
pair-fusion: Assume alias conflict if common address reg changes [PR116783]
As the PR shows, pair-fusion was tricking memory_modified_in_insn_p into returning false when a common base register (in this case, x1) was modified between the mem and the store insn. This lead to wrong code as the accesses really did alias. To avoid this sort of problem, this patch avoids invoking RTL alias analysis altogether (and assume an alias conflict) if the two insns to be compared share a common address register R, and the insns see different definitions of R (i.e. it was modified in between). gcc/ChangeLog: PR rtl-optimization/116783 * pair-fusion.cc (def_walker::cand_addr_uses): New. (def_walker::def_walker): Add parameter for candidate address uses. (def_walker::alias_conflict_p): Declare. (def_walker::addr_reg_conflict_p): New. (def_walker::conflict_p): New. (store_walker::store_walker): Add parameter for candidate address uses and pass to base ctor. (store_walker::conflict_p): Rename to ... (store_walker::alias_conflict_p): ... this. (load_walker::load_walker): Add parameter for candidate address uses and pass to base ctor. (load_walker::conflict_p): Rename to ... (load_walker::alias_conflict_p): ... this. (pair_fusion_bb_info::try_fuse_pair): Collect address register uses for candidate insns and pass down to alias walkers. gcc/testsuite/ChangeLog: PR rtl-optimization/116783 * g++.dg/torture/pr116783.C: New test.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions