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

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

Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?


From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?
Date: Thu, 19 Feb 2009 19:40:09 +0100

On Thu, 19 Feb 2009 19:21:07 +0100
Ruud Vlaming <address@hidden> wrote:

> Are you absolutely sure they are really left out?  I assume they are
> just not shown in the assembly file. Four or more nops are replaced
> by ellipses, but are present allright. Have a close look at the addresses.

Oooops !!!!! Can you see the red on my face ?! ;-)
Indeed you are right, with 4 nops, the assembly looks like this:


fa4:    db 9a           sbi     0x1b, 3 ; 27
...
fb6:    db 98           cbi     0x1b, 3 ; 27
fb8:    08 95           ret

I apologize ! It's just that I didn't know GCC behaved like this, so I wasn't 
watching for it !

> Otherwise you could use 
>   __asm__ volatile(
>     "nop \n\t"
>     "nop \n\t"
>     "nop \n\t"
>     "nop \n\t");
> in which gcc cannot start to optimize.

I take note...



--
Vince, embarassed...




reply via email to

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