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

            Bug ID: 82163
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu: in
                    check_loop_closed_ssa_use, at
                    tree-ssa-loop-manip.c:707
           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 seems to be a recent regression from 7.2.*. 

$ 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/8.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 8.0.0 20170909 (experimental) [trunk revision 251923] (GCC)
$
$ gcctk -O2 small.c; ./a.out
$ gcc-7.2.0 -O3 small.c; ./a.out
$
$ gcctk -O3 small.c
during GIMPLE pass: pcom
small.c: In function ‘h’:
small.c:3:6: internal compiler error: in check_loop_closed_ssa_use, at
tree-ssa-loop-manip.c:707
 void h ()
      ^
0xdeba2d check_loop_closed_ssa_use
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:706
0xdeea1d check_loop_closed_ssa_stmt
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:722
0xdeea1d verify_loop_closed_ssa(bool)
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:756
0xdf076b checking_verify_loop_closed_ssa
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.h:37
0xdf076b tree_transform_and_unroll_loop(loop*, unsigned int, edge_def*,
tree_niter_desc*, void (*)(loop*, void*), void*)
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:1408
0xd47d8a tree_predictive_commoning_loop
        ../../gcc-source-trunk/gcc/tree-predcom.c:3139
0xd47d8a tree_predictive_commoning()
        ../../gcc-source-trunk/gcc/tree-predcom.c:3172
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[4], d, e, f, g;

void h ()
{ 
  for (; a; a++)
    { 
      c[a + 3] = g;
      if (b)
        c[a] = f;
      else
        { 
          for (; d; d++)
            c[d + 3] = c[d];
          for (e = 1; e == 2; e++)
            ;
          if (e)
            break;
        }
    }
}

int main ()
{ 
  h ();
  return 0;
}

Reply via email to