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

            Bug ID: 87169
           Summary: ICE on valid code at -Os and above 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: su at cs dot ucdavis.edu
  Target Milestone: ---

It is a recent regression. 

$ gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 9.0.0 20180830 (experimental) [trunk revision 263982] (GCC)
$
$ gcctk -O1 small.c
$ gcc-8.1.0 -Os small.c
$
$ gcctk -Os small.c
during GIMPLE pass: fre
small.c: In function 'main':
small.c:38:1: internal compiler error: Segmentation fault
38 | }
   | ^
0xc7544f crash_signal
        ../../gcc-source-trunk/gcc/toplev.c:325
0x985fb4 is_gimple_val(tree_node*)
        ../../gcc-source-trunk/gcc/gimple-expr.c:789
0xcbbb9f verify_gimple_assign_binary
        ../../gcc-source-trunk/gcc/tree-cfg.c:3785
0xcbcdd7 verify_gimple_assign
        ../../gcc-source-trunk/gcc/tree-cfg.c:4620
0xcbcdd7 verify_gimple_stmt
        ../../gcc-source-trunk/gcc/tree-cfg.c:4882
0xcca931 verify_gimple_in_cfg(function*, bool)
        ../../gcc-source-trunk/gcc/tree-cfg.c:5360
0xb80f77 execute_function_todo
        ../../gcc-source-trunk/gcc/passes.c:1943
0xb818a9 execute_todo
        ../../gcc-source-trunk/gcc/passes.c:1997
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$


---------------------------------


int a, b, c;

int main ()
{ 
  int d;
  b = 1;
L1:
  for (; b > 1;)
    goto L2;
  { 
    int e[1];
  L3:;
  }
L2:
  while (a)
    { 
      d--;
      goto L1;
    }
  while (c)
    { 
      if (a)
        goto L3;
      if (a)
        break;
      if (a)
        goto L2;
      while (c)
        while (c)
          while (c)
            while (c)
              while (c)
                while (c)
                  while (c)
                    ;
    }
  return 0;
}

Reply via email to