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]

Patch to fix local-alloc REG_EQUIV handling


This should fix the local-alloc REG_EQUIV LO_SUM problem that's
occuring on HP.  This patch passes make bootstrap and check on
i386-unknown-freebsd4.2.  It also passes make check for
powerpc-eabisim.

ChangeLog:

Fri Mar  2 20:25:42 EST 2001  John Wehle  (john@feith.com)

	* local-alloc.c (validate_equiv_mem): Reject memory
	addresses which vary.
	* rtlanal.c (rtx_varies_p): Check operand 0 of a
	LO_SUM unless for_alias is set.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/local-alloc.c.ORIGINAL	Thu Mar  1 23:57:40 2001
--- gcc/local-alloc.c	Mon Mar  5 03:16:13 2001
*************** validate_equiv_mem (start, reg, memref)
*** 479,487 ****
    equiv_mem = memref;
    equiv_mem_modified = 0;
  
!   /* If the memory reference has side effects or is volatile, it isn't a
!      valid equivalence.  */
!   if (side_effects_p (memref))
      return 0;
  
    for (insn = start; insn && ! equiv_mem_modified; insn = NEXT_INSN (insn))
--- 479,487 ----
    equiv_mem = memref;
    equiv_mem_modified = 0;
  
!   /* If the memory reference has side effects, is volatile, or has
!      an address which varies, it isn't a valid equivalence.  */
!   if (side_effects_p (memref) || rtx_varies_p (XEXP (memref, 0), 0))
      return 0;
  
    for (insn = start; insn && ! equiv_mem_modified; insn = NEXT_INSN (insn))
*** gcc/rtlanal.c.ORIGINAL	Thu Mar  1 22:41:07 2001
--- gcc/rtlanal.c	Fri Mar  2 20:24:09 2001
*************** rtx_varies_p (x, for_alias)
*** 163,170 ****
  
      case LO_SUM:
        /* The operand 0 of a LO_SUM is considered constant
! 	 (in fact is it related specifically to operand 1).  */
!       return rtx_varies_p (XEXP (x, 1), for_alias);
        
      case ASM_OPERANDS:
        if (MEM_VOLATILE_P (x))
--- 163,172 ----
  
      case LO_SUM:
        /* The operand 0 of a LO_SUM is considered constant
! 	 (in fact it is related specifically to operand 1)
! 	 during alias analysis.  */
!       return (! for_alias && rtx_varies_p (XEXP (x, 0), for_alias))
! 	     || rtx_varies_p (XEXP (x, 1), for_alias);
        
      case ASM_OPERANDS:
        if (MEM_VOLATILE_P (x))
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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