Change the type of variable j of unsigned char to unsigned int solve the problem of this code. But the bug in sdcc remains!