This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix passing double float complex arguments in sparc64
- From: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- To: gdb-patches at sourceware dot org
- Date: Tue, 15 Oct 2013 17:57:27 +0200
- Subject: [PATCH] Fix passing double float complex arguments in sparc64
- Authentication-results: sourceware.org; auth=none
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);