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]

MEM tracking, round four


This should be the last of structural patches that affect a large number
of files.  The rest should be smaller.

Tested on alphaev56: problems on other targets are quite possible and I'll
try to address them quickly if and when they arise.

Wed Jul  4 13:40:02 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* emit-rtl.c (replace_equiv_address): New function.
	* expr.h (replace_equiv_address): New declaration.
	* explow.c (validize_mem): Call it instead of change_address and
	also call if -fforce-addr and address is constant.
	* expr.c: Replace more calls to change_address with adjust_address
	and/or replace_equiv_address or to validize_mem.
	* function.c, regmove.c, config/alpha/alpha.c: Likewise.
	* config/arm/arm.md, config/clipper/clipper.md: Likewise.
	* config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise.
	* config/i370/i370.md, config/i860/i860.md: Likewise.
	* config/i960/i960.md, config/mips/mips.c: Likewise.
	* config/mips/mips.md, config/pa/pa.md: Likewise.
	* config/pdp11/pdp11.md, config/rs6000/rs6000.c: Likewise.
	* config/rs6000/rs6000.md, config/sh/sh.md: Likewise.

*** emit-rtl.c	2001/07/02 19:47:38	1.184
--- emit-rtl.c	2001/07/03 20:56:59
*************** change_address (memref, mode, addr)
*** 1602,1605 ****
--- 1602,1606 ----
    return new;
  }
+ 
  /* Return a memory reference like MEMREF, but with its mode changed
     to MODE and its address offset by OFFSET bytes.  */
*************** adjust_address (memref, mode, offset)
*** 1615,1618 ****
--- 1616,1634 ----
    return
      change_address (memref, mode, plus_constant (XEXP (memref, 0), offset));
+ }
+ 
+ /* Return a memory reference like MEMREF, but with its address changed to
+    ADDR.  The caller is asserting that the actual piece of memory pointed
+    to is the same, just the form of the address is being changed, such as
+    by putting something into a register.  */
+ 
+ rtx
+ replace_equiv_address (memref, addr)
+      rtx memref;
+      rtx addr;
+ {
+   /* For now, this is just a wrapper for change_address, but eventually
+      will do memref tracking.  */
+   return change_address (memref, VOIDmode, addr);
  }
  
*** explow.c	2001/07/03 19:44:05	1.65
--- explow.c	2001/07/03 20:57:03
*************** validize_mem (ref)
*** 609,616 ****
    if (GET_CODE (ref) != MEM)
      return ref;
!   if (memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
      return ref;
    /* Don't alter REF itself, since that is probably a stack slot.  */
!   return change_address (ref, GET_MODE (ref), XEXP (ref, 0));
  }
  
--- 609,618 ----
    if (GET_CODE (ref) != MEM)
      return ref;
!   if (! (flag_force_addr && CONSTANT_ADDRESS_P (XEXP (ref, 0)))
!       || memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
      return ref;
+ 
    /* Don't alter REF itself, since that is probably a stack slot.  */
!   return replace_equiv_address (ref, XEXP (ref, 0));
  }
  
*** expr.c	2001/07/02 20:02:53	1.333
--- expr.c	2001/07/03 20:57:24
*************** move_block_from_reg (regno, x, nregs, si
*** 1880,1885 ****
        && (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode)
      {
!       emit_move_insn (change_address (x, mode, NULL),
! 		      gen_rtx_REG (mode, regno));
        return;
      }
--- 1880,1884 ----
        && (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode)
      {
!       emit_move_insn (adjust_address (x, mode, 0), gen_rtx_REG (mode, regno));
        return;
      }
*************** emit_move_insn (x, y)
*** 2747,2751 ****
  	  || (flag_force_addr
  	      && CONSTANT_ADDRESS_P (XEXP (x, 0)))))
!     x = change_address (x, VOIDmode, XEXP (x, 0));
  
    if (GET_CODE (y) == MEM
--- 2746,2750 ----
  	  || (flag_force_addr
  	      && CONSTANT_ADDRESS_P (XEXP (x, 0)))))
!     x = validize_mem (x);
  
    if (GET_CODE (y) == MEM
*************** emit_move_insn (x, y)
*** 2753,2757 ****
  	  || (flag_force_addr
  	      && CONSTANT_ADDRESS_P (XEXP (y, 0)))))
!     y = change_address (y, VOIDmode, XEXP (y, 0));
  
    if (mode == BLKmode)
--- 2752,2756 ----
  	  || (flag_force_addr
  	      && CONSTANT_ADDRESS_P (XEXP (y, 0)))))
!     y = validize_mem (y);
  
    if (mode == BLKmode)
*************** expand_assignment (to, from, want_value,
*** 3753,3759 ****
  	        to_rtx = temp;
  	      else
! 		to_rtx = change_address (to_rtx, mode1,
! 				         force_reg (GET_MODE (XEXP (temp, 0)),
! 						    XEXP (temp, 0)));
  	      bitpos = 0;
  	    }
--- 3752,3758 ----
  	        to_rtx = temp;
  	      else
! 		to_rtx = (replace_equiv_address
! 			  (to_rtx, force_reg (GET_MODE (XEXP (temp, 0)),
! 					      XEXP (temp, 0))));
  	      bitpos = 0;
  	    }
*************** store_field (target, bitsize, bitpos, mo
*** 5332,5343 ****
  		&& (XEXP (addr, 0) == virtual_incoming_args_rtx
  		    || XEXP (addr, 0) == virtual_stack_vars_rtx)))
! 	addr = copy_to_reg (addr);
  
        /* Now build a reference to just the desired component.  */
  
