summaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 18:15:20 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-05-13 18:15:20 +0000
commitb4ad0ea6f8b0de6d496a6dd304503cd7d9ceac46 (patch)
tree8f77d371215dca9f9a7b23006f61ba59789b83bf /gcc/expr.c
parentd07c9932fe3d8be3478554d156bf3bf189027339 (diff)
downloadgcc-b4ad0ea6f8b0de6d496a6dd304503cd7d9ceac46.tar.gz
* expr.c (move_by_pieces): Honor the alignment of TO and FROM.
(emit_push_insn): Don't use push when the source alignment is less than the stack's push rounding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66770 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 07d4b14e25d..9c21ac9a3a7 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -1463,7 +1463,7 @@ convert_modes (mode, oldmode, x, unsignedp)
If PUSH_ROUNDING is defined and TO is NULL, emit_single_push_insn is
used to push FROM to the stack.
- ALIGN is maximum alignment we can assume. */
+ ALIGN is maximum stack alignment we can assume. */
void
move_by_pieces (to, from, len, align)
@@ -1477,6 +1477,8 @@ move_by_pieces (to, from, len, align)
enum machine_mode mode = VOIDmode, tmode;
enum insn_code icode;
+ align = MIN (to ? MEM_ALIGN (to) : align, MEM_ALIGN (from));
+
data.offset = 0;
data.from_addr = from_addr;
if (to)
@@ -3849,6 +3851,7 @@ emit_push_insn (x, mode, type, size, align, partial, reg, extra,
&& PUSH_ARGS
&& GET_CODE (size) == CONST_INT
&& skip == 0
+ && MEM_ALIGN (xinner) >= align
&& (MOVE_BY_PIECES_P ((unsigned) INTVAL (size) - used, align))
/* Here we avoid the case of a structure whose weak alignment
forces many pushes of a small amount of data,