public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Need help creating a small test case for g++ 4.0.0 bug
@ 2005-08-03 16:31 Volker Reichelt
  2005-08-04 15:15 ` Paul C. Leopardi
  0 siblings, 1 reply; 10+ messages in thread
From: Volker Reichelt @ 2005-08-03 16:31 UTC (permalink / raw)
  To: leopardi; +Cc: gcc

Paul Leopardi wrote:

> I have now downloaded, bootstapped and installed gcc 4.0.1. The bug in g++ 
> optimization is still there. I've made an attempt to follow the instructions 
> on minimizing test cases and have so far accomplished:
> wc of old preprocessed source:
>   99412  260586 2965538 peg01.ii
> wc of new preprocessed source:
>   69309  241979 2668391 peg01.ii
> As you can see, this is not much of a reduction. The bug I'm seeing keeps 
> disappearing as I try to reduce the source code. It seems to be a subtle 
> interaction between the Barton-Nackman trick, Boost uBLAS, GNU hash_map and 
> the g++ flags -fstrict-aliasing and -finline-functions. If I try to eliminate 
> any of these, the bug disappears. 

You might want to try a recent snapshot of gcc 4.0.2, first.
Two aliasing bugs got fixed after the 4.0.1 release:

http://gcc.gnu.org/PR22591
http://gcc.gnu.org/PR23192

The first even caused std::list::swap to be miscompiled.

Regards,
Volker


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Need help creating a small test case for g++ 4.0.0 bug
@ 2005-08-03 16:16 Dan Kegel
  2005-08-03 16:19 ` Daniel Berlin
  2005-08-28 13:51 ` Paul C. Leopardi
  0 siblings, 2 replies; 10+ messages in thread
From: Dan Kegel @ 2005-08-03 16:16 UTC (permalink / raw)
  To: GCC Mailing List, leopardi

"Paul C. Leopardi" <leopardi@bigpond.net.au> wrote:
 > So I seem to be left with a large ( >2.5MB ) preprocessed source file. Should
 > I try to report the bug using this large file as a test case?

Sure.  But you might want to try using an automated tool
to reduce the test case first.  There's one called delta
(or maybe there are several by that name, I'm not sure)
that can do it.  I haven't tried them myself yet, but see:

Original implementation:
http://www.st.cs.uni-sb.de/dd/
   http://programming.newsforge.com/article.pl?sid=05/06/30/1549248&from=rss
   http://www.stanford.edu/class/cs295/asgns/asgn1/asgn.pdf
2nd implementation?:
http://www.cs.berkeley.edu/~dsw/

-- 
Trying to get a job as a c++ developer?  See http://kegel.com/academy/getting-hired.html

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Need help creating a small test case for g++ 4.0.0 bug
@ 2005-05-14  6:28 Paul C. Leopardi
  2005-05-14  9:04 ` Andrew Pinski
  2005-05-16 17:50 ` Janis Johnson
  0 siblings, 2 replies; 10+ messages in thread
From: Paul C. Leopardi @ 2005-05-14  6:28 UTC (permalink / raw)
  To: gcc

Hi all,
I originally posted these messages to gcc-help, but had no reply, so I am 
re-posting links to them here. 

I think I have found a bug in g++ 4.0.0, but need help in reporting it. 
Maintainers like their bug reports to include short test cases, but I don't 
know how to generate a short test case involving inlining. I discovered the 
original problem by compiling GluCat ( http://glucat.sf.net ) and the 
preprocessor output from a short GluCat test program contains over 66 000 
lines of libstdc++, uBLAS and Glucat code.

Can anyone help, or should I just file a bug report using the huge test case?

The original posts were:

g++ 4.0.0: hash_map hangs when compiled with -O3 on AMD64
http://gcc.gnu.org/ml/gcc-help/2005-05/msg00030.html

Re: g++ 4.0.0: hash_map hangs when compiled with -O3 on AMD64
http://gcc.gnu.org/ml/gcc-help/2005-05/msg00087.html

I am particularly interested in the interference between hash_map, 
-fstrict-aliasing  and -finline-functions, and I wonder if it happens on 
other architectures, or only on AMD64.

Best regards, Paul Leopardi

PS.
If you try compling the current GluCat 0.1.8 using g++ 4.0.0, you will need 
the following patch.

diff 
-u /home/leopardi/src/glucat/glucat-0.1.8/glucat/portability.h ./portability.h
--- /home/leopardi/src/glucat/glucat-0.1.8/glucat/portability.h 2004-05-10 
21:28:42.000000000 +1000
+++ ./portability.h     2005-05-01 22:11:22.000000000 +1000
@@ -28,15 +28,15 @@
 #define ios_base ios // scope is different for standard C++
 #endif

-//***************************** workaround for ICC and G++ 3.3+
-#if defined (__ICL) || defined (__ICC) || defined (__GNUG__) && (__GNUC__ >= 
3) && (__GNUC_MINOR__ >= 3)
+//***************************** workaround for ICC, G++ 3.3+, G++ 4.0+
+#if defined (__ICL) || defined (__ICC) || defined (__GNUG__) && ((__GNUC__ == 
3) && (__GNUC_MINOR__ >= 3) || (__GNUC__ == 4))
 #define _GLUCAT_PRIVATE public
 #else
 #define _GLUCAT_PRIVATE private
 #endif

 //***************************** workaround for G++ 3.2 typename bug
-#if defined (__GNUG__) && (__GNUC__ >= 3) && (__GNUC_MINOR__ <= 2)
+#if defined (__GNUG__) && (__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)
 #define _GLUCAT_USE_STRUCT_NAME(T)
 #else
 #define _GLUCAT_USE_STRUCT_NAME(T) T::

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

end of thread, other threads:[~2005-08-28  3:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-03 16:31 Need help creating a small test case for g++ 4.0.0 bug Volker Reichelt
2005-08-04 15:15 ` Paul C. Leopardi
  -- strict thread matches above, loose matches on Subject: below --
2005-08-03 16:16 Dan Kegel
2005-08-03 16:19 ` Daniel Berlin
2005-08-28 13:51 ` Paul C. Leopardi
2005-05-14  6:28 Paul C. Leopardi
2005-05-14  9:04 ` Andrew Pinski
2005-05-14  9:59   ` Paul C. Leopardi
2005-05-16 17:50 ` Janis Johnson
2005-08-03 15:18   ` Paul C. Leopardi

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