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]
Other format: [Raw text]

[patch] Remove REG_WAS_0.


Hi,

Attached is a patch to remove REG_WAS_0 in an effort to clean up gcc.

The middle end does not seem to use REG_WAS_0 in any crucial way.
Rather comments about REG_WAS_0 in various files, also in the patch,
sound like REG_WAS_0 is more of trouble than anything else.

avr and vax use REG_WAS_0 at insn output time to improve the loading
of a constant, but IMHO they should use things like move2add, machine
dependent reorg.  The patch removes relevant functions.

m68hc11 has a trace of an attempt to use REG_WAS_0.  REG_WAS_0 is
going away, I remove the trace.

Tested on i686-pc-linux-gnu.  Built cc1 for each affected target.  OK
to apply?

Kazu Hirata

2003-06-29  Kazu Hirata  <kazu@cs.umass.edu>

	* combine.c (distribute_notes): Don't bother REG_WAS_0.
	* cse.c (cse_insn): Likewise.
	* final.c (final_scan_insn): Likewise.
	* jump.c (duplicate_loop_exit_test): Likewise.
	* rtl.c (reg_note_name): Remove REG_WAS_0.
	* rtl.h (REG_WAS_0): Remove.
	* unroll.c (final_reg_note_copy): Don't bother REG_WAS_0.
	* config/avr/avr.c (output_movqi): Don't use reg_was_0.
	(output_movhi): Likewise.
	(output_movsisf): Likewise.
	(reg_was_0): Remove.
	* config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Don't use
	REG_WAS_0.
	(m68hc11_gen_movqi): Likewise.
	* config/vax/vax-protos.h: Remove the prototype for
	reg_was_0_p.
	* config/vax/vax.c (follows_p): Remove.
	(reg_was_0_p): Likewise.
	* config/vax/vax.md (movsi): Don't use reg_was_0_p.
	(movhi): Likewise.
	(movqi): Likewise.
	* doc/rtl.texi (REG_WAS_0): Remove.

Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.364
diff -u -r1.364 combine.c
*** combine.c	27 Jun 2003 19:42:24 -0000	1.364
--- combine.c	29 Jun 2003 14:06:30 -0000
***************
*** 12605,12612 ****
  	  break;
  
  	case REG_NONNEG:
! 	case REG_WAS_0:
! 	  /* These notes say something about the value of a register prior
  	     to the execution of an insn.  It is too much trouble to see
  	     if the note is still correct in all situations.  It is better
  	     to simply delete it.  */
--- 12605,12611 ----
  	  break;
  
  	case REG_NONNEG:
! 	  /* This note says something about the value of a register prior
  	     to the execution of an insn.  It is too much trouble to see
  	     if the note is still correct in all situations.  It is better
  	     to simply delete it.  */
Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.266
diff -u -r1.266 cse.c
*** cse.c	29 Jun 2003 13:53:06 -0000	1.266
--- cse.c	29 Jun 2003 14:06:34 -0000
***************
*** 5675,5715 ****
  		 making a new one if one does not already exist.  */
  	      set_unique_reg_note (insn, REG_EQUAL, src_const);
  	    }
- 
- 	  /* If storing a constant value in a register that
- 	     previously held the constant value 0,
- 	     record this fact with a REG_WAS_0 note on this insn.
- 
- 	     Note that the *register* is required to have previously held 0,
- 	     not just any register in the quantity and we must point to the
- 	     insn that set that register to zero.
- 
- 	     Rather than track each register individually, we just see if
- 	     the last set for this quantity was for this register.  */
- 
- 	  if (REGNO_QTY_VALID_P (REGNO (dest)))
- 	    {
- 	      int dest_q = REG_QTY (REGNO (dest));
- 	      struct qty_table_elem *dest_ent = &qty_table[dest_q];
- 
- 	      if (dest_ent->const_rtx == const0_rtx)
- 		{
- 		  /* See if we previously had a REG_WAS_0 note.  */
- 		  rtx note = find_reg_note (insn, REG_WAS_0, NULL_RTX);
- 		  rtx const_insn = dest_ent->const_insn;
- 
- 		  if ((tem = single_set (const_insn)) != 0
- 		      && rtx_equal_p (SET_DEST (tem), dest))
- 		    {
- 		      if (note)
- 			XEXP (note, 0) = const_insn;
- 		      else
- 			REG_NOTES (insn)
- 			  = gen_rtx_INSN_LIST (REG_WAS_0, const_insn,
- 					       REG_NOTES (insn));
- 		    }
- 		}
- 	    }
  	}
  
        /* Now deal with the destination.  */
