alignment: store_one_arg vs emit_push_insn
DJ Delorie
dj@redhat.com
Tue May 13 02:07:00 GMT 2003
Ok, this one has no regressions. Ok to apply?
2003-05-12 DJ Delorie <dj@redhat.com>
* 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.
> 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
>
More information about the Gcc-patches
mailing list