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

            Bug ID: 125477
           Summary: ICE on x86_64-linux-gnu: Segmentation fault during
                    GIMPLE pass: vect with asm goto at -O3
           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/xc9fPM661

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

*******************************************************************************
Program:
$ cat mutant.c
#include <setjmp.h>
int c;
struct d {
  jmp_buf buf;
} e() {
  int f;
  long *a, *d;
  struct d b;
g:
  volatile int i;
  if (i)
    __builtin_trap();
  setjmp(b.buf);
  for (;;) {
    __asm__ goto("" : : : : g);
    c = 0;
    for (; c < f; c++)
      a[c] = d[c];
  }
}

*******************************************************************************
Command Lines:
$ gcc -O3 -c small.c
during GIMPLE pass: vect
small.c: In function 'e':
small.c:5:3: internal compiler error: Segmentation fault
    5 | } e() {
      |   ^
0x593a78b diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x591f98a internal_error(char const*, ...)
        ???:0
0x23cdacc extract_true_false_edges_from_block(basic_block_def*, edge_def**,
edge_def**)
        ???:0
0x2a5f56e vect_loop_versioning(_loop_vec_info*, gimple*)
        ???:0
0x2a32dd8 vect_transform_loop(_loop_vec_info*, gimple*)
        ???:0
/compiler/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1 -quiet
-imultiarch x86_64-linux-gnu small.c -quiet -dumpbase small.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -O3 -o /tmp/ccvGf6qP.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