Topic : Problem with arrays and Ride7

Forum : 8051

Original Post
Post Information Post
March 9, 2011 - 1:49pm
Guest

I changed from ride6 to ride7 last month.

Ride6 c-compiler version: 3.03.3
Ride7 c-compiler version: 3.08.10.309

now I have a problem with Ride 7:

My software with the ride6 c-compiler works correct!
If I compile the same c-code with the new ride7-compiler the following function is not correct addressing my array.
It's a nestet call of 2 arrays. If I seperate the two array calls with extra variable it works.

Is there a bug with nested calls in the Ride7 version?

Here are my code examples (glei is a global variable),
the arrays are stored as const char in code memory:

This ist working with Ride6 and not with Ride7:

void makeinfotxt(char z)

{
glei=nrseg[Seg7txt[z][3]];
}

This ist working with Ride7:

void makeinfotxt(char z)

{ char a;

a=Seg7txt[z][3];
glei=nrseg[a];
}

Replies
Post Information Post
+1
0
-1
March 10, 2011 - 11:55am
Raisonance Support Team

Hello,

We weren't able to reproduce this issue in our lab.
Can you provide us more information such as variable types, memory model, ...
The best will be a Ride7 project showing the trouble.

Stéphane

+1
0
-1
March 10, 2011 - 12:37pm
Guest

O.K. here are my complete routine with the const arrays declarations
(It is a 7seg-decoder for a 4-digits display)

the disfunctionating code is in /*... */

void makeinfotxt(char z)

{ char a, e, c , d;
/*
glta=nrseg[Seg7txt[z][0]];
glhu=nrseg[Seg7txt[z][1]];
glze=nrseg[Seg7txt[z][2]];
glei=nrseg[Seg7txt[z][3]];
*/

a=Seg7txt[z][0];
e=Seg7txt[z][1];
c=Seg7txt[z][2];
d=Seg7txt[z][3];

glta=nrseg[a];
glhu=nrseg[e];
glze=nrseg[c];
glei=nrseg[d];

}

const char code nrseg[36]=
{
/*0*/ 136, /*1*/ 187, /*2*/ 148, /*3*/ 146,
/*4*/ 163, /*5*/ 194, /*6*/ 192, /*7*/ 155,
/*8*/ 128, /*9*/ 130, /*A*/ 129, /*b*/ 224,
/*C*/ 204, /*d*/ 176, /*E*/ 196, /*F*/ 197,
/*H*/ 161, /*J*/ 184, /*L*/ 236, /*n*/ 241,
/*o*/ 240, /*P*/ 133, /*r*/ 245, /*t*/ 228,
/*u*/ 248, /*y*/ 162, /*¾*/ 29, /*c*/ 244,
/*^*/ 143, /*U*/ 168, /*-*/ 247, /* */ 255,
/*c*/ 244, /*i*/ 251, /*h*/ 225, /* */ 168

};

const char code Seg7txt[27][4]=
{// t h z e
31, 31, 31, 31, //Clear
23, 24, 22, 11, //turb
5, 14, 19, 5, //SEnS
12, 31, 20, 19, //C on
12, 20, 15, 15, //Coff
12, 20, 21, 5, //CoPS
31, 22, 14, 18, // rEL
31, 20, 24, 23, // out
33, 19, 21, 23, //InPt
24, 24, 24, 24, //uuuu
28, 28, 28, 28, //^^^^
14, 14, 14, 14, //EEEE
31, 5, 24, 19, // Sun
31, 12, 10, 18, // CAL
29, 21, 13, 23, //UPdt
5, 21, 14, 22, //SPEC
13, 15, 18, 23, //dFLt
2, 0, 0, 0, //2000
31, 1, 0, 0, // 100
11, 20, 20, 23, // boot
14, 22, 22, 22, //Errr
33, 19, 15, 20, //inFo
13, 33, 22, 23, //dirt
19, 20, 5, 13, //noSd
31, 1, 12, 14, // ICE
15, 33, 18, 23, //FiLt
30, 21, 12, 30 //-PC-
};

+1
0
-1
March 10, 2011 - 5:59pm
Raisonance Support Team

Thanx for your clean bug report.

The issue is fixed. It was in the optimisation pass. Setting optimisation level to 6 is a workaround.

The fix will be available in the next release.

Stéphane