From: Jan W. <we...@ef...> - 2006-12-18 02:28:29
|
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.6.1 #4478 (Nov 23 2006) (MINGW32) When compiling the following snippet for mcs51, both *px translates to mov dptr,#_x movx a,@dptr i.e. *x, which may not be true. Is this an error or just me being stupid? Jan Waclawek PS. In this short test program, I am unable to insert some code modifying px before "if", to demonstrate that the "if" is not redundant, without "spoiling the error", but I have a long-long program where this really happens. --- code snippet --- xdata unsigned char *px; xdata unsigned char x[3]; unsigned char t; void incrementpx(void) { px++; } void main(void) { px = x; if (px == x) { incrementpx(); t = *px; } else { t = *px; } } |