From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22694 invoked by alias); 2 Feb 2008 00:27:13 -0000 Received: (qmail 22645 invoked by uid 22791); 2 Feb 2008 00:27:13 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 02 Feb 2008 00:26:55 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1) with ESMTP id m1208mat010183; Sat, 2 Feb 2008 01:08:48 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.1/8.14.1/Submit) id m1208k7N002182; Sat, 2 Feb 2008 01:08:47 +0100 (CET) Date: Sat, 02 Feb 2008 00:27:00 -0000 Message-Id: <200802020008.m1208k7N002182@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: brobecker@adacore.com CC: bauerman@br.ibm.com, luisgpm@linux.vnet.ibm.com, drow@false.org, gdb-patches@sourceware.org In-reply-to: <20080201223839.GA27578@adacore.com> (message from Joel Brobecker on Fri, 1 Feb 2008 14:38:39 -0800) Subject: Re: [RFC] Linux-specific ppc32 ABI References: <1199991624.3343.19.camel@gargoyle> <20080111060629.GC12954@adacore.com> <1200066920.26270.9.camel@gargoyle> <20080111155733.GA3240@caradoc.them.org> <1200086736.26270.35.camel@gargoyle> <1201277155.11950.134.camel@localhost.localdomain> <200801261535.m0QFZddH026156@brahms.sibelius.xs4all.nl> <20080201223839.GA27578@adacore.com> 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 X-SW-Source: 2008-02/txt/msg00040.txt.bz2 > Date: Fri, 1 Feb 2008 14:38:39 -0800 > From: Joel Brobecker > > Hi Mark, > > > How about the attached diff? > > Sounds like everyone is happy with the patch you suggested. Thiago > just mentioned one nit in your comments (repeated below). Can the patch > be checked in? We'd like to have it for the release. > I tweaked the comment a bit more. See below what I comitted. Thiago/Luis, can you commit the testsuite change? Index: ChangeLog from Mark Kettenis Luis Machado Thiago Jung Bauermann * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Pass floats that don't fit into registerson the stack the way GCC does. Index: ppc-sysv-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ppc-sysv-tdep.c,v retrieving revision 1.47 diff -u -p -r1.47 ppc-sysv-tdep.c --- ppc-sysv-tdep.c 1 Feb 2008 15:04:18 -0000 1.47 +++ ppc-sysv-tdep.c 2 Feb 2008 00:07:14 -0000 @@ -129,17 +129,21 @@ ppc_sysv_abi_push_dummy_call (struct gdb } else { - /* SysV ABI converts floats to doubles before - writing them to an 8 byte aligned stack location. */ - argoffset = align_up (argoffset, 8); + /* The SysV ABI tells us to convert floats to + doubles before writing them to an 8 byte aligned + stack location. Unfortunately GCC does not do + that, and stores floats into 4 byte aligned + locations without converting them to doubles. + Since there is no know compiler that actually + follows the ABI here, we implement the GCC + convention. */ + + /* Align to 4 bytes or 8 bytes depending on the type of + the argument (float or double). */ + argoffset = align_up (argoffset, len); if (write_pass) - { - char memval[8]; - convert_typed_floating (val, type, memval, - builtin_type_ieee_double); write_memory (sp + argoffset, val, len); - } - argoffset += 8; + argoffset += len; } } else if (TYPE_CODE (type) == TYPE_CODE_FLT