This is the mail archive of the gcc@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++ ABI: cloning of constructors/destructors


Joe Buck <jbuck@synopsys.COM> writes:

>> I've just installed GCC 3.0 on a i386 linux box.
>> 
>> Having a look at the code generated from a dummy C++
>> program, it seems constructors and destructors are
>> generated twice even for the simplest classes.
> 
> That can't be right.  Please post an example.

He probably means that two *types* of constructors are generated for
"even the simplest classes".
nm test.o |/buildspace/libiberty/src/libiberty/cxxfilt --verbose
                 U _Unwind_Resume
0000000000000000 W a::a[in-charge]()
0000000000000000 W a::a[not-in-charge]()
0000000000000000 W a::~a [in-charge deleting]()
0000000000000000 W a::~a [in-charge]()
0000000000000000 W a::~a [not-in-charge]()
0000000000000000 W b::b[in-charge]()
0000000000000000 W b::~b [in-charge deleting]()
0000000000000000 W b::~b [in-charge]()
0000000000000000 V typeinfo for a
0000000000000000 V typeinfo for b
0000000000000000 V typeinfo name for a
0000000000000000 V typeinfo name for b
0000000000000000 V vtable for a
0000000000000000 V vtable for b
                 U vtable for __cxxabiv1::__class_type_info
                 U vtable for __cxxabiv1::__si_class_type_info
                 U operator delete(void*)
0000000000000000 ? __FRAME_BEGIN__
                 U __gxx_personality_v0
0000000000000000 T main


(if you just cxxfilt it without --verbose, you'll not see the
[in-charge]/[not-in-charge]/etc stuff, and thus, you'll end up seeing
a::a twice, a::~a three times, etc.


-- 
"Today I was arrested for scalping low numbers at the deli.  I
sold a #3 for 28 bucks.
"-Steven Wright


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