!       to_rtx = copy_rtx (change_address (target, mode,
! 					 plus_constant (addr,
! 							(bitpos
! 							 / BITS_PER_UNIT))));
        MEM_SET_IN_STRUCT_P (to_rtx, 1);
        /* If the address of the structure varies, then it might be on
--- 5331,5341 ----
  		&& (XEXP (addr, 0) == virtual_incoming_args_rtx
  		    || XEXP (addr, 0) == virtual_stack_vars_rtx)))
! 	target = replace_equiv_address (target, copy_to_reg (addr));
  
        /* Now build a reference to just the desired component.  */
  
!       to_rtx = copy_rtx (adjust_address (target, mode,
! 					 bitpos / BITS_PER_UNIT));
! 
        MEM_SET_IN_STRUCT_P (to_rtx, 1);
        /* If the address of the structure varies, then it might be on
*************** save_noncopied_parts (lhs, list)
*** 5684,5694 ****
  			 0, 1, 1);
  
- 	if (! memory_address_p (TYPE_MODE (part_type), XEXP (target, 0)))
- 	  target = change_address (target, TYPE_MODE (part_type), NULL_RTX);
  	parts = tree_cons (to_be_saved,
  			   build (RTL_EXPR, part_type, NULL_TREE,
! 				  (tree) target),
  			   parts);
! 	store_expr (TREE_PURPOSE (parts), RTL_EXPR_RTL (TREE_VALUE (parts)), 0);
        }
    return parts;
--- 5682,5691 ----
  			 0, 1, 1);
  
  	parts = tree_cons (to_be_saved,
  			   build (RTL_EXPR, part_type, NULL_TREE,
! 				  (tree) validize_mem (target)),
  			   parts);
! 	store_expr (TREE_PURPOSE (parts),
! 		    RTL_EXPR_RTL (TREE_VALUE (parts)), 0);
        }
    return parts;
*************** expand_expr (exp, target, tmode, modifie
*** 6343,6352 ****
  	  addr = XEXP (DECL_RTL (exp), 0);
  	  if (GET_CODE (addr) == MEM)
! 	    addr = change_address (addr, Pmode,
! 				   fix_lexical_addr (XEXP (addr, 0), exp));
  	  else
  	    addr = fix_lexical_addr (addr, exp);
  
! 	  temp = change_address (DECL_RTL (exp), mode, addr);
  	}
  
--- 6340,6350 ----
  	  addr = XEXP (DECL_RTL (exp), 0);
  	  if (GET_CODE (addr) == MEM)
! 	    addr
! 	      = replace_equiv_address (addr,
! 				       fix_lexical_addr (XEXP (addr, 0), exp));
  	  else
  	    addr = fix_lexical_addr (addr, exp);
  
! 	  temp = replace_equiv_address (DECL_RTL (exp), addr);
  	}
  
*************** expand_expr (exp, target, tmode, modifie
*** 6357,6362 ****
        else if (GET_CODE (DECL_RTL (exp)) == MEM
  	       && GET_CODE (XEXP (DECL_RTL (exp), 0)) == REG)
! 	temp = change_address (DECL_RTL (exp), GET_MODE (DECL_RTL (exp)),
! 			       XEXP (DECL_RTL (exp), 0));
  
        /* If DECL_RTL is memory, we are in the normal case and either
--- 6355,6359 ----
        else if (GET_CODE (DECL_RTL (exp)) == MEM
  	       && GET_CODE (XEXP (DECL_RTL (exp), 0)) == REG)
! 	temp = validize_mem (DECL_RTL (exp));
  
        /* If DECL_RTL is memory, we are in the normal case and either
*************** expand_expr (exp, target, tmode, modifie
*** 6372,6377 ****
  		   || (flag_force_addr
  		       && GET_CODE (XEXP (DECL_RTL (exp), 0)) != REG)))
! 	temp = change_address (DECL_RTL (exp), VOIDmode,
! 			       copy_rtx (XEXP (DECL_RTL (exp), 0)));
  
        /* If we got something, return it.  But first, set the alignment
--- 6369,6374 ----
  		   || (flag_force_addr
  		       && GET_CODE (XEXP (DECL_RTL (exp), 0)) != REG)))
! 	temp = replace_equiv_address (DECL_RTL (exp),
! 				      copy_rtx (XEXP (DECL_RTL (exp), 0)));
  
        /* If we got something, return it.  But first, set the alignment
*************** expand_expr (exp, target, tmode, modifie
*** 6442,6447 ****
  	      || (flag_force_addr
  		  && GET_CODE (XEXP (TREE_CST_RTL (exp), 0)) != REG)))
! 	return change_address (TREE_CST_RTL (exp), VOIDmode,
! 			       copy_rtx (XEXP (TREE_CST_RTL (exp), 0)));
        return TREE_CST_RTL (exp);
  
--- 6439,6444 ----
  	      || (flag_force_addr
  		  && GET_CODE (XEXP (TREE_CST_RTL (exp), 0)) != REG)))
! 	return replace_equiv_address (TREE_CST_RTL (exp),
! 				      copy_rtx (XEXP (TREE_CST_RTL (exp), 0)));
        return TREE_CST_RTL (exp);
  
*************** expand_expr (exp, target, tmode, modifie
*** 6492,6497 ****
  	  if (temp == 0 || GET_CODE (temp) != MEM)
  	    abort ();
! 	  return change_address (temp, mode,
! 				 fix_lexical_addr (XEXP (temp, 0), exp));
  	}
        if (SAVE_EXPR_RTL (exp) == 0)
--- 6489,6495 ----
  	  if (temp == 0 || GET_CODE (temp) != MEM)
  	    abort ();
! 	  return
! 	    replace_equiv_address (temp,
! 				   fix_lexical_addr (XEXP (temp, 0), exp));
  	}
        if (SAVE_EXPR_RTL (exp) == 0)
*************** expand_expr (exp, target, tmode, modifie
*** 6748,6758 ****
  	  if (modifier != EXPAND_CONST_ADDRESS
  	      && modifier != EXPAND_INITIALIZER
! 	      && modifier != EXPAND_SUM
! 	      && (! memory_address_p (GET_MODE (constructor),
! 				      XEXP (constructor, 0))
! 		  || (flag_force_addr
! 		      && GET_CODE (XEXP (constructor, 0)) != REG)))
! 	    constructor = change_address (constructor, VOIDmode,
! 					  XEXP (constructor, 0));
  	  return constructor;
  	}
--- 6746,6752 ----
  	  if (modifier != EXPAND_CONST_ADDRESS
  	      && modifier != EXPAND_INITIALIZER
! 	      && modifier != EXPAND_SUM)
! 	    constructor = validize_mem (constructor);
! 
  	  return constructor;
  	}
*************** expand_expr (exp, target, tmode, modifie
*** 7096,7102 ****
  		  op0 = temp;
  		else
! 		  op0 = change_address (op0, mode1,
! 					force_reg (GET_MODE (XEXP (temp, 0)),
! 						   XEXP (temp, 0)));
  		bitpos = 0;
  	      }
--- 7090,7097 ----
  		  op0 = temp;
  		else
! 		  op0 = (replace_equiv_address
! 			 (op0,
! 			  force_reg (GET_MODE (XEXP (temp, 0)),
! 				     XEXP (temp, 0))));
  		bitpos = 0;
  	      }
*************** expand_increment (exp, post, ignore)
*** 9401,9405 ****
  	  rtx temp, result;
  
! 	  op0 = change_address (op0, VOIDmode, addr);
  	  temp = force_reg (GET_MODE (op0), op0);
  	  if (! (*insn_data[icode].operand[2].predicate) (op1, mode))
--- 9396,9400 ----
  	  rtx temp, result;
  
! 	  op0 = replace_equiv_address (op0, addr);
  	  temp = force_reg (GET_MODE (op0), op0);
  	  if (! (*insn_data[icode].operand[2].predicate) (op1, mode))
*** expr.h	2001/07/02 19:47:38	1.81
--- expr.h	2001/07/03 20:57:27
*************** extern rtx change_address PARAMS ((rtx, 
*** 1155,1158 ****
--- 1155,1164 ----
  extern rtx adjust_address PARAMS ((rtx, enum machine_mode, HOST_WIDE_INT));
  
+ /* Return a memory reference like MEMREF, but with its address changed to
+    ADDR.  The caller is asserting that the actual piece of memory pointed
+    to is the same, just the form of the address is being changed, such as
+    by putting something into a register.  */
+ extern rtx replace_equiv_address PARAMS ((rtx, rtx));
+ 
  /* Return a memory reference like MEMREF, but which is known to have a
     valid address.  */
