https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125155

            Bug ID: 125155
           Summary: [16/17 regression] or1k: ICE in emit_move_multi_word
                    when compiling glibc-2.43
           Product: gcc
           Version: 16.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

The following test case causes gcc-16.1.0 and current trunk targeting
or1k-unknown-linux-gnu to ICE:

> gcc/xgcc -Bgcc -O1 -S pthread_key_delete.i 
during RTL pass: ce2
pthread_key_delete.c: In function '___pthread_key_delete':
pthread_key_delete.c:40:1: internal compiler error: in emit_move_multi_word, at
expr.cc:4497
0x17d80df internal_error(char const*, ...)
       
/mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/diagnostic-global-context.cc:787
0x4413ed fancy_abort(char const*, int, char const*)
       
/mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/diagnostics/context.cc:1813
0x40d6d9 emit_move_multi_word
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/expr.cc:4497
0x6fa491 emit_move_insn(rtx_def*, rtx_def*)
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/expr.cc:4751
0x6db6c1 copy_to_reg(rtx_def*)
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/explow.cc:630
0xad5777 gen_lowpart_general(machine_mode, rtx_def*)
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/rtlhooks.cc:56
0x6fbbf5 convert_mode_scalar
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/expr.cc:822
0x6fc8ec convert_modes(machine_mode, machine_mode, rtx_def*, int)
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/expr.cc:965
0x9cf4f0 prepare_operand(insn_code, rtx_def*, int, machine_mode, machine_mode,
int)
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/optabs.cc:4662
0x9cf729 prepare_cmp_insn
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/optabs.cc:4563
0x9d3846 emit_conditional_move(rtx_def*, rtx_comparison, rtx_def*, rtx_def*,
machine_mode, int)
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/optabs.cc:5327
0x164c0ab noce_emit_cmove
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:1994
0x165111f noce_try_cmove
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:2072
0x1657e45 noce_process_if_block
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:4487
0x1657e45 noce_find_if_block
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:4970
0x1657e45 find_if_header
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:5175
0x1657e45 if_convert
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:6322
0x1658b4d execute
        /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/gcc/ifcvt.cc:6475
gcc/cc1 -fpreprocessed /tmp/pthread_key_delete.i -quiet -dumpbase
pthread_key_delete.i -dumpbase-ext .i -O1 -o pthread_key_delete.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

The test case is from glibc-2.43. This is a regression from gcc-15.2.0 which
has no problem building glibc-2.43 for or1k.

Host is x86_64-linux-gnu (Fedora 43) with gcc-16.1.0 as host compiler.

Target configured as:
> gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=gcc/xgcc
Target: or1k-unknown-linux-gnu
Configured with: /mnt/scratch/cross/downloads/gcc-mirror-gcc.git/configure
--target=or1k-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--prefix=/mnt/scratch/cross/cross-or1k
--with-sysroot=/mnt/scratch/cross/cross-or1k
--with-gmp=/mnt/scratch/cross/host-tools/gmp-6.3.0
--with-mpfr=/mnt/scratch/cross/host-tools/mpfr-4.2.2
--with-mpc=/mnt/scratch/cross/host-tools/mpc-1.4.1 --without-cloog
--without-isl --disable-gcov --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 --enable-threads=posix --enable-libssp
--enable-initfini-array
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 17.0.0 20260502 (experimental) (GCC)

Addendum: I was going to attach pthread_key_delete.i but something in F43 has
broken file dialogs in both Firefox and Chrome, so I can't. But you can
reproduce it by building glibc-2.43 with the cross-compiler.

Reply via email to