--- 5675,5680 ----
***************
*** 6314,6333 ****
  	      validate_change (insn, &SET_DEST (sets[0].rtl), src, 1);
  	      validate_change (insn, &SET_SRC (sets[0].rtl), dest, 1);
  	      apply_change_group ();
- 
- 	      /* If there was a REG_WAS_0 note on PREV, remove it.  Move
- 		 any REG_WAS_0 note on INSN to PREV.  */
- 	      note = find_reg_note (prev, REG_WAS_0, NULL_RTX);
- 	      if (note)
- 		remove_note (prev, note);
- 
- 	      note = find_reg_note (insn, REG_WAS_0, NULL_RTX);
- 	      if (note)
- 		{
- 		  remove_note (insn, note);
- 		  XEXP (note, 1) = REG_NOTES (prev);
- 		  REG_NOTES (prev) = note;
- 		}
  
  	      /* If INSN has a REG_EQUAL note, and this note mentions
  		 REG0, then we must delete it, because the value in
--- 6279,6284 ----
Index: final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.283
diff -u -r1.283 final.c
*** final.c	29 Jun 2003 13:53:07 -0000	1.283
--- final.c	29 Jun 2003 14:06:36 -0000
***************
*** 2503,2511 ****
  #endif
  
  #if 0
! 	/* It's not at all clear why we did this and doing so interferes
! 	   with tests we'd like to do to use REG_WAS_0 notes, so let's try
! 	   with this out.  */
  
  	/* Mark this insn as having been output.  */
  	INSN_DELETED_P (insn) = 1;
--- 2503,2511 ----
  #endif
  
  #if 0
! 	/* It's not at all clear why we did this and doing so used to
! 	   interfere with tests that used REG_WAS_0 notes, which are
! 	   now gone, so let's try with this out.  */
  
  	/* Mark this insn as having been output.  */
  	INSN_DELETED_P (insn) = 1;
Index: jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.230
diff -u -r1.230 jump.c
*** jump.c	27 Jun 2003 19:40:09 -0000	1.230
--- jump.c	29 Jun 2003 14:06:37 -0000
***************
*** 357,366 ****
  	  break;
  	case JUMP_INSN:
  	case INSN:
- 	  /* The code below would grossly mishandle REG_WAS_0 notes,
- 	     so get rid of them here.  */
- 	  while ((p = find_reg_note (insn, REG_WAS_0, NULL_RTX)) != 0)
- 	    remove_note (insn, p);
  	  if (++num_insns > 20
  	      || find_reg_note (insn, REG_RETVAL, NULL_RTX)
  	      || find_reg_note (insn, REG_LIBCALL, NULL_RTX))
