Hi Janis, A belated reply to your message is below. Best regards, Paul Leopardi
On Tue, 17 May 2005 03:23 am, Janis Johnson wrote: > On Sat, May 14, 2005 at 12:16:54PM +1000, Paul C. Leopardi wrote: > > 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 information in http://gcc.gnu.org/bugs/minimize.html might help. 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. [ See http://en.wikipedia.org/wiki/Barton-Nackman ] 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? Or maybe I could get one of the gcc developers interested in using GluCat as a test bed for detecting bugs in g++ ? I am planning to release GluCat 0.1.9 fairly soon in any case, using g++ -O3 -fno-strict-aliasing as a workaround. Since GluCat is a template library, the compiler flags are only used to build test programs, and as a guideline to users of the library. So the bug is not holding up GluCat. It's just that I'd like to see how a nightmare corner case bug like this gets fixed, and I'd like to contribute something to that fix, even though I don't know enough about gcc internals to provide a patch.