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]

Make MEM_ALIGN in bits


Even though MEMs can only be aligned at a byte boundary, we recently
converted  using bit alignment everywhere, so having this in bytes is
a step backward.

Tested only with build since values currently unused.

Sat Oct 20 07:27:14 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* emit-rtl.c (set_mem_attributes): Alignment is in bits.
	(adjust_address_1, offset_address): Likewise.

*** emit-rtl.c	2001/10/19 19:54:06	1.212
--- emit-rtl.c	2001/10/20 12:21:25
*************** set_mem_attributes (ref, t, objectp)
*** 1718,1722 ****
    /* If this is an INDIRECT_REF, we know its alignment.  */
    if (TREE_CODE (t) == INDIRECT_REF)
!     set_mem_align (ref, TYPE_ALIGN (type) / BITS_PER_UNIT);
  
    /* Now see if we can say more about whether it's an aggregate or
--- 1718,1722 ----
    /* If this is an INDIRECT_REF, we know its alignment.  */
    if (TREE_CODE (t) == INDIRECT_REF)
!     set_mem_align (ref, TYPE_ALIGN (type));
  
    /* Now see if we can say more about whether it's an aggregate or
*************** set_mem_alias_set (mem, set)
*** 1753,1757 ****
  }
  
! /* Set the alignment of MEM to ALIGN.  */
  
  void
--- 1753,1757 ----
  }
  
! /* Set the alignment of MEM to ALIGN bits.  */
  
  void
*************** adjust_address_1 (memref, mode, offset, 
*** 1867,1871 ****
       if zero.  */
    if (offset != 0)
!     memalign = MIN (memalign, offset & -offset);
  
    MEM_ATTRS (new)
--- 1867,1871 ----
       if zero.  */
    if (offset != 0)
!     memalign = MIN (memalign, (offset & -offset) * BITS_PER_UNIT);
  
    MEM_ATTRS (new)
*************** offset_address (memref, offset, pow2)
*** 1897,1901 ****
       we don't know.  */
    MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_DECL (memref),
! 				   0, 0, MIN (MEM_ALIGN (memref), pow2));
    return new;
  }
--- 1897,1902 ----
       we don't know.  */
    MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_DECL (memref),
! 				   0, 0, MIN (MEM_ALIGN (memref),
! 					      pow2 * BITS_PER_UNIT));
    return new;
  }
*** expr.h	2001/10/18 21:34:10	1.97
--- expr.h	2001/10/20 12:21:27
*************** extern rtx memory_address_noforce PARAMS
*** 613,617 ****
  extern void set_mem_alias_set PARAMS ((rtx, HOST_WIDE_INT));
  
! /* Set the alignment of MEM to ALIGN.  */
  extern void set_mem_align PARAMS ((rtx, unsigned int));
  
--- 613,617 ----
  extern void set_mem_alias_set PARAMS ((rtx, HOST_WIDE_INT));
  
! /* Set the alignment of MEM to ALIGN bits.  */
  extern void set_mem_align PARAMS ((rtx, unsigned int));
  
*** rtl.h	2001/10/20 10:03:51	1.306
--- rtl.h	2001/10/20 12:21:42
*************** typedef struct
*** 96,100 ****
    rtx offset;			/* Offset from start of DECL, as CONST_INT.  */
    rtx size;			/* Size in bytes, as a CONST_INT.  */
!   unsigned int align;		/* Alignment of MEM in bytes.  */
  } mem_attrs;
  
--- 96,100 ----
    rtx offset;			/* Offset from start of DECL, as CONST_INT.  */
    rtx size;			/* Size in bytes, as a CONST_INT.  */
!   unsigned int align;		/* Alignment of MEM in bits.  */
  } mem_attrs;
  
*************** extern unsigned int subreg_regno 	PARAMS
*** 913,917 ****
  #define MEM_SIZE(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->size)
  
! /* For a MEM rtx, the alignment in bytes.  */
  #define MEM_ALIGN(RTX) (MEM_ATTRS (RTX) == 0 ? 1 : MEM_ATTRS (RTX)->align)
  
--- 913,917 ----
  #define MEM_SIZE(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->size)
  
! /* For a MEM rtx, the alignment in bits.  */
  #define MEM_ALIGN(RTX) (MEM_ATTRS (RTX) == 0 ? 1 : MEM_ATTRS (RTX)->align)
  


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