This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

Re: gcc code bloat again


>>
>> this is gcc 2.95.1 on arm linux
>> I wonder if someone could kindly explain why gcc produces this output for
>> the constructor of an object and maybe give some suggestions how to avoid
>> it.
>> The size of the constructor code is 300 bytes!  The source  compiled with
>> -O2 -fomit-frame-pointer flags
>> By contrast, the code produced by Metrowerks 68k compiler is 46 bytes ( see
>> the disassembly below)
>
>Without source, it's hard to be sure what is happening, but much of the
>output looks to be related to using the set-jump version of exception
>(re-)throwing.

In the class constructor only one member variable (a pointer to another
object) is initialized
The class inherits from 2 more classes.
The parent's constructor does nothing
The grandparent's constructor  calls a static function of a utility class
that adds this class instance to a list.

>Try compiling the code with -fno-exceptions.  How does it
>compare then?

I can try but the code uses exceptions throughout so probably it will break

>Does the Metroworks compiler support exceptions?
yes

>Gcc-3 will probably use dwarf2 table-based exceptions, so the code will
>probably be much tighter for your example, but without the source, I can't
>demonstrate.

When will that be avaiable ?

Thanks a lot for help

Andy




------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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