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

--- Comment #3 from Zhendong Su <su at cs dot ucdavis.edu> ---
Below is another test that might trigger the same miscompilation: 

$ gcc-trunk -O2 -fsplit-loops small.c; ./a.out
Aborted (core dumped)
$       
$ gcc-trunk -O3 -fno-split-loops small.c; ./a.out
$ 
$ gcc-trunk -O3 small.c; ./a.out
Aborted (core dumped)
$ 
$ cat small.c
int a, b, c;

int main ()
{
  int d; 
  for (; c < 1; c++)
    for (d = 0; d < 3; d++)
      for (b = 0; b < 1; b++)
        if (c >= d) 
          a = 1;

  if (a != 1) 
    __builtin_abort ();

  return 0; 
}
$ 
$ 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 20161211 (experimental) [trunk revision 243523] (GCC) 
$

Reply via email to