This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]