This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++ code that egcs kills ...


> Date: Thu, 20 Aug 1998 10:44:11 -0700
> From: "Glenn W. Bach" <glenn@dodgson.wonderland.caltech.edu>
> To: egcs-bugs@cygnus.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 (hjl@gnu.ai.mit.edu)
broke your code, and checked in:

Wed Aug 27 01:24:25 1997  H.J. Lu   (hjl@gnu.ai.mit.edu)

       * 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++.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]