From: SourceForge.net <no...@so...> - 2004-05-07 15:47:50
|
Bugs item #949967, was opened at 2004-05-07 17:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=949967&group_id=599 Category: msc51(8051) target Group: None Status: Open Resolution: None Priority: 5 Submitted By: Mattias Lindblad (matli) Assigned to: Nobody/Anonymous (nobody) Summary: Problem with for-loops Initial Comment: The following code example leads to bad assembler code being generated: ///////// test.c unsigned char screen[8][7]; void main() { unsigned char i; for (i = 1; i < 7; i++) { screen[i][0]= 0xaa; } } //////// compile with "sdcc --no-peep test.c" I expect screen[1..6][0] to be filled with 0xaa. Instead, however, screen[0..5][0] will be filled, while screen[6][0] remains empty. (The index variable runs from 5 down to 0.) If the screen variable is one-dimensional, everything work as expected. I have tried this with the following sdcc version: SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08 2.4.1 (May 7 2004) (UNIX) I am using the following platform: SunOS sun73 5.8 Generic_108528-23 sun4u sparc SUNW,Sun-Blade-1000 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=949967&group_id=599 |