sh.c (sh_gimplify_va_arg_expr): Don't call targetm.calls.must_pass_in_stack for void...
authorKaz Kojima <kkojima@gcc.gnu.org>
Tue, 26 Apr 2011 22:25:59 +0000 (22:25 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Tue, 26 Apr 2011 22:25:59 +0000 (22:25 +0000)
* config/sh/sh.c (sh_gimplify_va_arg_expr): Don't call
targetm.calls.must_pass_in_stack for void type.

From-SVN: r172991

gcc/ChangeLog
gcc/config/sh/sh.c

index 1b1f4d26f7292329dd2c2938bbbb3f9e1ab46c59..6714b1f5db0661bc28517f0f8cfd5d3a315b50fa 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-26  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/48767
+       * config/sh/sh.c (sh_gimplify_va_arg_expr): Don't call
+       targetm.calls.must_pass_in_stack for void type.
+
 2011-04-26  Jan Hubicka  <jh@suse.cz>
 
        * cgraphbuild.c (build_cgraph_edges): Update call
index c84c510eba308f9116b09ab7dc6fcf7a471251eb..6d0e2131392262d2c64856cbddfc0e47bbeeb9b9 100644 (file)
@@ -8062,9 +8062,14 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
   HOST_WIDE_INT size, rsize;
   tree tmp, pptr_type_node;
   tree addr, lab_over = NULL, result = NULL;
-  int pass_by_ref = targetm.calls.must_pass_in_stack (TYPE_MODE (type), type);
+  bool pass_by_ref;
   tree eff_type;
 
+  if (!VOID_TYPE_P (type))
+    pass_by_ref = targetm.calls.must_pass_in_stack (TYPE_MODE (type), type);
+  else
+    pass_by_ref = false;
+
   if (pass_by_ref)
     type = build_pointer_type (type);