Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: jose.marchesi@oracle.com (Jose E. Marchesi)
To: gdb-patches@sourceware.org
Subject: [PATCH] Fix passing double float complex arguments in sparc64
Date: Tue, 15 Oct 2013 15:55:00 -0000	[thread overview]
Message-ID: <87ob6qo7bs.fsf@oracle.com> (raw)


Hi.

Double float complex objects are not 16-byte aligned in either gcc or
solaris studio.  This patch makes gdb to not align double float complex
arguments in the dummy frame when calling a function.

This makes all the tests in gdb.base/varargs.exp to pass in
sparc64-*-linux-gnu.

2013-10-15  Jose E. Marchesi  <jose.marchesi@oracle.com>

        * sparc64-tdep.c (sparc64_store_arguments): Do not align complex
        double float arguments to 16-byte.

Index: sparc64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc64-tdep.c,v
retrieving revision 1.62
diff -u -r1.62 sparc64-tdep.c
--- sparc64-tdep.c	1 Jan 2013 06:32:51 -0000	1.62
+++ sparc64-tdep.c	15 Oct 2013 15:46:25 -0000
@@ -831,7 +831,7 @@
                  quad-aligned, and thus a hole might be introduced
                  into the parameter array to force alignment."  Skip
                  an element if necessary.  */
-	      if (num_elements % 2)
+	      if ((num_elements % 2) && sparc64_16_byte_align_p (type))
 		num_elements++;
 	    }
 	  else
@@ -913,7 +913,7 @@
 	  /* Floating arguments.  */
 	  if (len == 16)
 	    {
-	      if (element % 2)
+	      if ((element % 2) && sparc64_16_byte_align_p (type))
 		element++;
 	      if (element < 16)
 		regnum = SPARC64_Q0_REGNUM + element / 2;
@@ -961,7 +961,7 @@
 	    }
 	  else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM)
 	    {
-	      gdb_assert (element < 5);
+	      gdb_assert (element < 6);
 	      regnum = SPARC_O0_REGNUM + element;
 	      regcache_cooked_write (regcache, regnum, valbuf);
 	      regcache_cooked_write (regcache, regnum + 1, valbuf + 8);


             reply	other threads:[~2013-10-15 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15 15:55 Jose E. Marchesi [this message]
2013-10-23 19:58 ` Mark Kettenis
2013-12-10 18:46   ` Jose E. Marchesi
2013-12-11 12:29     ` Jose E. Marchesi
2013-12-11 14:09       ` Jose E. Marchesi
2014-01-23 15:01 Jose E. Marchesi
2014-02-05 19:02 ` Jose E. Marchesi
2014-02-08  2:47   ` Joel Brobecker
2014-02-10 13:22     ` Jose E. Marchesi
2014-02-11  4:45       ` Joel Brobecker
2014-02-11 12:39         ` Jose E. Marchesi

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=87ob6qo7bs.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gdb-patches@sourceware.org \
    /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