[sh2a] fix varargs

DJ Delorie dj@redhat.com
Mon Aug 27 20:54:00 GMT 2007


Hopefully obvious, tested with no regressions.  OK?

2007-08-27  DJ Delorie  <dj@redhat.com>

	* config/sh/sh.c (sh_gimplify_va_arg_expr): Fix sh2a support.

Index: config/sh/sh.c
===================================================================
--- config/sh/sh.c	(revision 127838)
+++ config/sh/sh.c	(working copy)
@@ -7198,13 +7198,13 @@ sh_gimplify_va_arg_expr (tree valist, tr
 			  || (TYPE_ALIGN (eff_type)
 			      > GET_MODE_BITSIZE (TYPE_MODE (field_type))));
 	      break;
 	    }
 	}
 
-      if (TARGET_SH4)
+      if (TARGET_SH4 || TARGET_SH2A)
 	{
 	  pass_as_float = ((TREE_CODE (eff_type) == REAL_TYPE && size <= 8)
 			   || (TREE_CODE (eff_type) == COMPLEX_TYPE
 			       && TREE_CODE (TREE_TYPE (eff_type)) == REAL_TYPE
 			       && size <= 16));
 	}
@@ -7310,13 +7310,13 @@ sh_gimplify_va_arg_expr (tree valist, tr
 	  tmp = build1 (GOTO_EXPR, void_type_node, lab_over);
 	  gimplify_and_add (tmp, pre_p);
 
 	  tmp = build1 (LABEL_EXPR, void_type_node, lab_false);
 	  gimplify_and_add (tmp, pre_p);
 
-	  if (size > 4 && ! TARGET_SH4)
+	  if (size > 4 && ! (TARGET_SH4 || TARGET_SH2A))
 	    {
 	      tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node,
 		  	    next_o, next_o_limit);
 	      gimplify_and_add (tmp, pre_p);
 	    }
 



More information about the Gcc-patches mailing list