Unaligned block moves and MEM_ALIGN re-broken

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Sat Jan 26 00:00:00 GMT 2002


    STRICT_ALIGNMENT must be tested dynamically when the compiler is
    running, not statically by the preprocessor.  It can be set by
    command-line options. 

Oh, right.

Even simpler then:

*** rtl.h	2002/01/22 14:33:33	1.326
--- rtl.h	2002/01/26 02:47:13
*************** do {						\
*** 927,936 ****
   : 0)
  
! /* For a MEM rtx, the alignment in bits.  */
  #define MEM_ALIGN(RTX)							\
  (MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->align				\
!  : GET_MODE (RTX) != BLKmode ? GET_MODE_ALIGNMENT (GET_MODE (RTX))	\
!  : BITS_PER_UNIT)
! 
  
  /* Copy the attributes that apply to memory locations from RHS to LHS.  */
--- 927,936 ----
   : 0)
  
! /* For a MEM rtx, the alignment in bits.  We can use the alignment of the
!    mode as a default when STRICT_ALIGNMENT, but not if not.  */
  #define MEM_ALIGN(RTX)							\
  (MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->align				\
!  : (STRICT_ALIGNMENT && GET_MODE (RTX) != BLKmode			\
!     ? GET_MODE_ALIGNMENT (GET_MODE (RTX)) : BITS_PER_UNIT))
  
  /* Copy the attributes that apply to memory locations from RHS to LHS.  */
*** emit-rtl.c	2002/01/24 12:30:37	1.243
--- emit-rtl.c	2002/01/26 02:47:16
*************** get_mem_attrs (alias, expr, offset, size
*** 293,297 ****
  	  || (mode != BLKmode && GET_MODE_SIZE (mode) == INTVAL (size)))
        && (align == BITS_PER_UNIT
! 	  || (mode != BLKmode && align == GET_MODE_ALIGNMENT (mode))))
      return 0;
  
--- 293,298 ----
  	  || (mode != BLKmode && GET_MODE_SIZE (mode) == INTVAL (size)))
        && (align == BITS_PER_UNIT
! 	  || (STRICT_ALIGNMENT
! 	      && mode != BLKmode && align == GET_MODE_ALIGNMENT (mode))))
      return 0;
  



More information about the Gcc mailing list