https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101697
Bug ID: 101697 Summary: [11/12 regression] ICE compiling uClibc-ng for h8300-linux Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: mikpelinux at gmail dot com Target Milestone: --- Created attachment 51226 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51226&action=edit pre-processed source of uClibc's getaddrinfo.c Attempting to build uClibc-ng-1.0.38 with a gcc-11.2.0 cross to h8300-unknown-linux-uclibc fails with an ICE: libc/inet/getaddrinfo.c: In function 'gaih_inet': libc/inet/getaddrinfo.c:801:1: error: unrecognizable insn: 801 | } | ^ (insn 1444 1443 164 31 (parallel [ (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) (reg/f:SI 7 sp)) (clobber (reg:CC 12 cc)) ]) "libc/inet/getaddrinfo.c":466:11 -1 (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) during RTL pass: split2 libc/inet/getaddrinfo.c:801:1: internal compiler error: in extract_insn, at recog.c:2770 0x41a6f0 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /mnt/scratch/cross/sources/gcc-11.2.0/gcc/rtl-error.c:108 0x41a70c _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) /mnt/scratch/cross/sources/gcc-11.2.0/gcc/rtl-error.c:116 0x4199e8 extract_insn(rtx_insn*) /mnt/scratch/cross/sources/gcc-11.2.0/gcc/recog.c:2770 0x8cf1c4 extract_insn_cached(rtx_insn*) /mnt/scratch/cross/sources/gcc-11.2.0/gcc/recog.c:2659 0x67c782 cleanup_subreg_operands(rtx_insn*) /mnt/scratch/cross/sources/gcc-11.2.0/gcc/final.c:3330 0x8cd42f split_insn /mnt/scratch/cross/sources/gcc-11.2.0/gcc/recog.c:3399 0x8d2407 split_all_insns() /mnt/scratch/cross/sources/gcc-11.2.0/gcc/recog.c:3467 0x8d2498 execute /mnt/scratch/cross/sources/gcc-11.2.0/gcc/recog.c:4385 A gcc-12 cross also ICEs on the same location, but with a different message: libc/inet/getaddrinfo.c: In function 'gaih_inet': libc/inet/getaddrinfo.c:801:1: error: could not split insn 801 | } | ^ (insn 163 1443 1444 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3 S4 A32]) (reg/f:SI 7 sp)) "libc/inet/getaddrinfo.c":466:11 19 {*movsi} (expr_list:REG_ARGS_SIZE (const_int 4 [0x4]) (nil))) during RTL pass: final libc/inet/getaddrinfo.c:801:1: internal compiler error: in final_scan_insn_1, at final.c:2861 0x41abf2 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /mnt/scratch/cross/sources/gcc-12-20210725/gcc/rtl-error.c:108 0x40ded8 final_scan_insn_1 /mnt/scratch/cross/sources/gcc-12-20210725/gcc/final.c:2861 0x687d9b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) /mnt/scratch/cross/sources/gcc-12-20210725/gcc/final.c:2940 0x688064 final_1 /mnt/scratch/cross/sources/gcc-12-20210725/gcc/final.c:1997 0x688842 rest_of_handle_final /mnt/scratch/cross/sources/gcc-12-20210725/gcc/final.c:4285 0x688842 execute, /mnt/scratch/cross/sources/gcc-12-20210725/gcc/final.c:4363 gcc-10.3.0 has no problems building uClibc-1.0.38 for the h8300. Attaching the preprocessed getaddrinfo.i. Compile with -fno-builtin and -Os, -O2, or -O3 to trigger the ICE. Removing -fno-builtin or reducing optimization to -Og, -O1, or -O0 stops the ICE. The cross-compilers were configured (yes there's some redundancies there): --target=h8300-unknown-linux-uclibc --build=x86_64-pc-linux-gnu --prefix=/mnt/scratch/cross/cross-h8300 --with-sysroot=/mnt/scratch/cross/cross-h8300 --with-gmp=/mnt/scratch/cross/host-tools/gmp-6.2.1 --with-mpfr=/mnt/scratch/cross/host-tools/mpfr-4.1.0 --with-mpc=/mnt/scratch/cross/host-tools/mpc-1.2.1 --without-cloog --without-isl --disable-libatomic --disable-libgomp --disable-libitm --disable-libmpx --disable-libmudflap --disable-libquadmath --disable-libsanitizer --disable-lto --disable-nls --disable-plugin --disable-shared --enable-checking=release --enable-languages=c --enable-multilib --disable-threads --disable-libssp