I finally found the bug: its name is "g++"

Markus Werle numerical.simulation@web.de
Fri Sep 7 02:34:00 GMT 2001


Carlo Wood wrote:

> I started to use C++ around 2.96 (RedHats) and have since
> reported dozens of bug reports - which indeed have taken a lot
> of my time.  By far most of these problems have been related
> to templates, as I've been playing pioneer in this field
> (not being bothered by any experience but the ISO C++ ref).

Now _this_ is really funny: I started using g++ because of its
rather good template support.
I played around with expression templates and those were nicely
accepted by this compiler.

> However, since the release of 3.0 this 'nightmare' stopped.

A dying compiler is not a nightmare. A dying executable is one.
No, 3.0.X definitely creates incorrect code.
The kde developers even dropped a note on their web-page
_not_ to use it for their project, but rather stay with gcc-2.95.3

> It has been a long time since I ran into a compiler bug.

So _your_ code is cleaner than mine perhaps.

> The problems that 3.0 has are known

but not published on http://gcc.gnu.org/bugs.html#known .
"No time, we are volunteers", developers say.
So why do we have that webpage then?

> and will be fixed in 3.1 I hear.

Yes they always _will_ be fixed some day, that's not the point

> I trust the developers that 3.1 will be able
> to compile whatever 3.0 could compile (THAT is what the
> testsuite is about: it is a regression testsuite, not a
> standards-compliant testsuite).

But then the problem is bigger than I thought.

>From my own programming experience I have to state
that since I know my code, I am able to build some
small test cases which let me trace what my code does
(with all flags on I get a detailed report on every little
step taking place during a run). After a bigger change
I run the old examples again to see what happens.

I expected that developers are capable of tracing the
basic block of a C++ compiler: constructor calls.
I think it is a severe damage of the development system
if an error like the doubled constructor call enters a release.

I have no problem with such an error in a cvs checkout.
I have a problem when it is in a major release.

My aim is on the release policy.
Compare to www.trolltech.com:
The latest release is called: Qt 3.0 Beta 4
As "client" I can decide now whether I take that "release"
being aware of possible failures, and if I do not have the time
to make experiments I use the latest stable stuff or wait.

gcc-3.0 promised too much. That's all.
I feel like gcc-3.0 is nothing but a well-numbered
cvs-checkout including documentation.
If it was tagged as alpha software I would not have
written my original message.

> I should be noted that I never (yet) compiled anything
> with -O1 ... I'll leave that till the moment that I am
> 100% satisfied with what g++ achieves with -O0 ;).

Expression templates (-ftemplate-depth-500)
only make sense with at least -O2 turned on.
Without that my numerical simulation
project makes me wait just too long.

> I don't know what you are programming,

It is a numerical simulation using expression templates
to achieve compile time analytic differentiation
and automatic galerkin discretization of partial differential
equations (C++ is fun!).
It uses a thin wrapper around PETSc as linear solver.

> but I DO know that
> what has appeared to me as a compiler bug often wasn't
> one.

Yes, and I feel like developers hide behind this possibility
much too often.

> You simply can't know until you made that small
> test-case.

Most of the problems arise when I paste
a tested fine-compiling snippet into the production code.
My rule of thumb: ICEs are not very easy to catch.
And what about linker errors, good friends of mine on hpux
in the 32bit, 64bit and 64-bit-gnu-ld version?
I _know_ it is gcc, not hp ld, not binutils ld, perhaps as.
I just cannot give You a simple example.

My 230Mb executable tumbles at program start,
the debuggers become detached zombies, forcing me to
reboot, no chance to catch it at all. The same code
runs perfectly on linux - so it is my error then? Maybe.
Who knows ...

>  I do believe you have had a lot of problems
> but were they really compiler bugs?  How many bugs reports
> have you written that have been confirmed to be really
> compiler bugs in the end?

I never really got a confirmation. I only found the next cvs tree
did not have the reported bug anymore, so I think they
catched it. I do not know if my reports were helpful in these
cases or if the developers were aware of the problem before
I found it.

I found the doubled constructor call the day gcc-3.0.1 was
released. With gcc-3.0.1 this error was gone, others came in.
The never ending story.

Regards,


Markus Werle



More information about the Gcc-bugs mailing list