From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18135 invoked by alias); 1 Aug 2002 22:47:39 -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 18103 invoked from network); 1 Aug 2002 22:47:22 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 1 Aug 2002 22:47:22 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g71MYpl08192 for ; Thu, 1 Aug 2002 18:34:51 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g71MlJu11022; Thu, 1 Aug 2002 18:47:19 -0400 Received: from romulus.sfbay.redhat.com (IDENT:3dq5qRbYryXwOOp+sZcKTFaDR/DWatJn@romulus.sfbay.redhat.com [172.16.27.251]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g71MlCm08646; Thu, 1 Aug 2002 15:47:12 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g71MlAS30369; Thu, 1 Aug 2002 15:47:10 -0700 Date: Thu, 01 Aug 2002 15:47:00 -0000 From: Kevin Buettner Message-Id: <1020801224710.ZM30368@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit" (Aug 1, 6:27pm) References: <1020731210452.ZM23445@localhost.localdomain> <3D486843.8007D610@redhat.com> <1020731232203.ZM24308@localhost.localdomain> <3D4870EB.BB9C282A@redhat.com> <1020801011054.ZM24816@localhost.localdomain> <3D49AE69.3040708@ges.redhat.com> <1020801221807.ZM30183@localhost.localdomain> <3D49B5B7.1080900@ges.redhat.com> To: Andrew Cagney , Kevin Buettner Subject: Re: [RFA] mips_push_arguments(): Make O64 ABI test explicit Cc: Michael Snyder , gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00035.txt.bz2 On Aug 1, 6:27pm, Andrew Cagney wrote: > > That being the case, more than just the comment > > will need to change. (IMO, of course.) > > In what way? GDB was trying to implement things according to the ABI > (unless someone snuck in a change or the code suffered bit rot). The short answer: I've probably managed to bit rot it with one of my other (as of yet unapplied) patches since it changes MIPS_SAVED_REGSIZE for the N32 ABI. Even if it weren't for this "bit rot", I'd still need to change the code to accomodate the N64 ABI. Long answer: Let's look at the condition again... if (!MIPS_EABI && MIPS_SAVED_REGSIZE < 8 && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && partial_len < MIPS_SAVED_REGSIZE && (typecode == TYPE_CODE_STRUCT || ... The part that bothers me in the above is ``MIPS_SAVED_REGSIZE < 8''. This, in conjunction with !MIPS_EABI, is supposed to specify some set of ABI's that the shifting operations needs to be performed on when the other conditions hold. The problem is that one of my other patches changes MIPS_SAVED_REGSIZE for N32. We can discuss whether my other patch is correct or not elsewhere. The point is that we shouldn't be using the value of MIPS_SAVED_REGSIZE to be an indicator of the ABI which is in use. In my opinion, it would be better for us to explicitly list the ABI's affected. That way someone reading the code doesn't need to deduce the affected ABIs or scratch their heads over whether the prefatory comment is correct or not. I.e, maybe something like this: if ( (tdep->mips_abi == MIPS_ABI_O32 || tdep->mips_abi == MIPS_ABI_N32 || tdep->mips_abi == MIPS_ABI_N64) && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && partial_len < MIPS_SAVED_REGSIZE && (typecode == TYPE_CODE_STRUCT || ... > As DanielJ mentioned, GCC should be fixed. I agree with this.