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]

patches applied



I've applied the following 2 patches to the egcs sources. 
Both have been bootstrapped on solaris and passed the testsuites
on solaris and mn10200

The first was approved by Jim, and the second by Jeff.

The first patch fixes a problem with dwarf2 frame output.
The second one prevents multiple REG_EQUAL notes from appearing on insns.

Andrew


	* rtl.texi (RTX_FRAME_RELATED_P): Add documentation.
	* rtl.h (struct rtx_def): Update comment for frame_related field.
	* dwarf2out.c (dwarf2out_frame_debug_expr): Split out from
	'dwarf2out_frame_debug' to handle only expressions, and process
	component parts of a PARALLEL expression.
	(dwarf2out_frame_debug): Process insns only, and call
	new function 'dwarf2out_frame_debug_expr' for patterns.

Index: gcc/dwarf2out.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/dwarf2out.c,v
retrieving revision 1.104
diff -c -p -r1.104 dwarf2out.c
*** dwarf2out.c	1999/01/15 07:57:18	1.104
--- dwarf2out.c	1999/03/10 15:14:56
*************** dwarf2out_stack_adjust (insn)
*** 1190,1195 ****
--- 1190,1419 ----
    dwarf2out_args_size (label, args_size);
  }
  
+ /* A temporary register used in adjusting SP or setting up the store_reg.  */
+ static unsigned cfa_temp_reg;
+ 
+ /* A temporary value used in adjusting SP or setting up the store_reg.  */
+ static long cfa_temp_value;
+ 
+ /* Record call frame debugging information for an expression, which either
+    sets SP or FP (adjusting how we calculate the frame address) or saves a
+    register to the stack. */
+ 
+ static void
+ dwarf2out_frame_debug_expr (expr, label)
+      rtx expr;
+      char *label;
+ {
+   rtx src, dest;
+   long offset;
+     
+   /* If RTX_FRAME_RELATED_P is set on a PARALLEL, process each member of 
+      the PARALLEL independantly. The first element is always processed if 
+      it is a SET. This is for backward compatability.   Other elements 
+      are processed only if they are SETs and the RTX_FRAME_RELATED_P 
+      flag is set in them. */
+ 
+   if (GET_CODE (expr) == PARALLEL)
+     { 
+       int par_index;
+       int limit = XVECLEN (expr, 0);
+ 
+       for (par_index = 0; par_index < limit; par_index++)
+         {
+           rtx x = XVECEXP (expr, 0, par_index);
+           
+           if (GET_CODE (x) == SET &&
+ 	      (RTX_FRAME_RELATED_P (x) || par_index == 0))
+ 	      dwarf2out_frame_debug_expr (x, label);
+         }
+       return;
+     }
+   
+   if (GET_CODE (expr) != SET)
+     abort ();
+ 
+   src = SET_SRC (expr);
+   dest = SET_DEST (expr);
+ 
+   switch (GET_CODE (dest))
+     {
+     case REG:
+       /* Update the CFA rule wrt SP or FP.  Make sure src is
+          relative to the current CFA register.  */
+       switch (GET_CODE (src))
+         {
+           /* Setting FP from SP.  */
+         case REG:
+           if (cfa_reg != (unsigned) REGNO (src))
+             abort ();
+           if (REGNO (dest) != STACK_POINTER_REGNUM
+       	&& !(frame_pointer_needed
+       	     && REGNO (dest) == HARD_FRAME_POINTER_REGNUM))
+             abort ();
+           cfa_reg = REGNO (dest);
+           break;
+ 
+         case PLUS:
+         case MINUS:
+           if (dest == stack_pointer_rtx)
+             {
+       	/* Adjusting SP.  */
+       	switch (GET_CODE (XEXP (src, 1)))
+       	  {
+       	  case CONST_INT:
+       	    offset = INTVAL (XEXP (src, 1));
+       	    break;
+       	  case REG:
+       	    if ((unsigned) REGNO (XEXP (src, 1)) != cfa_temp_reg)
+       	      abort ();
+       	    offset = cfa_temp_value;
+       	    break;
+       	  default:
+       	    abort ();
+       	  }
+ 
+       	if (XEXP (src, 0) == hard_frame_pointer_rtx)
+       	  {
+       	    /* Restoring SP from FP in the epilogue.  */
+       	    if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
+       	      abort ();
+       	    cfa_reg = STACK_POINTER_REGNUM;
+       	  }
+       	else if (XEXP (src, 0) != stack_pointer_rtx)
+       	  abort ();
+ 
+       	if (GET_CODE (src) == PLUS)
+       	  offset = -offset;
+       	if (cfa_reg == STACK_POINTER_REGNUM)
+       	  cfa_offset += offset;
+       	if (cfa_store_reg == STACK_POINTER_REGNUM)
+       	  cfa_store_offset += offset;
+             }
+           else if (dest == hard_frame_pointer_rtx)
+             {
+       	/* Either setting the FP from an offset of the SP,
+       	   or adjusting the FP */
+       	if (! frame_pointer_needed
+       	    || REGNO (dest) != HARD_FRAME_POINTER_REGNUM)
+       	  abort ();
+ 
+       	if (XEXP (src, 0) == stack_pointer_rtx
+       	    && GET_CODE (XEXP (src, 1)) == CONST_INT)
+       	  {
+       	    if (cfa_reg != STACK_POINTER_REGNUM)
+       	      abort ();
+       	    offset = INTVAL (XEXP (src, 1));
+       	    if (GET_CODE (src) == PLUS)
+       	      offset = -offset;
+       	    cfa_offset += offset;
+       	    cfa_reg = HARD_FRAME_POINTER_REGNUM;
+       	  }
+       	else if (XEXP (src, 0) == hard_frame_pointer_rtx
+       		 && GET_CODE (XEXP (src, 1)) == CONST_INT)
+       	  {
+       	    if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
+       	      abort ();
+       	    offset = INTVAL (XEXP (src, 1));
+       	    if (GET_CODE (src) == PLUS)
+       	      offset = -offset;
+       	    cfa_offset += offset;
+       	  }
+ 
+       	else 
+       	  abort();
+             }
+           else
+             {
+       	if (GET_CODE (src) != PLUS
+       	    || XEXP (src, 1) != stack_pointer_rtx)
+       	  abort ();
+       	if (GET_CODE (XEXP (src, 0)) != REG
+       	    || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
+       	  abort ();
+       	if (cfa_reg != STACK_POINTER_REGNUM)
+       	  abort ();
+       	cfa_store_reg = REGNO (dest);
+       	cfa_store_offset = cfa_offset - cfa_temp_value;
+             }
+           break;
+ 
+         case CONST_INT:
+           cfa_temp_reg = REGNO (dest);
+           cfa_temp_value = INTVAL (src);
+           break;
+ 
+         case IOR:
+           if (GET_CODE (XEXP (src, 0)) != REG
+       	|| (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg
+       	|| (unsigned) REGNO (dest) != cfa_temp_reg
+       	|| GET_CODE (XEXP (src, 1)) != CONST_INT)
+             abort ();
+           cfa_temp_value |= INTVAL (XEXP (src, 1));
+           break;
+ 
+         default:
+           abort ();
+         }
+       dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
+     break;
+ 
+   case MEM:
+     /* Saving a register to the stack.  Make sure dest is relative to the
+        CFA register.  */
+     if (GET_CODE (src) != REG)
+       abort ();
+     switch (GET_CODE (XEXP (dest, 0)))
+       {
+         /* With a push.  */
+       case PRE_INC:
+       case PRE_DEC:
+         offset = GET_MODE_SIZE (GET_MODE (dest));
+         if (GET_CODE (XEXP (dest, 0)) == PRE_INC)
+           offset = -offset;
+ 
+         if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
+             || cfa_store_reg != STACK_POINTER_REGNUM)
+           abort ();
+         cfa_store_offset += offset;
+         if (cfa_reg == STACK_POINTER_REGNUM)
+           cfa_offset = cfa_store_offset;
+ 
+         offset = -cfa_store_offset;
+         break;
+ 
+         /* With an offset.  */
+       case PLUS:
+       case MINUS:
+         offset = INTVAL (XEXP (XEXP (dest, 0), 1));
+         if (GET_CODE (XEXP (dest, 0)) == MINUS)
+           offset = -offset;
+ 
+         if (cfa_store_reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
+           abort ();
+         offset -= cfa_store_offset;
+         break;
+ 
+         /* Without an offset.  */
+       case REG:
+         if (cfa_store_reg != (unsigned) REGNO (XEXP (dest, 0)))
+           abort();
+         offset = -cfa_store_offset;
+         break;
+ 
+       default:
+         abort ();
+       }
+     dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
+     dwarf2out_reg_save (label, REGNO (src), offset);
+     break;
+ 
+   default:
+     abort ();
+   }
+ }
+ 
+ 
  /* Record call frame debugging information for INSN, which either
     sets SP or FP (adjusting how we calculate the frame address) or saves a
     register to the stack.  If INSN is NULL_RTX, initialize our state.  */
*************** dwarf2out_frame_debug (insn)
*** 1199,1210 ****
       rtx insn;
  {
    char *label;
!   rtx src, dest;
!   long offset;
! 
!   /* A temporary register used in adjusting SP or setting up the store_reg.  */
!   static unsigned cfa_temp_reg;
!   static long cfa_temp_value;
  
    if (insn == NULL_RTX)
      {
--- 1423,1429 ----
       rtx insn;
  {
    char *label;
!   rtx src;
  
    if (insn == NULL_RTX)
      {
*************** dwarf2out_frame_debug (insn)
*** 1231,1424 ****
    src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
    if (src)
      insn = XEXP (src, 0);
!   else
      insn = PATTERN (insn);
- 
-   /* Assume that in a PARALLEL prologue insn, only the first elt is
-      significant.  Currently this is true.  */
-   if (GET_CODE (insn) == PARALLEL)
-     insn = XVECEXP (insn, 0, 0);
-   if (GET_CODE (insn) != SET)
-     abort ();
- 
-   src = SET_SRC (insn);
-   dest = SET_DEST (insn);
- 
-   switch (GET_CODE (dest))
-     {
-     case REG:
-       /* Update the CFA rule wrt SP or FP.  Make sure src is
- 	 relative to the current CFA register.  */
-       switch (GET_CODE (src))
- 	{
- 	  /* Setting FP from SP.  */
- 	case REG:
- 	  if (cfa_reg != (unsigned) REGNO (src))
- 	    abort ();
- 	  if (REGNO (dest) != STACK_POINTER_REGNUM
- 	      && !(frame_pointer_needed
- 		   && REGNO (dest) == HARD_FRAME_POINTER_REGNUM))
- 	    abort ();
- 	  cfa_reg = REGNO (dest);
- 	  break;
- 
- 	case PLUS:
- 	case MINUS:
- 	  if (dest == stack_pointer_rtx)
- 	    {
- 	      /* Adjusting SP.  */
- 	      switch (GET_CODE (XEXP (src, 1)))
- 		{
- 		case CONST_INT:
- 		  offset = INTVAL (XEXP (src, 1));
- 		  break;
- 		case REG:
- 		  if ((unsigned) REGNO (XEXP (src, 1)) != cfa_temp_reg)
- 		    abort ();
- 		  offset = cfa_temp_value;
- 		  break;
- 		default:
- 		  abort ();
- 		}
- 
- 	      if (XEXP (src, 0) == hard_frame_pointer_rtx)
- 		{
- 		  /* Restoring SP from FP in the epilogue.  */
- 		  if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
- 		    abort ();
- 		  cfa_reg = STACK_POINTER_REGNUM;
- 		}
- 	      else if (XEXP (src, 0) != stack_pointer_rtx)
- 		abort ();
- 
- 	      if (GET_CODE (src) == PLUS)
- 		offset = -offset;
- 	      if (cfa_reg == STACK_POINTER_REGNUM)
- 		cfa_offset += offset;
- 	      if (cfa_store_reg == STACK_POINTER_REGNUM)
- 		cfa_store_offset += offset;
- 	    }
-           else if (dest == hard_frame_pointer_rtx)
-             {
-               /* Either setting the FP from an offset of the SP,
-                  or adjusting the FP */
- 	      if (! frame_pointer_needed
- 		  || REGNO (dest) != HARD_FRAME_POINTER_REGNUM)
- 		abort ();
- 
-               if (XEXP (src, 0) == stack_pointer_rtx
-                   && GET_CODE (XEXP (src, 1)) == CONST_INT)
-                 {
- 		  if (cfa_reg != STACK_POINTER_REGNUM)
- 		    abort ();
-                   offset = INTVAL (XEXP (src, 1));
-                   if (GET_CODE (src) == PLUS)
-                     offset = -offset;
-                   cfa_offset += offset;
-                   cfa_reg = HARD_FRAME_POINTER_REGNUM;
-                 }
-               else if (XEXP (src, 0) == hard_frame_pointer_rtx
-                        && GET_CODE (XEXP (src, 1)) == CONST_INT)
-                 {
- 		  if (cfa_reg != (unsigned) HARD_FRAME_POINTER_REGNUM)
- 		    abort ();
-                   offset = INTVAL (XEXP (src, 1));
-                   if (GET_CODE (src) == PLUS)
-                     offset = -offset;
-                   cfa_offset += offset;
-                 }
- 
-               else 
-                 abort();
-             }
- 	  else
- 	    {
- 	      if (GET_CODE (src) != PLUS
- 		  || XEXP (src, 1) != stack_pointer_rtx)
- 		abort ();
- 	      if (GET_CODE (XEXP (src, 0)) != REG
- 		  || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg)
- 		abort ();
- 	      if (cfa_reg != STACK_POINTER_REGNUM)
- 		abort ();
- 	      cfa_store_reg = REGNO (dest);
- 	      cfa_store_offset = cfa_offset - cfa_temp_value;
- 	    }
- 	  break;
- 
- 	case CONST_INT:
- 	  cfa_temp_reg = REGNO (dest);
- 	  cfa_temp_value = INTVAL (src);
- 	  break;
- 
- 	case IOR:
- 	  if (GET_CODE (XEXP (src, 0)) != REG
- 	      || (unsigned) REGNO (XEXP (src, 0)) != cfa_temp_reg
- 	      || (unsigned) REGNO (dest) != cfa_temp_reg
- 	      || GET_CODE (XEXP (src, 1)) != CONST_INT)
- 	    abort ();
- 	  cfa_temp_value |= INTVAL (XEXP (src, 1));
- 	  break;
- 
- 	default:
- 	  abort ();
- 	}
-       dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
-       break;
  
!     case MEM:
!       /* Saving a register to the stack.  Make sure dest is relative to the
!          CFA register.  */
!       if (GET_CODE (src) != REG)
! 	abort ();
!       switch (GET_CODE (XEXP (dest, 0)))
! 	{
! 	  /* With a push.  */
! 	case PRE_INC:
! 	case PRE_DEC:
! 	  offset = GET_MODE_SIZE (GET_MODE (dest));
! 	  if (GET_CODE (XEXP (dest, 0)) == PRE_INC)
! 	    offset = -offset;
! 
! 	  if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
! 	      || cfa_store_reg != STACK_POINTER_REGNUM)
! 	    abort ();
! 	  cfa_store_offset += offset;
! 	  if (cfa_reg == STACK_POINTER_REGNUM)
! 	    cfa_offset = cfa_store_offset;
! 
! 	  offset = -cfa_store_offset;
! 	  break;
! 
! 	  /* With an offset.  */
! 	case PLUS:
! 	case MINUS:
! 	  offset = INTVAL (XEXP (XEXP (dest, 0), 1));
! 	  if (GET_CODE (src) == MINUS)
! 	    offset = -offset;
! 
! 	  if (cfa_store_reg != (unsigned) REGNO (XEXP (XEXP (dest, 0), 0)))
! 	    abort ();
! 	  offset -= cfa_store_offset;
! 	  break;
! 
! 	  /* Without an offset.  */
! 	case REG:
! 	  if (cfa_store_reg != (unsigned) REGNO (XEXP (dest, 0)))
! 	    abort();
! 	  offset = -cfa_store_offset;
! 	  break;
! 
! 	default:
! 	  abort ();
! 	}
!       dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
!       dwarf2out_reg_save (label, REGNO (src), offset);
!       break;
! 
!     default:
!       abort ();
!     }
  }
  
  /* Return the size of an unsigned LEB128 quantity.  */
--- 1450,1459 ----
    src = find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX);
    if (src)
      insn = XEXP (src, 0);
!   else 
      insn = PATTERN (insn);
  
!   dwarf2out_frame_debug_expr (insn, label);
  }
  
  /* Return the size of an unsigned LEB128 quantity.  */
Index: gcc/rtl.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/rtl.h,v
retrieving revision 1.104
diff -c -p -r1.104 rtl.h
*** rtl.h	1999/01/20 05:32:42	1.104
--- rtl.h	1999/03/10 15:14:59
*************** typedef struct rtx_def
*** 167,175 ****
       END CYGNUS LOCAL
       */
    unsigned integrated : 1;
!   /* Nonzero if this rtx is related to the call frame, either changing how
!      we compute the frame address or saving and restoring registers in
!      the prologue and epilogue.  */
    unsigned frame_related : 1;
    /* The first element of the operands of this rtx.
       The number of operands and their types are controlled
--- 167,175 ----
       END CYGNUS LOCAL
       */
    unsigned integrated : 1;
!   /* 1 in an INSN or a SET if this rtx is related to the call frame,
!      either changing how we compute the frame address or saving and
!      restoring registers in the prologue and epilogue. */
    unsigned frame_related : 1;
    /* The first element of the operands of this rtx.
       The number of operands and their types are controlled
Index: gcc/rtl.texi
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/rtl.texi,v
retrieving revision 1.43
diff -c -p -r1.43 rtl.texi
*** rtl.texi	1999/01/15 07:57:57	1.43
--- rtl.texi	1999/03/10 15:15:05
*************** other functions or by aliasing.)  Stored
*** 391,396 ****
--- 391,403 ----
  Nonzero in an insn if it resulted from an in-line function call.
  Stored in the @code{integrated} field and printed as @samp{/i}.
  
+ @findex RTX_FRAME_RELATED_P
+ @item RTX_FRAME_RELATED_P (@var{x})
+ Nonzero in an insn or expression which is part of a function
+ prologue and sets the stack pointer, sets the frame pointer, or saves a 
+ register. This flag is required for exception handling support
+ on targets with RTL prologues.
+ 
  @findex SYMBOL_REF_USED
  @cindex @code{used}, in @code{symbol_ref}
  @item SYMBOL_REF_USED (@var{x})




I've applied this patch to prevent multiple REG_EQUALs notes.


	* emit-rtl.c (set_unique_reg_note): New function to add a reg note,
	but if there is an existingone, deletes it first.
	* rtl.h (set_unique_reg_note): Declare prototype.
	* expmed.c (expand_mult, expand_divmod): Use set_unique_reg_note.
	* optabs.c (add_equal_note, expand_binop): Use set_unique_reg_note.
	(emit_no_conflict_block, emit_libcall_block): Use set_unique_reg_note.
	(expand_fix):  Use set_unique_reg_note.


Index: gcc/emit-rtl.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/emit-rtl.c,v
retrieving revision 1.123
diff -c -p -r1.123 emit-rtl.c
*** emit-rtl.c	1999/01/21 19:46:39	1.123
--- emit-rtl.c	1999/02/22 21:14:03
*************** force_next_line_note ()
*** 3069,3074 ****
--- 3069,3092 ----
  {
    last_linenum = -1;
  }
+ 
+ /* Place a note of KIND on insn INSN with DATUM as the datum. If a
+    note of this type already exists, remove it first. */
+ 
+ void 
+ set_unique_reg_note (insn, kind, datum)
+      rtx insn;
+      enum reg_note kind;
+      rtx datum;
+ {
+   rtx note = find_reg_note (insn, kind, NULL_RTX);
+ 
+   /* First remove the note if there already is one.  */
+   if (note) 
+     remove_note (insn, note);
+ 
+   REG_NOTES (insn) = gen_rtx_EXPR_LIST (kind, datum, REG_NOTES (insn));
+ }
  
  /* Return an indication of which type of insn should have X as a body.
     The value is CODE_LABEL, INSN, CALL_INSN or JUMP_INSN.  */
Index: gcc/expmed.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/expmed.c,v
retrieving revision 1.130
diff -c -p -r1.130 expmed.c
*** expmed.c	1998/12/08 22:59:12	1.130
--- expmed.c	1999/02/22 21:14:08
*************** expand_mult (mode, op0, op1, target, uns
*** 2475,2484 ****
  		 multiplication sequences.  */
  
  	      insn = get_last_insn ();
! 	      REG_NOTES (insn)
! 		= gen_rtx_EXPR_LIST (REG_EQUAL,
! 				     gen_rtx_MULT (mode, op0, GEN_INT (val_so_far)),
! 				     REG_NOTES (insn));
  	    }
  
  	  if (variant == negate_variant)
--- 2475,2484 ----
  		 multiplication sequences.  */
  
  	      insn = get_last_insn ();
! 	      set_unique_reg_note (insn, 
! 	      			   REG_EQUAL,
! 				   gen_rtx_MULT (mode, op0, 
! 				   	         GEN_INT (val_so_far)));
  	    }
  
  	  if (variant == negate_variant)
*************** expand_divmod (rem_flag, code, mode, op0
*** 3172,3181 ****
  		if (insn != last
  		    && (set = single_set (insn)) != 0
  		    && SET_DEST (set) == quotient)
! 		  REG_NOTES (insn)
! 		    = gen_rtx_EXPR_LIST (REG_EQUAL,
! 					 gen_rtx_UDIV (compute_mode, op0, op1),
! 					 REG_NOTES (insn));
  	      }
  	    else		/* TRUNC_DIV, signed */
  	      {
--- 3172,3180 ----
  		if (insn != last
  		    && (set = single_set (insn)) != 0
  		    && SET_DEST (set) == quotient)
! 		  set_unique_reg_note (insn, 
! 		  		       REG_EQUAL,
! 				       gen_rtx_UDIV (compute_mode, op0, op1));
  	      }
  	    else		/* TRUNC_DIV, signed */
  	      {
*************** expand_divmod (rem_flag, code, mode, op0
*** 3249,3260 ****
  			if (insn != last
  			    && (set = single_set (insn)) != 0
  			    && SET_DEST (set) == quotient)
! 			  REG_NOTES (insn)
! 			    = gen_rtx_EXPR_LIST (REG_EQUAL,
! 						 gen_rtx_DIV (compute_mode,
! 							      op0,
! 							      GEN_INT (abs_d)),
! 				       REG_NOTES (insn));
  
  			quotient = expand_unop (compute_mode, neg_optab,
  						quotient, quotient, 0);
--- 3248,3258 ----
  			if (insn != last
  			    && (set = single_set (insn)) != 0
  			    && SET_DEST (set) == quotient)
! 			  set_unique_reg_note (insn, 
! 			  		       REG_EQUAL,
! 					       gen_rtx_DIV (compute_mode,
! 							    op0,
! 							    GEN_INT (abs_d)));
  
  			quotient = expand_unop (compute_mode, neg_optab,
  						quotient, quotient, 0);
*************** expand_divmod (rem_flag, code, mode, op0
*** 3319,3328 ****
  		if (insn != last
  		    && (set = single_set (insn)) != 0
  		    && SET_DEST (set) == quotient)
! 		  REG_NOTES (insn)
! 		    = gen_rtx_EXPR_LIST (REG_EQUAL,
! 					 gen_rtx_DIV (compute_mode, op0, op1),
! 					 REG_NOTES (insn));
  	      }
  	    break;
  	  }
--- 3317,3325 ----
  		if (insn != last
  		    && (set = single_set (insn)) != 0
  		    && SET_DEST (set) == quotient)
! 		  set_unique_reg_note (insn, 
! 		  		       REG_EQUAL,
! 				       gen_rtx_DIV (compute_mode, op0, op1));
  	      }
  	    break;
  	  }