*** function.c	2001/07/02 19:47:39	1.279
--- function.c	2001/07/03 20:57:41
*************** fixup_stack_1 (x, insn)
*** 2618,2622 ****
  	  end_sequence ();
  	  emit_insn_before (seq, insn);
! 	  return change_address (x, VOIDmode, temp);
  	}
        return x;
--- 2618,2622 ----
  	  end_sequence ();
  	  emit_insn_before (seq, insn);
! 	  return replace_equiv_address (x, temp);
  	}
        return x;
*** regmove.c	2001/06/19 14:34:23	1.105
--- regmove.c	2001/07/03 20:57:48
*************** combine_stack_adjustments_for_block (bb)
*** 2459,2464 ****
  	      && memory_address_p (GET_MODE (dest), stack_pointer_rtx)
  	      && validate_change (insn, &SET_DEST (set),
! 				  change_address (dest, VOIDmode,
! 						  stack_pointer_rtx), 0))
  	    {
  	      if (last_sp_set == bb->head)
--- 2459,2465 ----
  	      && memory_address_p (GET_MODE (dest), stack_pointer_rtx)
  	      && validate_change (insn, &SET_DEST (set),
! 				  replace_equiv_address (dest,
! 							 stack_pointer_rtx),
! 				  0))
  	    {
  	      if (last_sp_set == bb->head)
*** config/alpha/alpha.c	2001/07/02 19:47:40	1.166
--- config/alpha/alpha.c	2001/07/03 20:58:01
*************** alpha_expand_block_move (operands)
*** 2931,2936 ****
  
        /* No appropriate mode; fall back on memory.  */
!       orig_src = change_address (orig_src, GET_MODE (orig_src),
! 				 copy_addr_to_reg (XEXP (orig_src, 0)));
        src_align = GET_MODE_BITSIZE (GET_MODE (tmp));
      }
--- 2931,2936 ----
  
        /* No appropriate mode; fall back on memory.  */
!       orig_src = replace_equiv_address (orig_src,
! 					copy_addr_to_reg (XEXP (orig_src, 0)));
        src_align = GET_MODE_BITSIZE (GET_MODE (tmp));
      }
*************** alpha_expand_block_move (operands)
*** 2962,2968 ****
        for (i = 0; i < words; ++i)
  	emit_move_insn (data_regs[nregs + i],
! 			change_address (orig_src, SImode,
! 					plus_constant (XEXP (orig_src, 0),
! 						       ofs + i * 4)));
  
        nregs += words;
