Noticed ICE when was building linux-6.6.1 with gcc-master at r14-5529-g7a496b7ce10518 cvise came up with the following trigger: // $ cat ast_mode.c.c union { char b[4]; void (*ul)(void); } gu; int gv; void writew(...); void bug(void) { struct { char b[2]; } s; gu.ul = bug; s.b[0] = gu.b[1] | gv; writew(s); } Crashes as: $ gcc -O1 -c ast_mode.c.c -o a.o during RTL pass: split2 ast_mode.c.c: In function 'bug': ast_mode.c.c:12:1: internal compiler error: Segmentation fault 12 | } | ^ 0x103e83f crash_signal ../../source/gcc/toplev.cc:316 0xbd5d7b mark_label_nuses ../../source/gcc/emit-rtl.cc:3755 0xbd5dcc mark_label_nuses ../../source/gcc/emit-rtl.cc:3763 0xbd5dcc mark_label_nuses ../../source/gcc/emit-rtl.cc:3763 0xbd5ded mark_label_nuses ../../source/gcc/emit-rtl.cc:3766 0xbda6e6 try_split(rtx_def*, rtx_insn*, int) ../../source/gcc/emit-rtl.cc:3952 0xf929d7 split_insn ../../source/gcc/recog.cc:3383 0xf981c7 split_all_insns() ../../source/gcc/recog.cc:3487 0xf98278 execute ../../source/gcc/recog.cc:4411 $ gcc/xgcc -Bgcc -v Reading specs from gcc/specs COLLECT_GCC=gcc/xgcc COLLECT_LTO_WRAPPER=gcc/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib --disable-bootstrap --disable-lto --disable-libsanitizer --enable-languages=c CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0' : (reconfigured) /home/slyfox/dev/git/gcc/configure --disable-multilib --disable-bootstrap --disable-lto --disable-libsanitizer --enable-languages=c CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0' Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20231116 (experimental) (GCC)
Mine, due to [1], this time I managed to split to invalid RTX... I have a patch. [1] https://gcc.gnu.org/pipermail/gcc-cvs/2023-November/393104.html
I get the same for this C++ code: struct { long length(); } fromBase32Hex_input; int set_bits_start, set_bits_length; char fromBase32Hex_block[1]; char fromBase32Hex_cr; void fromBase32Hex() { for (; fromBase32Hex_input.length();) { char *s = fromBase32Hex_block; char cc = set_bits_length >> 8; if (set_bits_length) { s[set_bits_start / 8] |= cc; s[set_bits_start / 8 + 1] |= fromBase32Hex_cr; } s[set_bits_start / 8] |= fromBase32Hex_cr; } } cvise $ ~/gcc/results/bin/gcc -c -w -O2 bug982.cc cvise $ ~/gcc/results/bin/gcc -c -w -O2 -march=znver1 bug982.cc during RTL pass: split2 bug982.cc: In function ‘void fromBase32Hex()’: bug982.cc:17:1: internal compiler error: Segmentation fault 17 | } | ^ 0x11b6759 crash_signal(int) ../../trunk.year/gcc/toplev.cc:316 0xcc7899 mark_label_nuses(rtx_def*) ../../trunk.year/gcc/emit-rtl.cc:3750
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>: https://gcc.gnu.org/g:06ff410e0dea135d41bc5f7a9a007d7ba6822dbf commit r14-5533-g06ff410e0dea135d41bc5f7a9a007d7ba6822dbf Author: Uros Bizjak <ubizjak@gmail.com> Date: Thu Nov 16 16:48:07 2023 +0100 i386: Fix invalid RTX in split2 pass [PR112567] Also fix some indentitation inconsistencies. PR target/112567 gcc/ChangeLog: * config/i386/i386.md (*<any_logic:code>qi_ext<mode>_1_slp): Fix generation of invalid RTX in split pattern.
Fixed.
The fix allowed me to build linux-6.6.1 successfully with current gcc-master. Thank you!