*************** expand_divmod (rem_flag, code, mode, op0
*** 3735,3746 ****
  				     NULL_RTX, unsignedp);
  
  	    insn = get_last_insn ();
! 	    REG_NOTES (insn)
! 	      = gen_rtx_EXPR_LIST (REG_EQUAL,
! 				   gen_rtx_fmt_ee (unsignedp ? UDIV : DIV,
! 						   compute_mode,
! 						   op0, op1),
! 				   REG_NOTES (insn));
  	  }
  	break;
  
--- 3732,3742 ----
  				     NULL_RTX, unsignedp);
  
  	    insn = get_last_insn ();
! 	    set_unique_reg_note (insn,
! 	    			 REG_EQUAL,
! 				 gen_rtx_fmt_ee (unsignedp ? UDIV : DIV,
! 						 compute_mode,
! 						 op0, op1));
  	  }
  	break;
  
Index: gcc/optabs.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/optabs.c,v
retrieving revision 1.107
diff -c -p -r1.107 optabs.c
*** optabs.c	1999/01/20 17:50:24	1.107
--- optabs.c	1999/02/22 21:14:14
*************** add_equal_note (seq, target, code, op0, 
*** 306,314 ****
    else
      note = gen_rtx_fmt_ee (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
  
!   REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1))
!     = gen_rtx_EXPR_LIST (REG_EQUAL, note,
! 			 REG_NOTES (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1)));
  
    return 1;
  }
