I get your point. A bit suprising though. Do you consider it a bug?
/Kjeld
-----Original Message-----
From: owner-linux-mips@oss.sgi.com
[mailto:owner-linux-mips@oss.sgi.com]On Behalf Of H . J . Lu
Sent: 13. september 2001 23:15
To: Kjeld Borch Egevang
Cc: linux-mips@oss.sgi.com
Subject: Re: Error in gcc version 2.96 20000731
On Thu, Sep 13, 2001 at 11:09:04PM +0200, Kjeld Borch Egevang wrote:
> Perhaps I don't get you point, but I get the same with:
>
> int main()
> {
> rtx rt;
>
> put_code(&rt, (short)5);
> printf("gen_rtx, code=%d\n", (int)rt.code);
> }
>
That is not what I meant. You have
typedef struct rtx_def
{
short code;
int dummy;
} rtx;
The first field of rtx_def is short.
for (; length >= 0; length--)
((int *) rt)[length] = 0;
But you access it as int. If you do
for (; length >= 0; length--)
((short *) rt)[length] = 0;
It will be ok.
H.J.
|