[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: Tue, 10 May 2005 06:47:33 +0200
User-agent: Mutt/

As Vesa Jääskeläinen wrote:

> Joerg Wunsch wrote:

> >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. [...]

That's of course nonsense.  By reading a NULL pointer, your're
fetching the contents of r0/r1 (maybe r0 through r2 on 24-bit address
machines), which is always possible and has no further side-effects.
(I confused NULL pointer dereference with a dereference of the value
fetched by deref'ing the NULL pointer.)

> >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, ...

Even more wrong then.

Of course, *writing* to a NULL pointer is almost a guarantee your
application will go south -- but that hasn't been the issue here.

> >so I think you should write a bug report for this.

> I filed a bug report to here:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21479

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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