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

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

Re: [avr-gcc-list] Strange issues with 16-bit values


From: Brian Neltner
Subject: Re: [avr-gcc-list] Strange issues with 16-bit values
Date: Fri, 07 Nov 2008 00:24:20 -0500

Very oddly, the code runs when I compile it with -O3, but not with any
other optimization level.

...

Is this a known bug?

On Fri, 2008-11-07 at 00:05 -0500, Brian Neltner wrote:
> Apologies if this has been mentioned before.
> 
> I have some software that previously compiled perfectly on my computer,
> but which now fails silently when uploaded (no compile-time errors or
> warnings). I am hoping someone can help me!
> 
> This works:
> 
> int main(void) {
>       uint8_t i;
>       for(i=1;i<0xFF;i++) asm volatile("nop/n/t");
>       PORTA=0x01;
>       while(1);
> }
> 
> and PORTA is correctly set.
> 
> However, this doesn't work:
> 
> int main(void) {
>       uint16_t i;
>       for(i=1;i<0xFF;i++) asm volatile("nop/n/t");
>       PORTA=0x01;
>       while(1);
> }
> 
> and the code never reaches the PORTA setting command.
> 
> I have included the following libraries:
> 
> #include <avr/io.h>
> #include <avr/interrupt.h>
> #include <stdlib.h>
> #include <stdint.h>
> #include <stdbool.h>
> 
> and this all worked previously, so I'm not sure what to do.
> 
> This is using avr-gcc 4.3.0
> 
> Hopefully I am just missing a library which didn't used to be necessary
> but now is? It's very strange to me that my code is compiling without
> errors or warnings... but not running.
> 
> Thanks,
> Brian
> 
> 
> 
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list





reply via email to

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