diff options
author | Joseph Myers <joseph@codesourcery.com> | 2007-02-09 01:11:18 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2007-02-09 01:11:18 +0000 |
commit | 46bd2beed4c78dcb32fcde4913815527c14e5e17 (patch) | |
tree | 0c7d195e64cf1a546187b71d49c8c44bdca1041f /gcc/expr.c | |
parent | 687e00ee8a88d034fb91a9eecb611b5927c5f677 (diff) | |
download | gcc-46bd2beed4c78dcb32fcde4913815527c14e5e17.tar.gz |
calls.c (store_one_arg): Pass correct alignment to emit_push_insn for non-BLKmode values.
* calls.c (store_one_arg): Pass correct alignment to
emit_push_insn for non-BLKmode values.
* expr.c (emit_push_insn): If STRICT_ALIGNMENT, copy to an
unaligned stack slot via a suitably aligned slot.
From-SVN: r121736
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index b49813ab2a9..a04e931acd0 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -3643,7 +3643,8 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, xinner = x; - if (mode == BLKmode) + if (mode == BLKmode + || (STRICT_ALIGNMENT && align < GET_MODE_ALIGNMENT (mode))) { /* Copy a block into the stack, entirely or partially. */ @@ -3655,6 +3656,20 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, offset = partial % (PARM_BOUNDARY / BITS_PER_UNIT); used = partial - offset; + if (mode != BLKmode) + { + /* A value is to be stored in an insufficiently aligned + stack slot; copy via a suitably aligned slot if + necessary. */ + size = GEN_INT (GET_MODE_SIZE (mode)); + if (!MEM_P (xinner)) + { + temp = assign_temp (type, 0, 1, 1); + emit_move_insn (temp, xinner); + xinner = temp; + } + } + gcc_assert (size); /* USED is now the # of bytes we need not copy to the stack |