[PATCH] reorg: Ignore debug insns in neighboring-insn lookups [PR127725]

Jeff Law jeffrey.law@oss.qualcomm.com
Fri Oct 9 14:49:38 GMT 2026



On 10/9/26 4:46 AM, Yongqiang Tian wrote:
> The delay-slot reorganization pass uses note-skipping neighboring-insn
> lookups in three places where a DEBUG_INSN is not an executable boundary.
> As a result, debug information can change skip optimization, label reuse,
> and register-copy recognition.
>
> Use the nondebug lookup helpers and add focused SPARC -fcompare-debug
> tests for all three paths.
>
> Assisted-by: OpenAI Codex 5.6 Sol, co-reviewed by Claude and Yongqiang Tian.
>
> 	PR rtl-optimization/127725
>
> gcc/ChangeLog:
>
> 	* reorg.cc (optimize_skip): Use next_nonnote_nondebug_insn.
> 	(get_label_before): Use prev_nonnote_nondebug_insn.
> 	(fill_slots_from_thread): Use next_nonnote_nondebug_insn.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.target/sparc/reorg-fill-slots-regcopy-debug.c: New test.
> 	* gcc.target/sparc/reorg-get-label-before-debug.c: New test.
> 	* gcc.target/sparc/reorg-optimize-skip-debug.c: New test.
>
> Signed-off-by: Yongqiang Tian <yqtian668@gmail.com>
Thanks.  I did the same testing as the prior reorg patch and it's clean.

This isn't significant from a copyright standpoint, even when aggregated 
with the prior patch, so if the code was LLM generated, we're still OK 
from a policy standpoint.    I've pushed this to the trunk.

Thanks again,

jeff


More information about the Gcc-patches mailing list