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 make find_last_value more flexible


This patch allows find_last_value to skip checking to see if the
object has been modified.

ChangeLog:

Sun Jan 16 21:48:30 EST 2000  John Wehle  (john@feith.com)

	* rtlanal.c (find_last_value): Allow NULL_RTX for valid_to.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/rtlanal.c.ORIGINAL	Sun Jan  9 00:50:47 2000
--- gcc/rtlanal.c	Sun Jan 16 21:32:00 2000
*************** multiple_sets (insn)
*** 744,754 ****
    return 0;
  }
  
! /* Return the last thing that X was assigned from before *PINSN.  Verify that
!    the object is not modified up to VALID_TO.  If it was, if we hit
!    a partial assignment to X, or hit a CODE_LABEL first, return X.  If we
!    found an assignment, update *PINSN to point to it.  
!    ALLOW_HWREG is set to 1 if hardware registers are allowed to be the src.  */
  
  rtx
  find_last_value (x, pinsn, valid_to, allow_hwreg)
--- 744,755 ----
    return 0;
  }
  
! /* Return the last thing that X was assigned from before *PINSN.  If VALID_TO
!    is not NULL_RTX then verify that the object is not modified up to VALID_TO.
!    If the object was modified, if we hit a partial assignment to X, or hit a
!    CODE_LABEL first, return X.  If we found an assignment, update *PINSN to
!    point to it.  ALLOW_HWREG is set to 1 if hardware registers are allowed to
!    be the src.  */
  
  rtx
  find_last_value (x, pinsn, valid_to, allow_hwreg)
*************** find_last_value (x, pinsn, valid_to, all
*** 773,779 ****
  	    if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
  	      src = XEXP (note, 0);
  
! 	    if (! modified_between_p (src, PREV_INSN (p), valid_to)
  		/* Reject hard registers because we don't usually want
  		   to use them; we'd rather use a pseudo.  */
  		&& (! (GET_CODE (src) == REG
--- 774,781 ----
  	    if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST)
  	      src = XEXP (note, 0);
  
! 	    if ((valid_to == NULL_RTX
! 		 || ! modified_between_p (src, PREV_INSN (p), valid_to))
  		/* Reject hard registers because we don't usually want
  		   to use them; we'd rather use a pseudo.  */
  		&& (! (GET_CODE (src) == REG
-------------------------------------------------------------------------
|   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]