https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110220
Bug ID: 110220
Summary: ICE in patch_jump_insn, at cfgrtl.cc:1295 - avr/xmega
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: daniel at rozsnyo dot com
Target Milestone: ---
Created attachment 55308
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55308&action=edit
Code that fails to compile
After I migrated from gcc-4.8/4.9 to recent versions, both the gcc-14.0.0 and
gcc-13.1.1 fail to compile my pretty large avr-mcu project at one specific
function/construct. While I have found a solution with making the code
differently constructed to not trigger the ICE, now that I found time, I did
reduce the output of the -save-temps into a single function that triggers the
assertion.
during RTL pass: jump
insn-bug-minimal.c: In function ‘cmd_parse’:
insn-bug-minimal.c:184:1: internal compiler error: in patch_jump_insn, at
cfgrtl.cc:1295
184 | }
| ^
0x90de427 internal_error(char const*, ...)
???:0
0x820f6af fancy_abort(char const*, int, char const*)
???:0
0x835a3be redirect_edge_and_branch(edge_def*, basic_block_def*)
???:0
0x8dc2b15 cleanup_cfg(int)
???:0
The way to avoid this ICE is to comment out one of the switch(state) cases, or
move one of them before the switch into an if-statement (my current function
equivalent workaround).
My cross-compile toolchain is made by gentoo crossdev package.
The ICE seems to be present only at -Os for the attached minimal source:
avr-gcc -g -Os -Wall -mmcu=atxmega128a4u -std=gnu99 -c insn-bug-minimal.c -o
bug.o