avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?


From: Stu Bell
Subject: RE: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?
Date: Fri, 30 Oct 2009 11:11:27 -0600

David Brown wrote:

> > Returns the following error:
> > 
> > CmdFocus.c: In function 'FcsAcquireLookForSumOKDeassert':
> > CmdFocus.c:4020: sorry, unimplemented: inlining failed in call to
> > 'FcsStartUtilTimer': function body not available
> > CmdFocus.c:4152: sorry, unimplemented: called from here ...
> > 
> 
> That's hardly "throwing a fit" - it's simply telling you it 
> can't obey the "always_inline" attribute.

Okay, bad humor day.  Sorry. 

> However, I think the problem stems from a misunderstanding 
> about "always_inline" - it's an /additional/ request to the 
> compiler that you can use for /inline/ functions.  From the 
> gcc documentation:
> 
> always_inline
>      Generally, functions are not inlined unless optimization 
> is specified. For functions declared inline, this attribute 
> inlines the function even if no optimization level was specified.
> 
> 
> If you declare your functions "inline", it should work as you 
> desire even with -O0:
> 
> static inline void
> FcsStartUtilTimer( uint16_t Wait ) 
> __attribute__((always_inline)); static inline void 
> FcsStartUtilTimer( uint16_t Wait )

Ah ha, that's it!  I read that description several times and never quite
got it.  Thanks for setting me straight, Dave!

Best regards, 

Stu Bell 
DataPlay (DPHI, Inc.) 

 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]