https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127858
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:c312eea008ebfefc946d51cd064adaaa0efe8fb0 commit r17-5123-gc312eea008ebfefc946d51cd064adaaa0efe8fb0 Author: Richard Biener <[email protected]> Date: Tue Oct 13 15:28:09 2026 +0200 tree-optimization/127858 - fix memory access canonicalization in LIM When we canonicalize a memory access we merge accesses with differing access paths to a plain MEM_REF, but when there is a previous access with an access path we fail to clear the ao_refs base and offset. PR tree-optimization/127858 * tree-ssa-loop-im.cc (gather_mem_refs_stmt): When merging accesses with differing access path always reset base and offset to the canonical form by re-using the already canonical ao_ref. * gcc.dg/torture/pr127858.c: New testcase.
