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: Joerg Desch
Subject: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?
Date: Wed, 28 Oct 2009 14:08:05 +0100

Hi Erik,

On Wed, 28 Oct 2009 23:29:59 +1100
Erik Christiansen <address@hidden> wrote:

> When generating output pulses of only a few cpu cycles, I've always
> preferred to do it in an asm file, linked in with the rest of the code.

I personally don't use assembler any more. At least I try to avoid it. ;-)


> That does cost a function call and return, but the timing cannot be
> changed by gcc or command-line option vagaries.

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.


> P.S. If this somehow doesn't make it to the list, could you please
>      forward it?

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

-- 
Email: Joerg Desch <jd DOT vvd AT web DOT de>




reply via email to

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