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

            Bug ID: 86035
           Summary: wrong code at -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, and might be the same as or related to
PR 86034. 

$ 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 20180602 (experimental) [trunk revision 261116] (GCC) 
$ 
$ gcctk -O0 small.c; ./a.out
 $ 
$ 
$ gcctk -O2 small.c
$ ./a.out
 Aborted (core dumped)
$ 


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


int printf (const char *, ...);

struct
{
  int a:2;
  int b:9;
} c = { -1, 0 };

int d, e;

void f ()
{
  printf (" ");
  if (d < 1)
    e = -1;
  c.b = 0;
  c.a = e;
}

int main ()
{
  f ();
  if (c.b != 0)
    __builtin_abort (); 
  return 0; 
}

Reply via email to