[Bug tree-optimization/83298] New: wrong code at -O1, -O2 and -O3 on x86_64-linux-gnu

su at cs dot ucdavis.edu gcc-bugzilla@gcc.gnu.org
Wed Dec 6 01:58:00 GMT 2017


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

            Bug ID: 83298
           Summary: wrong code at -O1, -O2 and -O3 on x86_64-linux-gnu
           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: ---

This appears to be 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/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 20171205 (experimental) [trunk revision 255434] (GCC) 
$ 
$ gcctk -O0 small.c; ./a.out
$ gcc-7.2.0 -O1 small.c; ./a.out
$ 
$ gcctk -O1 small.c
$ ./a.out
Aborted (core dumped)
$ 


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


int a, b, c = 1;

int main ()
{
  for (; b < 1; b++)
    ;
  if (!(c * (a < 1))) 
    __builtin_abort ();
  return 0; 
}


More information about the Gcc-bugs mailing list