gcse cleanup

Jan Hubicka jh@suse.cz
Thu Jan 10 09:33:00 GMT 2002


Hi,
constant propagation explicitly tests for few of the constant expressions
we do have.  I thing it should use CONSTANT_P instead to get them all in
cleaner way.
Bootstrapped/regtested i386

Thu Jan 10 19:32:27 CET 2002  Jan Hubicka  <jh@suse.cz>
	* gcse.c (hash_scan_set): Use CONSTANT_INSN_P.
	(cprop_insn): Likewise.

Index: gcse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcse.c,v
retrieving revision 1.164.2.9
diff -c -3 -p -r1.164.2.9 gcse.c
*** gcse.c	2002/01/10 16:32:04	1.164.2.9
--- gcse.c	2002/01/10 17:25:16
*************** hash_scan_set (pat, insn, set_p)
*** 2204,2212 ****
  		    && REGNO (src) >= FIRST_PSEUDO_REGISTER
  		    && can_copy_p [GET_MODE (dest)]
  		    && REGNO (src) != regno)
! 		   || GET_CODE (src) == CONST_INT
! 		   || GET_CODE (src) == SYMBOL_REF
! 		   || GET_CODE (src) == CONST_DOUBLE)
  	       /* A copy is not available if its src or dest is subsequently
  		  modified.  Here we want to search from INSN+1 on, but
  		  oprs_available_p searches from INSN on.  */
--- 2204,2210 ----
  		    && REGNO (src) >= FIRST_PSEUDO_REGISTER
  		    && can_copy_p [GET_MODE (dest)]
  		    && REGNO (src) != regno)
! 		   || CONSTANT_P (src))
  	       /* A copy is not available if its src or dest is subsequently
  		  modified.  Here we want to search from INSN+1 on, but
  		  oprs_available_p searches from INSN on.  */
*************** cprop_insn (bb, insn, alter_jumps)
*** 4157,4164 ****
        src = SET_SRC (pat);
  
        /* Constant propagation.  */
!       if (GET_CODE (src) == CONST_INT || GET_CODE (src) == CONST_DOUBLE
! 	  || GET_CODE (src) == SYMBOL_REF)
  	{
  	  /* Handle normal insns first.  */
  	  if (GET_CODE (insn) == INSN
--- 4155,4161 ----
        src = SET_SRC (pat);
  
        /* Constant propagation.  */
!       if (CONSTANT_P (src))
  	{
  	  /* Handle normal insns first.  */
  	  if (GET_CODE (insn) == INSN



More information about the Gcc-patches mailing list