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


Glenn W Bach <glenn@dodgson.wonderland.caltech.edu> writes:

> Has this been seen before? Is there hope of fixing it in a future version?

>   B
>  / \
> A   D - E
>  \ /
>   C

> In the above inheritance tree, B and C inherit virtually from A. When an
> object of type E is constructed, D's constructor calls a function in A
> which in turn calls a virtual function overridden by D. This requires a
> downcast from type A to type D, and egcs incorrectly adjusts the object
> pointer, forgetting the size of E's member data.

I believe this is a known problem in the vtable-thunks implementation.
You may work around it by rebuilding libstdc++ with -fno-vtable-thunks 
and compiling any C++ program with -fno-vtable-thunks.

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil



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