GCC3.0-release and multiple inheritance

Nathan Sidwell nathan@codesourcery.com
Fri Aug 3 02:03:00 GMT 2001


Simon Gee wrote:
> with a compiler generated from the same code on an i386 gives the me correct
> behaviour which led me to believe that I am looking at a machine dependent
Hm, there is definitely some machine dependancy involved here,

> _ZThn4_N1C7BmethodE1D:
This is a thunk to C::Bmethod (D) (used when you have a B pointer)

>         la      $25,_ZN1C7BmethodE1D
>         jal     $31,$25 # <-- call to other destructor call for Bmethod
This is the call to the actual C::Bmethod (D) function.

>         la      $25,_ZN1DD1Ev
>         jal     $31,$25 # <-- call to class D destructor -- we have now called
And here we destruct our value argument. Which is wrong, because the real function
will have done so.

This is the same signature as a bug I fixed which the above code was generated
when we attempted to inline into the body of the thunk. Why you're seeing it
I don't know (BTW, optimized or unoptimized?) Ah, I see a difference.
i86 can support non-virtual thunks directly in assembler, mips cannot - but why
this is making the difference I don't know.

Please file a GNATs report on this.

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org



More information about the Gcc-bugs mailing list