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

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

Compiler Explorer: https://godbolt.org/z/5Pbz1KM6W

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


[595] % 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 20261022 (experimental) [master r17-1628-gd1c12591336] (GCC) 
[596] % 
[596] % gcctk -O3 -c small.c
during GIMPLE pass: ifcvt
small.c: In function ā€˜d’:
small.c:3:6: internal compiler error: Segmentation fault
    3 | void d() {
      |      ^
0x287666b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0x12663f3 crash_signal
        ../../gcc-trunk/gcc/toplev.cc:325
0x7ba9c064532f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x13725b4 gimple_bb(gimple const*)
        ../../gcc-trunk/gcc/gimple.h:1918
0x13725b4 analyze_scalar_evolution_1
        ../../gcc-trunk/gcc/tree-scalar-evolution.cc:2045
0x1373005 analyze_scalar_evolution(loop*, tree_node*)
        ../../gcc-trunk/gcc/tree-scalar-evolution.cc:2138
0x1372777 interpret_condition_phi
        ../../gcc-trunk/gcc/tree-scalar-evolution.cc:1696
0x1372777 analyze_scalar_evolution_1
        ../../gcc-trunk/gcc/tree-scalar-evolution.cc:2076
0x13730e2 analyze_scalar_evolution(loop*, tree_node*)
        ../../gcc-trunk/gcc/tree-scalar-evolution.cc:2138
0x12eaad3 predicate_scalar_phi
        ../../gcc-trunk/gcc/tree-if-conv.cc:2441
0x12ec7b6 predicate_all_scalar_phis
        ../../gcc-trunk/gcc/tree-if-conv.cc:2664
0x12ec7b6 combine_blocks
        ../../gcc-trunk/gcc/tree-if-conv.cc:3273
0x12f0b2f tree_if_conversion(loop*, vec<gimple*, va_heap, vl_ptr>*)
        ../../gcc-trunk/gcc/tree-if-conv.cc:4228
0x12f13dc execute
        ../../gcc-trunk/gcc/tree-if-conv.cc:4334
0x12f13dc execute
        ../../gcc-trunk/gcc/tree-if-conv.cc:4323
/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/cc0FYerp.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.
[597] % 
[597] % cat small.c
int printf(const char *, ...);
int a, b;
void d() {
  int e = -524288, f = 1, *g = &e;
  do {
    if (f == 0) {
      if (!a)
        e = 0;
      goto k;
    }
  j:
    e = 5017 + *g;
    f = a;
  k:
    if (!((long)e << 44 >> 44))
      goto j;
  } while (238709 == 262143 - (-505837 ^ e));
  b = *g;
  printf("%d", ((long)b << 44 >> 44));
}

Reply via email to