This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PowerPC long double stdarg breakage
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Edelsohn <dje at watson dot ibm dot com>
- Date: Thu, 20 Apr 2006 11:27:41 +0930
- Subject: PowerPC long double stdarg breakage
This patch fixes a bug in the new ppc long double support. On
powerpc-linux, a long double function arg is not passed split between
the last fpr and stack: If there is only one fpr available, the long
double is passed entirely on the stack, and all following fp args are
passed on the stack. rs6000_gimplify_va_arg needs to be taught that
all the following fp args are stack based.
I'll apply this as obvious to mainline and 4.1 after performing
regression tests.
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Consume all
fp regs if the last fp arg doesn't fit in regs.
Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c (revision 113079)
+++ gcc/config/rs6000/rs6000.c (working copy)
@@ -5960,7 +5973,7 @@ rs6000_gimplify_va_arg (tree valist, tre
t = build1 (LABEL_EXPR, void_type_node, lab_false);
append_to_statement_list (t, pre_p);
- if (n_reg > 2)
+ if ((n_reg == 2 && reg != gpr) || n_reg > 2)
{
/* Ensure that we don't find any more args in regs.
Alignment has taken care of the n_reg == 2 case. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre