From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15562 invoked by alias); 20 Apr 2004 13:12:25 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15551 invoked from network); 20 Apr 2004 13:12:23 -0000 Received: from unknown (HELO jurand.ds.pg.gda.pl) (153.19.208.2) by sources.redhat.com with SMTP; 20 Apr 2004 13:12:23 -0000 Received: by jurand.ds.pg.gda.pl (Postfix, from userid 1011) id D91F84AEE7; Tue, 20 Apr 2004 15:12:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by jurand.ds.pg.gda.pl (Postfix) with ESMTP id C7BB24AD95; Tue, 20 Apr 2004 15:12:21 +0200 (CEST) Date: Tue, 20 Apr 2004 13:12:00 -0000 From: "Maciej W. Rozycki" To: cgd@broadcom.com Cc: gdb-patches@sources.redhat.com Subject: Re: 6.1: Fix gcc 3.5.0 failure in sim In-Reply-To: Message-ID: References: Organization: Technical University of Gdansk MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-04/txt/msg00460.txt.bz2 On Mon, 19 Apr 2004 cgd@broadcom.com wrote: > > Building sim for mipsel-linux fails with gcc 3.5.0 with an "invalid > > lvalue in assignment" error. Here's a fix. > > Did you test the simulator in any way, once you'd made this change? No I didn't. Actually, I've never used the simulator at all. > (I wouldn't expect a difference, but it's important to know what you > tested, if anything.) Well, while in the silicon the BadVAddr register has the same width as general purpose ones, decode_coproc() appears to decode dmfc0/dmtc0 as 32-bit, so perhaps the following change is needed as well (the code looks messy, grrr). Here's an updated patch. This wasn't tested either. ;-) 2004-04-20 Maciej W. Rozycki * mips/interp.c (decode_coproc): Sign-extend the address retrieved from COP0_BADVADDR. * mips/sim-main.h (COP0_BADVADDR): Remove a cast. Please apply. Maciej -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro@ds2.pg.gda.pl, PGP key available + gdb-6.1-sim-gcc3.patch diff -up --recursive --new-file gdb-6.1.macro/sim/mips/interp.c gdb-6.1/sim/mips/interp.c --- gdb-6.1.macro/sim/mips/interp.c 2003-02-27 23:26:34.000000000 +0000 +++ gdb-6.1/sim/mips/interp.c 2004-04-20 13:03:50.000000000 +0000 @@ -2102,7 +2102,7 @@ decode_coproc (SIM_DESC sd, case 8: /* 8 = BadVAddr R4000 VR4100 VR4300 */ if (code == 0x00) - GPR[rt] = COP0_BADVADDR; + GPR[rt] = (signed_word) (signed_address) COP0_BADVADDR; else COP0_BADVADDR = GPR[rt]; break; diff -up --recursive --new-file gdb-6.1.macro/sim/mips/sim-main.h gdb-6.1/sim/mips/sim-main.h --- gdb-6.1.macro/sim/mips/sim-main.h 2003-01-05 07:56:59.000000000 +0000 +++ gdb-6.1/sim/mips/sim-main.h 2004-04-20 13:03:44.000000000 +0000 @@ -383,7 +383,7 @@ struct _sim_cpu { #define NR_COP0_GPR 32 unsigned_word cop0_gpr[NR_COP0_GPR]; #define COP0_GPR ((CPU)->cop0_gpr) -#define COP0_BADVADDR ((unsigned32)(COP0_GPR[8])) +#define COP0_BADVADDR (COP0_GPR[8]) /* While space is allocated for the floating point registers in the main registers array, they are stored separatly. This is because