Hello,

Brian Neltner wrote:
> Very oddly, the code runs when I compile it with -O3, but not with any
> other optimization level.
>> This works:
>>
>> int main(void) {
>>      uint8_t i;
>>      for(i=1;i<0xFF;i++) asm volatile("nop/n/t");
>>      PORTA=0x01;
>>      while(1);
>> }

You are using /n  and /t instead of \n \t (backslash-slash). Anyway I
don't think this is the problem in your case. Could you please give us
the avr-gcc command with all parameters and compiler flags you use to
compile the code.

Which target device are you using? Have you already took a look into the
dissembled code (using avr-objdump)? May that will give you some hints.

BR,
Josef



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to