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

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

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


From: Erik Christiansen
Subject: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?
Date: Thu, 29 Oct 2009 00:46:27 +1100
User-agent: Mutt/1.5.15+20070412 (2007-04-11)

On Wed, Oct 28, 2009 at 02:08:05PM +0100, Joerg Desch wrote:
> I've played with "inline" and with "__attribute__((gnu_inline,
> always_inline))" to avoid this overhead, but it doesn't work as expected.
> 
> #if defined(__GNUC__)
> #  define ALLWAYS_INLINE inline __attribute__((gnu_inline, always_inline))
> #endif
> ALLWAYS_INLINE int foo (void)
> {
>   // ...
> }
> 
> I've tried it with -Os and foo() is still called.

Ah, yes, optimisation needs to be used for inline to work. If the above
fails on a small test case, "avr-gcc -v" and the command-line don't show
a lurking "-fno-inline", and "-Wall -Wextra" doesn't provide any clues
either, I'd pretty soon be tempted to report it as a bug, unless a magic
method is revealed on the list. You've probably tried other
optimisations? (Just in case the size optimisation is absolute in its
approach.)

 
> As you can see it receives in the list. But with 1/2 hour delay.

Oh goody, it works again! :-)

Erik




reply via email to

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