Hallo
I am quite sure to have a problem with a specific loop where an array is filled with the loops variable value. The array is found to be filled backwards with the decending instead of accending value and also writes are made over the end of the array.

Please accept the following description which I posted a couple of days ago in the yahoo gnu-m68hc11 group. I checked to see whether this case has maybe already reported but didn't see anything obvious - please accept appologies if already reported / fixed.

Regards

Mark Butcher
-unavailable-

////////////////////////////////////////////////////////

Hi All

I wonder whether I have found a bug in the compiler?

The compiler version is:
Thread model: single
gcc version 3.3.4-m68hc1x-20040829

The result which I obtain is that the array spi_test1[] is
initialised but not as expected. I expect it to be initialised as
follows:
spi_test1[0] = 0;
spi_test1[1] = 1;
spi_test1[2] = 2;
...
spi_test1[255] = 255;

The results which I get is

spi_test1[0] = 0; // I think this was not set as it was 0 by default
spi_test1[1] = 255;
spi_test1[2] = 254;
...
spi_test1[255] = 1;
spi_test1[256] = 0; // !! 256 doesn't exit so a write is made after
end of buffer

That is BACKWARDS...As can be seen it actually also overwrites data
after the end of the array....