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]

cse canon tweek


On a small_register_class machine with an explicit hard flags register,
cse won't do obvious conditional branch simplifications because the 
flags register expressions are non interned in the hash table.  Not good.

This modifies the small_register_class rules to not reject interning
CCmode registers.


r~

	* cse.c (canon_hash): Never reject hard regs in CCmode.

Index: cse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cse.c,v
retrieving revision 1.66
diff -c -p -d -r1.66 cse.c
*** cse.c	1999/03/02 00:45:45	1.66
--- cse.c	1999/03/07 09:58:21
*************** canon_hash (x, mode)
*** 2009,2015 ****
  
  	/* On some machines, we can't record any non-fixed hard register,
  	   because extending its life will cause reload problems.  We
! 	   consider ap, fp, and sp to be fixed for this purpose.
  	   On all machines, we can't record any global registers.  */
  
  	if (regno < FIRST_PSEUDO_REGISTER
--- 2009,2020 ----
  
  	/* On some machines, we can't record any non-fixed hard register,
  	   because extending its life will cause reload problems.  We
! 	   consider ap, fp, and sp to be fixed for this purpose. 
! 
! 	   We also consider CCmode registers to be fixed for this purpose;
! 	   failure to do so leads to failure to simplify 0<100 type of
! 	   conditionals.
! 
  	   On all machines, we can't record any global registers.  */
  
  	if (regno < FIRST_PSEUDO_REGISTER
*************** canon_hash (x, mode)
*** 2019,2025 ****
  		    && regno != FRAME_POINTER_REGNUM
  		    && regno != HARD_FRAME_POINTER_REGNUM
  		    && regno != ARG_POINTER_REGNUM
! 		    && regno != STACK_POINTER_REGNUM)))
  	  {
  	    do_not_record = 1;
  	    return 0;
--- 2024,2031 ----
  		    && regno != FRAME_POINTER_REGNUM
  		    && regno != HARD_FRAME_POINTER_REGNUM
  		    && regno != ARG_POINTER_REGNUM
! 		    && regno != STACK_POINTER_REGNUM
! 		    && GET_MODE_CLASS (GET_MODE (x)) != MODE_CC)))
  	  {
  	    do_not_record = 1;
  	    return 0;


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