public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58662] New: wrong code at -O2 and -O3 on x86_64-linux-gnu (in 64-bit mode)
@ 2013-10-08  5:27 su at cs dot ucdavis.edu
  2013-10-08  7:32 ` [Bug tree-optimization/58662] " mpolacek at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-10-08  5:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58662
           Summary: wrong code at -O2 and -O3 on x86_64-linux-gnu (in
                    64-bit mode)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The current gcc trunk miscompiles the attached testcase on x86_64-linux-gnu at
-O2 and -O3 in 64-bit mode. 

It is a regression from 4.8.x.  


$ 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/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure
--enable-languages=c,c++,objc,obj-c++,fortran,lto --disable-werror
--enable-checking=release --with-gmp=/usr/local/gcc-trunk
--with-mpfr=/usr/local/gcc-trunk --with-mpc=/usr/local/gcc-trunk
--with-cloog=/usr/local/gcc-trunk --prefix=/usr/local/gcc-trunk
Thread model: posix
gcc version 4.9.0 20131007 (experimental) [trunk revision 203235] (GCC) 
$ 
$ gcc-trunk -Os small.c; a.out
0
$ gcc-trunk -O2 small.c; a.out
-1008071096
$ gcc-trunk -O3 small.c; a.out
86090104
$
$ gcc-4.8 -O2 small.c; a.out
0
$ gcc-4.8 -O3 small.c; a.out
0 
$ 

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

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

int a, b, c, d;

int
foo (int p1, short p2)
{
  return p1 / p2;
}

int
main ()
{
  char e;
  d = foo (a == 0, (0, 35536)); 
  e = d % 14;
  b = e && c;
  printf ("%d\n", b);
  return 0;
}


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

end of thread, other threads:[~2013-10-13 13:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-08  5:27 [Bug tree-optimization/58662] New: wrong code at -O2 and -O3 on x86_64-linux-gnu (in 64-bit mode) su at cs dot ucdavis.edu
2013-10-08  7:32 ` [Bug tree-optimization/58662] " mpolacek at gcc dot gnu.org
2013-10-08  8:31 ` mpolacek at gcc dot gnu.org
2013-10-08 11:24 ` mpolacek at gcc dot gnu.org
2013-10-10 12:03 ` rguenth at gcc dot gnu.org
2013-10-10 13:30 ` rguenth at gcc dot gnu.org
2013-10-10 13:48 ` [Bug rtl-optimization/58662] [4.9 Regression] " rguenth at gcc dot gnu.org
2013-10-10 14:00 ` rguenth at gcc dot gnu.org
2013-10-11  7:07 ` ebotcazou at gcc dot gnu.org
2013-10-13 13:29 ` [Bug rtl-optimization/58662] [4.9 Regression] wrong code at -O2 for dumb condition ebotcazou at gcc dot gnu.org
2013-10-13 13:30 ` ebotcazou 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).