From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19465 invoked by alias); 9 Jun 2006 18:16:55 -0000 Received: (qmail 19453 invoked by uid 22791); 9 Jun 2006 18:16:54 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 09 Jun 2006 18:16:52 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id 2464048CCC0; Fri, 9 Jun 2006 14:16:50 -0400 (EDT) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13499-01-2; Fri, 9 Jun 2006 14:16:49 -0400 (EDT) Received: from takamaka.act-europe.fr (s142-179-108-108.bc.hsia.telus.net [142.179.108.108]) by nile.gnat.com (Postfix) with ESMTP id 96E4848CBAF; Fri, 9 Jun 2006 14:16:49 -0400 (EDT) Received: by takamaka.act-europe.fr (Postfix, from userid 507) id C7D2B47E7F; Fri, 9 Jun 2006 11:16:48 -0700 (PDT) Date: Fri, 09 Jun 2006 18:16:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: GDB Patches , Fred Fish Subject: Re: [RFA] mips eabi, passing corner-case structs Message-ID: <20060609181648.GB860@adacore.com> References: <447E2AEB.504@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <447E2AEB.504@redhat.com> User-Agent: Mutt/1.4i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00101.txt.bz2 > That odd little corner case in eabi, wherein structs whose > single field is a float or double are passed like a float or double. > > 2006-05-31 Michael Snyder > > * mips-tdep.c (mips_eabi_push_dummy_call): Catch corner case, > structs with a single field of floating point type. I have been trying to convince myself that it's ok to not verify that the unique field inside the struct is not a float. It looks OK to me, but do you confirm as well? The patch seems OK to me, but could you merge the two comments instead of adding one right after the current one. Also, there is a missing "s" in "unless". The indenting seems a bit odd in the diff, but I imagine this is because of tabulations (when are we going to get rid of these horros...). Thanks, > Index: mips-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/mips-tdep.c,v > retrieving revision 1.393 > diff -p -r1.393 mips-tdep.c > *** mips-tdep.c 31 May 2006 23:15:50 -0000 1.393 > --- mips-tdep.c 31 May 2006 23:44:31 -0000 > *************** mips_eabi_push_dummy_call (struct gdbarc > *** 2453,2460 **** > > /* The EABI passes structures that do not fit in a register by > reference. */ > ! if (len > mips_abi_regsize (gdbarch) > ! && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) > { > store_unsigned_integer (valbuf, mips_abi_regsize (gdbarch), > VALUE_ADDRESS (arg)); > --- 2453,2467 ---- > > /* The EABI passes structures that do not fit in a register by > reference. */ > ! /* MVS: unles the struct has only one field, and that field > ! will fit into two registers. */ > ! if ((typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION) > ! && TYPE_NFIELDS (arg_type) == 1 > ! && len == 2 * mips_abi_regsize (gdbarch)) > ! val = value_contents (arg); > ! else if (len > mips_abi_regsize (gdbarch) > ! && (typecode == TYPE_CODE_STRUCT > ! || typecode == TYPE_CODE_UNION)) > { > store_unsigned_integer (valbuf, mips_abi_regsize (gdbarch), > VALUE_ADDRESS (arg)); -- Joel