--- 2962,2966 ----
        for (i = 0; i < words; ++i)
  	emit_move_insn (data_regs[nregs + i],
! 			adjust_address (orig_src, SImode, ofs + i * 4));
  
        nregs += words;
*************** alpha_expand_block_move (operands)
*** 3077,3082 ****
        /* No appropriate mode; fall back on memory.  We can speed things
  	 up by recognizing extra alignment information.  */
!       orig_dst = change_address (orig_dst, GET_MODE (orig_dst),
! 				 copy_addr_to_reg (XEXP (orig_dst, 0)));
        dst_align = GET_MODE_BITSIZE (GET_MODE (tmp));
      }
--- 3075,3080 ----
        /* No appropriate mode; fall back on memory.  We can speed things
  	 up by recognizing extra alignment information.  */
!       orig_dst = replace_equiv_address (orig_dst,
! 					copy_addr_to_reg (XEXP (orig_dst, 0)));
        dst_align = GET_MODE_BITSIZE (GET_MODE (tmp));
      }
*************** alpha_expand_block_clear (operands)
*** 3230,3235 ****
  
        /* No appropriate mode; fall back on memory.  */
!       orig_dst = change_address (orig_dst, GET_MODE (orig_dst),
! 				 copy_addr_to_reg (tmp));
        align = GET_MODE_BITSIZE (GET_MODE (XEXP (tmp, 0)));
      }
--- 3228,3232 ----
  
        /* No appropriate mode; fall back on memory.  */
!       orig_dst = replace_equiv_address (orig_dst, copy_addr_to_reg (tmp));
        align = GET_MODE_BITSIZE (GET_MODE (XEXP (tmp, 0)));
      }
*** config/arm/arm.md	2001/07/02 19:47:40	1.82
--- config/arm/arm.md	2001/07/03 20:58:18
***************
*** 4283,4295 ****
    "
    {
!     rtx addr = XEXP (operands[1], 0);
      enum rtx_code code = GET_CODE (addr);
  
      if ((code == PLUS && GET_CODE (XEXP (addr, 1)) != CONST_INT)
  	|| code == MINUS)
!       addr = force_reg (SImode, addr);
  
!     operands[4] = change_address (operands[1], QImode,
! 				  plus_constant (addr, 1));
      operands[1] = adjust_address (operands[1], QImode, 0);
      operands[3] = gen_lowpart (QImode, operands[0]);
--- 4283,4295 ----
    "
    {
!     rtx op1 = operands[1];
!     rtx addr = XEXP (op1, 0);
      enum rtx_code code = GET_CODE (addr);
  
      if ((code == PLUS && GET_CODE (XEXP (addr, 1)) != CONST_INT)
  	|| code == MINUS)
!       op1 = replace_equiv_address (operands[1], force_reg (SImode, addr));
  
!     operands[4] = adjust_address (op1, QImode, 1);
      operands[1] = adjust_address (operands[1], QImode, 0);
      operands[3] = gen_lowpart (QImode, operands[0]);
***************
*** 4307,4319 ****
    "
    {
!     rtx addr = XEXP (operands[1], 0);
      enum rtx_code code = GET_CODE (addr);
  
      if ((code == PLUS && GET_CODE (XEXP (addr, 1)) != CONST_INT)
  	|| code == MINUS)
!       addr = force_reg (SImode, addr);
  
!     operands[4] = change_address (operands[1], QImode,
! 				  plus_constant (addr, 1));
      operands[1] = adjust_address (operands[1], QImode, 0);
      operands[3] = gen_lowpart (QImode, operands[0]);
--- 4307,4319 ----
    "
    {
!     rtx op1 = operands[1];
!     rtx addr = XEXP (op1, 0);
      enum rtx_code code = GET_CODE (addr);
  
      if ((code == PLUS && GET_CODE (XEXP (addr, 1)) != CONST_INT)
  	|| code == MINUS)
!       op1 = replace_equiv_address (op1, force_reg (SImode, addr));
  
!     operands[4] = adjust_address (op1, QImode, 1);
      operands[1] = adjust_address (operands[1], QImode, 0);
      operands[3] = gen_lowpart (QImode, operands[0]);
***************
*** 4333,4341 ****
      HOST_WIDE_INT value = INTVAL (operands[1]);
      rtx addr = XEXP (operands[0], 0);
      enum rtx_code code = GET_CODE (addr);
  
      if ((code == PLUS && GET_CODE (XEXP (addr, 1)) != CONST_INT)
  	|| code == MINUS)
!       addr = force_reg (SImode, addr);
  
      operands[1] = gen_reg_rtx (SImode);
--- 4333,4342 ----
      HOST_WIDE_INT value = INTVAL (operands[1]);
      rtx addr = XEXP (operands[0], 0);
+     rtx op0 = operands[0];
      enum rtx_code code = GET_CODE (addr);
  
      if ((code == PLUS && GET_CODE (XEXP (addr, 1)) != CONST_INT)
  	|| code == MINUS)
!       op0 = replace_equiv_address (op0, force_reg (SImode, addr));
  
      operands[1] = gen_reg_rtx (SImode);
***************
*** 4363,4368 ****
        }
  
!     operands[3] = change_address (operands[0], QImode,
! 				  plus_constant (addr, 1));
      operands[0] = adjust_address (operands[0], QImode, 0);
    }"
--- 4364,4368 ----
        }
  
!     operands[3] = adjust_address (op0, QImode, 1);
      operands[0] = adjust_address (operands[0], QImode, 0);
    }"
***************
*** 4551,4566 ****
  	      && !memory_address_p (GET_MODE (operands[0]),
  				    XEXP (operands[0], 0)))
