mep.c (mep_expand_builtin_saveregs): Make sure 64-bit types are dword-aligned.

* config/mep/mep.c (mep_expand_builtin_saveregs): Make sure 64-bit
types are dword-aligned.
(mep_expand_va_start): Likewise.

From-SVN: r150136
This commit is contained in:
DJ Delorie 2009-07-27 16:31:04 -04:00 committed by DJ Delorie
parent a348618dae
commit 683a1be69a
2 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2009-07-27 DJ Delorie <dj@redhat.com>
* config/mep/mep.c (mep_expand_builtin_saveregs): Make sure 64-bit
types are dword-aligned.
(mep_expand_va_start): Likewise.
2009-07-27 Olivier Hainque <hainque@adacore.com>
Douglas B Rupp <rupp@gnat.com>

View File

@ -3530,15 +3530,23 @@ mep_expand_builtin_saveregs (void)
rtx regbuf;
ns = cfun->machine->arg_regs_to_save;
bufsize = ns * (TARGET_IVC2 ? 12 : 4);
regbuf = assign_stack_local (SImode, bufsize, 32);
if (TARGET_IVC2)
{
bufsize = 8 * ((ns + 1) / 2) + 8 * ns;
regbuf = assign_stack_local (SImode, bufsize, 64);
}
else
{
bufsize = ns * 4;
regbuf = assign_stack_local (SImode, bufsize, 32);
}
move_block_from_reg (5-ns, regbuf, ns);
if (TARGET_IVC2)
{
rtx tmp = gen_rtx_MEM (DImode, XEXP (regbuf, 0));
int ofs = 4 * ns;
int ofs = 8 * ((ns+1)/2);
for (i=0; i<ns; i++)
{
@ -3627,7 +3635,9 @@ mep_expand_va_start (tree valist, rtx nextarg)
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* va_list.next_cop = va_list.next_gp_limit; */
u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
size_int (8 * ((ns+1)/2)));
/* va_list.next_cop = ROUND_UP(va_list.next_gp_limit,8); */
t = build2 (MODIFY_EXPR, ptr_type_node, next_cop, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);