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

--- Comment #2 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Another reproducer that is smaller and doesn't need the extra flags:

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

[508] % 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++,lto --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20261015 (experimental) [master r17-1628-gd1c12591336] (GCC) 
[509] % 
[509] % gcctk -O3 -c small.c
during GIMPLE pass: slp
small.c: In function ā€˜j’:
small.c:9:6: internal compiler error: in check_loop_closed_ssa_def, at
tree-ssa-loop-manip.cc:664
    9 | void j() {
      |      ^
0x2867b0b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa85107 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x906918 check_loop_closed_ssa_def
        ../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:664
0x141fed7 check_loop_closed_ssa_bb
        ../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:689
0x1420366 verify_loop_closed_ssa(bool, loop*)
        ../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:714
0x1420366 verify_loop_closed_ssa(bool, loop*)
        ../../gcc-trunk/gcc/tree-ssa-loop-manip.cc:698
0x1120df9 execute_function_todo
        ../../gcc-trunk/gcc/passes.cc:2118
0x11214fe execute_todo
        ../../gcc-trunk/gcc/passes.cc:2152
/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 -o /tmp/ccRnqtSJ.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.
[510] % 
[510] % cat small.c
int printf(const char *, ...);
struct {
  int a;
  int b;
  int c;
  int d;
} h;
int f, g;
void j() {
  int k, l;
  do {
    h.a = h.b = g + 1;
    h.c = 2 * l + 1;
    h.d = 2 * k + 1;
    printf("0");
  } while (f);
  h.c = 2 * l + 1;
  h.d = 2 * k + 1;
}
  • [Bug tree-optimization/126988]... zhendong.su at inf dot ethz.ch via Gcc-bugs

Reply via email to