This is a v2 because I accidentally sent a WIP version of the patch last time round which used replace_equiv_address instead of replace_equiv_address_nv; that caused some ICEs (pointed out by the Linaro CI) since pair addressing modes aren't a subset of the addresses that are accepted by memory_operand for a given mode. This patch should otherwise be identical to v1. Bootstrapped/regtested on aarch64-linux-gnu (indeed this is the patch I actually tested last time), is this version also OK for GCC 15? Thanks, Alex --- >8 --- The ldp/stp fusion pass can change the base of an access so that the two accesses end up using a common base register. So far we have been using adjust_address_nv to do this, but this means that we don't preserve other properties of the mem we're replacing. It seems better to use replace_equiv_address_nv, as this will preserve e.g. the MEM_ALIGN of the mem whose address we're changing. The PR shows that by adjusting the other mem we lose alignment information about the original access and therefore end up rejecting an otherwise viable pair when --param=aarch64-stp-policy=aligned is passed. This patch fixes that by using replace_equiv_address_nv instead. Notably this is the same approach as taken by aarch64_check_consecutive_mems when a change of base is required, so this at least makes things more consistent between the ldp fusion pass and the peepholes. gcc/ChangeLog: PR target/114674 * config/aarch64/aarch64-ldp-fusion.cc (ldp_bb_info::fuse_pair): Use replace_equiv_address_nv on a change of base instead of adjust_address_nv on the other access. gcc/testsuite/ChangeLog: PR target/114674 * gcc.target/aarch64/pr114674.c: New test.