aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/mep
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2009-07-27 16:31:04 -0400
committerDJ Delorie <dj@gcc.gnu.org>2009-07-27 16:31:04 -0400
commit683a1be69a5bd28ff71030b666975c2f185037ee (patch)
tree4b7f4b48e7940765fa39709396ab0ec6b794e744 /gcc/config/mep
parenta348618dae884974ebfbf4ddb746100fed4dba6b (diff)
downloadgcc-683a1be69a5bd28ff71030b666975c2f185037ee.zip
gcc-683a1be69a5bd28ff71030b666975c2f185037ee.tar.gz
gcc-683a1be69a5bd28ff71030b666975c2f185037ee.tar.bz2
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
Diffstat (limited to 'gcc/config/mep')
-rw-r--r--gcc/config/mep/mep.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index a5869ca..e237c47 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -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);