https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126931
Bug ID: 126931
Summary: [17 Regression] Recent threading change causes c6x
testsuite failure
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: law at gcc dot gnu.org
Target Milestone: ---
This change:
commit 4fe2072d5d16ce26112d8035e627d47809aaa6c2
Author: Richard Biener <[email protected]>
Date: Mon Aug 17 09:58:27 2026 +0200
tree-optimization/126887 - allow backward threading to loop exit
The following allows the backward thread through a loop header
to exit, allowing it to fully peel a not iterating loop on a
threading path. The backward thread copier cannot handle copying
loops, but this special case is OK and is also handled by the
forward threader. We have to take care to not randomly peel
loops though, not even after loop opts, so this patch adds
appropriate measures and a testcase.
[ ... ]
Is causing regressions in c6x:
Tests that now fail, but worked before (3 tests):
c6x-sim: gcc: gcc.c-torture/execute/pr64682.c -O2 (test for excess errors)
c6x-sim: gcc: gcc.c-torture/execute/pr64682.c -O2 -flto
-fno-use-linker-plugin -flto-partition=none (test for excess errors)
c6x-sim: gcc: gcc.c-torture/execute/pr64682.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
In the log file we have:
during RTL pass: mach
/home/jlaw/jenkins/workspace/c6x-elf/gcc/gcc/testsuite/gcc.c-torture/execute/pr64682.c:
In function 'main':
/home/jlaw/jenkins/workspace/c6x-elf/gcc/gcc/testsuite/gcc.c-torture/execute/pr64682.c:26:1:
internal compiler error: Se
gmentation fault
0x292349d internal_error(char const*, ...)
../../..//gcc/gcc/diagnostic-global-context.cc:787
0x14c247e crash_signal
../../..//gcc/gcc/toplev.cc:325
0x7f9b37f51fcf ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xd1d15d duplicate_insn_chain(rtx_insn*, rtx_insn*, loop*, copy_bb_data*)
../../..//gcc/gcc/cfgrtl.cc:4398
0x1a1d4bd hwloop_optimize
../../..//gcc/gcc/config/c6x/c6x.cc:5606
0x26a530f optimize_loop
../../..//gcc/gcc/hw-doloop.cc:589
0x26a54a2 reorg_loops(bool, hw_doloop_hooks*)
../../..//gcc/gcc/hw-doloop.cc:653
0x1a1e33a c6x_hwloops
../../..//gcc/gcc/config/c6x/c6x.cc:5879
0x1a1e3dd c6x_reorg
../../..//gcc/gcc/config/c6x/c6x.cc:5919
0x141ba9a execute
../../..//gcc/gcc/reorg.cc:3924
So likely specific to c6x, so marking as target. I haven't debugged this any
further.