From: SourceForge.net <no...@so...> - 2003-09-17 00:28:40
|
Bugs item #669713, was opened at 2003-01-17 07:00 Message generated for change (Settings changed) made by epetrich You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=669713&group_id=599 Category: z80 port >Group: fixed >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Erik Petrich (epetrich) Summary: array index error Initial Comment: bugs in the snapshot-versions ( tested with versions: sdcc-snapshot-i586-mingw32msvc-20020823.zip sdcc-snapshot-i586-mingw32msvc-20021229.zip sdcc-snapshot-i586-mingw32msvc-20030110.zip ) 1. c-source: UCHAR DecodeBuffer[maxstore+1]; //first char is counter ... void COMDECO_1(UCHAR c){ DecodeBuffer[++DecodeBuffer[0]]= ((c>'9') ? (c-'7') & 0x5F :c-0x30)<<4; } 2. wrong generated code with snapshot versions: problem: ++DecodeBuffer[0] ; --------------------------------- ; Function COMDECO_1 ; --------------------------------- _COMDECO_1_start:: _COMDECO_1: push ix ld ix,#0 add ix,sp ; celdeco.c 135 ; genPointerGet ld hl,#_DecodeBuffer <--- ld l,(hl) <--- error ; genPlus ; genPlusIncr ld c,l inc c ; genAssign (pointer) ld (hl),c <--- hl destroyed !!! ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld a,#<_DecodeBuffer add a,c ld c,a ld a,#>_DecodeBuffer adc a,#0x00 ld b,a ; genCmpGt ; AOP_STK for ... 3. generated code with version 2.3.0 from 29.sept.2001 location ++DecodeBuffer[0] ; --------------------------------- ; Function COMDECO_1 ; --------------------------------- ___COMDECO_1_start: _COMDECO_1: push ix ld ix,#0 add ix,sp ; celdeco.c 135 ; genPointerGet ld hl,#_DecodeBuffer ld c,(hl) <--- o.k ; genPlus ; genPlusIncr inc c ; genAssign (pointer) ld (hl),c <--- hl o.k ; genPlus ; Can't optimise plus by inc, falling back to the normal way ld a,#<_DecodeBuffer add a,c ld c,a ld a,#>_DecodeBuffer adc a,#0x00 ld b,a ; genCmpGt 4. the last version 2.3.0 works well at this place, but have other problems e.g. all kinds of 8-bit-comparison with "sbc xx"-instructions instead of "sub xx" mailto:tbr...@da... ---------------------------------------------------------------------- >Comment By: Erik Petrich (epetrich) Date: 2003-09-16 19:28 Message: Logged In: YES user_id=635249 Recently fixed in src/z80/gen.c 1.117 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=669713&group_id=599 |