a problem about type checking
qinfeng.zhang@philips.com
qinfeng.zhang@philips.com
Wed Jun 4 11:00:00 GMT 2003
In test case 960416-1.c (See attached file: 960416-1.c),
I have ported GCC to TriMedia chip , and the compiler can deal with most test case.( above 95%), but when compiling 960416-1.c, there are errors before
converting Tree code into RTL.
typedef unsigned long int st;
typedef unsigned long long dt;
typedef union
{
dt d;
struct
{
st h, l;
}
s;
} t_be;
............
main ()
{
t_be x;
x.s.h = 0x10000000U;
x.s.l = 0xe0000000U;
if (x.d == 0x10000000e0000000ULL
&& f_be ((t_be) 0x100000000ULL, (t_be) 0x100000000ULL) != -1) //the parameters passing to f_be are union type , so errors are arise when compiling;
abort (); //
if (x.d == 0xe000000010000000ULL
&& f_le ((t_le) 0x100000000ULL, (t_le) 0x100000000ULL) != -1)
abort ();
exit (0);
}
here, t_be is a union data structure, so when passing the parameters, compiler don't know which element should be matched. So there is errors when checking
type. type checking should be machine-independent, then the error is odd. Should anyone drop me a line ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 960416-1.c
Type: application/octet-stream
Size: 1082 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030604/43c9df7f/attachment.obj>
More information about the Gcc
mailing list