--- 357,362 ----
Index: rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.c,v
retrieving revision 1.123
diff -u -r1.123 rtl.c
*** rtl.c	20 Feb 2003 08:54:40 -0000	1.123
--- rtl.c	29 Jun 2003 14:06:37 -0000
***************
*** 225,231 ****
  const char * const reg_note_name[] =
  {
    "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_EQUAL",
!   "REG_WAS_0", "REG_RETVAL", "REG_LIBCALL", "REG_NONNEG",
    "REG_NO_CONFLICT", "REG_UNUSED", "REG_CC_SETTER", "REG_CC_USER",
    "REG_LABEL", "REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_BR_PROB",
    "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
--- 225,231 ----
  const char * const reg_note_name[] =
  {
    "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_EQUAL",
!   "REG_RETVAL", "REG_LIBCALL", "REG_NONNEG",
    "REG_NO_CONFLICT", "REG_UNUSED", "REG_CC_SETTER", "REG_CC_USER",
    "REG_LABEL", "REG_DEP_ANTI", "REG_DEP_OUTPUT", "REG_BR_PROB",
    "REG_NOALIAS", "REG_SAVE_AREA", "REG_BR_PRED",
Index: rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.421
diff -u -r1.421 rtl.h
*** rtl.h	28 Jun 2003 05:39:40 -0000	1.421
--- rtl.h	29 Jun 2003 14:06:38 -0000
***************
*** 633,644 ****
       but it can be used for cse.  */
    REG_EQUAL,
  
-   /* The register set in this insn held 0 before the insn.  The contents of
-      the note is the insn that stored the 0.  If that insn is deleted or
-      patched to a NOTE, the REG_WAS_0 is inoperative.  The REG_WAS_0 note
-      is actually an INSN_LIST, not an EXPR_LIST.  */
-   REG_WAS_0,
- 
    /* This insn copies the return-value of a library call out of the hard reg
       for return values.  This note is actually an INSN_LIST and it points to
       the first insn involved in setting up arguments for the call.  flow.c
--- 633,638 ----
Index: unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unroll.c,v
retrieving revision 1.195
diff -u -r1.195 unroll.c
*** unroll.c	27 Jun 2003 09:49:36 -0000	1.195
--- unroll.c	29 Jun 2003 14:06:41 -0000
***************
*** 1735,1763 ****
  
        if (GET_CODE (note) == INSN_LIST)
  	{
! 	  /* Sometimes, we have a REG_WAS_0 note that points to a
! 	     deleted instruction.  In that case, we can just delete the
! 	     note.  */
! 	  if (REG_NOTE_KIND (note) == REG_WAS_0)
  	    {
! 	      *notesp = XEXP (note, 1);
! 	      continue;
  	    }
  	  else
! 	    {
! 	      rtx insn = map->insn_map[INSN_UID (XEXP (note, 0))];
! 
! 	      /* If we failed to remap the note, something is awry.
! 		 Allow REG_LABEL as it may reference label outside
! 		 the unrolled loop.  */
! 	      if (!insn)
! 		{
! 		  if (REG_NOTE_KIND (note) != REG_LABEL)
! 		    abort ();
! 		}
! 	      else
! 	        XEXP (note, 0) = insn;
! 	    }
  	}
  
        notesp = &XEXP (note, 1);
--- 1735,1752 ----
  
        if (GET_CODE (note) == INSN_LIST)
  	{
! 	  rtx insn = map->insn_map[INSN_UID (XEXP (note, 0))];
! 
! 	  /* If we failed to remap the note, something is awry.
! 	     Allow REG_LABEL as it may reference label outside
! 	     the unrolled loop.  */
! 	  if (!insn)
  	    {
! 	      if (REG_NOTE_KIND (note) != REG_LABEL)
! 		abort ();
  	    }
  	  else
! 	    XEXP (note, 0) = insn;
  	}
  
        notesp = &XEXP (note, 1);
Index: config/avr/avr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.c,v
retrieving revision 1.98
diff -u -r1.98 avr.c
*** config/avr/avr.c	28 Jun 2003 20:00:06 -0000	1.98
--- config/avr/avr.c	29 Jun 2003 14:06:43 -0000
***************
*** 58,64 ****
  static int    out_set_stack_ptr    PARAMS ((FILE *, int, int));
  static RTX_CODE compare_condition  PARAMS ((rtx insn));
  static int    compare_sign_p       PARAMS ((rtx insn));
- static int    reg_was_0            PARAMS ((rtx insn, rtx op));
  static tree   avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, bool *));
  static tree   avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
  const struct attribute_spec avr_attribute_table[];
