Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] GCC runing optomization!

2005-02-19 by jane highland

Gus,

The rule with optimisation e.g. -O3 :

If a function calls a function outside of the current
'C' module, the function will definately be called.

If a function calls another function which calls
another function etc. inside the SAME module, it may
not compile as expected (some of the calls may be
optimised out) UNLESS the FINAL function in the chain
accesses something volatile, or is an external
function (to the module).

e.g.

* (volatile unsigned long fred) * FRED = 0;


This is because the scope of the optimiser is limited
to the current module only - it has no idea about
external functions and there leaves any calls to them
intact. But functions inside the same module may just
magically dissappear if they're deemed not to access
anything useful (volatile).

I learned the hard way over several days!

Jane

 --- Gus <gus_is_working@...> wrote: 

---------------------------------

Hello,

Anyone is using GCC compiler version 3.4.2 WITH
optomization?

When I enable optomization, my applicatin acts funny!
I am not sure 
why.


Gus





---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/lpc2000/
 
   To unsubscribe from this group, send an email to:
lpc2000-unsubscribe@yahoogroups.com
 
   Your use of Yahoo! Groups is subject to the Yahoo!
Terms of Service.
 


	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.