! 	    {
! 	      rtx temp = copy_to_reg (XEXP (operands[0], 0));
! 	      operands[0] = change_address (operands[0], VOIDmode, temp);
! 	    }
     
            if (GET_CODE (operands[1]) == MEM
  	      && !memory_address_p (GET_MODE (operands[1]),
  				    XEXP (operands[1], 0)))
! 	    {
! 	      rtx temp = copy_to_reg (XEXP (operands[1], 0));
! 	      operands[1] = change_address (operands[1], VOIDmode, temp);
! 	    }
          }
        /* Handle loading a large integer during reload */
--- 4551,4564 ----
  	      && !memory_address_p (GET_MODE (operands[0]),
  				    XEXP (operands[0], 0)))
! 	    operands[0]
! 	      = replace_equiv_address (operands[0],
! 				       copy_to_reg (XEXP (operands[0], 0)));
     
            if (GET_CODE (operands[1]) == MEM
  	      && !memory_address_p (GET_MODE (operands[1]),
  				    XEXP (operands[1], 0)))
! 	    operands[1]
! 	      = replace_equiv_address (operands[1],
! 				       copy_to_reg (XEXP (operands[1], 0)));
          }
        /* Handle loading a large integer during reload */
***************
*** 4851,4865 ****
  	      && !memory_address_p (GET_MODE (operands[0]),
  		  		     XEXP (operands[0], 0)))
! 	    {
! 	      rtx temp = copy_to_reg (XEXP (operands[0], 0));
! 	      operands[0] = change_address (operands[0], VOIDmode, temp);
! 	    }
            if (GET_CODE (operands[1]) == MEM
  	      && !memory_address_p (GET_MODE (operands[1]),
  				    XEXP (operands[1], 0)))
! 	    {
! 	       rtx temp = copy_to_reg (XEXP (operands[1], 0));
! 	       operands[1] = change_address (operands[1], VOIDmode, temp);
! 	    }
          }
        /* Handle loading a large integer during reload */
--- 4849,4861 ----
  	      && !memory_address_p (GET_MODE (operands[0]),
  		  		     XEXP (operands[0], 0)))
! 	    operands[0]
! 	      = replace_equiv_address (operands[0],
! 				       copy_to_reg (XEXP (operands[0], 0)));
            if (GET_CODE (operands[1]) == MEM
  	      && !memory_address_p (GET_MODE (operands[1]),
  				    XEXP (operands[1], 0)))
! 	     operands[1]
! 	       = replace_equiv_address (operands[1],
! 					copy_to_reg (XEXP (operands[1], 0)));
          }
        /* Handle loading a large integer during reload */
*** config/clipper/clipper.md	2001/07/03 19:44:08	1.6
--- config/clipper/clipper.md	2001/07/03 20:58:21
***************
*** 532,537 ****
    operands[7] = addr1;
  
!   operands[0] = change_address (operands[0], VOIDmode, addr0);
!   operands[1] = change_address (operands[1], VOIDmode, addr1);
  
    if (GET_CODE (operands[2]) != CONST_INT)
--- 532,537 ----
    operands[7] = addr1;
  
!   operands[0] = replace_equiv_address (operands[0], addr0);
!   operands[1] = replace_equiv_address (operands[1], addr1);
  
    if (GET_CODE (operands[2]) != CONST_INT)
*** config/dsp16xx/dsp16xx.md	2001/07/02 19:47:41	1.10
--- config/dsp16xx/dsp16xx.md	2001/07/03 20:58:25
***************
*** 1132,1137 ****
    operands[6] = addr1;
  
!   operands[0] = change_address (operands[0], VOIDmode, addr0);
!   operands[1] = change_address (operands[1], VOIDmode, addr1);
  }")
  
--- 1132,1137 ----
    operands[6] = addr1;
  
!   operands[0] = replace_equiv_address (operands[0], VOIDmode, addr0);
!   operands[1] = replace_equiv_address (operands[1], VOIDmode, addr1);
  }")
  
