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

            Bug ID: 125538
           Summary: ICE at -O3 -fprofile-generate on aarch64 during vregs
                    pass: unrecognizable insn with V4QI vec_duplicate
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xintong.zhou1 at uwaterloo dot ca
  Target Milestone: ---

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

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/aarch64-unknown-linux-gnu/17.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /data/x27zhou/compiler-nightly/src/gcc/configure
--enable-checking=yes --disable-bootstrap --disable-multilib
--enable-languages=c,c++ --prefix=/data/x27zhou/compiler-nightly/install/gcc
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260531 (experimental) (GCC)
$
$
$ gcc-trunk -O3 small.c
$ gcc-trunk -O3 -fprofile-generate small.c
small.c: In function ā€˜g’:
small.c:46:1: error: unrecognizable insn:
   46 | }
      | ^
(insn 247 246 248 18 (set (reg:V4QI 388)
        (vec_duplicate:V4QI (reg:QI 389))) -1
     (nil))
during RTL pass: vregs
small.c:46:1: internal compiler error: in extract_insn, at recog.cc:2894
0x25292c7 internal_error(char const*, ...)
       
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostic-global-context.cc:787
0x87b86b fancy_abort(char const*, int, char const*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostics/context.cc:1813
0x8569e7 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/rtl-error.cc:108
0x856a1b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/rtl-error.cc:116
0x104ab5b extract_insn(rtx_insn*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/recog.cc:2894
0xc87677 instantiate_virtual_regs_in_insn
        /data/x27zhou/compiler-nightly/src/gcc/gcc/function.cc:1643
0xc87677 instantiate_virtual_regs
        /data/x27zhou/compiler-nightly/src/gcc/gcc/function.cc:2019
0xc87677 execute
        /data/x27zhou/compiler-nightly/src/gcc/gcc/function.cc:2066
/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/aarch64-unknown-linux-gnu/17.0.0/cc1
-quiet -imultiarch aarch64-linux-gnu small.c -quiet -dumpdir a- -dumpbase
small.c -dumpbase-ext .c -mlittle-endian -mabi=lp64 -O3 -fprofile-generate -o
/tmp/cc7Nfw6d.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.
$
$
$ cat small.c
short a, b, c, d;
char e, f;
void g() {
  short h;
  int j, i;
  int k[3];
  for (int l; l; l += 5) {
    i = 0;
    for (; i < 3; i++)
      k[i] = 8;
  }
m:
  if (k[1]) {
    h = a;
    j = h;
  }
  switch (f | e - 15830)
  case -15617: {
    c = 0;
    for (; c != 56; ++c) {
      int n[4];
      switch ((279736945 ^ e) + 602435225) {
      case 882172221:
        n[i] = 0;
        if (j > 1)
          ;
        else
          for (;;)
            ;
      case 882172222:
        i = 2;
        for (; i < 4; i++)
          n[3] = 0;
        if (h > 1)
          d = n[3];
      default:
        if (h > 1)
          ;
        else
          goto m;
      }
      if (b)
        continue;
    }
  }
}
void main() {}

Reply via email to