This is the mail archive of the
mailing list for the GCC project.
Re: c++ code that egcs kills ...
- To: egcs-bugs at cygnus dot com, glenn at dodgson dot wonderland dot caltech dot edu
- Subject: Re: c++ code that egcs kills ...
- From: mrs at wrs dot com (Mike Stump)
- Date: Fri, 21 Aug 1998 08:08:52 -0700
> Date: Thu, 20 Aug 1998 10:44:11 -0700
> From: "Glenn W. Bach" <firstname.lastname@example.org>
> To: email@example.com
> The following code demonstrates a bug in how egcs handles c++.
> Has this been seen before? Is there hope of fixing it in a future version?
> We are stuck, because RedHat Linux uses egcs, so we can't get any of our
> code to work.
If this is the bug I think it is, H.J. Lu (firstname.lastname@example.org)
broke your code, and checked in:
Wed Aug 27 01:24:25 1997 H.J. Lu (email@example.com)
* config/linux.h (DEFAULT_VTABLE_THUNKS): New. Defined as 1 if
USE_GNULIBC_1 is not defined.
I knew it would break your code, and told him `Some users will expect
this testcase to work. The failure mode of this with thunks is
particularly bad as the this pointer will be wrong at times, and that
shift can cause all sorts of very hard to figure out problems' (see
http://www.cygnus.com/ml/egcs/1997-Aug/0668.html). Per Bothner said
your code `is a fairly bogus and arcane
(i.e. difficult-to-understand)' (see
http://www.cygnus.com/ml/egcs/1997-Aug/0676.html), Joe Buck said
`Leave the thunks in, and document the case that doesn't work. It is
very rare that it will arise in real code, and when it does it can be
worked around. [...] This particular bug is the least harmful type: it
is 100% predictable what the result will be so informed users will
never be surprised' (see
http://www.cygnus.com/ml/egcs/1997-Aug/0702.html), and Ulrich Drepper
said `I agree with Joe. I don't want to get in panic just because a
well known but seldomly used feature does not work as expected'.
My preference was for people to finish off the implementation of
thunks, and then if they are a codegen win, to default all
architectures over to thunks.
You can use -fno-vtable-thunks to solve your problem, but you will
need to recompile _all_ C++ code, and all C++ libraries and libstdc++.