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

            Bug ID: 124572
           Summary: ICE at -O2/3 on aarch64 during RTL pass reload in
                    rtl_verify_bb_layout, at cfgrtl.cc:3122
           Product: gcc
           Version: 16.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/n4oM5Wqvn

$ 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/16.0.1/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 16.0.1 20260317 (experimental) (GCC)
$
$
$ cat small.c
long a;
int b(char *c) {
  for (int d = 0; d < 1; d++)
    a = (long)c + 1;
  return a;
}
int e() {
  char f;
  int g = b(&f);
  return 3 + g;
}
void main() {}
$
$
$ gcc-trunk -O2 small.c
small.c: In function ā€˜e’:
small.c:11:1: error: insn outside basic block
   11 | }
      | ^
(insn 19 18 0 (set (reg:DI 2 x2 [110])
        (reg/f:DI 64 sfp)) -1
     (nil))
during RTL pass: reload
small.c:11:1: internal compiler error: in rtl_verify_bb_layout, at
cfgrtl.cc:3122
0x24b53b7 internal_error(char const*, ...)
       
/data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostic-global-context.cc:787
0x870efb fancy_abort(char const*, int, char const*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/diagnostics/context.cc:1813
0x84d447 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /data/x27zhou/compiler-nightly/src/gcc/gcc/rtl-error.cc:108
0xac19b3 rtl_verify_bb_layout
        /data/x27zhou/compiler-nightly/src/gcc/gcc/cfgrtl.cc:3122
0xac19b3 rtl_verify_flow_info
        /data/x27zhou/compiler-nightly/src/gcc/gcc/cfgrtl.cc:3171
0xaa5e67 verify_flow_info()
        /data/x27zhou/compiler-nightly/src/gcc/gcc/cfghooks.cc:286
0xfa2413 execute_function_todo
        /data/x27zhou/compiler-nightly/src/gcc/gcc/passes.cc:2112
0xfa2d1f execute_todo
        /data/x27zhou/compiler-nightly/src/gcc/gcc/passes.cc:2152
/data/x27zhou/compiler-nightly/install/gcc/libexec/gcc/aarch64-unknown-linux-gnu/16.0.1/cc1
-quiet -imultiarch aarch64-linux-gnu small.c -quiet -dumpdir a- -dumpbase
small.c -dumpbase-ext .c -mlittle-endian -mabi=lp64 -O2 -o /tmp/ccNlwRfs.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.

Reply via email to