Bad optimization of condition handling.
for(;;) {
__bit t;
//EA=0;
t=(timer==0);
//EA=1;
if(t) break;
}
translate to
00104$:
; main.c:8: t=(timer==0);
mov a,_timer
orl a,(_timer + 1)
cjne a,#0x01,00114$
00114$:
; main.c:10: if(t) break;
mov _main_t_30000_4,c
jnc 00104$
Why isn't jnz
used?
sdcc -v
Sub-optimal code generation is not a bug. File this as a feature request next time, please.
Further, I cannot reproduce this with version 4.4.2 #14916