public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66272] New: wrong code at -O3 on x86_64-linux-gnu
@ 2015-05-24 10:02 su at cs dot ucdavis.edu
  2015-05-24 23:29 ` [Bug tree-optimization/66272] [4.9.2/5/6 Regression] " miyuki at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: su at cs dot ucdavis.edu @ 2015-05-24 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66272
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: gcc
           Version: 6.0
            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: ---

The current gcc trunk miscompiles the following code on x86_64-linux at -O3 in
both 32-bit and 64-bit modes.  

It also affects gcc 5.1.x and 4.9.2 (but not 4.9.0 and I didn't check 4.9.1). 


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20150524 (experimental) [trunk revision 223630] (GCC) 
$ 
$ gcc-trunk -O2 small.c; ./a.out
$ gcc-4.9.0 -O3 small.c; ./a.out
$ 
$ gcc-trunk -O3 small.c  
$ ./a.out
Aborted (core dumped)
$ gcc-4.9.2 -O3 small.c
$ ./a.out
Aborted (core dumped)
$ gcc-5.1.0 -O3 small.c
$ ./a.out
Aborted (core dumped)
$ 


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


struct S
{
  int f0;
  int f1;
} a[2], c;

int b;

int
main ()
{
  struct S d = { 0, 1 };

  for (b = 0; b < 2; b++)
    {
      a[b] = d;
      c = d = a[0];
    }

  if (c.f1 != 1)
    __builtin_abort ();

  return 0;
}


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-03 13:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 10:02 [Bug tree-optimization/66272] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2015-05-24 23:29 ` [Bug tree-optimization/66272] [4.9.2/5/6 Regression] " miyuki at gcc dot gnu.org
2015-05-25  7:18 ` [Bug tree-optimization/66272] [4.9/5/6 " jakub at gcc dot gnu.org
2015-05-25  7:21 ` jakub at gcc dot gnu.org
2015-05-26 10:46 ` rguenth at gcc dot gnu.org
2015-05-27 14:22 ` rguenth at gcc dot gnu.org
2015-05-27 14:22 ` [Bug tree-optimization/66272] [4.9/5 " rguenth at gcc dot gnu.org
2015-06-03  7:39 ` [Bug tree-optimization/66272] [4.8/4.9/5 " rguenth at gcc dot gnu.org
2015-06-03 11:04 ` [Bug tree-optimization/66272] [4.8/4.9 " rguenth at gcc dot gnu.org
2015-06-03 13:50 ` [Bug tree-optimization/66272] [4.8 " rguenth at gcc dot gnu.org
2015-06-03 13:51 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).