public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19050] New: optimization bug in 4.0-20041212 snapshot
@ 2004-12-17 8:15 jasonp at boo dot net
2004-12-17 12:39 ` [Bug tree-optimization/19050] [4.0 Regression] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: jasonp at boo dot net @ 2004-12-17 8:15 UTC (permalink / raw)
To: gcc-bugs
System in question is a 2GHz opteron running Fedora Core 2
Reading specs from /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.0.0/specs
Configured with: ../gcc-4.0-20041212/configure --disable-nls --with-system-zlib
--with-libiconv-prefix=/usr/local --program-suffix=40 --disable-shared --disable
-libgcj --disable-multilib
Thread model: posix
gcc version 4.0.0 20041212 (experimental)
The package at www.boo.net/~jasonp/gccbug.tar.bz2 contains
driver.c: driver program
graph.h: header with a few definitions
graph.c: contains code to find the number of vertices and connected
components of a very large graph. This is an excerpt from a
much larger source file, and contains the problem code
graph.dat: the input graph; contains 80000 edges, each given by a pair
of integers in hex format. I'm sorry I can't get the input
set to be any smaller; the full dataset this came from is 20x
larger than this
This program prints out the computed number of connected components
for the graph described by graph.dat; compiling with
gcc40 *.c {-O1|-O2|-O3}
and running a.out yields '57670' as output. Compiling with 'gcc40 *.c'
or using gcc 3.4.1 with or without optimization, produces '57671' for
output. The difference is only 1 here, but for the full dataset it is
quite noticeably off.
The loop that I believe is responsible for the discrepancy starts at
graph.c:124 and is labeled with a comment that reads
/* OPTIMIZATION PRODUCES A BUG IN THIS LOOP */
Declaring the two variables above this comment to be volatile causes
the resulting code to work correctly with any level of optimization in
gcc 4.0...I've tried to understand the assembly code generated by the
compiler but it's a bit too convoluted for me.
I'll be happy to provide additional clarification if it's needed.
jasonp
--
Summary: optimization bug in 4.0-20041212 snapshot
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jasonp at boo dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19050
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/19050] [4.0 Regression] optimization bug in 4.0-20041212 snapshot
2004-12-17 8:15 [Bug c/19050] New: optimization bug in 4.0-20041212 snapshot jasonp at boo dot net
@ 2004-12-17 12:39 ` pinskia at gcc dot gnu dot org
2004-12-18 3:48 ` jasonp at boo dot net
2004-12-18 3:50 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-17 12:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-17 12:38 -------
I could reproduce it with 20041208 but with 20041214 it is fixed, can you test a newer GCC?
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Component|c |tree-optimization
Keywords| |wrong-code
Summary|optimization bug in 4.0- |[4.0 Regression]
|20041212 snapshot |optimization bug in 4.0-
| |20041212 snapshot
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19050
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/19050] [4.0 Regression] optimization bug in 4.0-20041212 snapshot
2004-12-17 8:15 [Bug c/19050] New: optimization bug in 4.0-20041212 snapshot jasonp at boo dot net
2004-12-17 12:39 ` [Bug tree-optimization/19050] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-12-18 3:48 ` jasonp at boo dot net
2004-12-18 3:50 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: jasonp at boo dot net @ 2004-12-18 3:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jasonp at boo dot net 2004-12-18 03:48 -------
(In reply to comment #1)
> I could reproduce it with 20041208 but with 20041214 it is fixed, can you test
a newer GCC?
Latest CVS works fine.
Ticket can close.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19050
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/19050] [4.0 Regression] optimization bug in 4.0-20041212 snapshot
2004-12-17 8:15 [Bug c/19050] New: optimization bug in 4.0-20041212 snapshot jasonp at boo dot net
2004-12-17 12:39 ` [Bug tree-optimization/19050] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-12-18 3:48 ` jasonp at boo dot net
@ 2004-12-18 3:50 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-18 3:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-18 03:50 -------
Thanks for testing, closing as fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19050
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-12-18 3:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-17 8:15 [Bug c/19050] New: optimization bug in 4.0-20041212 snapshot jasonp at boo dot net
2004-12-17 12:39 ` [Bug tree-optimization/19050] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-12-18 3:48 ` jasonp at boo dot net
2004-12-18 3:50 ` pinskia at gcc dot gnu dot 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).