GCC was recently changed to prevent simplify_subreg from simplifying a subreg of a mem when the mode of the new mem would have stricter alignment constraints than the inner mem already has when the target requires STRICT_ALIGNMENT. However, such targets may have specialist patterns that can handle unaligned accesses and this restriction turns out to be unduly restrictive. So limit this restriction to only apply when the inner mem is naturally aligned to the inner mode. gcc/ChangeLog: PR target/102125 * simplify-rtx.c (simplify_context::simplify_subreg): Allow simplifying (subreg (mem())) when the inner mem is already misaligned for its type. --- gcc/simplify-rtx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)