From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29650 invoked by alias); 21 Apr 2004 17:54: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 29461 invoked from network); 21 Apr 2004 17:54:22 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 21 Apr 2004 17:54:22 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3LHsLFg020795 for ; Wed, 21 Apr 2004 13:54:21 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3LHsLp32517; Wed, 21 Apr 2004 13:54:21 -0400 Received: from localhost.localdomain (vpn50-20.rdu.redhat.com [172.16.50.20]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i3LHsKK6008743; Wed, 21 Apr 2004 13:54:21 -0400 Received: from saguaro (saguaro.lan [192.168.64.2]) by localhost.localdomain (8.12.10/8.12.10) with SMTP id i3LHsFOR018497; Wed, 21 Apr 2004 10:54:15 -0700 Date: Wed, 21 Apr 2004 17:54:00 -0000 From: Kevin Buettner To: Jerome Guitton Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] powerpc - extract a float return value Message-Id: <20040421105415.12577df1@saguaro> In-Reply-To: <20040420180348.GA23715@act-europe.fr> References: <20040420180348.GA23715@act-europe.fr> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-04/txt/msg00496.txt.bz2 On Tue, 20 Apr 2004 20:03:48 +0200 Jerome Guitton wrote: > The way GDB extracts float return values in rs6000-tdep.c > (rs6000_extract_return_value) seems dubious to me: > > [...] > memcpy (&dd, ®buf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8); > ff = (float) dd; > memcpy (valbuf, &ff, sizeof (float)); > [...] > > The cast will not work properly if the target and the host have not a similar > float representation. I agree. > I propose to fix that by a call to convert_typed_floating. See patch in > attachment. This looks right to me. The rs6000 return value code will need to be revamped to not refer to DEPRECATED_REGISTER_BYTE. And, in fact, it probably ought to be restructured to use the mechanisms found in ppc-linux.c. See ppc_linux_return_value() and ppc_sysv_abi_return_value(). This is not a barrier to getting your current patch in; I only mention it in case you wish to tackle this bit of work too. > I have not yet tested it against the testsuite, I will do that > tomorrow. In the meantime, if you have comments I would be happy to > address them! Please let me know the results of your tests. If they look good, please commit your patch. Thanks! Kevin