--- 306,312 ----
    else
      note = gen_rtx_fmt_ee (code, GET_MODE (target), copy_rtx (op0), copy_rtx (op1));
  
!   set_unique_reg_note (XVECEXP (seq, 0, XVECLEN (seq, 0) - 1), REG_EQUAL, note);
  
    return 1;
  }
*************** expand_binop (mode, binoptab, op0, op1, 
*** 991,1002 ****
  	    {
  	      rtx temp = emit_move_insn (target, target);
  
! 	      REG_NOTES (temp)
! 		= gen_rtx_EXPR_LIST (REG_EQUAL,
! 				     gen_rtx_fmt_ee (binoptab->code, mode,
! 						     copy_rtx (xop0),
! 						     copy_rtx (xop1)),
! 				     REG_NOTES (temp));
  	    }
  	  return target;
  	}
--- 989,999 ----
  	    {
  	      rtx temp = emit_move_insn (target, target);
  
! 	      set_unique_reg_note (temp,
! 	      			   REG_EQUAL,
! 				   gen_rtx_fmt_ee (binoptab->code, mode,
! 						   copy_rtx (xop0),
! 						   copy_rtx (xop1)));
  	    }
  	  return target;
  	}
*************** expand_binop (mode, binoptab, op0, op1, 
*** 1174,1185 ****
  	      if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  		{
  		  temp = emit_move_insn (product, product);
! 		  REG_NOTES (temp)
! 		    = gen_rtx_EXPR_LIST (REG_EQUAL,
! 					 gen_rtx_fmt_ee (MULT, mode,
! 							 copy_rtx (op0),
! 							 copy_rtx (op1)),
! 					 REG_NOTES (temp));
  		}
  	      return product;
  	    }
