[Top][All Lists]
[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>
- [avr-gcc-list] optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/27
- Re: [avr-gcc-list] optimizer removes volatile pin access code. why?, Joerg Wunsch, 2009/10/27
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/28
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?,
Joerg Desch <=
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/28
- RE: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Stu Bell, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/29
- RE: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Stu Bell, 2009/10/30
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, df_welch, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/29
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/29
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/29
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Joerg Wunsch, 2009/10/31