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

            Bug ID: 125960
           Summary: ICE on valid code at -O{2,3} on x86_64-linux-gnu: in
                    extract_constrain_insn, at recog.cc:2795
           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: ---

Note:
- fails: trunk
- works: 16.1 and earlier
- Doesn't reproduce on Compiler Explorer's latest build, so very recent


[514] % 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++,lto --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260623 (experimental) (GCC)
[515] %
[515] % gcctk -O2 -w -c small.c
small.c: In function ‘h’:
small.c:17:1: error: insn does not satisfy its constraints:
   17 | }
      | ^
(insn 36 16 19 3 (set (mem/c:HI (symbol_ref:DI ("a") [flags 0x2] <var_decl
0x7ffb8cf62e40 a>) [2 a+0 S2 A16])
        (reg:HI 21 xmm1 [106])) "small.c":14:5 101 {*movhi_internal}
     (expr_list:REG_DEAD (reg:HI 21 xmm1 [106])
        (nil)))
during RTL pass: cprop_hardreg
small.c:17:1: internal compiler error: in extract_constrain_insn, at
recog.cc:2795
0x268174b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa31900 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x8af32b _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc-trunk/gcc/rtl-error.cc:108
0x8af357 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc-trunk/gcc/rtl-error.cc:118
0x8ad8a9 extract_constrain_insn(rtx_insn*)
        ../../gcc-trunk/gcc/recog.cc:2795
0x115ce47 copyprop_hardreg_forward_1
        ../../gcc-trunk/gcc/regcprop.cc:881
0x115e01f execute
        ../../gcc-trunk/gcc/regcprop.cc:1474
/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 -w -o /tmp/ccUkrHny.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.
[516] %
[516] % cat small.c
short a;
int b, c;
__attribute__((noinline)) void g(int p) {
  static int d;
  if (d)
    d = b;
}
void h() {
  __attribute__((__vector_size__(16))) int i;
  if (c)
    goto j;
  i[3] = b;
  i[0] = 0;
  a = 0;
j:
  g(i[2]);
}

Reply via email to