User`s guide
System LSI Division, Semiconductor Business
Fixed: In the expression that a variable which has the long type is masked with the value
‘0xffff’ its result takes incorrectly the value of higher word instead of lower word
only when the corresponding temporary register has been spilled due to the absence
of allocable register. It occurs only over the optimization level 1.
Ex>
#include <stdio.h>
typedef struct {
char c;
int * pi;
} SS;
static SS ssArr = {1, (int *)0x81100};
static SS *ss = &ssArr;
static void func(unsigned int i, unsigned int j)
{
if (j != 0x1100) printf("fail\n");
}
static unsigned long gl1 = 1; gl2 = 2; gl3 = 3; gl4 = 4; gl5 = 5; gl6 = 6; gl7 = 7;
static unsigned long l1;
static void spill(void)
{
unsigned long l1=gl1,l2=gl2,l3=gl3,l4=gl4,l5=gl5,l6=gl6,l7=gl7;
unsigned int i = l1;
//The lower word of ‘(unsigned long)ss->pi’ should be passed as parameter.
func(0x2200 +((unsigned long)ss->pi>>16), (unsigned int)((unsigned long)ss->pi &
0xffff));
l2++;l3++;l4++;l5++;l6++;l7++;
}
void main(void)
{
spill();
}
10 Property of Samsung Electronics Co., Ltd.