linux-mips
[Top] [All Lists]

Re: Error in gcc version 2.96 20000731

To: Kjeld Borch Egevang <kjelde@mips.com>
Subject: Re: Error in gcc version 2.96 20000731
From: "H . J . Lu" <hjl@lucon.org>
Date: Thu, 13 Sep 2001 14:14:54 -0700
Cc: linux-mips@oss.sgi.com
In-reply-to: <NFBBKGGKGLLGNBGCEPKIEEHDCAAA.kjelde@mips.com>; from kjelde@mips.com on Thu, Sep 13, 2001 at 11:09:04PM +0200
References: <20010913081040.A24910@lucon.org> <NFBBKGGKGLLGNBGCEPKIEEHDCAAA.kjelde@mips.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
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.

<Prev in Thread] Current Thread [Next in Thread>