[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] WinAVR 20050214 (gcc 3.4.3) and optimizer bug.
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] WinAVR 20050214 (gcc 3.4.3) and optimizer bug. |
Date: |
Mon, 9 May 2005 21:01:48 +0200 (MET DST) |
Vesa Jääskeläinen <address@hidden> wrote:
> Thank you for this information. This indeed seems to cure the
> problem in this case. But shouldn't this be default for AVR ?
I'm not sure. On the AVR, memory address 0 is an alias for r0. Thus,
by dereferencing a NULL pointer, you're touching whatever r0 (rather
r0/r1) points to. As this can touch anywhere (including memory-mapped
IO devices), the behaviour is completely undefined, and you should
probably avoid that kind of program anyway.
However, the assumption that a pointer is not NULL just because the
program still runs at a certain point is for sure wrong for the AVR,
so I think you should write a bug report for this.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)