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

            Bug ID: 123221
           Summary: ICE on valid code at -O3 with -fno-tree-pre on
                    x86_64-linux-gnu: Segmentation fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

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

Note:
- fails: trunk
- works: 15.2 and earlier


[519] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20251219 (experimental) (GCC) 
[520] % 
[520] % gcctk -O3 -fno-tree-pre small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:5:5: internal compiler error: Segmentation fault
    5 | int main() {
      |     ^~~~
0x25aad1b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x11d39e3 crash_signal
        ../../gcc-trunk/gcc/toplev.cc:325
0x7fe36196e51f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x14e6def vectorizable_reduction(_loop_vec_info*, _stmt_vec_info*, _slp_tree*,
_slp_instance*, vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../gcc-trunk/gcc/tree-vect-loop.cc:7111
0x14c0a04 vect_analyze_stmt(vec_info*, _slp_tree*, _slp_instance*,
vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../gcc-trunk/gcc/tree-vect-stmts.cc:13165
0x151f5e3 vect_slp_analyze_node_operations_1
        ../../gcc-trunk/gcc/tree-vect-slp.cc:8541
0x151f5e3 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.cc:8810
0x151f573 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.cc:8787
0x152116e vect_slp_analyze_operations(vec_info*)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:9214
0x14daaad vect_analyze_loop_2
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2341
0x14dc0c8 vect_analyze_loop_1
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2816
0x14dc8f1 vect_analyze_loop(loop*, gimple*, vec_info_shared*)
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2997
0x153770c try_vectorize_loop_1
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1097
0x153770c try_vectorize_loop
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1216
0x153807c execute
        ../../gcc-trunk/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.
[521] % 
[521] % cat small.c
int a, d;
struct {
  char b;
} c;
int main() {
  int f;
  for (; d; d++)
    c.b = f = a ? c.b : 0;
  return 0;
}

Reply via email to