From: <no...@so...> - 2001-09-28 12:52:05
|
Bugs item #466029, was opened at 2001-09-28 05:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100599&aid=466029&group_id=599 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Marc Nijweide (nijweide) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect code for comparison Initial Comment: The following code: extern void f( unsigned char x ); int main( unsigned char* a ) { unsigned char *p = a + 4; unsigned char c; while ((p>a) && (*p)) { --p; c = *p - '0'; if (c>9) //INCORRECT CODE f(c); } } generates incorrect code for the comparison: ; test2.c 11 // c = *p - '0' ; genPointerGet ld a,(bc) ; genMinus ld e,a add a,#0xD0 ld e,a ; test2.c 12 // if (c>9) ; genCmpGt ld a,#0x09 sbc a,e // <<== should be SUB jp nc,00104$ Tested with RC2 and september 27 snapshot, both fail. Compiler flags -mz80 -c. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=100599&aid=466029&group_id=599 |