gcc code bloat again
andy@softbookpress.com
andy@softbookpress.com
Wed Dec 6 13:48:00 GMT 2000
>>
>> 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
More information about the crossgcc
mailing list