*** config/fr30/fr30.c	2001/07/02 19:47:41	1.11
--- config/fr30/fr30.c	2001/07/03 20:58:26
*************** fr30_move_double (operands)
*** 1008,1012 ****
  	    {
  	      emit_insn (gen_rtx_SET (VOIDmode, dest1,
! 				      change_address (src, SImode, addr)));
  	      emit_insn (gen_rtx_SET (SImode, dest0,
  				      gen_rtx_REG (SImode, REGNO (addr))));
--- 1008,1012 ----
  	    {
  	      emit_insn (gen_rtx_SET (VOIDmode, dest1,
! 				      adjust_address (src, SImode, 0)));
  	      emit_insn (gen_rtx_SET (SImode, dest0,
  				      gen_rtx_REG (SImode, REGNO (addr))));
*************** fr30_move_double (operands)
*** 1022,1026 ****
  	    {
  	      emit_insn (gen_rtx_SET (VOIDmode, dest0,
! 				      change_address (src, SImode, addr)));
  	      emit_insn (gen_rtx_SET (SImode, dest1,
  				      gen_rtx_REG (SImode, REGNO (addr))));
--- 1022,1026 ----
  	    {
  	      emit_insn (gen_rtx_SET (VOIDmode, dest0,
! 				      adjust_address (src, SImode, 0)));
  	      emit_insn (gen_rtx_SET (SImode, dest1,
  				      gen_rtx_REG (SImode, REGNO (addr))));
*************** fr30_move_double (operands)
*** 1059,1064 ****
        src1 = operand_subword (src, 1, TRUE, mode);
        
!       emit_insn (gen_rtx_SET (VOIDmode,
! 			      change_address (dest, SImode, addr),
  			      src0));
  
--- 1059,1063 ----
        src1 = operand_subword (src, 1, TRUE, mode);
        
!       emit_insn (gen_rtx_SET (VOIDmode, adjust_address (dest, SImode, 0),
  			      src0));
  
*** config/i370/i370.md	2001/05/27 10:35:09	1.17
--- config/i370/i370.md	2001/07/03 20:58:33
*************** check_label_emit ();
*** 1381,1399 ****
     "
  {
- /*
-   XXX bogus, i think, unless change_address has a side effet we need
-   rtx op0;
- 
-   op0 = XEXP (operands[0], 0);
-   if (GET_CODE (op0) == REG
-       || (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 0)) == REG
- 	  && GET_CODE (XEXP (op0, 1)) == CONST_INT
- 	  && (unsigned) INTVAL (XEXP (op0, 1)) < 4096))
-     op0 = operands[0];
-   else
-     op0 = change_address (operands[0], VOIDmode,
- 			  copy_to_mode_reg (SImode, op0));
- 
- */
    {
          /* implementation suggested by  Richard Henderson <rth@cygnus.com> */
--- 1381,1384 ----
*************** check_label_emit ();
*** 1443,1448 ****
      op0 = operands[0];
    else
!     op0 = change_address (operands[0], VOIDmode,
! 			  copy_to_mode_reg (SImode, op0));
  
    op1 = XEXP (operands[1], 0);
--- 1428,1432 ----
      op0 = operands[0];
    else
!     op0 = replace_equiv_address (operands[0], copy_to_mode_reg (SImode, op0));
  
    op1 = XEXP (operands[1], 0);
*************** check_label_emit ();
*** 1453,1458 ****
      op1 = operands[1];
    else
!     op1 = change_address (operands[1], VOIDmode,
! 			  copy_to_mode_reg (SImode, op1));
  
    if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 256)
--- 1437,1441 ----
      op1 = operands[1];
    else
!     op1 = replace_equiv_address (operands[1], copy_to_mode_reg (SImode, op1));
  
    if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 256)
*** config/i860/i860.md	2001/06/30 17:23:53	1.10
--- config/i860/i860.md	2001/07/03 20:58:37
***************
*** 1023,1028 ****
    operands[8] = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
  
!   operands[0] = change_address (operands[0], VOIDmode, operands[7]);
!   operands[1] = change_address (operands[1], VOIDmode, operands[8]);
  }")
  
--- 1023,1028 ----
    operands[8] = copy_to_mode_reg (SImode, XEXP (operands[1], 0));
  
!   operands[0] = replace_equiv_address (operands[0], operands[7]);
!   operands[1] = replace_equiv_address (operands[1], operands[8]);
  }")
  
*************** fmul.ss %1,%0,%4\;fmul.ss %3,%4,%0\";
*** 2128,2133 ****
    if (! call_insn_operand (operands[0], QImode))
      operands[0]
!       = change_address (operands[0], VOIDmode,
! 			copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
    if (INTVAL (operands[1]) > 0)
      {
--- 2128,2134 ----
    if (! call_insn_operand (operands[0], QImode))
      operands[0]
!       = replace_equiv_address (operands[0],
! 			       copy_to_mode_reg (Pmode,
! 						 XEXP (operands[0], 0)));
    if (INTVAL (operands[1]) > 0)
      {
*************** fmul.ss %1,%0,%4\;fmul.ss %3,%4,%0\";
*** 2196,2201 ****
    if (! call_insn_operand (operands[1], QImode))
      operands[1]
!       = change_address (operands[1], VOIDmode,
! 			copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
    if (INTVAL (operands[2]) > 0)
      {
--- 2197,2203 ----
    if (! call_insn_operand (operands[1], QImode))
      operands[1]
!       = replace_equiv_address (operands[1],
! 			       copy_to_mode_reg (Pmode,
! 						 XEXP (operands[1], 0)));
    if (INTVAL (operands[2]) > 0)
      {
*** config/i960/i960.md	2001/07/03 19:44:11	1.20
--- config/i960/i960.md	2001/07/03 20:58:44
***************
*** 1005,1009 ****
    int regno;
    int count;
!   rtx from;
  
    if (GET_CODE (operands[0]) != MEM
--- 1005,1009 ----
    int regno;
    int count;
!   int offset = 0;
  
    if (GET_CODE (operands[0]) != MEM
***************
*** 1017,1044 ****
  
    regno = REGNO (operands[1]);
-   from = memory_address (SImode, XEXP (operands[0], 0));
    while (count >= 4 && ((regno & 3) == 0))
      {
!       emit_move_insn (change_address (operands[0], TImode, from),
  		      gen_rtx_REG (TImode, regno));
        count -= 4;
        regno += 4;
!       from = memory_address (TImode, plus_constant (from, 16));
      }
    while (count >= 2 && ((regno & 1) == 0))
      {
!       emit_move_insn (change_address (operands[0], DImode, from),
  		      gen_rtx_REG (DImode, regno));
        count -= 2;
        regno += 2;
!       from = memory_address (DImode, plus_constant (from, 8));
      }
    while (count > 0)
      {
!       emit_move_insn (change_address (operands[0], SImode, from),
  		      gen_rtx_REG (SImode, regno));
        count -= 1;
        regno += 1;
!       from = memory_address (SImode, plus_constant (from, 4));
      }
    DONE;
--- 1017,1043 ----
  
    regno = REGNO (operands[1]);
    while (count >= 4 && ((regno & 3) == 0))
      {
!       emit_move_insn (adjust_address (operands[0], TImode, offset),
  		      gen_rtx_REG (TImode, regno));
        count -= 4;
        regno += 4;
!       offset += 16;
      }
    while (count >= 2 && ((regno & 1) == 0))
      {
!       emit_move_insn (adjust_address (operands[0], DImode, offset),
  		      gen_rtx_REG (DImode, regno));
        count -= 2;
        regno += 2;
!       offset += 8;
      }
    while (count > 0)
      {
!       emit_move_insn (adjust_address (operands[0], SImode, offset),
  		      gen_rtx_REG (SImode, regno));
        count -= 1;
        regno += 1;
!       offset += 4;
      }
    DONE;
*** config/mips/mips.c	2001/07/03 19:44:14	1.120
--- config/mips/mips.c	2001/07/03 20:59:04
*************** block_move_loop (dest_reg, src_reg, byte
*** 3249,3257 ****
       unsigned int bytes;	/* # bytes to move */
       int align;			/* alignment */
!      rtx orig_dest;		/* original dest for change_address */
       rtx orig_src;		/* original source for making a reg note */
  {
!   rtx dest_mem = change_address (orig_dest, BLKmode, dest_reg);
!   rtx src_mem = change_address (orig_src, BLKmode, src_reg);
    rtx align_rtx = GEN_INT (align);
    rtx label;
--- 3249,3257 ----
       unsigned int bytes;	/* # bytes to move */
       int align;			/* alignment */
!      rtx orig_dest;		/* original dest */
       rtx orig_src;		/* original source for making a reg note */
  {
!   rtx dest_mem = replace_equiv_address (orig_dest, dest_reg);
!   rtx src_mem = replace_equiv_address (orig_src, src_reg);
    rtx align_rtx = GEN_INT (align);
    rtx label;
*************** expand_block_move (operands)
*** 3384,3391 ****
  	
    else if (constp && bytes <= (unsigned)2 * MAX_MOVE_BYTES)
!     emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode,
! 						      dest_reg),
! 				      change_address (orig_src, BLKmode,
! 						      src_reg),
  				      bytes_rtx, align_rtx));
  
--- 3384,3391 ----
  	
    else if (constp && bytes <= (unsigned)2 * MAX_MOVE_BYTES)
!     emit_insn (gen_movstrsi_internal (replace_equiv_address (orig_dest,
! 							     dest_reg),
! 				      replace_equiv_address (orig_src,
! 							     src_reg),
  				      bytes_rtx, align_rtx));
  
*************** expand_block_move (operands)
*** 3434,3441 ****
        /* Bytes at the end of the loop.  */
        if (leftover)
! 	emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode,
! 							  dest_reg),
! 					  change_address (orig_src, BLKmode,
! 							  src_reg),
  					  GEN_INT (leftover),
  					  GEN_INT (align)));
--- 3434,3441 ----
        /* Bytes at the end of the loop.  */
        if (leftover)
! 	emit_insn (gen_movstrsi_internal (replace_equiv_address (orig_dest,
! 								 dest_reg),
! 					  replace_equiv_address (orig_src,
! 								 src_reg),
  					  GEN_INT (leftover),
  					  GEN_INT (align)));
*** config/mips/mips.md	2001/07/03 19:44:15	1.97
--- config/mips/mips.md	2001/07/03 20:59:25
*************** move\\t%0,%z4\\n\\
*** 5067,5071 ****
  	  rtx memword, offword, hi_word, lo_word;
  	  rtx addr = find_replacement (&XEXP (operands[1], 0));
! 	  rtx op1 = change_address (operands[1], VOIDmode, addr);
  
  	  scratch = gen_rtx_REG (SImode, REGNO (scratch));
--- 5067,5071 ----
  	  rtx memword, offword, hi_word, lo_word;
  	  rtx addr = find_replacement (&XEXP (operands[1], 0));
! 	  rtx op1 = replace_equiv_address (operands[1], addr);
  
  	  scratch = gen_rtx_REG (SImode, REGNO (scratch));
*************** move\\t%0,%z4\\n\\
*** 5147,5151 ****
  	  rtx scratch, memword, offword, hi_word, lo_word;
  	  rtx addr = find_replacement (&XEXP (operands[0], 0));
! 	  rtx op0 = change_address (operands[0], VOIDmode, addr);
  
  	  scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
--- 5147,5151 ----
  	  rtx scratch, memword, offword, hi_word, lo_word;
  	  rtx addr = find_replacement (&XEXP (operands[0], 0));
! 	  rtx op0 = replace_equiv_address (operands[0], addr);
  
  	  scratch = gen_rtx_REG (SImode, REGNO (operands[2]));
*** config/pa/pa.md	2001/05/07 19:22:28	1.90
--- config/pa/pa.md	2001/07/03 20:59:38
***************
*** 2815,2823 ****
    /* Fall through means we're going to use our block move pattern.  */
    operands[0]
!     = change_address (operands[0], VOIDmode,
! 		      copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
    operands[1]
!     = change_address (operands[1], VOIDmode,
! 		      copy_to_mode_reg (SImode, XEXP (operands[1], 0)));
    operands[4] = gen_reg_rtx (SImode);
    operands[5] = gen_reg_rtx (SImode);
--- 2815,2823 ----
    /* Fall through means we're going to use our block move pattern.  */
    operands[0]
!     = replace_equiv_address (operands[0],
! 			     copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
    operands[1]
!     = replace_equiv_address (operands[1],
! 			     copy_to_mode_reg (SImode, XEXP (operands[1], 0)));
    operands[4] = gen_reg_rtx (SImode);
    operands[5] = gen_reg_rtx (SImode);
*** config/pdp11/pdp11.md	2001/07/03 19:44:18	1.15
--- config/pdp11/pdp11.md	2001/07/03 20:59:40
***************
*** 697,705 ****
  {
    operands[0]
!     = change_address (operands[0], VOIDmode,
! 		      copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
    operands[1]
!     = change_address (operands[1], VOIDmode,
! 		      copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
  
    operands[5] = XEXP (operands[0], 0);
--- 697,705 ----
  {
    operands[0]
!     = replace_equiv_address (operands[0],
! 			     copy_to_mode_reg (Pmode, XEXP (operands[0], 0)));
    operands[1]
!     = replace_equiv_address (operands[1],
! 			     copy_to_mode_reg (Pmode, XEXP (operands[1], 0)));
  
    operands[5] = XEXP (operands[0], 0);
*** config/rs6000/rs6000.c	2001/07/03 01:58:35	1.188
--- config/rs6000/rs6000.c	2001/07/03 20:59:55
*************** rs6000_emit_move (dest, source, mode)
*** 1867,1878 ****
  	  && GET_CODE (XEXP (operands[0], 0)) != REG
  	  && ! reload_in_progress)
! 	operands[0] = change_address (operands[0], TImode,
! 				      copy_addr_to_reg (XEXP (operands[0], 0)));
  
        if (GET_CODE (operands[1]) == MEM
  	  && GET_CODE (XEXP (operands[1], 0)) != REG
  	  && ! reload_in_progress)
! 	operands[1] = change_address (operands[1], TImode,
! 				      copy_addr_to_reg (XEXP (operands[1], 0)));
        break;
  
--- 1867,1880 ----
  	  && GET_CODE (XEXP (operands[0], 0)) != REG
  	  && ! reload_in_progress)
! 	operands[0]
! 	  = replace_equiv_address (operands[0],
! 				   copy_addr_to_reg (XEXP (operands[0], 0)));
  
        if (GET_CODE (operands[1]) == MEM
  	  && GET_CODE (XEXP (operands[1], 0)) != REG
  	  && ! reload_in_progress)
! 	operands[1]
! 	  = replace_equiv_address (operands[1],
! 				   copy_addr_to_reg (XEXP (operands[1], 0)));
        break;
  
*** config/rs6000/rs6000.md	2001/05/26 01:08:13	1.119
--- config/rs6000/rs6000.md	2001/07/03 21:00:22
*************** operands[2] = GEN_INT (INTVAL (operands[
*** 8258,8262 ****
    int regno;
    int count;
!   rtx from;
    int i;
  
--- 8258,8262 ----
    int regno;
    int count;
!   rtx op1;
    int i;
  
*************** operands[2] = GEN_INT (INTVAL (operands[
*** 8276,8286 ****
  
    operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
!   from = force_reg (SImode, XEXP (operands[1], 0));
  
    for (i = 0; i < count; i++)
      XVECEXP (operands[3], 0, i)
        = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
! 		     change_address (operands[1], SImode,
! 				     plus_constant (from, i * 4)));
  }")
  
--- 8276,8286 ----
  
    operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
!   op1 = replace_equiv_address (operands[1],
! 			       force_reg (SImode, XEXP (operands[1], 0)));
  
    for (i = 0; i < count; i++)
      XVECEXP (operands[3], 0, i)
        = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
! 		     adjust_address (op1, SImode, i * 4));
  }")
  
*************** operands[2] = GEN_INT (INTVAL (operands[
*** 8355,8358 ****
--- 8355,8359 ----
    int count;
    rtx to;
+   rtx op0;
    int i;
  
*************** operands[2] = GEN_INT (INTVAL (operands[
*** 8373,8380 ****
    operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
    to = force_reg (SImode, XEXP (operands[0], 0));
  
    XVECEXP (operands[3], 0, 0)
!     = gen_rtx_SET (VOIDmode, change_address (operands[0], SImode, to),
! 		   operands[1]);
    XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
  						 gen_rtx_SCRATCH (SImode));
--- 8374,8381 ----
    operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
    to = force_reg (SImode, XEXP (operands[0], 0));
+   op0 = replace_equiv_address (operands[0], to);
  
    XVECEXP (operands[3], 0, 0)
!     = gen_rtx_SET (VOIDmode, op0, operands[1]);
    XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
  						 gen_rtx_SCRATCH (SImode));
*************** operands[2] = GEN_INT (INTVAL (operands[
*** 8383,8388 ****
      XVECEXP (operands[3], 0, i + 1)
        = gen_rtx_SET (VOIDmode,
! 		     change_address (operands[0], SImode,
! 				     plus_constant (to, i * 4)),
  		     gen_rtx_REG (SImode, regno + i));
  }")
--- 8384,8388 ----
      XVECEXP (operands[3], 0, i + 1)
        = gen_rtx_SET (VOIDmode,
! 		     adjust_address (op0, SImode, i * 4),
  		     gen_rtx_REG (SImode, regno + i));
  }")
*** config/sh/sh.md	2001/06/21 19:37:35	1.85
--- config/sh/sh.md	2001/07/03 21:00:33
***************
*** 5029,5033 ****
    addr_target = copy_addr_to_reg (plus_constant (orig_address, size - 1));
  
!   operands[0] = change_address (operands[0], QImode, addr_target);
    emit_insn (gen_movqi (operands[0], gen_rtx_SUBREG (QImode, shift_reg, 0)));
  
--- 5029,5033 ----
    addr_target = copy_addr_to_reg (plus_constant (orig_address, size - 1));
  
!   operands[0] = replace_equiv_address (operands[0], addr_target);
    emit_insn (gen_movqi (operands[0], gen_rtx_SUBREG (QImode, shift_reg, 0)));
  


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