public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58696] New: wrong code at -O3 on x86_64-linux-gnu
@ 2013-10-12 0:28 su at cs dot ucdavis.edu
2013-10-12 10:27 ` [Bug tree-optimization/58696] " mikpelinux at gmail dot com
2013-10-14 9:15 ` rguenth at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: su at cs dot ucdavis.edu @ 2013-10-12 0:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58696
Bug ID: 58696
Summary: wrong code at -O3 on x86_64-linux-gnu
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 produces wrong code for the following testcase on
x86_64-linux when compiled at -O3 in both 32-bit and 64-bit modes.
This 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 20131011 (experimental) [trunk revision 203458] (GCC)
$
$ gcc-trunk -O2 small.c; a.out
0
$ gcc-4.8 -O3 small.c; a.out
0
$ gcc-trunk -O3 small.c; a.out
1
$
----------------------------------
int printf (const char *, ...);
int a[20], b, c;
int
fn1 ()
{
int d, e, f, g = 0;
a[12] = 1;
for (e = 0; e < 3; e++)
for (d = 0; d < 2; d++)
{
for (f = 0; f < 2; f++)
{
g ^= a[12] > 1;
if (g)
return 0;
if (b)
break;
}
for (c = 0; c < 1; c++)
a[d] = a[e * 3 + 9];
}
return 0;
}
int
main ()
{
fn1 ();
printf ("%d\n", a[0]);
return 0;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-14 9:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-12 0:28 [Bug tree-optimization/58696] New: wrong code at -O3 on x86_64-linux-gnu su at cs dot ucdavis.edu
2013-10-12 10:27 ` [Bug tree-optimization/58696] " mikpelinux at gmail dot com
2013-10-14 9:15 ` 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).