This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: alignment: store_one_arg vs emit_push_insn


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]