--- 58,63 ----
***************
*** 1612,1620 ****
  		return AS1 (clr,%0);
  	      else if (src == const1_rtx)
  		{
- 		  if (reg_was_0 (insn, dest))
- 		    return AS1 (inc,%0 ; reg_was_0);
- 
  		  *l = 2;
  		  return (AS1 (clr,%0) CR_TAB
  			  AS1 (inc,%0));
--- 1611,1616 ----
***************
*** 1622,1630 ****
  	      else if (src == constm1_rtx)
  		{
  		  /* Immediate constants -1 to any register */
- 		  if (reg_was_0 (insn, dest))
- 		    return AS1 (dec,%0 ; reg_was_0);
- 
  		  *l = 2;
  		  return (AS1 (clr,%0) CR_TAB
  			  AS1 (dec,%0));
--- 1618,1623 ----
***************
*** 1635,1653 ****
  
  		  if (bit_nr >= 0)
  		    {
! 		      if (reg_was_0 (insn, dest))
! 			{
! 			  *l = 2;
! 			  if (!real_l)
! 			    output_asm_insn ("set ; reg_was_0", operands);
! 			}
! 		      else
! 			{
! 			  *l = 3;
! 			  if (!real_l)
! 			    output_asm_insn ((AS1 (clr,%0) CR_TAB
! 					      "set"), operands);
! 			}
  		      if (!real_l)
  			avr_output_bld (operands, bit_nr);
  
--- 1628,1637 ----
  
  		  if (bit_nr >= 0)
  		    {
! 		      *l = 3;
! 		      if (!real_l)
! 			output_asm_insn ((AS1 (clr,%0) CR_TAB
! 					  "set"), operands);
  		      if (!real_l)
  			avr_output_bld (operands, bit_nr);
  
***************
*** 1753,1765 ****
  	{
  	  if (test_hard_reg_class (LD_REGS, dest)) /* ldi d,i */
  	    {
- 	      if (byte_immediate_operand (src, HImode)
- 		  && reg_was_0 (insn, dest))
- 		{
- 		  *l = 1;
- 		  return (AS2 (ldi,%A0,lo8(%1) ; reg_was_0));
- 		}
- 
  	      *l = 2;
  	      return (AS2 (ldi,%A0,lo8(%1)) CR_TAB
  		      AS2 (ldi,%B0,hi8(%1)));
--- 1737,1742 ----
***************
*** 1775,1786 ****
  		}
  	      else if (src == const1_rtx)
  		{
- 		  if (reg_was_0 (insn, dest))
- 		    {
- 		      *l = 1;
- 		      return AS1 (inc,%0 ; reg_was_0);
- 		    }
- 
  		  *l = 3;
  		  return (AS1 (clr,%A0) CR_TAB
  			  AS1 (clr,%B0) CR_TAB
--- 1752,1757 ----
***************
*** 1789,1801 ****
  	      else if (src == constm1_rtx)
  		{
  		  /* Immediate constants -1 to any register */
- 		  if (reg_was_0 (insn, dest))
- 		    {
- 		      *l = 2;
- 		      return (AS1 (dec,%A0 ; reg_was_0) CR_TAB
- 			      AS1 (dec,%B0));
- 		    }
- 
  		  *l = 3;
  		  return (AS1 (clr,%0)  CR_TAB
  			  AS1 (dec,%A0) CR_TAB
--- 1760,1765 ----
***************
*** 1807,1826 ****
  
  		  if (bit_nr >= 0)
  		    {
! 		      if (reg_was_0 (insn, dest))
! 			{
! 			  *l = 2;
! 			  if (!real_l)
! 			    output_asm_insn ("set ; reg_was_0", operands);
! 			}
! 		      else
! 			{
! 			  *l = 4;
! 			  if (!real_l)
! 			    output_asm_insn ((AS1 (clr,%A0) CR_TAB
! 					      AS1 (clr,%B0) CR_TAB
! 					      "set"), operands);
! 			}
  		      if (!real_l)
  			avr_output_bld (operands, bit_nr);
  
--- 1771,1781 ----
  
  		  if (bit_nr >= 0)
  		    {
! 		      *l = 4;
! 		      if (!real_l)
! 			output_asm_insn ((AS1 (clr,%A0) CR_TAB
! 					  AS1 (clr,%B0) CR_TAB
! 					  "set"), operands);
  		      if (!real_l)
  			avr_output_bld (operands, bit_nr);
  
***************
*** 2452,2464 ****
  	{
  	  if (test_hard_reg_class (LD_REGS, dest)) /* ldi d,i */
  	    {
- 	      if (byte_immediate_operand (src, SImode)
- 		  && reg_was_0 (insn, dest))
- 		{
- 		  *l = 1;
- 		  return (AS2 (ldi,%A0,lo8(%1) ; reg_was_0));
- 		}
- 
  	      *l = 4;
  	      return (AS2 (ldi,%A0,lo8(%1))  CR_TAB
  		      AS2 (ldi,%B0,hi8(%1))  CR_TAB
--- 2407,2412 ----
***************
*** 2484,2494 ****
  		}
  	      else if (src == const1_rtx)
  		{
- 		  if (reg_was_0 (insn, dest))
- 		    {
- 		      *l = 1;
- 		      return AS1 (inc,%A0 ; reg_was_0);
- 		    }
  		  if (!real_l)
  		    output_asm_insn (clr_op0, operands);
  		  *l = AVR_ENHANCED ? 4 : 5;
--- 2432,2437 ----
***************
*** 2497,2517 ****
  	      else if (src == constm1_rtx)
  		{
  		  /* Immediate constants -1 to any register */
- 		  if (reg_was_0 (insn, dest))
- 		    {
- 		      if (AVR_ENHANCED)
- 			{
- 			  *l = 3;
- 			  return (AS1 (dec,%A0) CR_TAB
- 				  AS1 (dec,%B0) CR_TAB
- 				  AS2 (movw,%C0,%A0));
- 			}
- 		      *l = 4;
- 		      return (AS1 (dec,%D0 ; reg_was_0) CR_TAB
- 			      AS1 (dec,%C0)             CR_TAB
- 			      AS1 (dec,%B0)             CR_TAB
- 			      AS1 (dec,%A0));
- 		    }
  		  if (AVR_ENHANCED)
  		    {
  		      *l = 4;
--- 2440,2445 ----
***************
*** 2533,2552 ****
  
  		  if (bit_nr >= 0)
  		    {
! 		      if (reg_was_0 (insn, dest))
! 			{
! 			  *l = 2;
! 			  if (!real_l)
! 			    output_asm_insn ("set ; reg_was_0", operands);
! 			}
! 		      else
  			{
! 			  *l = AVR_ENHANCED ? 5 : 6;
! 			  if (!real_l)
! 			    {
! 			      output_asm_insn (clr_op0, operands);
! 			      output_asm_insn ("set", operands);
! 			    }
  			}
  		      if (!real_l)
  			avr_output_bld (operands, bit_nr);
--- 2461,2471 ----
  
  		  if (bit_nr >= 0)
  		    {
! 		      *l = AVR_ENHANCED ? 5 : 6;
! 		      if (!real_l)
  			{
! 			  output_asm_insn (clr_op0, operands);
! 			  output_asm_insn ("set", operands);
  			}
  		      if (!real_l)
  			avr_output_bld (operands, bit_nr);
***************
*** 5399,5423 ****
    /*  if (regno < 24 && !AVR_ENHANCED)
        return 1;*/
    return !(regno & 1);
- }
- 
- /* Returns 1 if we know register operand OP was 0 before INSN.  */
- 
- static int
- reg_was_0 (insn, op)
-      rtx insn;
-      rtx op;
- {
-   rtx link;
-   return (optimize > 0 && insn && op && REG_P (op)
- 	  && (link = find_reg_note (insn, REG_WAS_0, 0))
- 	  /* Make sure the insn that stored the 0 is still present.  */
- 	  && ! INSN_DELETED_P (XEXP (link, 0))
- 	  && GET_CODE (XEXP (link, 0)) != NOTE
- 	  /* Make sure cross jumping didn't happen here.  */
- 	  && no_labels_between_p (XEXP (link, 0), insn)
- 	  /* Make sure the reg hasn't been clobbered.  */
- 	  && ! reg_set_between_p (op, XEXP (link, 0), insn));
  }
  
  /* Returns 1 if X is a valid address for an I/O register of size SIZE
--- 5318,5323 ----
Index: config/m68hc11/m68hc11.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68hc11/m68hc11.c,v
retrieving revision 1.82
diff -u -r1.82 m68hc11.c
*** config/m68hc11/m68hc11.c	28 Jun 2003 14:56:24 -0000	1.82
--- config/m68hc11/m68hc11.c	29 Jun 2003 14:06:45 -0000
***************
*** 3295,3311 ****
  	{
  	  if (SP_REG_P (operands[0]))
  	    output_asm_insn ("lds\t%1", operands);
- 	  else if (0 /* REG_WAS_0 note is boggus;  don't rely on it.  */
-                    && !D_REG_P (operands[0])
-                    && GET_CODE (operands[1]) == CONST_INT
-                    && (INTVAL (operands[1]) == 1 || INTVAL (operands[1]) == -1)
-                    && find_reg_note (insn, REG_WAS_0, 0))
-             {
-               if (INTVAL (operands[1]) == 1)
-                 output_asm_insn ("in%0", operands);
-               else
-                 output_asm_insn ("de%0", operands);
-             }
  	  else
  	    output_asm_insn ("ld%0\t%1", operands);
  	}
--- 3295,3300 ----
***************
*** 3489,3504 ****
  	      cc_status = cc_prev_status;
  	      output_asm_insn ("tsx", operands);
  	    }
- 	  else if (0 /* REG_WAS_0 note is boggus;  don't rely on it.  */
-                    && GET_CODE (operands[1]) == CONST_INT
-                    && (INTVAL (operands[1]) == 1 || INTVAL (operands[1]) == -1)
-                    && find_reg_note (insn, REG_WAS_0, 0))
-             {
-               if (INTVAL (operands[1]) == 1)
-                 output_asm_insn ("in%0", operands);
-               else
-                 output_asm_insn ("de%0", operands);
-             }
  	  else
  	    {
  	      output_asm_insn ("ldx\t%1", operands);
--- 3478,3483 ----
***************
*** 3547,3562 ****
  	      cc_status = cc_prev_status;
  	      output_asm_insn ("tsy", operands);
  	    }
- 	  else if (0 /* REG_WAS_0 note is boggus;  don't rely on it.  */
-                    && GET_CODE (operands[1]) == CONST_INT
-                    && (INTVAL (operands[1]) == 1 || INTVAL (operands[1]) == -1)
-                    && find_reg_note (insn, REG_WAS_0, 0))
-             {
-               if (INTVAL (operands[1]) == 1)
-                 output_asm_insn ("in%0", operands);
-               else
-                 output_asm_insn ("de%0", operands);
-             }
            else
  	    {
  	      output_asm_insn ("ldy\t%1", operands);
--- 3526,3531 ----
***************
*** 3797,3812 ****
  		  output_asm_insn ("ldab\t%T0", operands);
  		}
  	    }
- 	  else if (0 /* REG_WAS_0 note is boggus;  don't rely on it.  */
-                    && GET_CODE (operands[1]) == CONST_INT
-                    && (INTVAL (operands[1]) == 1 || INTVAL (operands[1]) == -1)
-                    && find_reg_note (insn, REG_WAS_0, 0))
-             {
-               if (INTVAL (operands[1]) == 1)
-                 output_asm_insn ("inc%b0", operands);
-               else
-                 output_asm_insn ("dec%b0", operands);
-             }          
  	  else if (!DB_REG_P (operands[1]) && !D_REG_P (operands[1])
  		   && !DA_REG_P (operands[1]))
  	    {
--- 3766,3771 ----
Index: config/vax/vax-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax-protos.h,v
retrieving revision 1.13
diff -u -r1.13 vax-protos.h
*** config/vax/vax-protos.h	4 Jun 2003 05:21:41 -0000	1.13
--- config/vax/vax-protos.h	29 Jun 2003 14:06:45 -0000
***************
*** 25,31 ****
  extern void split_quadword_operands PARAMS ((rtx *, rtx *, int));
  extern void print_operand_address PARAMS ((FILE *, rtx));
  extern int vax_float_literal PARAMS ((rtx));
- extern int reg_was_0_p PARAMS ((rtx, rtx));
  #endif /* RTX_CODE */
  
  #ifdef REAL_VALUE_TYPE
--- 25,30 ----
Index: config/vax/vax.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.c,v
retrieving revision 1.46
diff -u -r1.46 vax.c
*** config/vax/vax.c	19 Jun 2003 21:47:25 -0000	1.46
--- config/vax/vax.c	29 Jun 2003 14:06:46 -0000
***************
*** 41,47 ****
  #include "target.h"
  #include "target-def.h"
  
- static int follows_p PARAMS ((rtx, rtx));
  static void vax_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
  static void vax_file_start PARAMS ((void));
  static void vax_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
--- 41,46 ----
***************
*** 755,795 ****
    return true;
  }
  
- /* Return 1 if insn A follows B.  */
- 
- static int
- follows_p (a, b)
-      rtx a, b;
- {
-   register rtx p;
- 
-   for (p = a; p != b; p = NEXT_INSN (p))
-     if (! p)
-       return 1;
- 
-   return 0;
- }
- 
- /* Returns 1 if we know operand OP was 0 before INSN.  */
- 
- int
- reg_was_0_p (insn, op)
-      rtx insn, op;
- {
-   rtx link;
- 
-   return ((link = find_reg_note (insn, REG_WAS_0, 0))
- 	  /* Make sure the insn that stored the 0 is still present
- 	     and doesn't follow INSN in the insn sequence.  */
- 	  && ! INSN_DELETED_P (XEXP (link, 0))
- 	  && GET_CODE (XEXP (link, 0)) != NOTE
- 	  && ! follows_p (XEXP (link, 0), insn)
- 	  /* Make sure cross jumping didn't happen here.  */
- 	  && no_labels_between_p (XEXP (link, 0), insn)
- 	  /* Make sure the reg hasn't been clobbered.  */
- 	  && ! reg_set_between_p (op, XEXP (link, 0), insn));
- }
- 
  /* Output code to add DELTA to the first argument, and then jump to FUNCTION.
     Used for C++ multiple inheritance.
  	.mask	^m<r2,r3,r4,r5,r6,r7,r8,r9,r10,r11>  #conservative entry mask
--- 754,759 ----
Index: config/vax/vax.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.md,v
retrieving revision 1.24
diff -u -r1.24 vax.md
*** config/vax/vax.md	13 Mar 2003 03:23:55 -0000	1.24
--- config/vax/vax.md	29 Jun 2003 14:06:46 -0000
***************
*** 193,201 ****
    ""
    "*
  {
-   if (operands[1] == const1_rtx && reg_was_0_p (insn, operands[0]))
-     return \"incl %0\";
- 
    if (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST)
      {
        if (push_operand (operands[0], SImode))
--- 193,198 ----
***************
*** 230,238 ****
    ""
    "*
  {
-   if (operands[1] == const1_rtx && reg_was_0_p (insn, operands[0]))
-     return \"incw %0\";
- 
    if (GET_CODE (operands[1]) == CONST_INT)
      {
        int i = INTVAL (operands[1]);
--- 227,232 ----
***************
*** 275,283 ****
    ""
    "*
  {
-   if (operands[1] == const1_rtx && reg_was_0_p (insn, operands[0]))
-     return \"incb %0\";
- 
    if (GET_CODE (operands[1]) == CONST_INT)
      {
        int i = INTVAL (operands[1]);
--- 269,274 ----
Index: doc/rtl.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/rtl.texi,v
retrieving revision 1.58
diff -u -r1.58 rtl.texi
*** doc/rtl.texi	22 Jun 2003 15:11:07 -0000	1.58
--- doc/rtl.texi	29 Jun 2003 14:06:49 -0000
***************
*** 3354,3366 ****
  Thus, compiler passes prior to register allocation need only check for
  @code{REG_EQUAL} notes and passes subsequent to register allocation
  need only check for @code{REG_EQUIV} notes.
- 
- @findex REG_WAS_0
- @item REG_WAS_0
- The single output of this insn contained zero before this insn.
- @var{op} is the insn that set it to zero.  You can rely on this note if
- it is present and @var{op} has not been deleted or turned into a @code{note};
- its absence implies nothing.
  @end table
  
  These notes describe linkages between insns.  They occur in pairs: one
--- 3354,3359 ----


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