https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101797
Bug ID: 101797 Summary: ICE on valid code at -O2 and -O3: in extract_constrain_insn, at recog.c:2670 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: zhendong.su at inf dot ethz.ch Target Milestone: --- [566] % gcctk -v Using built-in specs. COLLECT_GCC=gcctk COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-trunk/configure --disable-bootstrap --prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib --with-system-zlib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20210806 (experimental) [master revision 9124bbe1857:9d62796a203:fd351c76c23187fdc74d9af6874a54e2e84c4d25] (GCC) [567] % [567] % gcctk -Os small.c [568] % [568] % gcctk -O2 small.c small.c: In function ‘main’: small.c:11:1: error: insn does not satisfy its constraints: 11 | } | ^ (insn 56 55 57 3 (set (reg/v:SI 0 ax [orig:85 c ] [85]) (not:SI (reg:SI 1 dx [89]))) "small.c":6:7 650 {*one_cmplsi2_1} (expr_list:REG_DEAD (reg:SI 1 dx [89]) (nil))) during RTL pass: cprop_hardreg small.c:11:1: internal compiler error: in extract_constrain_insn, at recog.c:2670 0x615f0a _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ../../gcc-trunk/gcc/rtl-error.c:108 0x615f33 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) ../../gcc-trunk/gcc/rtl-error.c:118 0xd2e2cd extract_constrain_insn(rtx_insn*) ../../gcc-trunk/gcc/recog.c:2670 0xd3a4fa copyprop_hardreg_forward_1 ../../gcc-trunk/gcc/regcprop.c:825 0xd3b521 execute ../../gcc-trunk/gcc/regcprop.c:1390 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. [569] % [569] % cat small.c int a; int main() { int b, c, d, e = 0; if (a) { c += a; e = ~(a % c); e || c || (b & d); } a = e; return 0; }