Hope this can help:

On 2007-06-09, Fco  Javier Rodríguez García <[email protected]> wrote:

> One optimization CodeWarrior does is like this: If you don't
> use one function in your source code, then CW doesn't compile
> that function and throw it away, which means, CW only yields
> code for those functions that actually you use. I saw GCC
> didn't, even with -O3 or -Os, is there someway or option in
> GCC to achieve what CW does?

Pass -ffunction-sections to the compiler and --gc-sections to
the linker.

If you want data objects you can add -fdata-sections to the
compiler flags, but you'll need a version of gcc containing
some patches I submitted a while back...

BTW, "gc" stands for "garbage collection", in case you missed
the thread currently running in the msp430 group where somebody
is claiming that "garbage collection" is not the correct phrase
for this feature, that it's wrong for compilers to discard
unused objects, because doing so will break all sorts of
programs.

-- 
Grant Edwards                   grante             Yow!  I like the way ONLY
                                  at               their mouths move... They
                               visi.com            look like DYING OYSTERS


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

----- Mensaje original ----
De: Juergen Schlinker <[email protected]>
Para: GCC for MSP430 - http://mspgcc.sf.net 
Enviado: sábado, 30 de junio, 2007 17:10:17
Asunto: Re: [Mspgcc-users] optimizing space with mspgcc <v4.0

>>You could consider placing each function into a seperate file. But if your
>>software contains unused functions, why bother to keep the unused

>>functions? You can delete them or compile them conditionally with #ifdef.

Putting each function in a separate file is going to make the whole development 
process more difficult (as you might have guessed :-))

The functions are not "generally" unused.
I am talking about functions in driver implementation used by my applications.
Depending on the specific application different functions are used.
So I can't get rid of them easily.

Using #ifdef is also very difficult because I am not completely aware of the 
conditions when a function may be used or not.
In theory this would work, but I am looking for a solution that fits to my work 
flow.


Juergen


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users







      Llama gratis a cualquier PC del mundo. 
Con una excelente calidad de sonido. 
http://mx.messenger.yahoo.com/

Reply via email to