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

            Bug ID: 125019
           Summary: ICE on valid code at -O{2,3} with
                    "-fno-vect-cost-model -fno-tree-dce -fno-tree-pre" 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: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

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

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/17.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 17.0.0 20260425 (experimental) (GCC) 
[520] % 
[520] % gcctk -O3 -c small.c
[521] % 
[521] % gcctk -O3 -c -fno-vect-cost-model -fno-tree-dce -fno-tree-pre small.c
during GIMPLE pass: vect
small.c: In function ā€˜e’:
small.c:2:6: internal compiler error: Segmentation fault
    2 | void e(unsigned f) {
      |      ^
0x25dff2b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x11e59e3 crash_signal
        ../../gcc-trunk/gcc/toplev.cc:325
0x7f00b321751f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x14fbda4 vectorizable_recurr(_loop_vec_info*, _stmt_vec_info*, _slp_tree*,
vec<stmt_info_for_cost, va_heap, vl_ptr>*)
        ../../gcc-trunk/gcc/tree-vect-loop.cc:8865
0x14d89f7 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        ../../gcc-trunk/gcc/tree-vect-stmts.cc:13446
0x151914f vect_schedule_slp_node
        ../../gcc-trunk/gcc/tree-vect-slp.cc:12126
0x153d1ff vect_schedule_slp_node
        ../../gcc-trunk/gcc/tree-vect-slp.cc:11895
0x153d1ff vect_schedule_scc
        ../../gcc-trunk/gcc/tree-vect-slp.cc:12373
0x153d879 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>
const&)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:12518
0x14ea62c vect_transform_loop(_loop_vec_info*, gimple*)
        ../../gcc-trunk/gcc/tree-vect-loop.cc:11351
0x154f58b vect_transform_loops
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1036
0x154fc73 try_vectorize_loop_1
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1185
0x154fc73 try_vectorize_loop
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1215
0x155030c execute
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1332
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mtune=generic -march=x86-64
-O3 -fvect-cost-model=unlimited -fno-tree-dce -fno-tree-pre -o /tmp/ccgcL478.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.
[522] % 
[522] % cat small.c
int a, b, c, d;
void e(unsigned f) {
  for (c = 0; c < 2; c++) {
    b = d;
    d = f;
    for (a = 0; a < 2; a++)
      ;
  }
}

Reply via email to