--- 1171,1181 ----
  	      if (mov_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  		{
  		  temp = emit_move_insn (product, product);
! 		  set_unique_reg_note (temp,
! 		  		       REG_EQUAL,
! 				       gen_rtx_fmt_ee (MULT, mode,
! 						       copy_rtx (op0),
! 						       copy_rtx (op1)));
  		}
  	      return product;
  	    }
*************** emit_no_conflict_block (insns, target, o
*** 2547,2554 ****
      {
        last = emit_move_insn (target, target);
        if (equiv)
! 	REG_NOTES (last)
! 	  = gen_rtx_EXPR_LIST (REG_EQUAL, equiv, REG_NOTES (last));
      }
    else
      last = get_last_insn ();
--- 2543,2549 ----
      {
        last = emit_move_insn (target, target);
        if (equiv)
! 	set_unique_reg_note (last, REG_EQUAL, equiv);
      }
    else
      last = get_last_insn ();
*************** emit_libcall_block (insns, target, resul
*** 2646,2653 ****
    last = emit_move_insn (target, result);
    if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
        != CODE_FOR_nothing)
!     REG_NOTES (last) = gen_rtx_EXPR_LIST (REG_EQUAL, copy_rtx (equiv),
! 					  REG_NOTES (last));
  
    if (prev == 0)
      first = get_insns ();
--- 2641,2647 ----
    last = emit_move_insn (target, result);
    if (mov_optab->handlers[(int) GET_MODE (target)].insn_code
        != CODE_FOR_nothing)
!     set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv));
  
    if (prev == 0)
      first = get_insns ();
