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

            Bug ID: 123247
           Summary: [16 Regression] ICE at -O3 on x86_64-linux-gnu:
                    Segmentation fault
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xintong.zhou1 at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/x27zhou/compilers/gcc-trunk-install/libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --enable-checking=yes --disable-bootstrap
--disable-multilib --disable-shared --enable-languages=c,c++
--prefix=/home/x27zhou/compilers/gcc-trunk-install
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20251220 (experimental) (GCC) 
$
$
$ gcc-trunk -O0 small.c
$ gcc-trunk -O3 small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:12:6: internal compiler error: Segmentation fault
   12 | void main() { f(); }
      |      ^~~~
0x25abacb internal_error(char const*, ...)
        ../../gcc/gcc/diagnostic-global-context.cc:787
0x11d4f33 crash_signal
        ../../gcc/gcc/toplev.cc:325
0x7f114e4ea51f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x14e835f vectorizable_reduction(_loop_vec_info*, _stmt_vec_info*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../gcc/gcc/tree-vect-loop.cc:7111
0x14c1fc4 vect_analyze_stmt(vec_info*, _slp_tree*, _slp_instance*,
vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../gcc/gcc/tree-vect-stmts.cc:13165
0x1520b53 vect_slp_analyze_node_operations_1
        ../../gcc/gcc/tree-vect-slp.cc:8541
0x1520b53 vect_slp_analyze_node_operations
        ../../gcc/gcc/tree-vect-slp.cc:8810
0x1520ae3 vect_slp_analyze_node_operations
        ../../gcc/gcc/tree-vect-slp.cc:8787
0x15226de vect_slp_analyze_operations(vec_info*)
        ../../gcc/gcc/tree-vect-slp.cc:9214
0x14dc06d vect_analyze_loop_2
        ../../gcc/gcc/tree-vect-loop.cc:2341
0x14dd688 vect_analyze_loop_1
        ../../gcc/gcc/tree-vect-loop.cc:2816
0x14ddeb1 vect_analyze_loop(loop*, gimple*, vec_info_shared*)
        ../../gcc/gcc/tree-vect-loop.cc:2997
0x1538c7c try_vectorize_loop_1
        ../../gcc/gcc/tree-vectorizer.cc:1097
0x1538c7c try_vectorize_loop
        ../../gcc/gcc/tree-vectorizer.cc:1216
0x15395ec execute
        ../../gcc/gcc/tree-vectorizer.cc:1333
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
int a, c, b;
unsigned short d[1];
unsigned short e[1];
static void f() {
  int g[7];
  for (; b; b--) {
    g[a + 3] = (d[0] && c) | e[a];
    e[a] = g[a + 3];
  }
}
int main() { f(); }

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

Reply via email to