https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127795
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:084169bfcc44a1dd249ca73ca8a606fcd2034dad commit r17-5025-g084169bfcc44a1dd249ca73ca8a606fcd2034dad Author: Yongqiang Tian <[email protected]> Date: Fri Oct 9 07:38:56 2026 -0600 [PATCH] reorg: Ignore debug insns in delete_prior_computation [PR127795] delete_prior_computation walks backward with prev_nonnote_insn while deleting a dead computation. A DEBUG_INSN therefore terminates the scan and can make -g retain an instruction that is deleted with -g0. Use prev_nonnote_nondebug_insn for both steps of the walk. Add a SPARC regression test that checks both -fcompare-debug and the absence of the dead add. Assisted-by: OpenAI Codex 5.6 Sol, co-reviewed by Claude and Yongqiang Tian. PR rtl-optimization/127795 gcc/ChangeLog: * reorg.cc (delete_prior_computation): Ignore debug insns in the backward scan. gcc/testsuite/ChangeLog: * gcc.target/sparc/reorg-delete-prior-debug.c: New test. Signed-off-by: Yongqiang Tian <[email protected]>
