From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5974 invoked by alias); 7 Jul 2014 08:14:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5958 invoked by uid 89); 7 Jul 2014 08:14:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Jul 2014 08:14:36 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1X444F-0005WH-Kj from Luis_Gustavo@mentor.com ; Mon, 07 Jul 2014 01:14:31 -0700 Received: from SVR-ORW-FEM-06.mgc.mentorg.com ([147.34.97.120]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 7 Jul 2014 01:14:31 -0700 Received: from [172.30.72.37] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.2.247.3; Mon, 7 Jul 2014 01:14:28 -0700 Message-ID: <53BA56E2.6020402@codesourcery.com> Date: Mon, 07 Jul 2014 08:14:00 -0000 From: Luis Machado Reply-To: User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Mark Kettenis CC: Subject: Re: [PATCH] Fix passing/returning of complex data for PowerPC 32-bit References: <53ABB5B3.1070803@codesourcery.com> <201406271030.s5RAUDJo025356@glazunov.sibelius.xs4all.nl> <53ADBAA5.9090404@codesourcery.com> In-Reply-To: <53ADBAA5.9090404@codesourcery.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-07/txt/msg00106.txt.bz2 On 06/27/2014 07:40 PM, Luis Machado wrote: > On 06/27/2014 11:30 AM, Mark Kettenis wrote: >>> Date: Thu, 26 Jun 2014 06:54:59 +0100 >>> From: Luis Machado >>> >>> The PowerPC 32-bit unified ABI states that there are two ways of passing >>> and returning complex type data: >>> >>> - Pointer, in a register, to a memory area. >>> - Data in registers. >>> >>> The problem is that it is not clear how to detect which variation a >>> program is using. GDB currently does a bit of both. It uses the first >>> mechanism for passing parameters and uses both to return data, depending >>> on the size of the data type. It is a bit messy because GDB is not >>> handling complex types explicitly. >>> >>> Checking the gdb.base/callfuncs.exp testcase for a PowerPC 32-bit >>> target, with code built with GCC, showed a few failures related to >>> complex types. >>> >>> This patch steers GDB towards what GCC seems to generate for PowerPC >>> 32-bit and handles complex type passing/return via general registers >>> (the second option). All failures are gone. >>> >>> The problem here is if some other target/compiler is using the other >>> variation. So, for those that have a PowerPC 32-bit handy, can you >>> confirm it works reliably? I'm thinking AIX, Darwin or some other eabi >>> target. >> >> AIX uses its own inplementations (rs6000_push_dummy_call and >> rs6000_return_value). And we don't support Darwin on PowerPC. >> > > True. That should be a non issue then. > >>> Otherwise, does this look reasonable? >> >> I agree that the "System V" support code should support the >> ATR-PASS-COMPLEX-IN-GPRS ABI Attribute. This is what the Linux ABI >> uses (it is included in ATR-LINUX) which pretty much is the direct >> succssor of the System V ABI (which didn't specify anything about >> complex floating-point support). >> >> If somebody really wants to support complex numbers on an embedded >> system that uses ATR-PASS-COMPLEX-AS-STRUCT, they'll have to implement >> an osabi sniffer for it and override the appropriate methods. >> >> Code generally looks good. Some nits below. The comments are a bit >> elaborate though. I'd cut them down a bit; see my suggestion below. >> >> > > I adjusted the patch and compressed the comments according to the > suggestions. > > Thanks! > Luis It seems folks are happy with this patch (at least the interested parties), so i'll go ahead and commit this one in the following days unless i hear something back. Thanks, Luis