Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: brobecker@adacore.com
Cc: bauerman@br.ibm.com, luisgpm@linux.vnet.ibm.com, drow@false.org,
	        gdb-patches@sourceware.org
Subject: Re: [RFC] Linux-specific ppc32 ABI
Date: Sat, 02 Feb 2008 00:27:00 -0000	[thread overview]
Message-ID: <200802020008.m1208k7N002182@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <20080201223839.GA27578@adacore.com> (message from Joel Brobecker 	on Fri, 1 Feb 2008 14:38:39 -0800)

> Date: Fri, 1 Feb 2008 14:38:39 -0800
> From: Joel Brobecker <brobecker@adacore.com>
> 
> 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  <kettenis@gnu.org>
	Luis Machado  <luisgpm@br.ibm.com>
	Thiago Jung Bauermann  <bauerman@br.ibm.com>	

	* 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


  reply	other threads:[~2008-02-02  0:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 19:00 Luis Machado
2008-01-10 19:13 ` Daniel Jacobowitz
2008-01-10 19:26   ` Thiago Jung Bauermann
2008-01-11  6:06 ` Joel Brobecker
2008-01-11 15:55   ` Luis Machado
2008-01-11 15:58     ` Daniel Jacobowitz
2008-01-11 21:26       ` Luis Machado
2008-01-25 16:13         ` Thiago Jung Bauermann
2008-01-25 16:51           ` Thiago Jung Bauermann
2008-01-26 18:18           ` Mark Kettenis
2008-01-26 19:08             ` Joseph S. Myers
2008-01-26 19:10               ` Mark Kettenis
2008-01-28 20:32             ` Thiago Jung Bauermann
2008-02-01 21:42             ` Thiago Jung Bauermann
2008-02-01 22:39             ` Joel Brobecker
2008-02-02  0:27               ` Mark Kettenis [this message]
2008-02-06  3:57                 ` Thiago Jung Bauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200802020008.m1208k7N002182@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=bauerman@br.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=luisgpm@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox