This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/79666] New: wrong code (SIGFPE) at -O2 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)


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

            Bug ID: 79666
           Summary: wrong code (SIGFPE) at -O2 on x86_64-linux-gnu (in
                    both 32-bit and 64-bit modes)
           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 very recent regression. 

$ 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.1/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.1 20170221 (experimental) [trunk revision 245619] (GCC) 
$ 
$ gcc-trunk -Os small.c; ./a.out
$ gcc-6.2 -O2 small.c; ./a.out
$ 
$ gcc-trunk -O2 small.c
$ ./a.out
Floating point exception (core dumped)
$ 


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


struct
{
  unsigned a:6;
} b;

int c, e, g = 7;
char d, f = 6, h = -10;

void fn1 ()
{
  for (; c < 9; c++)
    {
      if (f)
        g = ~(~0 / (g ^ e));
      b.a = ~0;
      d = ~((h ^ b.a) & 132 & (~(f && g) | (d && 1)));
      e = ~0;
      if (d < 127 || f < 1)
        continue;
      g = 0;
    }
}

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]