gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: SDCC overoptimizing
From: Ralf Forsberg
Date: Sat, 29 Mar 2003 00:50:34 +0100

On Fri, Mar 28, 2003 at 11:25:39PM +0100, Erik Gustavsson wrote:
> 
> #define LCD_DPORT PORTA
> BIT_AT(PORTB_ADDR,4) LCD_E1;
> BIT_AT(PORTB_ADDR,5) LCD_E2;
> BIT_AT(PORTB_ADDR,6) LCD_RS;
> BIT_AT(PORTB_ADDR,7) LCD_RW;
> 
> void lcd_write(char x)
> {
>    LCD_DPORT=x;
>    LCD_E1=1;   
>    LCD_E1=0;
> }
> 
> Here the first E1 assignment (that is "BSF PORTB,4") is
> optimized away...

I belive this specific issue can be worked around by changing the
definition of BIT_AT() to use sbit instead of bit. 

http://sourceforge.net/tracker/index.php?func=detail&aid=688137&group_id=599&atid=100599

 / Ralf


gnupic@linuxhacker.org