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

            Bug ID: 78574
           Summary: ice on valid C code at -O2 and -O3 in both 32- and
                    64-bit modes on x86_64-linux-gnu (internal compiler
                    error: Segmentation fault (program cc1))
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20161128 (experimental) [trunk revision 242906] (GCC) 
$ 
$ gcc-trunk -O3 small.c
gcc-trunk: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 
$ cat small.c
int a, d, f, g;
int b[1];
short h;
int main() {
  long j;
  int k, i;
  for (; j; j++) {
    i = 0;
    for (; i < 6; i++) {
      int l = a, m = d || g;
    L:
      l ^ m | a;
    }
    b[j + 1] = 2;
    ++k;
    for (; g; g++) {
      d ^= h;
      if (f)
        for (;;)
          ;
    }
  }
  if (k)
    goto L;
}
$

Reply via email to