On 9/3/26 4:09 AM, wangjue wrote:
From: juewang <[email protected]>
Some targets only provide a valid issue rate when instruction scheduling
is enabled. Fall back to serial costing when flag_schedule_insns is
false.
Assisted-by: Codex (OpenAI)
gcc/ChangeLog:
* ifcvt.cc (noce_parallel_seq_cost): Fall back to serial cost when
instruction scheduling is disabled.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/ifcvt-parallel-cost-1.c: New test.
* gcc.target/riscv/ifcvt-parallel-cost-2.c: Likewise.
* gcc.target/riscv/ifcvt-parallel-cost-3.c: Likewise.
The problem is one could be using the m68k on a variant with no
scheduling model (such as anything except the coldfire variants), but
still explicitly use the -fschedule-insns or -fschedule-insns2
compile-time flags. With your patch the ICE would trigger again.
The better thing to do is fix the m68k issue rate definition. In the
default clause just return 1 rather than using gcc_unreachable.
I'll assume Andreas didn't include a testcase because m68k triggers it
on existing tests such as compile/20000802-1.c or perhaps when building
libgcc/libstdc++.
Jeff