Re: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Joerg Wunsch
As Schwichtenberg, Knut wrote: > Is compiled to: > > .LM2: > lds r24,minute > clr r25 > cpi r24,15 > cpc r25,__zero_reg__ > breq .L6 > .LM3: > cpi r24,16 > cpc r25,__zero_reg__ > brge .L

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Schwichtenberg, Knut
Hi, > -Original Message- > From: > [EMAIL PROTECTED] > g > [mailto:[EMAIL PROTECTED] ongnu.org] On Behalf Of Joerg Wunsch > Sent: Tuesday, March 27, 2007 7:10 AM > To: avr-gcc-list@nongnu.org > Subject: Re: [avr-gcc-list] Inconsisten behaviour of switch statement > Knut, can you provide

Re: [avr-gcc-list] avr-gdb error when run "info io_registers"

2007-03-26 Thread Joerg Wunsch
[EMAIL PROTECTED] wrote: > Does the avr-gdb not support this command on mega16? It basically means the backend program (avarice in your case) doesn't support that command. However, that's not quite true. The ATmega16 is one of the few CPUs where "info io_registers" is actually even implemented

Re: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Joerg Wunsch
Paulo Marques <[EMAIL PROTECTED]> wrote: > This is not a "missed optimization". I agree. > I would need some time to build an actual test case to show this. > Unfortunately, time is something that I don't have abundantly right > now :( I tried a quick test with some variations of: volatile int

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Paulo Marques
Quoting Eric Weddington <[EMAIL PROTECTED]>: But he shouldn't _have_ to do that. Bug in gcc? Hmm.. point. Maybe a "missed optimization" type of bug. You could fill out a GCC bug report. Feel free to put me on the CC list of the bug report so I can track it. This is not a "missed optimiza

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Eric Weddington
> -Original Message- > From: Dave Hansen [mailto:[EMAIL PROTECTED] > Sent: Monday, March 26, 2007 10:38 AM > To: [EMAIL PROTECTED]; > [EMAIL PROTECTED]; avr-gcc-list@nongnu.org > Subject: RE: [avr-gcc-list] Inconsisten behaviour of switch statement > > From: Eric Weddington <[EMAIL PR

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Dave Hansen
From: Eric Weddington <[EMAIL PROTECTED]> > From: Schwichtenberg, Knut [mailto:[EMAIL PROTECTED] [...] > Eric, the point is not that I don't like the output, but the > case to be > selected should be deterministic. I always thought that a switch > statement would lead to identical results if t

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Eric Weddington
> -Original Message- > From: Schwichtenberg, Knut [mailto:[EMAIL PROTECTED] > Sent: Monday, March 26, 2007 7:34 AM > To: Eric Weddington; avr-gcc-list@nongnu.org > Subject: RE: [avr-gcc-list] Inconsisten behaviour of switch statement > > Hi, > > > -Original Message- > > From:

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Schwichtenberg, Knut
Hi, > -Original Message- > From: Eric Weddington [mailto:[EMAIL PROTECTED] > Sent: Monday, March 26, 2007 2:46 PM > To: Schwichtenberg, Knut; avr-gcc-list@nongnu.org > Subject: RE: [avr-gcc-list] Inconsisten behaviour of switch statement > > The compiler has heuristics that decide when

RE: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Eric Weddington
> -Original Message- > From: > [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > org] On Behalf Of Schwichtenberg, Knut > Sent: Monday, March 26, 2007 12:39 AM > To: avr-gcc-list@nongnu.org > Subject: [avr-gcc-list] Inconsisten behaviour of switch statement > > Hi, > > while the size o

Re: [avr-gcc-list] Inconsisten behaviour of switch statement

2007-03-26 Thread Preston Wilson
"Schwichtenberg, Knut" <[EMAIL PROTECTED]> wrote: > BTW: Is there any reason why the compares within the switch are at least 16 > bit and not type dependent for 8 bit types? If you program this as a normal > if, 8 bit compares are generated. The promotion of the controlling expression in the swit