[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Optimization bug in AVRGCC 3.3 compiler
From: |
Marek Michalkiewicz |
Subject: |
Re: [avr-gcc-list] Optimization bug in AVRGCC 3.3 compiler |
Date: |
Sun, 6 Apr 2003 01:58:43 +0200 |
User-agent: |
Mutt/1.4i |
On Fri, Apr 04, 2003 at 10:25:44PM +0400, Alexei Semenov wrote:
> Following C code produces inapplicable assembler code with
> WinAVR-20030312:
>
> #include <avr/io.h>
>
> int main(void)
> {
> unsigned char v= 0;
> for(;;)
> {
> if ((PIND ^ v) & 1) // do wrong compiling
> {
> v= ~v;
> PORTB= v;
> }
> }
> }
Thanks. Looks like PORTB write optimized away as if there was no
"volatile". I couldn't reproduce this with avr-gcc 3.3 20030405
from CVS. So, the bug should be gone with a new WinAVR release...
Marek