This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: alignment: store_one_arg vs emit_push_insn
- From: DJ Delorie <dj at redhat dot com>
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 12 May 2003 20:10:07 -0400
- Subject: Re: alignment: store_one_arg vs emit_push_insn
- References: <10305122314.AA10029@vlsi1.ultra.nyu.edu>
I'm testing this patch now. emit_push_insn needs to avoid the
push-rounding case for misaligned data.
Index: expr.c
===================================================================
RCS file: /cvs/uberbaum/gcc/expr.c,v
retrieving revision 1.538
diff -p -2 -r1.538 expr.c
*** expr.c 9 May 2003 06:37:18 -0000 1.538
--- expr.c 13 May 2003 00:09:19 -0000
*************** convert_modes (mode, oldmode, x, unsigne
*** 1464,1468 ****
used to push FROM to the stack.
! ALIGN is maximum alignment we can assume. */
void
--- 1464,1468 ----
used to push FROM to the stack.
! ALIGN is maximum stack alignment we can assume. */
void
*************** move_by_pieces (to, from, len, align)
*** 1478,1481 ****
--- 1478,1483 ----
enum insn_code icode;
+ align = MIN (to ? MEM_ALIGN (to) : align, MEM_ALIGN (from));
+
data.offset = 0;
data.from_addr = from_addr;
*************** emit_push_insn (x, mode, type, size, ali
*** 3850,3853 ****
--- 3852,3856 ----
&& 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