public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58697] New: wrong code (segfaults) at -O3
@ 2013-10-12  1:17 su at cs dot ucdavis.edu
  2013-10-12 11:33 ` [Bug tree-optimization/58697] [4.8 Regression] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-10-12  1:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58697

            Bug ID: 58697
           Summary: wrong code (segfaults) at -O3
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

GCC 4.8.1 miscompiles the following code on x86_64-linux at -O3 in 64-bit mode,
resulting in a segfault. 

It doesn't seem to affect the current trunk and 4.7.x. 

It is related to 58653. 


$ gcc-4.8 -v
Using built-in specs.
COLLECT_GCC=gcc-4.8
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8.1/configure
--enable-languages=c,c++,objc,obj-c++,fortran,lto --disable-checking
--with-gmp=/usr/local/gcc-4.8 --with-mpfr=/usr/local/gcc-4.8
--with-mpc=/usr/local/gcc-4.8 --with-cloog=/usr/local/gcc-4.8
--prefix=/usr/local/gcc-4.8
Thread model: posix
gcc version 4.8.1 (GCC) 
$ 
$
$ gcc-4.8 -O3 small.c; a.out
Segmentation fault (core dumped)
$
$ gcc-trunk -O3 small.c; a.out
$
$ gcc-4.7 -O3 small.c; a.out
$ 


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

int b, f, d[5][2];
unsigned int c;

int
main ()
{
  for (c = 0; c < 2; c++)
    if (d[b + 3][c] & d[b + 4][c])
      if (f)
    break;
  return 0;
}


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

end of thread, other threads:[~2013-11-05 15:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-12  1:17 [Bug tree-optimization/58697] New: wrong code (segfaults) at -O3 su at cs dot ucdavis.edu
2013-10-12 11:33 ` [Bug tree-optimization/58697] [4.8 Regression] " jakub at gcc dot gnu.org
2013-10-14  9:08 ` rguenth at gcc dot gnu.org
2013-10-14  9:09 ` [Bug tree-optimization/58697] [4.8/4.9 " rguenth at gcc dot gnu.org
2013-10-15 18:47 ` amacleod at redhat dot com
2013-10-16  9:50 ` jakub at gcc dot gnu.org
2013-10-16 15:48 ` amacleod at redhat dot com
2013-11-05 14:59 ` rguenth at gcc dot gnu.org
2013-11-05 15:32 ` amacleod at redhat dot com

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).