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

            Bug ID: 125545
           Summary: ICE on aarch64: in insert_stmt_after, at
                    tree-ssa-reassoc.cc:1527 with asm goto at -O1/2/3
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jiangchangwu at smail dot nju.edu.cn
  Target Milestone: ---

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

*******************************************************************************
gcc version:
Using built-in specs.
COLLECT_GCC=/compiler/gcc-trunk-aarch64/bin/aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/compiler/gcc-trunk-aarch64/libexec/gcc/aarch64-linux-gnu/17.0.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../configure --target=aarch64-linux-gnu --disable-multilib
--disable-bootstrap --enable-languages=c,c++
--prefix=/compiler/gcc-trunk-aarch64 --with-sysroot=/usr/aarch64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260528 (experimental) (GCC)

*******************************************************************************
Program:
$ cat small.c
int b(int c) {
  int a;
  __asm__ goto("" : "=r"(a) : : : d);
d:
  return c && a != 42 && a >= 42;
}

*******************************************************************************
Command Lines:
$ /compiler/gcc-trunk-aarch64/bin/aarch64-linux-gnu-gcc -O1 -c small.c
during GIMPLE pass: reassoc
small.c: In function ‘b’:
small.c:1:5: internal compiler error: in insert_stmt_after, at
tree-ssa-reassoc.cc:1527
    1 | int b(int c) {
      |     ^
0x2612ca8 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x26078eb internal_error(char const*, ...)
        ???:0
0xac1eb4 fancy_abort(char const*, int, char const*)
        ???:0
/compiler/gcc-trunk-aarch64/libexec/gcc/aarch64-linux-gnu/17.0.0/cc1 -quiet
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mlittle-endian -mabi=lp64
-O1 -o /tmp/ccCUkFIr.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