Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-09 Thread Vesa Jääskeläinen
Jeff Epler wrote: On Mon, May 09, 2005 at 08:21:12AM -0700, Larry Barello wrote: I didn't understand everything that was said, but it seemed clear to me that having the construct char *foo; if (foo && (*foo !=0)) randomly break seemed pretty harsh. As I recall, your original code was more like 1

Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-09 Thread E. Weddington
Larry Barello wrote: So, this is all facinating reading, but what, if anything, is a NULL pointer in the AVR context? Address 0 is certainly valid. Or is it simply convention that 0 is "null". To the best of my knowledge, a NULL pointer in the AVR context is 0. And yes, that is simply a conventi

Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-09 Thread Russell Shaw
Larry Barello wrote: So, this is all facinating reading, but what, if anything, is a NULL pointer in the AVR context? Address 0 is certainly valid. Or is it simply convention that 0 is "null". If a pointer is NULL, the actual behind-the-scenes address it represents may be anything, and is just so

Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-09 Thread Jeff Epler
On Mon, May 09, 2005 at 08:21:12AM -0700, Larry Barello wrote: > I didn't understand everything that was said, but it seemed clear to me that > having the construct > > char *foo; > > if (foo && (*foo !=0)) > > randomly break seemed pretty harsh. As I recall, your original code was more like 1

RE: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-09 Thread Larry Barello
So, this is all facinating reading, but what, if anything, is a NULL pointer in the AVR context? Address 0 is certainly valid. Or is it simply convention that 0 is "null". I didn't understand everything that was said, but it seemed clear to me that having the construct char *foo; if (foo && (*

Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-09 Thread E. Weddington
Russell Shaw wrote: Only in cases where the context may not indicate where a pointer value is required: http://www.eskimo.com/~scs/C-faq/q5.2.html http://www.eskimo.com/~scs/C-faq/q5.3.html http://www.eskimo.com/~scs/C-faq/s5.html Thanks for the links, Russell. The first sentence in the firs

Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-08 Thread Russell Shaw
E. Weddington wrote: Vesa Jääskeläinen wrote: Joerg Wunsch wrote: As Vesa Jääskeläinen wrote: I have been debugging why Ethernut brakes in certain situations with gcc. And found an optimizer bug. In this clause: if (ppv && (*ppv != 0)) { We are missing code for (ppv != 0), but code for *pp

Re: [avr-gcc-list] Re: WinAVR 20050214 (gcc 3.4.3) and optimizer bug.

2005-05-08 Thread E. Weddington
Vesa Jääskeläinen wrote: Joerg Wunsch wrote: As Vesa Jääskeläinen wrote: I have been debugging why Ethernut brakes in certain situations with gcc. And found an optimizer bug. In this clause: if (ppv && (*ppv != 0)) { We are missing code for (ppv != 0), but code for *ppv != 0 is found. And