https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124895
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Soumya AR <[email protected]>: https://gcc.gnu.org/g:cefcc09723c363f61e65f9a2774f82258fc43474 commit r17-399-gcefcc09723c363f61e65f9a2774f82258fc43474 Author: Soumya AR <[email protected]> Date: Wed May 6 05:39:55 2026 +0000 aarch64: Move pass_narrow_gp_writes above pass_free_cfg The narrow_gp_writes pass uses RTL-SSA and updates DF state via df_insn_rescan / df_insn_delete. Both routines look up the insn's bb via BLOCK_FOR_INSN to mark it dirty after a change, but pass_free_cfg has already cleared those per-insn pointers by the time narrow_gp_writes runs. When BLOCK_FOR_INSN returns NULL, the dirty-marking step is silently skipped, leaving the DF stale. Move the pass to run before pass_free_cfg. Bootstrapped and regtested on aarch64-linux-gnu. SPEC CPU 2017 shows no codegen differences (compared to previous placement). OK for trunk? Signed-off-by: Soumya AR <[email protected]> PR target/124895 gcc/ChangeLog: * config/aarch64/aarch64-passes.def (pass_narrow_gp_writes): Move pass before pass_free_cfg. gcc/testsuite/ChangeLog: * gcc.target/aarch64/narrow-gp-writes-8.c: New test.
