Commit b78cb618 by Richard Henderson Committed by Richard Henderson

re PR target/45027 (FAIL: c-c++-common/dfp/pr36800.c)

	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
parent 2e290598
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> 2010-07-22 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/45028 PR bootstrap/45028
......
...@@ -7073,7 +7073,7 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) ...@@ -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 /* FPR size of varargs save area. We don't need it if we don't pass
anything in SSE registers. */ 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; ix86_varargs_fpr_size = X86_64_SSE_REGPARM_MAX * 16;
else else
ix86_varargs_fpr_size = 0; ix86_varargs_fpr_size = 0;
...@@ -7112,12 +7112,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) ...@@ -7112,12 +7112,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
emit_jump_insn (gen_cbranchqi4 (test, XEXP (test, 0), XEXP (test, 1), emit_jump_insn (gen_cbranchqi4 (test, XEXP (test, 0), XEXP (test, 1),
label)); label));
/* If we've determined that we're only loading scalars (and not /* ??? If !TARGET_SSE_TYPELESS_STORES, would we perform better if
vector data) then we can store doubles instead. */ we used movdqa (i.e. TImode) instead? Perhaps even better would
if (crtl->stack_alignment_needed < 128) be if we could determine the real mode of the data, via a hook
smode = DFmode; into pass_stdarg. Ignore all that for now. */
else
smode = V4SFmode; 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; max = cum->sse_regno + cfun->va_list_fpr_size / 16;
if (max > X86_64_SSE_REGPARM_MAX) if (max > X86_64_SSE_REGPARM_MAX)
...@@ -7549,8 +7550,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -7549,8 +7550,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
arg_boundary = MAX_SUPPORTED_STACK_ALIGNMENT; arg_boundary = MAX_SUPPORTED_STACK_ALIGNMENT;
/* Care for on-stack alignment if needed. */ /* Care for on-stack alignment if needed. */
if (arg_boundary <= 64 if (arg_boundary <= 64 || size == 0)
|| integer_zerop (TYPE_SIZE (type)))
t = ovf; t = ovf;
else else
{ {
...@@ -7561,9 +7561,8 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -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, t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
size_int (-align)); size_int (-align));
t = fold_convert (TREE_TYPE (ovf), t); 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_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
gimplify_assign (addr, t, pre_p); gimplify_assign (addr, t, pre_p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment