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: Ruud Vlaming
Subject: Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?
Date: Thu, 19 Feb 2009 19:21:07 +0100
User-agent: KMail/1.9.1

On Thursday 19 February 2009 19:01, Vincent Trouilliez wrote:

> I made a few trials. It appears that up to and including 3 nop
> statements, GCC leaves them alone. But if I put 4 of them, it removes
> them all ! 
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.

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.

Ruud




reply via email to

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