re PR target/45027 (FAIL: c-c++-common/dfp/pr36800.c)
authorRichard Henderson <rth@redhat.com>
Thu, 22 Jul 2010 21:40:41 +0000 (14:40 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 22 Jul 2010 21:40:41 +0000 (14:40 -0700)
PR target/45027
* config/i386/i386.c (setup_incoming_varargs_64): Force the use
of V4SFmode for the SSE saves; increase stack alignment if needed.
(ix86_gimplify_va_arg): Don't increase stack alignment here.

From-SVN: r162429

gcc/ChangeLog
gcc/config/i386/i386.c

index ac003a364e1e3c6b6406ed775e9e8e8bafc74ecf..d2576fbd246e86506a5a3f97c3cb25ea1c7c18b3 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-22  Richard Henderson  <rth@redhat.com>
+
+       PR target/45027
+       * config/i386/i386.c (setup_incoming_varargs_64): Force the use
+       of V4SFmode for the SSE saves; increase stack alignment if needed.
+       (ix86_gimplify_va_arg): Don't increase stack alignment here.
+
 2010-07-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/45028
index d9dc571dbfe48653aad5124faa9b9829aa2e25dc..596a6db22adf99a845f515342c42006eea541140 100644 (file)
@@ -7073,7 +7073,7 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
 
   /* FPR size of varargs save area.  We don't need it if we don't pass
      anything in SSE registers.  */
-  if (cum->sse_nregs && cfun->va_list_fpr_size)
+  if (TARGET_SSE && cfun->va_list_fpr_size)
     ix86_varargs_fpr_size = X86_64_SSE_REGPARM_MAX * 16;
   else
     ix86_varargs_fpr_size = 0;
@@ -7112,12 +7112,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
       emit_jump_insn (gen_cbranchqi4 (test, XEXP (test, 0), XEXP (test, 1),
                                      label));
 
-      /* If we've determined that we're only loading scalars (and not
-        vector data) then we can store doubles instead.  */
-      if (crtl->stack_alignment_needed < 128)
-       smode = DFmode;
-      else
-       smode = V4SFmode;
+      /* ??? If !TARGET_SSE_TYPELESS_STORES, would we perform better if
+        we used movdqa (i.e. TImode) instead?  Perhaps even better would
+        be if we could determine the real mode of the data, via a hook
+        into pass_stdarg.  Ignore all that for now.  */
+      smode = V4SFmode;
+      if (crtl->stack_alignment_needed < GET_MODE_ALIGNMENT (smode))
+       crtl->stack_alignment_needed = GET_MODE_ALIGNMENT (smode);
 
       max = cum->sse_regno + cfun->va_list_fpr_size / 16;
       if (max > X86_64_SSE_REGPARM_MAX)
@@ -7549,8 +7550,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
     arg_boundary = MAX_SUPPORTED_STACK_ALIGNMENT;
 
   /* Care for on-stack alignment if needed.  */
-  if (arg_boundary <= 64
-      || integer_zerop (TYPE_SIZE (type)))
+  if (arg_boundary <= 64 || size == 0)
     t = ovf;
  else
     {
@@ -7561,9 +7561,8 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
       t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
                  size_int (-align));
       t = fold_convert (TREE_TYPE (ovf), t);
-      if (crtl->stack_alignment_needed < arg_boundary)
-       crtl->stack_alignment_needed = arg_boundary;
     }
+
   gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
   gimplify_assign (addr, t, pre_p);