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

            Bug ID: 122441
           Summary: ICE on valid code at -O{2,3} 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/d69hzTbG7

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

[526] % 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 20251027 (experimental) (GCC)
[527] %
[527] % gcctk -O2 small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:2:5: internal compiler error: Segmentation fault
    2 | int main() {
      |     ^~~~
0x259c61b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x11c3963 crash_signal
        ../../gcc-trunk/gcc/toplev.cc:323
0x7f68a110851f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x14faf38 vec<_stmt_vec_info*, va_heap, vl_embed>::operator[](unsigned int)
        ../../gcc-trunk/gcc/vec.h:911
0x14faf38 vec<_stmt_vec_info*, va_heap, vl_ptr>::operator[](unsigned int)
        ../../gcc-trunk/gcc/vec.h:1610
0x14faf38 vect_analyze_slp_reduc_chain
        ../../gcc-trunk/gcc/tree-vect-slp.cc:4237
0x14fd183 vect_analyze_slp_reduction
        ../../gcc-trunk/gcc/tree-vect-slp.cc:4620
0x150026f vect_analyze_slp(vec_info*, unsigned int, bool)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:5624
0x14bfde0 vect_analyze_loop_2
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2233
0x14c115b vect_analyze_loop_1
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2788
0x14c1981 vect_analyze_loop(loop*, gimple*, vec_info_shared*)
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2969
0x151b0ec try_vectorize_loop_1
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1096
0x151b0ec try_vectorize_loop
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1215
0x151ba3c execute
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1331
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.
[528] %
[528] % cat small.c
int a, b;
int main() {
  short c;
  while (a++) {
    c = b;
    b = c;
  }
  return 0;
}
  • [Bug tree-optimization/122441]... zhendong.su at inf dot ethz.ch via Gcc-bugs

Reply via email to