Tweak to LO_SUM stuff

Richard Kenner kenner@vlsi1.ultra.nyu.edu
Tue Jul 10 04:27:00 GMT 2001


As discussed.  Tested on alphaev56.

Tue Jul 10 07:27:53 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* emit-rtl.c (adjust_address, adjust_address_nv): Change criteria for
	whether can put offset inside LO_SUM to check mode alignment, not size.

*** emit-rtl.c	2001/07/09 19:38:18	1.189
--- emit-rtl.c	2001/07/10 10:50:40
*************** adjust_address (memref, mode, offset)
*** 1632,1639 ****
    rtx addr = XEXP (memref, 0);
  
!   /* If MEMREF is a LO_SUM and the offset is within the size of the
       object, we can merge it into the LO_SUM.  */
    if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
!       && offset >= 0 && offset < GET_MODE_SIZE (GET_MODE (memref)))
      addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
  			   plus_constant (XEXP (addr, 1), offset));
--- 1632,1640 ----
    rtx addr = XEXP (memref, 0);
  
!   /* If MEMREF is a LO_SUM and the offset is within the alignment of the
       object, we can merge it into the LO_SUM.  */
    if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
!       && offset >= 0
!       && offset < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
      addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
  			   plus_constant (XEXP (addr, 1), offset));
*************** adjust_address_nv (memref, mode, offset)
*** 1659,1663 ****
       object, we can merge it into the LO_SUM.  */
    if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
!       && offset >= 0 && offset < GET_MODE_SIZE (GET_MODE (memref)))
      addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
  			   plus_constant (XEXP (addr, 1), offset));
--- 1660,1665 ----
       object, we can merge it into the LO_SUM.  */
    if (GET_MODE (memref) != BLKmode && GET_CODE (addr) == LO_SUM
!       && offset >= 0
!       && offset < GET_MODE_ALIGNMENT (GET_MODE (memref)) / BITS_PER_UNIT)
      addr = gen_rtx_LO_SUM (mode, XEXP (addr, 0),
  			   plus_constant (XEXP (addr, 1), offset));



More information about the Gcc-patches mailing list