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

            Bug ID: 125026
           Summary: ICE on valid code at -O{2,3} on x86_64-linux-gnu: in
                    extract_insn, at recog.cc:2892
           Product: gcc
           Version: 16.0
            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: ---

Compiler Explorer: https://godbolt.org/z/dMnMP4MGr

Note:
- fails: trunk
- works: 15.2 and earlier

[606] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260426 (experimental) (GCC)
[607] %
[607] % gcctk -O2 -c small.c
small.c: In function ā€˜g’:
small.c:12:1: error: unrecognizable insn:
   12 | }
      | ^
(insn 42 3 8 2 (set (reg:V2SI 113)
        (const_vector:V2SI [
                (const_int 1 [0x1]) repeated x2
            ])) -1
     (expr_list:REG_EQUIV (const_vector:V2SI [
                (const_int 1 [0x1]) repeated x2
            ])
        (nil)))
during RTL pass: ira
small.c:12:1: internal compiler error: in extract_insn, at recog.cc:2892
0x25e025b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa21a6a fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x8a5a9f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc-trunk/gcc/rtl-error.cc:108
0x8a5ac1 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc-trunk/gcc/rtl-error.cc:116
0x8a3ea1 extract_insn(rtx_insn*)
        ../../gcc-trunk/gcc/recog.cc:2892
0xf858a3 ira_remove_insn_scratches(rtx_insn*, bool, _IO_FILE*, rtx_def*
(*)(rtx_def*))
        ../../gcc-trunk/gcc/ira.cc:5460
0xf8818d remove_scratches
        ../../gcc-trunk/gcc/ira.cc:5504
0xf8818d ira
        ../../gcc-trunk/gcc/ira.cc:5860
0xf8818d execute
        ../../gcc-trunk/gcc/ira.cc:6220
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mtune=generic -march=x86-64
-O2 -o /tmp/ccBBipPK.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.
[608] %
[608] % cat small.c
extern void a(int[]);
int b;
int d(int e, volatile int f) {
  b = f - e;
  int t[2] = {b, b};
  a(t);
}
void g(int h[1]) {
  if (d(0, 1))
    h[0] = 0;
  d(0, 1);
}

Reply via email to