*************** expand_fix (to, from, unsignedp)
*** 3927,3938 ****
  	    {
  	      /* Make a place for a REG_NOTE and add it.  */
  	      insn = emit_move_insn (to, to);
! 	      REG_NOTES (insn)
! 		= gen_rtx_EXPR_LIST (REG_EQUAL,
! 				     gen_rtx_fmt_e (UNSIGNED_FIX,
! 						    GET_MODE (to),
! 						    copy_rtx (from)),
! 				     REG_NOTES (insn));
  	    }
  	  return;
  	}
--- 3921,3931 ----
  	    {
  	      /* Make a place for a REG_NOTE and add it.  */
  	      insn = emit_move_insn (to, to);
! 	      set_unique_reg_note (insn,
! 	                           REG_EQUAL,
! 				   gen_rtx_fmt_e (UNSIGNED_FIX,
! 						  GET_MODE (to),
! 						  copy_rtx (from)));
  	    }
  	  return;
  	}
Index: gcc/rtl.h
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/rtl.h,v
retrieving revision 1.105.2.2
diff -c -p -r1.105.2.2 rtl.h
*** rtl.h	1999/02/22 18:43:32	1.105.2.2
--- rtl.h	1999/02/22 21:14:19
*************** extern rtx gen_mem_addressof		PROTO((rtx
*** 999,1004 ****
--- 999,1005 ----
  extern rtx eliminate_constant_term	PROTO((rtx, rtx *));
  extern rtx expand_complex_abs		PROTO((enum machine_mode, rtx, rtx, int));
  extern enum machine_mode choose_hard_reg_mode PROTO((int, int));
+ extern void set_unique_reg_note         PROTO((rtx, enum reg_note, rtx));
  
  /* Functions in rtlanal.c */
  


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