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]

PATCH: Lazy DECL_RTL



This patch makes DECL_RTL operate lazily, calling make_decl_rtl if
there is not already any RTL associated with a declaration.  This is a
key step towards a significant C++ performance win, namely avoiding
generating mangled names for functions that are not actually emitted.
As such, I've put this patch on the branch.  I'll be checking the same
(or a very similar) patch in on the mainline as soon as I test there.

In addition to the performance benefit, this has the substantial
advantage of allowing front-ends to avoid having to think about
generating RTL for most declarations.  Over the years, there have been
several C++ front-end bugs where we called make_decl_rtl too late,
which caused various inconsistencies.  With this approach, front-ends
should be able to concentrate more on making tree sturcture, and let
the RTL generation take care of itself.

Boostrapped and tested on i686-pc-linux-gnu, installed on the branch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-03-14  Mark Mitchell  <mark@codesourcery.com>

	* tree.h (DECL_RTL): Allocate RTL lazily.
	(SET_DECL_RTL): New macro.
	(DECL_RTL_SET_P): Likewise.
	(COPY_DECL_RTL): Likewise.
	(DECL_RTL_IF_SET): Likewise.
	* varasm.c (make_decl_rtl): Add assertions about the kind of
	declaration we are processing.
	* c-decl.c (duplicate_decls): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
	(start_decl): Likewise.
	(finish_decl): Likewise.
	* c-semantics.c (emit_local_var): Likewise.
	* calls.c (expand_call): Likewise.
	* dbxout.c (dbxout_symbol): Likewise.
	* emit-rtl.c (unshare_all_rtl): Likewise.
	(unshare_all_decls): Likewise.
	(reset_used_decls): Likewise.
	* expr.c (store_constructor): Likewise.
	(safe_from_p): Likewise.
	(expand_expr): Likewise.
	* function.c (put_var_into_stack): Likewise.
	(instantiate_decls_1): Likewise.
	(assign_parms): Likewise.
	(expand_function_start): Likewise.
	(expand_function_end): Likewise.
	* ggc-common.c (gcc_mark_trees): Likewise.
	* integrate.c (function_cannot_inline_p): Likewise.
	(copy_decl_for_inlining): Likewise.
	(expand_inline_function): Likewise.
	(integrate_parm_decls): Likewise.
	(integrate_decl_tree): Likewise.
	* print-tree.c (print_node): Likewise.
	* reg-stack.c (stack_result): Likewise.
	* stmt.c (label_rtx): Likewise.
	(expand_return): Likewise.
	(expand_decl): Likewise.
	(expand_decl_cleanup): Likewise.
	(expand_anon_union_decl): Likewise.
	* toplev.c (check_global_declarations): Likewise.
	(rest_of_decl_compilation): Likewise.
	* tree.c (simple_cst_equal): Likewise.
	* objc/objc-act.c (generate_static_references): Likewise.
	
2001-03-14  Mark Mitchell  <mark@codesourcery.com>

	* class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
	* cp-tree.h (DECL_IN_MEMORY_P): Likewise.
	* decl.c (duplicate_decls): Likewise.
	(builtin_function): Likewise.
	(build_library_fn): Likewise.
	(build_cp_library_fn): Likewise.
	(check_initializer): Likewise.
	(cp_finish_decl): Likewise.
	* decl2.c (grokfield): Likewise.
	(grok_function_init): Remove #if 0'd code.
	(finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.
	* friend.c (do_friend): Likewise.
	* init.c (get_temp_regvar): Likewise.
	* method.c (make_thunk): Likewise.
	* pt.c (tsubst_friend_function): Likewise.
	(tsubst_decl): Likewise.
	(regenerate_decl_from_template): Likewise.
	* semantics.c (genrtl_named_return_value): Likewise.
	(expand_body): Likewise.
	(genrtl_finish_function): Likewise.
	* tree.c (cp_tree_equal): Likewise.
	
Wed Mar 14 09:29:27 2001  Mark Mitchell  <mark@codesourcery.com>

	* com.c (ffecom_member_phase_2): Use COPY_DECL_RTL,
	DECL_RTL_SET_P, etc.
	(duplicate_decls): Likewise.
	(start_decl): Likewise.
	
2001-03-14  Mark Mitchell  <mark@codesourcery.com>

	* decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.207.2.4
diff -c -p -r1.207.2.4 c-decl.c
*** c-decl.c	2001/03/02 19:51:56	1.207.2.4
--- c-decl.c	2001/03/14 17:08:03
*************** duplicate_decls (newdecl, olddecl, diffe
*** 1845,1851 ****
  	}
  
        /* Keep the old rtl since we can safely use it.  */
!       DECL_RTL (newdecl) = DECL_RTL (olddecl);
  
        /* Merge the type qualifiers.  */
        if (TREE_CODE (olddecl) == FUNCTION_DECL
--- 1845,1851 ----
  	}
  
        /* Keep the old rtl since we can safely use it.  */
!       COPY_DECL_RTL (olddecl, newdecl);
  
        /* Merge the type qualifiers.  */
        if (TREE_CODE (olddecl) == FUNCTION_DECL
*************** start_decl (declarator, declspecs, initi
*** 3455,3461 ****
        /* But not if this is a duplicate decl
  	 and we preserved the rtl from the previous one
  	 (which may or may not happen).  */
!       && DECL_RTL (tem) == 0
        && !DECL_CONTEXT (tem))
      {
        if (TREE_TYPE (tem) != error_mark_node
--- 3455,3461 ----
        /* But not if this is a duplicate decl
  	 and we preserved the rtl from the previous one
  	 (which may or may not happen).  */
!       && !DECL_RTL_SET_P (tem)
        && !DECL_CONTEXT (tem))
      {
        if (TREE_TYPE (tem) != error_mark_node
*************** finish_decl (decl, init, asmspec_tree)
*** 3598,3604 ****
    if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
      {
        DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN;
!       DECL_RTL (decl) = 0;
        DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
      }
  
--- 3598,3604 ----
    if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
      {
        DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN;
!       SET_DECL_RTL (decl, NULL_RTX);
        DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
      }
  
Index: c-semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-semantics.c,v
retrieving revision 1.17
diff -c -p -r1.17 c-semantics.c
*** c-semantics.c	2001/01/02 23:49:43	1.17
--- c-semantics.c	2001/03/14 17:08:04
*************** emit_local_var (decl)
*** 313,319 ****
       tree decl;
  {
    /* Create RTL for this variable.  */
!   if (!DECL_RTL (decl))
      {
        if (DECL_C_HARD_REGISTER (decl))
  	/* The user specified an assembler name for this variable.
--- 313,319 ----
       tree decl;
  {
    /* Create RTL for this variable.  */
!   if (!DECL_RTL_SET_P (decl))
      {
        if (DECL_C_HARD_REGISTER (decl))
  	/* The user specified an assembler name for this variable.
Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.175
diff -c -p -r1.175 calls.c
*** calls.c	2001/01/24 19:00:58	1.175
--- calls.c	2001/03/14 17:08:07
*************** expand_call (exp, target, ignore)
*** 2526,2533 ****
  	      {
  		tree var = build_decl (VAR_DECL, NULL_TREE,
  				       TREE_TYPE (args[i].tree_value));
! 		DECL_RTL (var) = expand_expr (args[i].tree_value, NULL_RTX,
! 					      VOIDmode, EXPAND_NORMAL);
  		args[i].tree_value = var;
  	      }
  	      break;
--- 2526,2534 ----
  	      {
  		tree var = build_decl (VAR_DECL, NULL_TREE,
  				       TREE_TYPE (args[i].tree_value));
! 		SET_DECL_RTL (var,
! 			      expand_expr (args[i].tree_value, NULL_RTX,
! 					   VOIDmode, EXPAND_NORMAL));
  		args[i].tree_value = var;
  	      }
  	      break;
Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.72.4.1
diff -c -p -r1.72.4.1 dbxout.c
*** dbxout.c	2001/02/21 14:56:07	1.72.4.1
--- dbxout.c	2001/03/14 17:08:09
*************** dbxout_symbol (decl, local)
*** 1971,1977 ****
  	  /* else it is something we handle like a normal variable.  */
  	}
  
!       DECL_RTL (decl) = eliminate_regs (DECL_RTL (decl), 0, NULL_RTX);
  #ifdef LEAF_REG_REMAP
        if (current_function_uses_only_leaf_regs)
  	leaf_renumber_regs_insn (DECL_RTL (decl));
--- 1971,1977 ----
  	  /* else it is something we handle like a normal variable.  */
  	}
  
!       SET_DECL_RTL (decl, eliminate_regs (DECL_RTL (decl), 0, NULL_RTX));
  #ifdef LEAF_REG_REMAP
        if (current_function_uses_only_leaf_regs)
  	leaf_renumber_regs_insn (DECL_RTL (decl));
*************** dbxout_parms (parms)
*** 2307,2313 ****
  	   so that the debugging output will be accurate.  */
  	DECL_INCOMING_RTL (parms)
  	  = eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
! 	DECL_RTL (parms) = eliminate_regs (DECL_RTL (parms), 0, NULL_RTX);
  #ifdef LEAF_REG_REMAP
  	if (current_function_uses_only_leaf_regs)
  	  {
--- 2307,2313 ----
  	   so that the debugging output will be accurate.  */
  	DECL_INCOMING_RTL (parms)
  	  = eliminate_regs (DECL_INCOMING_RTL (parms), 0, NULL_RTX);
! 	SET_DECL_RTL (parms, eliminate_regs (DECL_RTL (parms), 0, NULL_RTX));
  #ifdef LEAF_REG_REMAP
  	if (current_function_uses_only_leaf_regs)
  	  {
Index: emit-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.162.2.1
diff -c -p -r1.162.2.1 emit-rtl.c
*** emit-rtl.c	2001/03/02 19:51:57	1.162.2.1
--- emit-rtl.c	2001/03/14 17:08:12
*************** unshare_all_rtl (fndecl, insn)
*** 1741,1747 ****
  
    /* Make sure that virtual parameters are not shared.  */
    for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
!     DECL_RTL (decl) = copy_rtx_if_shared (DECL_RTL (decl));
  
    /* Make sure that virtual stack slots are not shared.  */
    unshare_all_decls (DECL_INITIAL (fndecl));
--- 1741,1747 ----
  
    /* Make sure that virtual parameters are not shared.  */
    for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
!     SET_DECL_RTL (decl, copy_rtx_if_shared (DECL_RTL (decl)));
  
    /* Make sure that virtual stack slots are not shared.  */
    unshare_all_decls (DECL_INITIAL (fndecl));
*************** unshare_all_decls (blk)
*** 1816,1822 ****
  
    /* Copy shared decls.  */
    for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
!     DECL_RTL (t) = copy_rtx_if_shared (DECL_RTL (t));
  
    /* Now process sub-blocks.  */
    for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
--- 1816,1823 ----
  
    /* Copy shared decls.  */
    for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
!     if (DECL_RTL_SET_P (t))
!       SET_DECL_RTL (t, copy_rtx_if_shared (DECL_RTL (t)));
  
    /* Now process sub-blocks.  */
    for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
*************** reset_used_decls (blk)
*** 1833,1839 ****
  
    /* Mark decls.  */
    for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
!     reset_used_flags (DECL_RTL (t));
  
    /* Now process sub-blocks.  */
    for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
--- 1834,1841 ----
  
    /* Mark decls.  */
    for (t = BLOCK_VARS (blk); t; t = TREE_CHAIN (t))
!     if (DECL_RTL_SET_P (t))
!       reset_used_flags (DECL_RTL (t));
  
    /* Now process sub-blocks.  */
    for (t = BLOCK_SUBBLOCKS (blk); t; t = TREE_CHAIN (t))
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.295.2.1
diff -c -p -r1.295.2.1 expr.c
*** expr.c	2001/03/02 19:51:56	1.295.2.1
--- expr.c	2001/03/14 17:08:18
*************** store_constructor (exp, target, align, c
*** 4721,4730 ****
  
  		  index = build_decl (VAR_DECL, NULL_TREE, domain);
  
! 		  DECL_RTL (index) = index_r
  		    = gen_reg_rtx (promote_mode (domain, DECL_MODE (index),
  						 &unsignedp, 0));
! 
  		  if (TREE_CODE (value) == SAVE_EXPR
  		      && SAVE_EXPR_RTL (value) == 0)
  		    {
--- 4721,4730 ----
  
  		  index = build_decl (VAR_DECL, NULL_TREE, domain);
  
! 		  index_r
  		    = gen_reg_rtx (promote_mode (domain, DECL_MODE (index),
  						 &unsignedp, 0));
! 		  SET_DECL_RTL (index, index_r);
  		  if (TREE_CODE (value) == SAVE_EXPR
  		      && SAVE_EXPR_RTL (value) == 0)
  		    {
*************** safe_from_p (x, exp, top_p)
*** 5649,5655 ****
    switch (TREE_CODE_CLASS (TREE_CODE (exp)))
      {
      case 'd':
!       exp_rtl = DECL_RTL (exp);
        break;
  
      case 'c':
--- 5649,5655 ----
    switch (TREE_CODE_CLASS (TREE_CODE (exp)))
      {
      case 'd':
!       exp_rtl = DECL_RTL_SET_P (exp) ? DECL_RTL (exp) : NULL_RTX;
        break;
  
      case 'c':
*************** expand_expr (exp, target, tmode, modifie
*** 6530,6536 ****
  	/* If VARS have not yet been expanded, expand them now.  */
  	while (vars)
  	  {
! 	    if (DECL_RTL (vars) == 0)
  	      {
  		vars_need_expansion = 1;
  		expand_decl (vars);
--- 6530,6536 ----
  	/* If VARS have not yet been expanded, expand them now.  */
  	while (vars)
  	  {
! 	    if (!DECL_RTL_SET_P (vars))
  	      {
  		vars_need_expansion = 1;
  		expand_decl (vars);
*************** expand_expr (exp, target, tmode, modifie
*** 8269,8275 ****
  
  	if (target == 0)
  	  {
! 	    if (DECL_RTL (slot) != 0)
  	      {
  		target = DECL_RTL (slot);
  		/* If we have already expanded the slot, so don't do
--- 8269,8275 ----
  
  	if (target == 0)
  	  {
! 	    if (DECL_RTL_SET_P (slot))
  	      {
  		target = DECL_RTL (slot);
  		/* If we have already expanded the slot, so don't do
*************** expand_expr (exp, target, tmode, modifie
*** 8282,8288 ****
  		target = assign_temp (type, 2, 0, 1);
  		/* All temp slots at this level must not conflict.  */
  		preserve_temp_slots (target);
! 		DECL_RTL (slot) = target;
  		if (TREE_ADDRESSABLE (slot))
  		  put_var_into_stack (slot);
  
--- 8282,8288 ----
  		target = assign_temp (type, 2, 0, 1);
  		/* All temp slots at this level must not conflict.  */
  		preserve_temp_slots (target);
! 		SET_DECL_RTL (slot, target);
  		if (TREE_ADDRESSABLE (slot))
  		  put_var_into_stack (slot);
  
*************** expand_expr (exp, target, tmode, modifie
*** 8308,8314 ****
  	    /* If we have already assigned it space, use that space,
  	       not target that we were passed in, as our target
  	       parameter is only a hint.  */
! 	    if (DECL_RTL (slot) != 0)
  	      {
  		target = DECL_RTL (slot);
  		/* If we have already expanded the slot, so don't do
--- 8308,8314 ----
  	    /* If we have already assigned it space, use that space,
  	       not target that we were passed in, as our target
  	       parameter is only a hint.  */
! 	    if (DECL_RTL_SET_P (slot))
  	      {
  		target = DECL_RTL (slot);
  		/* If we have already expanded the slot, so don't do
*************** expand_expr (exp, target, tmode, modifie
*** 8318,8324 ****
  	      }
  	    else
  	      {
! 		DECL_RTL (slot) = target;
  		/* If we must have an addressable slot, then make sure that
  		   the RTL that we just stored in slot is OK.  */
  		if (TREE_ADDRESSABLE (slot))
--- 8318,8324 ----
  	      }
  	    else
  	      {
! 		SET_DECL_RTL (slot, target);
  		/* If we must have an addressable slot, then make sure that
  		   the RTL that we just stored in slot is OK.  */
  		if (TREE_ADDRESSABLE (slot))
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.250.2.2
diff -c -p -r1.250.2.2 function.c
*** function.c	2001/03/05 01:05:07	1.250.2.2
--- function.c	2001/03/14 17:08:23
*************** put_var_into_stack (decl)
*** 1338,1344 ****
    context = decl_function_context (decl);
  
    /* Get the current rtl used for this object and its original mode.  */
!   reg = TREE_CODE (decl) == SAVE_EXPR ? SAVE_EXPR_RTL (decl) : DECL_RTL (decl);
  
    /* No need to do anything if decl has no rtx yet
       since in that case caller is setting TREE_ADDRESSABLE
--- 1338,1346 ----
    context = decl_function_context (decl);
  
    /* Get the current rtl used for this object and its original mode.  */
!   reg = (TREE_CODE (decl) == SAVE_EXPR 
! 	 ? SAVE_EXPR_RTL (decl) 
! 	 : DECL_RTL_IF_SET (decl));
  
    /* No need to do anything if decl has no rtx yet
       since in that case caller is setting TREE_ADDRESSABLE
*************** instantiate_decls_1 (let, valid_only)
*** 3606,3613 ****
    tree t;
  
    for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t))
!     instantiate_decl (DECL_RTL (t), int_size_in_bytes (TREE_TYPE (t)),
! 		      valid_only);
  
    /* Process all subblocks.  */
    for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t))
--- 3608,3617 ----
    tree t;
  
    for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t))
!     if (DECL_RTL_SET_P (t))
!       instantiate_decl (DECL_RTL (t), 
! 			int_size_in_bytes (TREE_TYPE (t)),
! 			valid_only);
  
    /* Process all subblocks.  */
    for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t))
*************** assign_parms (fndecl)
*** 4353,4360 ****
  	  || TREE_CODE (parm) != PARM_DECL
  	  || passed_type == NULL)
  	{
! 	  DECL_INCOMING_RTL (parm) = DECL_RTL (parm)
! 	    = gen_rtx_MEM (BLKmode, const0_rtx);
  	  TREE_USED (parm) = 1;
  	  continue;
  	}
--- 4357,4364 ----
  	  || TREE_CODE (parm) != PARM_DECL
  	  || passed_type == NULL)
  	{
! 	  SET_DECL_RTL (parm, gen_rtx_MEM (BLKmode, const0_rtx));
! 	  DECL_INCOMING_RTL (parm) = DECL_RTL (parm);
  	  TREE_USED (parm) = 1;
  	  continue;
  	}
*************** assign_parms (fndecl)
*** 4373,4379 ****
  	 and avoid the usual things like emit_move_insn that could crash.  */
        if (nominal_mode == VOIDmode)
  	{
! 	  DECL_INCOMING_RTL (parm) = DECL_RTL (parm) = const0_rtx;
  	  continue;
  	}
  
--- 4377,4384 ----
  	 and avoid the usual things like emit_move_insn that could crash.  */
        if (nominal_mode == VOIDmode)
  	{
! 	  SET_DECL_RTL (parm, const0_rtx);
! 	  DECL_INCOMING_RTL (parm) = DECL_RTL (parm);
  	  continue;
  	}
  
*************** assign_parms (fndecl)
*** 4669,4675 ****
  				     size_stored / UNITS_PER_WORD,
  				     int_size_in_bytes (TREE_TYPE (parm)));
  	    }
! 	  DECL_RTL (parm) = stack_parm;
  	}
        else if (! ((! optimize
  		   && ! DECL_REGISTER (parm)
--- 4674,4680 ----
  				     size_stored / UNITS_PER_WORD,
  				     int_size_in_bytes (TREE_TYPE (parm)));
  	    }
! 	  SET_DECL_RTL (parm, stack_parm);
  	}
        else if (! ((! optimize
  		   && ! DECL_REGISTER (parm)
*************** assign_parms (fndecl)
*** 4701,4713 ****
  	     appropriately.  */
  	  if (passed_pointer)
  	    {
! 	      DECL_RTL (parm)
! 		= gen_rtx_MEM (TYPE_MODE (TREE_TYPE (passed_type)), parmreg);
  	      set_mem_attributes (DECL_RTL (parm), parm, 1);
  	    }
  	  else
  	    {
! 	      DECL_RTL (parm) = parmreg;
  	      maybe_set_unchanging (DECL_RTL (parm), parm);
  	    }
  	      
--- 4706,4719 ----
  	     appropriately.  */
  	  if (passed_pointer)
  	    {
! 	      SET_DECL_RTL (parm,
! 			    gen_rtx_MEM (TYPE_MODE (TREE_TYPE (passed_type)), 
! 					 parmreg));
  	      set_mem_attributes (DECL_RTL (parm), parm, 1);
  	    }
  	  else
  	    {
! 	      SET_DECL_RTL (parm, parmreg);
  	      maybe_set_unchanging (DECL_RTL (parm), parm);
  	    }
  	      
*************** assign_parms (fndecl)
*** 4773,4784 ****
  	      if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
  		{
  		  rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
! 
  		  push_to_sequence (conversion_insns);
  		  emit_move_insn (tempreg, DECL_RTL (parm));
! 		  DECL_RTL (parm)
! 		    = convert_to_mode (GET_MODE (parmreg), tempreg,
! 				       TREE_UNSIGNED (TREE_TYPE (parm)));
  		  emit_move_insn (parmreg, DECL_RTL (parm));
  		  conversion_insns = get_insns();
  		  did_conversion = 1;
--- 4779,4791 ----
  	      if (GET_MODE (parmreg) != GET_MODE (DECL_RTL (parm)))
  		{
  		  rtx tempreg = gen_reg_rtx (GET_MODE (DECL_RTL (parm)));
! 		  int unsigned_p = TREE_UNSIGNED (TREE_TYPE (parm));
  		  push_to_sequence (conversion_insns);
  		  emit_move_insn (tempreg, DECL_RTL (parm));
! 		  SET_DECL_RTL (parm,
! 				convert_to_mode (GET_MODE (parmreg), 
! 						 tempreg,
! 						 unsigned_p));
  		  emit_move_insn (parmreg, DECL_RTL (parm));
  		  conversion_insns = get_insns();
  		  did_conversion = 1;
*************** assign_parms (fndecl)
*** 4786,4792 ****
  		}
  	      else
  		emit_move_insn (parmreg, DECL_RTL (parm));
! 	      DECL_RTL (parm) = parmreg;
  	      /* STACK_PARM is the pointer, not the parm, and PARMREG is
  		 now the parm.  */
  	      stack_parm = 0;
--- 4793,4799 ----
  		}
  	      else
  		emit_move_insn (parmreg, DECL_RTL (parm));
! 	      SET_DECL_RTL (parm, parmreg);
  	      /* STACK_PARM is the pointer, not the parm, and PARMREG is
  		 now the parm.  */
  	      stack_parm = 0;
*************** assign_parms (fndecl)
*** 5021,5027 ****
  	      conversion_insns = get_insns ();
  	      end_sequence ();
  	    }
! 	  DECL_RTL (parm) = stack_parm;
  	}
  
        /* If this "parameter" was the place where we are receiving the
--- 5028,5034 ----
  	      conversion_insns = get_insns ();
  	      end_sequence ();
  	    }
! 	  SET_DECL_RTL (parm, stack_parm);
  	}
  
        /* If this "parameter" was the place where we are receiving the
*************** assign_parms (fndecl)
*** 5030,5037 ****
  	{
  	  tree result = DECL_RESULT (fndecl);
  
! 	  DECL_RTL (result)
! 	    = gen_rtx_MEM (DECL_MODE (result), DECL_RTL (parm));
  
  	  set_mem_attributes (DECL_RTL (result), result, 1);
  	}
--- 5037,5044 ----
  	{
  	  tree result = DECL_RESULT (fndecl);
  
! 	  SET_DECL_RTL (result,
! 			gen_rtx_MEM (DECL_MODE (result), DECL_RTL (parm)));
  
  	  set_mem_attributes (DECL_RTL (result), result, 1);
  	}
*************** assign_parms (fndecl)
*** 5090,5096 ****
       to include tree.h.  Do this here so it gets done when an inlined
       function gets output.  */
  
!   current_function_return_rtx = DECL_RTL (DECL_RESULT (fndecl));
  }
  
  /* Indicate whether REGNO is an incoming argument to the current function
--- 5097,5105 ----
       to include tree.h.  Do this here so it gets done when an inlined
       function gets output.  */
  
!   current_function_return_rtx
!     = (DECL_RTL_SET_P (DECL_RESULT (fndecl))
!        ? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
  }
  
  /* Indicate whether REGNO is an incoming argument to the current function
*************** expand_function_start (subr, parms_have_
*** 6357,6371 ****
  	}
        if (value_address)
  	{
! 	  DECL_RTL (DECL_RESULT (subr))
! 	    = gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)), value_address);
  	  set_mem_attributes (DECL_RTL (DECL_RESULT (subr)),
  			      DECL_RESULT (subr), 1);
  	}
      }
    else if (DECL_MODE (DECL_RESULT (subr)) == VOIDmode)
      /* If return mode is void, this decl rtl should not be used.  */
!     DECL_RTL (DECL_RESULT (subr)) = 0;
    else if (parms_have_cleanups || current_function_instrument_entry_exit)
      {
        /* If function will end with cleanup code for parms,
--- 6366,6381 ----
  	}
        if (value_address)
  	{
! 	  SET_DECL_RTL (DECL_RESULT (subr),
! 			gen_rtx_MEM (DECL_MODE (DECL_RESULT (subr)), 
! 				     value_address));
  	  set_mem_attributes (DECL_RTL (DECL_RESULT (subr)),
  			      DECL_RESULT (subr), 1);
  	}
      }
    else if (DECL_MODE (DECL_RESULT (subr)) == VOIDmode)
      /* If return mode is void, this decl rtl should not be used.  */
!     SET_DECL_RTL (DECL_RESULT (subr), NULL_RTX);
    else if (parms_have_cleanups || current_function_instrument_entry_exit)
      {
        /* If function will end with cleanup code for parms,
*************** expand_function_start (subr, parms_have_
*** 6382,6394 ****
        mode = promote_mode (type, mode, &unsignedp, 1);
  #endif
  
!       DECL_RTL (DECL_RESULT (subr)) = gen_reg_rtx (mode);
      }
    else
      /* Scalar, returned in a register.  */
      {
!       DECL_RTL (DECL_RESULT (subr))
! 	= hard_function_value (TREE_TYPE (DECL_RESULT (subr)), subr, 1);
  
        /* Mark this reg as the function's return value.  */
        if (GET_CODE (DECL_RTL (DECL_RESULT (subr))) == REG)
--- 6392,6405 ----
        mode = promote_mode (type, mode, &unsignedp, 1);
  #endif
  
!       SET_DECL_RTL (DECL_RESULT (subr), gen_reg_rtx (mode));
      }
    else
      /* Scalar, returned in a register.  */
      {
!       SET_DECL_RTL (DECL_RESULT (subr),
! 		    hard_function_value (TREE_TYPE (DECL_RESULT (subr)), 
! 					 subr, 1));
  
        /* Mark this reg as the function's return value.  */
        if (GET_CODE (DECL_RTL (DECL_RESULT (subr))) == REG)
*************** expand_function_end (filename, line, end
*** 6846,6852 ****
    /* If scalar return value was computed in a pseudo-reg, or was a named
       return value that got dumped to the stack, copy that to the hard
       return register.  */
!   if (DECL_RTL (DECL_RESULT (current_function_decl)) != 0)
      {
        tree decl_result = DECL_RESULT (current_function_decl);
        rtx decl_rtl = DECL_RTL (decl_result);
--- 6857,6863 ----
    /* If scalar return value was computed in a pseudo-reg, or was a named
       return value that got dumped to the stack, copy that to the hard
       return register.  */
!   if (DECL_RTL_SET_P (DECL_RESULT (current_function_decl)))
      {
        tree decl_result = DECL_RESULT (current_function_decl);
        rtx decl_rtl = DECL_RTL (decl_result);
Index: ggc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-common.c,v
retrieving revision 1.34.4.1
diff -c -p -r1.34.4.1 ggc-common.c
*** ggc-common.c	2001/02/14 04:38:48	1.34.4.1
--- ggc-common.c	2001/03/14 17:08:30
*************** ggc_mark_trees ()
*** 376,382 ****
  	  ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
  	  ggc_mark_tree (DECL_SECTION_NAME (t));
  	  ggc_mark_tree (DECL_MACHINE_ATTRIBUTES (t));
! 	  ggc_mark_rtx (DECL_RTL (t));
  	  ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
  	  ggc_mark_tree (DECL_VINDEX (t));
  	  lang_mark_tree (t);
--- 376,383 ----
  	  ggc_mark_tree (DECL_ASSEMBLER_NAME (t));
  	  ggc_mark_tree (DECL_SECTION_NAME (t));
  	  ggc_mark_tree (DECL_MACHINE_ATTRIBUTES (t));
! 	  if (DECL_RTL_SET_P (t))
! 	    ggc_mark_rtx (DECL_RTL (t));
  	  ggc_mark_rtx (DECL_LIVE_RANGE_RTL (t));
  	  ggc_mark_tree (DECL_VINDEX (t));
  	  lang_mark_tree (t);
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.126.4.3
diff -c -p -r1.126.4.3 integrate.c
*** integrate.c	2001/03/01 16:55:39	1.126.4.3
--- integrate.c	2001/03/14 17:08:32
*************** function_cannot_inline_p (fndecl)
*** 137,143 ****
  
    register int ninsns = 0;
    register tree parms;
-   rtx result;
  
    if (DECL_UNINLINABLE (fndecl))
      return N_("function cannot be inline");
--- 137,142 ----
*************** function_cannot_inline_p (fndecl)
*** 236,244 ****
      }
  
    /* We can't inline functions that return a PARALLEL rtx.  */
!   result = DECL_RTL (DECL_RESULT (fndecl));
!   if (result && GET_CODE (result) == PARALLEL)
!     return N_("inline functions not supported for this return value type");
  
    /* If the function has a target specific attribute attached to it,
       then we assume that we should not inline it.  This can be overriden
--- 235,246 ----
      }
  
    /* We can't inline functions that return a PARALLEL rtx.  */
!   if (DECL_RTL_SET_P (DECL_RESULT (fndecl)))
!     {
!       rtx result = DECL_RTL (DECL_RESULT (fndecl));
!       if (GET_CODE (result) == PARALLEL)
! 	return N_("inline functions not supported for this return value type");
!     }
  
    /* If the function has a target specific attribute attached to it,
       then we assume that we should not inline it.  This can be overriden
*************** copy_decl_for_inlining (decl, from_fn, t
*** 349,355 ****
    DECL_ABSTRACT_ORIGIN (copy) = DECL_ORIGIN (decl);
  
    /* The new variable/label has no RTL, yet.  */
!   DECL_RTL (copy) = NULL_RTX;
  
    /* These args would always appear unused, if not for this.  */
    TREE_USED (copy) = 1;
--- 351,357 ----
    DECL_ABSTRACT_ORIGIN (copy) = DECL_ORIGIN (decl);
  
    /* The new variable/label has no RTL, yet.  */
!   SET_DECL_RTL (copy, NULL_RTX);
  
    /* These args would always appear unused, if not for this.  */
    TREE_USED (copy) = 1;
*************** expand_inline_function (fndecl, parms, t
*** 952,958 ****
       REG_FUNCTION_RETURN_VALUE_P.  */
  
    map->inline_target = 0;
!   loc = DECL_RTL (DECL_RESULT (fndecl));
  
    if (TYPE_MODE (type) == VOIDmode)
      /* There is no return value to worry about.  */
--- 954,961 ----
       REG_FUNCTION_RETURN_VALUE_P.  */
  
    map->inline_target = 0;
!   loc = (DECL_RTL_SET_P (DECL_RESULT (fndecl)) 
! 	 ? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
  
    if (TYPE_MODE (type) == VOIDmode)
      /* There is no return value to worry about.  */
*************** integrate_parm_decls (args, map, arg_vec
*** 1634,1640 ****
  	 subst_constants.  */
        subst_constants (&new_decl_rtl, NULL_RTX, map, 1);
        apply_change_group ();
!       DECL_RTL (decl) = new_decl_rtl;
      }
  }
  
--- 1637,1643 ----
  	 subst_constants.  */
        subst_constants (&new_decl_rtl, NULL_RTX, map, 1);
        apply_change_group ();
!       SET_DECL_RTL (decl, new_decl_rtl);
      }
  }
  
*************** integrate_decl_tree (let, map)
*** 1664,1678 ****
  
        d = copy_decl_for_inlining (t, map->fndecl, current_function_decl);
  
!       if (DECL_RTL (t) != 0)
  	{
! 	  DECL_RTL (d) = copy_rtx_and_substitute (DECL_RTL (t), map, 1);
  
  	  /* Fully instantiate the address with the equivalent form so that the
  	     debugging information contains the actual register, instead of the
  	     virtual register.   Do this by not passing an insn to
  	     subst_constants.  */
! 	  subst_constants (&DECL_RTL (d), NULL_RTX, map, 1);
  	  apply_change_group ();
  	}
  
--- 1667,1685 ----
  
        d = copy_decl_for_inlining (t, map->fndecl, current_function_decl);
  
!       if (DECL_RTL_SET_P (t))
  	{
! 	  rtx r;
! 
! 	  SET_DECL_RTL (d, copy_rtx_and_substitute (DECL_RTL (t), map, 1));
  
  	  /* Fully instantiate the address with the equivalent form so that the
  	     debugging information contains the actual register, instead of the
  	     virtual register.   Do this by not passing an insn to
  	     subst_constants.  */
! 	  r = DECL_RTL (d);
! 	  subst_constants (&r, NULL_RTX, map, 1);
! 	  SET_DECL_RTL (d, r);
  	  apply_change_group ();
  	}
  
Index: print-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-tree.c,v
retrieving revision 1.39.2.1
diff -c -p -r1.39.2.1 print-tree.c
*** print-tree.c	2001/02/18 06:03:45	1.39.2.1
--- print-tree.c	2001/03/14 17:08:33
*************** print_node (file, prefix, node, indent)
*** 441,447 ****
  
        print_lang_decl (file, node, indent);
  
!       if (DECL_RTL (node) != 0)
  	{
  	  indent_to (file, indent + 4);
  	  print_rtl (file, DECL_RTL (node));
--- 441,447 ----
  
        print_lang_decl (file, node, indent);
  
!       if (DECL_RTL_SET_P (node))
  	{
  	  indent_to (file, indent + 4);
  	  print_rtl (file, DECL_RTL (node));
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reg-stack.c,v
retrieving revision 1.63.4.2
diff -c -p -r1.63.4.2 reg-stack.c
*** reg-stack.c	2001/03/08 18:58:18	1.63.4.2
--- reg-stack.c	2001/03/14 17:08:34
*************** stack_result (decl)
*** 784,805 ****
    if (aggregate_value_p (DECL_RESULT (decl)))
      return 0;
  
!   result = DECL_RTL (DECL_RESULT (decl));
!   /* ?!?  What is this code supposed to do?  Can this code actually
!      trigger if we kick out aggregates above?  */
!   if (result != 0
!       && ! (GET_CODE (result) == REG
! 	    && REGNO (result) < FIRST_PSEUDO_REGISTER))
      {
  #ifdef FUNCTION_OUTGOING_VALUE
!       result
!         = FUNCTION_OUTGOING_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl);
  #else
!       result = FUNCTION_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl);
  #endif
      }
! 
!   return result != 0 && STACK_REG_P (result) ? result : 0;
  }
  
  
--- 784,806 ----
    if (aggregate_value_p (DECL_RESULT (decl)))
      return 0;
  
!   if (DECL_RTL_SET_P (DECL_RESULT (decl)))
      {
+       rtx result = DECL_RTL (DECL_RESULT (decl));
+       if (! (GET_CODE (result) == REG
+ 	     && REGNO (result) < FIRST_PSEUDO_REGISTER))
+ 	{
  #ifdef FUNCTION_OUTGOING_VALUE
! 	  result
! 	    = FUNCTION_OUTGOING_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl);
  #else
! 	  result = FUNCTION_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl);
  #endif
+ 	}
+       return STACK_REG_P (result) ? result : NULL_RTX;
      }
!   else
!     return NULL_RTX;
  }
  
  
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.184.2.1
diff -c -p -r1.184.2.1 stmt.c
*** stmt.c	2001/02/20 18:36:52	1.184.2.1
--- stmt.c	2001/03/14 17:08:38
*************** label_rtx (label)
*** 675,686 ****
    if (TREE_CODE (label) != LABEL_DECL)
      abort ();
  
!   if (DECL_RTL (label))
!     return DECL_RTL (label);
  
!   return DECL_RTL (label) = gen_label_rtx ();
  }
  
  /* Add an unconditional jump to LABEL as the next sequential instruction.  */
  
  void
--- 675,687 ----
    if (TREE_CODE (label) != LABEL_DECL)
      abort ();
  
!   if (!DECL_RTL_SET_P (label))
!     SET_DECL_RTL (label, gen_label_rtx ());
  
!   return DECL_RTL (label);
  }
  
+ 
  /* Add an unconditional jump to LABEL as the next sequential instruction.  */
  
  void
*************** expand_return (retval)
*** 2920,2926 ****
       run destructors on variables that might be used in the subsequent
       computation of the return value.  */
    rtx last_insn = 0;
!   rtx result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
    register rtx val = 0;
    tree retval_rhs;
    int cleanups;
--- 2921,2927 ----
       run destructors on variables that might be used in the subsequent
       computation of the return value.  */
    rtx last_insn = 0;
!   rtx result_rtl;
    register rtx val = 0;
    tree retval_rhs;
    int cleanups;
*************** expand_return (retval)
*** 3000,3005 ****
--- 3001,3008 ----
        return;
      }
  
+   result_rtl = DECL_RTL (DECL_RESULT (current_function_decl));
+ 
    /* If the result is an aggregate that is being returned in one (or more)
       registers, load the registers here.  The compiler currently can't handle
       copying a BLKmode value into registers.  We could put this code in a
*************** expand_decl (decl)
*** 3838,3855 ****
    /* Create the RTL representation for the variable.  */
  
    if (type == error_mark_node)
!     DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
  
    else if (DECL_SIZE (decl) == 0)
      /* Variable with incomplete type.  */
      {
        if (DECL_INITIAL (decl) == 0)
  	/* Error message was already done; now avoid a crash.  */
! 	DECL_RTL (decl) = gen_rtx_MEM (BLKmode, const0_rtx);
        else
  	/* An initializer is going to decide the size of this array.
  	   Until we know the size, represent its address with a reg.  */
! 	DECL_RTL (decl) = gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode));
  
        set_mem_attributes (DECL_RTL (decl), decl, 1);
      }
--- 3841,3858 ----
    /* Create the RTL representation for the variable.  */
  
    if (type == error_mark_node)
!     SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
  
    else if (DECL_SIZE (decl) == 0)
      /* Variable with incomplete type.  */
      {
        if (DECL_INITIAL (decl) == 0)
  	/* Error message was already done; now avoid a crash.  */
! 	SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, const0_rtx));
        else
  	/* An initializer is going to decide the size of this array.
  	   Until we know the size, represent its address with a reg.  */
! 	SET_DECL_RTL (decl, gen_rtx_MEM (BLKmode, gen_reg_rtx (Pmode)));
  
        set_mem_attributes (DECL_RTL (decl), decl, 1);
      }
*************** expand_decl (decl)
*** 3868,3874 ****
        enum machine_mode reg_mode
  	= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
  
!       DECL_RTL (decl) = gen_reg_rtx (reg_mode);
        mark_user_reg (DECL_RTL (decl));
  
        if (POINTER_TYPE_P (type))
--- 3871,3877 ----
        enum machine_mode reg_mode
  	= promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
  
!       SET_DECL_RTL (decl, gen_reg_rtx (reg_mode));
        mark_user_reg (DECL_RTL (decl));
  
        if (POINTER_TYPE_P (type))
*************** expand_decl (decl)
*** 3895,3901 ****
  	 whose size was determined by the initializer.
  	 The old address was a register; set that register now
  	 to the proper address.  */
!       if (DECL_RTL (decl) != 0)
  	{
  	  if (GET_CODE (DECL_RTL (decl)) != MEM
  	      || GET_CODE (XEXP (DECL_RTL (decl), 0)) != REG)
--- 3898,3904 ----
  	 whose size was determined by the initializer.
  	 The old address was a register; set that register now
  	 to the proper address.  */
!       if (DECL_RTL_SET_P (decl))
  	{
  	  if (GET_CODE (DECL_RTL (decl)) != MEM
  	      || GET_CODE (XEXP (DECL_RTL (decl), 0)) != REG)
*************** expand_decl (decl)
*** 3903,3909 ****
  	  oldaddr = XEXP (DECL_RTL (decl), 0);
  	}
  
!       DECL_RTL (decl) = assign_temp (TREE_TYPE (decl), 1, 1, 1);
  
        /* Set alignment we actually gave this decl.  */
        DECL_ALIGN (decl) = (DECL_MODE (decl) == BLKmode ? BIGGEST_ALIGNMENT
--- 3906,3913 ----
  	  oldaddr = XEXP (DECL_RTL (decl), 0);
  	}
  
!       SET_DECL_RTL (decl,
! 		    assign_temp (TREE_TYPE (decl), 1, 1, 1));
  
        /* Set alignment we actually gave this decl.  */
        DECL_ALIGN (decl) = (DECL_MODE (decl) == BLKmode ? BIGGEST_ALIGNMENT
*************** expand_decl (decl)
*** 3945,3951 ****
  					      TYPE_ALIGN (TREE_TYPE (decl)));
  
        /* Reference the variable indirect through that rtx.  */
!       DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl), address);
  
        set_mem_attributes (DECL_RTL (decl), decl, 1);
  
--- 3949,3955 ----
  					      TYPE_ALIGN (TREE_TYPE (decl)));
  
        /* Reference the variable indirect through that rtx.  */
!       SET_DECL_RTL (decl, gen_rtx_MEM (DECL_MODE (decl), address));
  
        set_mem_attributes (DECL_RTL (decl), decl, 1);
  
*************** expand_decl_cleanup (decl, cleanup)
*** 4061,4067 ****
  	  emit_move_insn (flag, const1_rtx);
  
  	  cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
! 	  DECL_RTL (cond) = flag;
  
  	  /* Conditionalize the cleanup.  */
  	  cleanup = build (COND_EXPR, void_type_node,
--- 4065,4071 ----
  	  emit_move_insn (flag, const1_rtx);
  
  	  cond = build_decl (VAR_DECL, NULL_TREE, type_for_mode (word_mode, 1));
! 	  SET_DECL_RTL (cond, flag);
  
  	  /* Conditionalize the cleanup.  */
  	  cleanup = build (COND_EXPR, void_type_node,
*************** expand_anon_union_decl (decl, cleanup, d
*** 4262,4280 ****
        if (GET_CODE (x) == MEM)
  	{
  	  if (mode == GET_MODE (x))
! 	    DECL_RTL (decl_elt) = x;
  	  else
  	    {
! 	      DECL_RTL (decl_elt) = gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0)));
  	      MEM_COPY_ATTRIBUTES (DECL_RTL (decl_elt), x);
  	    }
  	}
        else if (GET_CODE (x) == REG)
  	{
  	  if (mode == GET_MODE (x))
! 	    DECL_RTL (decl_elt) = x;
  	  else
! 	    DECL_RTL (decl_elt) = gen_rtx_SUBREG (mode, x, 0);
  	}
        else
  	abort ();
--- 4266,4285 ----
        if (GET_CODE (x) == MEM)
  	{
  	  if (mode == GET_MODE (x))
! 	    SET_DECL_RTL (decl_elt, x);
  	  else
  	    {
! 	      SET_DECL_RTL (decl_elt,
! 			    gen_rtx_MEM (mode, copy_rtx (XEXP (x, 0))));
  	      MEM_COPY_ATTRIBUTES (DECL_RTL (decl_elt), x);
  	    }
  	}
        else if (GET_CODE (x) == REG)
  	{
  	  if (mode == GET_MODE (x))
! 	    SET_DECL_RTL (decl_elt, x);
  	  else
! 	    SET_DECL_RTL (decl_elt, gen_rtx_SUBREG (mode, x, 0));
  	}
        else
  	abort ();
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.420.2.6
diff -c -p -r1.420.2.6 toplev.c
*** toplev.c	2001/03/02 19:51:59	1.420.2.6
--- toplev.c	2001/03/14 17:08:42
*************** check_global_declarations (vec, len)
*** 2026,2032 ****
  	/* Cancel the RTL for this decl so that, if debugging info
  	   output for global variables is still to come,
  	   this one will be omitted.  */
! 	DECL_RTL (decl) = NULL;
  
        /* Warn about any function
  	 declared static but not defined.
--- 2026,2032 ----
  	/* Cancel the RTL for this decl so that, if debugging info
  	   output for global variables is still to come,
  	   this one will be omitted.  */
! 	SET_DECL_RTL (decl, NULL_RTX);
  
        /* Warn about any function
  	 declared static but not defined.
*************** rest_of_decl_compilation (decl, asmspec,
*** 2596,2602 ****
        || TREE_CODE (decl) == FUNCTION_DECL)
      {
        timevar_push (TV_VARCONST);
!       make_decl_rtl (decl, asmspec);
        /* Initialized extern variable exists to be replaced
  	 with its value, or represents something that will be
  	 output in another file.  */
--- 2596,2603 ----
        || TREE_CODE (decl) == FUNCTION_DECL)
      {
        timevar_push (TV_VARCONST);
!       if (asmspec)
! 	make_decl_rtl (decl, asmspec);
        /* Initialized extern variable exists to be replaced
  	 with its value, or represents something that will be
  	 output in another file.  */
*************** rest_of_decl_compilation (decl, asmspec,
*** 2622,2635 ****
      {
        if (decode_reg_name (asmspec) >= 0)
  	{
! 	  DECL_RTL (decl) = 0;
  	  make_decl_rtl (decl, asmspec);
  	}
        else
  	{
  	  error ("invalid register name `%s' for register variable", asmspec);
  	  DECL_REGISTER (decl) = 0;
! 	  make_decl_rtl (decl, NULL);
  	}
      }
  #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
--- 2623,2637 ----
      {
        if (decode_reg_name (asmspec) >= 0)
  	{
! 	  SET_DECL_RTL (decl, NULL_RTX);
  	  make_decl_rtl (decl, asmspec);
  	}
        else
  	{
  	  error ("invalid register name `%s' for register variable", asmspec);
  	  DECL_REGISTER (decl) = 0;
! 	  if (!top_level)
! 	    expand_decl (decl);
  	}
      }
  #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.185.2.2
diff -c -p -r1.185.2.2 tree.c
*** tree.c	2001/03/11 02:03:54	1.185.2.2
--- tree.c	2001/03/14 17:08:44
*************** simple_cst_equal (t1, t2)
*** 3518,3527 ****
  	 as being equivalent to anything.  */
        if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
  	   && DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
! 	   && DECL_RTL (TREE_OPERAND (t1, 0)) == 0)
  	  || (TREE_CODE (TREE_OPERAND (t2, 0)) == VAR_DECL
  	      && DECL_NAME (TREE_OPERAND (t2, 0)) == NULL_TREE
! 	      && DECL_RTL (TREE_OPERAND (t2, 0)) == 0))
  	cmp = 1;
        else
  	cmp = simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
--- 3518,3527 ----
  	 as being equivalent to anything.  */
        if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
  	   && DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
! 	   && !DECL_RTL_SET_P (TREE_OPERAND (t1, 0)))
  	  || (TREE_CODE (TREE_OPERAND (t2, 0)) == VAR_DECL
  	      && DECL_NAME (TREE_OPERAND (t2, 0)) == NULL_TREE
! 	      && !DECL_RTL_SET_P (TREE_OPERAND (t2, 0))))
  	cmp = 1;
        else
  	cmp = simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.223.2.4
diff -c -p -r1.223.2.4 tree.h
*** tree.h	2001/03/02 19:51:58	1.223.2.4
--- tree.h	2001/03/14 17:08:47
*************** struct tree_type
*** 1341,1348 ****
     PROMOTED_MODE is defined, the mode of this expression may not be same
     as DECL_MODE.  In that case, DECL_MODE contains the mode corresponding
     to the variable's data type, while the mode
!    of DECL_RTL is the mode actually used to contain the data.  */
! #define DECL_RTL(NODE) (DECL_CHECK (NODE)->decl.rtl)
  /* Holds an INSN_LIST of all of the live ranges in which the variable
     has been moved to a possibly different register.  */
  #define DECL_LIVE_RANGE_RTL(NODE) (DECL_CHECK (NODE)->decl.live_range_rtl)
--- 1341,1367 ----
     PROMOTED_MODE is defined, the mode of this expression may not be same
     as DECL_MODE.  In that case, DECL_MODE contains the mode corresponding
     to the variable's data type, while the mode
!    of DECL_RTL is the mode actually used to contain the data.  
! 
!    This value can be evaluated lazily for functions, variables with
!    static storage duration, and labels.  */
! #define DECL_RTL(NODE)					\
!   (DECL_CHECK (NODE)->decl.rtl				\
!    ? (NODE)->decl.rtl					\
!    : (make_decl_rtl (NODE, NULL), (NODE)->decl.rtl))
! /* Set the DECL_RTL for NODE to RTL.  */
! #define SET_DECL_RTL(NODE, RTL) \
!   (DECL_CHECK (NODE)->decl.rtl = (RTL))
! /* Returns non-zero if the DECL_RTL for NODE has already been set.  */
! #define DECL_RTL_SET_P(NODE) \
!   (DECL_CHECK (NODE)->decl.rtl != NULL)
! /* Copy the RTL from NODE1 to NODE2.  If the RTL was not set for
!    NODE1, it will not be set for NODE2; this is a lazy copy.  */
! #define COPY_DECL_RTL(NODE1, NODE2) \
!   (DECL_CHECK (NODE2)->decl.rtl = DECL_CHECK (NODE1)->decl.rtl)
! /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set.  */
! #define DECL_RTL_IF_SET(NODE) \
!   (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
  /* Holds an INSN_LIST of all of the live ranges in which the variable
     has been moved to a possibly different register.  */
  #define DECL_LIVE_RANGE_RTL(NODE) (DECL_CHECK (NODE)->decl.live_range_rtl)
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.161.2.2
diff -c -p -r1.161.2.2 varasm.c
*** varasm.c	2001/03/02 19:51:57	1.161.2.2
--- varasm.c	2001/03/14 17:08:50
*************** decode_reg_name (asmspec)
*** 565,575 ****
    return -1;
  }
  
! /* Create the DECL_RTL for a declaration for a static or external variable
!    or static or external function.
!    ASMSPEC, if not 0, is the string which the user specified
!    as the assembler symbol name.
  
     This is never called for PARM_DECL nodes.  */
  
  void
--- 565,580 ----
    return -1;
  }
  
! /* Create the DECL_RTL for a VAR_DECL or FUNCTION_DECL.  DECL should
!    have static storage duration.  In other words, it should not be an
!    automatic variable, including PARM_DECLs.
  
+    There is, however, one exception: this function handles variables
+    explicitly placed in a particular register by the user.
+ 
+    ASMSPEC, if not 0, is the string which the user specified as the
+    assembler symbol name.
+ 
     This is never called for PARM_DECL nodes.  */
  
  void
*************** make_decl_rtl (decl, asmspec)
*** 582,590 ****
    const char *new_name = 0;
    int reg_number;
  
    /* For a duplicate declaration, we can be called twice on the
       same DECL node.  Don't discard the RTL already made.  */
!   if (DECL_RTL (decl) != 0)
      {
        /* If the old RTL had the wrong mode, fix the mode.  */
        if (GET_MODE (DECL_RTL (decl)) != DECL_MODE (decl))
--- 587,608 ----
    const char *new_name = 0;
    int reg_number;
  
+   /* Check that we are not being given an automatic variable.  */
+   if (TREE_CODE (decl) == PARM_DECL
+       || TREE_CODE (decl) == RESULT_DECL
+       || (TREE_CODE (decl) == VAR_DECL
+ 	  && !TREE_STATIC (decl)
+ 	  && !DECL_EXTERNAL (decl)
+ 	  && !DECL_REGISTER (decl)))
+     abort ();
+   /* And that we were not given a type or a label.  */
+   else if (TREE_CODE (decl) == TYPE_DECL 
+ 	   || TREE_CODE (decl) == LABEL_DECL)
+     abort ();
+ 
    /* For a duplicate declaration, we can be called twice on the
       same DECL node.  Don't discard the RTL already made.  */
!   if (DECL_RTL_SET_P (decl))
      {
        /* If the old RTL had the wrong mode, fix the mode.  */
        if (GET_MODE (DECL_RTL (decl)) != DECL_MODE (decl))
*************** make_decl_rtl (decl, asmspec)
*** 652,659 ****
  	     usage is somewhat suspect, we nevertheless use the following
  	     kludge to avoid setting DECL_RTL to frame_pointer_rtx.  */
  
! 	  DECL_RTL (decl)
! 	    = gen_rtx_REG (DECL_MODE (decl), FIRST_PSEUDO_REGISTER);
  	  REGNO (DECL_RTL (decl)) = reg_number;
  	  REG_USERVAR_P (DECL_RTL (decl)) = 1;
  
--- 670,678 ----
  	     usage is somewhat suspect, we nevertheless use the following
  	     kludge to avoid setting DECL_RTL to frame_pointer_rtx.  */
  
! 	  SET_DECL_RTL (decl,
! 			gen_rtx_REG (DECL_MODE (decl), 
! 				     FIRST_PSEUDO_REGISTER));
  	  REGNO (DECL_RTL (decl)) = reg_number;
  	  REG_USERVAR_P (DECL_RTL (decl)) = 1;
  
*************** make_decl_rtl (decl, asmspec)
*** 731,738 ****
  	   && (TREE_PUBLIC (decl) || TREE_STATIC (decl)))))
      TREE_SIDE_EFFECTS (decl) = 1;
  
!   DECL_RTL (decl) = gen_rtx_MEM (DECL_MODE (decl),
! 				 gen_rtx_SYMBOL_REF (Pmode, name));
    if (TREE_CODE (decl) != FUNCTION_DECL)
      set_mem_attributes (DECL_RTL (decl), decl, 1);
  
--- 750,757 ----
  	   && (TREE_PUBLIC (decl) || TREE_STATIC (decl)))))
      TREE_SIDE_EFFECTS (decl) = 1;
  
!   SET_DECL_RTL (decl, gen_rtx_MEM (DECL_MODE (decl),
! 				   gen_rtx_SYMBOL_REF (Pmode, name)));
    if (TREE_CODE (decl) != FUNCTION_DECL)
      set_mem_attributes (DECL_RTL (decl), decl, 1);
  
Index: cp/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.358.2.8
diff -c -p -r1.358.2.8 class.c
*** class.c	2001/03/03 09:24:32	1.358.2.8
--- class.c	2001/03/14 17:08:55
*************** build_clone (fn, name)
*** 4265,4271 ****
    set_mangled_name_for_decl (clone);
  
    /* Create the RTL for this function.  */
!   DECL_RTL (clone) = NULL_RTX;
    rest_of_decl_compilation (clone, NULL, /*top_level=*/1, at_eof);
    
    /* Make it easy to find the CLONE given the FN.  */
--- 4265,4271 ----
    set_mangled_name_for_decl (clone);
  
    /* Create the RTL for this function.  */
!   SET_DECL_RTL (clone, NULL_RTX);
    rest_of_decl_compilation (clone, NULL, /*top_level=*/1, at_eof);
    
    /* Make it easy to find the CLONE given the FN.  */
*************** finish_struct_1 (t)
*** 5212,5225 ****
    /* Complete the rtl for any static member objects of the type we're
       working on.  */
    for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x))
!     {
!       if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
! 	  && TREE_TYPE (x) == t)
! 	{
! 	  DECL_MODE (x) = TYPE_MODE (t);
! 	  make_decl_rtl (x, NULL);
! 	}
!     }
  
    /* Done with FIELDS...now decide whether to sort these for
       faster lookups later.
--- 5212,5220 ----
    /* Complete the rtl for any static member objects of the type we're
       working on.  */
    for (x = TYPE_FIELDS (t); x; x = TREE_CHAIN (x))
!     if (TREE_CODE (x) == VAR_DECL && TREE_STATIC (x)
! 	&& TREE_TYPE (x) == t)
!       DECL_MODE (x) = TYPE_MODE (t);
  
    /* Done with FIELDS...now decide whether to sort these for
       faster lookups later.
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.572.2.9
diff -c -p -r1.572.2.9 cp-tree.h
*** cp-tree.h	2001/02/27 13:37:05	1.572.2.9
--- cp-tree.h	2001/03/14 17:08:59
*************** struct lang_decl
*** 1915,1921 ****
     here because on most RISC machines, a variable's address
     is not, by itself, a legitimate address.  */
  #define DECL_IN_MEMORY_P(NODE) \
!   (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM)
  
  /* For FUNCTION_DECLs: return the language in which this decl
     was declared.  */
--- 1915,1921 ----
     here because on most RISC machines, a variable's address
     is not, by itself, a legitimate address.  */
  #define DECL_IN_MEMORY_P(NODE) \
!   (DECL_RTL_SET_P (NODE) && GET_CODE (DECL_RTL (NODE)) == MEM)
  
  /* For FUNCTION_DECLs: return the language in which this decl
     was declared.  */
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.747.2.7
diff -c -p -r1.747.2.7 decl.c
*** decl.c	2001/02/22 12:13:50	1.747.2.7
--- decl.c	2001/03/14 17:09:08
*************** duplicate_decls (newdecl, olddecl)
*** 3159,3165 ****
  	     that all remnants of the builtin-ness of this function
  	     will be banished.  */
  	  DECL_LANGUAGE (olddecl) = DECL_LANGUAGE (newdecl);
! 	  DECL_RTL (olddecl) = DECL_RTL (newdecl);
  	  DECL_ASSEMBLER_NAME (olddecl) = DECL_ASSEMBLER_NAME (newdecl);
  	  SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (newdecl),
  				       newdecl);
--- 3159,3165 ----
  	     that all remnants of the builtin-ness of this function
  	     will be banished.  */
  	  DECL_LANGUAGE (olddecl) = DECL_LANGUAGE (newdecl);
! 	  SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
  	  DECL_ASSEMBLER_NAME (olddecl) = DECL_ASSEMBLER_NAME (newdecl);
  	  SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (newdecl),
  				       newdecl);
*************** duplicate_decls (newdecl, olddecl)
*** 3532,3538 ****
  	DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl);
  
        /* Keep the old rtl since we can safely use it.  */
!       DECL_RTL (newdecl) = DECL_RTL (olddecl);
  
        if (TREE_CODE (newdecl) == FUNCTION_DECL)
  	{
--- 3532,3538 ----
  	DECL_SECTION_NAME (newdecl) = DECL_SECTION_NAME (olddecl);
  
        /* Keep the old rtl since we can safely use it.  */
!       COPY_DECL_RTL (olddecl, newdecl);
  
        if (TREE_CODE (newdecl) == FUNCTION_DECL)
  	{
*************** duplicate_decls (newdecl, olddecl)
*** 3633,3639 ****
  	{
  	  DECL_LANGUAGE (olddecl) = DECL_LANGUAGE (newdecl);
  	  DECL_ASSEMBLER_NAME (olddecl) = DECL_ASSEMBLER_NAME (newdecl);
! 	  DECL_RTL (olddecl) = DECL_RTL (newdecl);
  	}
        if (! types_match || new_defines_function)
  	{
--- 3633,3639 ----
  	{
  	  DECL_LANGUAGE (olddecl) = DECL_LANGUAGE (newdecl);
  	  DECL_ASSEMBLER_NAME (olddecl) = DECL_ASSEMBLER_NAME (newdecl);
! 	  SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
  	}
        if (! types_match || new_defines_function)
  	{
*************** duplicate_decls (newdecl, olddecl)
*** 3657,3663 ****
  	      DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
  	      /* If we're keeping the built-in definition, keep the rtl,
  		 regardless of declaration matches.  */
! 	      DECL_RTL (newdecl) = DECL_RTL (olddecl);
  	    }
  	  else
  	    DECL_FRAME_SIZE (newdecl) = DECL_FRAME_SIZE (olddecl);
--- 3657,3663 ----
  	      DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl);
  	      /* If we're keeping the built-in definition, keep the rtl,
  		 regardless of declaration matches.  */
! 	      SET_DECL_RTL (newdecl, DECL_RTL (olddecl));
  	    }
  	  else
  	    DECL_FRAME_SIZE (newdecl) = DECL_FRAME_SIZE (olddecl);
*************** builtin_function (name, type, code, clas
*** 6669,6675 ****
       function in the namespace.  */
    if (libname)
      DECL_ASSEMBLER_NAME (decl) = get_identifier (libname);
-   make_decl_rtl (decl, NULL);
  
    /* Warn if a function in the namespace for users
       is used without an occasion to consider it declared.  */
--- 6669,6674 ----
*************** build_library_fn (name, type)
*** 6706,6714 ****
       tree name;
       tree type;
  {
!   tree fn = build_library_fn_1 (name, ERROR_MARK, type);
!   make_decl_rtl (fn, NULL);
!   return fn;
  }
  
  /* Returns the _DECL for a library function with C++ linkage.  */
--- 6705,6711 ----
       tree name;
       tree type;
  {
!   return build_library_fn_1 (name, ERROR_MARK, type);
  }
  
  /* Returns the _DECL for a library function with C++ linkage.  */
*************** build_cp_library_fn (name, operator_code
*** 6723,6729 ****
    TREE_NOTHROW (fn) = TYPE_NOTHROW_P (type);
    DECL_CONTEXT (fn) = FROB_CONTEXT (current_namespace);
    set_mangled_name_for_decl (fn);
-   make_decl_rtl (fn, NULL);
    return fn;
  }
  
--- 6720,6725 ----
*************** check_initializer (decl, init)
*** 7630,7637 ****
      }
    else if (!DECL_EXTERNAL (decl) && TREE_CODE (type) == REFERENCE_TYPE)
      {
-       if (TREE_STATIC (decl))
- 	make_decl_rtl (decl, NULL_PTR);
        grok_reference_init (decl, type, init);
        init = NULL_TREE;
      }
--- 7626,7631 ----
*************** cp_finish_decl (decl, init, asmspec_tree
*** 8037,8043 ****
      {
        /* This must override the asm specifier which was placed by
  	 grokclassfn.  Lay this out fresh.  */
!       DECL_RTL (TREE_TYPE (decl)) = NULL_RTX;
        DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
        make_decl_rtl (decl, asmspec);
      }
--- 8031,8037 ----
      {
        /* This must override the asm specifier which was placed by
  	 grokclassfn.  Lay this out fresh.  */
!       SET_DECL_RTL (TREE_TYPE (decl), NULL_RTX);
        DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
        make_decl_rtl (decl, asmspec);
      }
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.437.2.7
diff -c -p -r1.437.2.7 decl2.c
*** decl2.c	2001/03/01 14:10:44	1.437.2.7
--- decl2.c	2001/03/14 17:09:11
*************** grokfield (declarator, declspecs, init, 
*** 1772,1778 ****
  	{
  	  /* This must override the asm specifier which was placed
  	     by grokclassfn.  Lay this out fresh.  */
! 	  DECL_RTL (value) = NULL_RTX;
  	  DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
  	}
        cp_finish_decl (value, init, asmspec_tree, flags);
--- 1772,1778 ----
  	{
  	  /* This must override the asm specifier which was placed
  	     by grokclassfn.  Lay this out fresh.  */
! 	  SET_DECL_RTL (value, NULL_RTX);
  	  DECL_ASSEMBLER_NAME (value) = get_identifier (asmspec);
  	}
        cp_finish_decl (value, init, asmspec_tree, flags);
*************** grok_function_init (decl, init)
*** 1925,1949 ****
  
    if (TREE_CODE (type) == FUNCTION_TYPE)
      cp_error ("initializer specified for non-member function `%D'", decl);
- #if 0
-   /* We'll check for this in finish_struct_1.  */
-   else if (DECL_VINDEX (decl) == NULL_TREE)
-     cp_error ("initializer specified for non-virtual member function `%D'", decl);
- #endif
    else if (integer_zerop (init))
      {
- #if 0
-       /* Mark this function as being "defined".  */
-       DECL_INITIAL (decl) = error_mark_node;
-       /* pure virtual destructors must be defined.  */
-       /* pure virtual needs to be defined (as abort) only when put in 
- 	 vtbl. For wellformed call, it should be itself. pr4737 */
-       if (!DECL_DESTRUCTOR_P (decl)))
- 	{
- 	  /* Give this node rtl from `abort'.  */
- 	  DECL_RTL (decl) = DECL_RTL (abort_fndecl);
- 	}
- #endif
        DECL_PURE_VIRTUAL_P (decl) = 1;
        if (DECL_OVERLOADED_OPERATOR_P (decl) == NOP_EXPR)
  	{
--- 1925,1932 ----
*************** finish_anon_union (anon_union_decl)
*** 2203,2209 ****
    if (static_p)
      {
        make_decl_rtl (main_decl, 0);
!       DECL_RTL (anon_union_decl) = DECL_RTL (main_decl);
        expand_anon_union_decl (anon_union_decl, 
  			      NULL_TREE,
  			      DECL_ANON_UNION_ELEMS (anon_union_decl));
--- 2186,2192 ----
    if (static_p)
      {
        make_decl_rtl (main_decl, 0);
!       COPY_DECL_RTL (main_decl, anon_union_decl);
        expand_anon_union_decl (anon_union_decl, 
  			      NULL_TREE,
  			      DECL_ANON_UNION_ELEMS (anon_union_decl));
Index: cp/friend.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/friend.c,v
retrieving revision 1.64.4.1
diff -c -p -r1.64.4.1 friend.c
*** friend.c	2001/02/15 12:56:46	1.64.4.1
--- friend.c	2001/03/14 17:09:11
*************** do_friend (ctype, declarator, decl, parm
*** 413,419 ****
  	    }
  	}
  
-       make_decl_rtl (decl, NULL_PTR);
        add_friend (current_class_type, 
  		  is_friend_template ? DECL_TI_TEMPLATE (decl) : decl);
        DECL_FRIEND_P (decl) = 1;
--- 413,418 ----
Index: cp/init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/init.c,v
retrieving revision 1.232.2.5
diff -c -p -r1.232.2.5 init.c
*** init.c	2001/02/18 19:09:49	1.232.2.5
--- init.c	2001/03/14 17:09:14
*************** get_temp_regvar (type, init)
*** 2779,2785 ****
    if (building_stmt_tree ())
      add_decl_stmt (decl);
    if (!building_stmt_tree ())
!     DECL_RTL (decl) = assign_temp (type, 2, 0, 1);
    finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
  
    return decl;
--- 2779,2785 ----
    if (building_stmt_tree ())
      add_decl_stmt (decl);
    if (!building_stmt_tree ())
!     SET_DECL_RTL (decl, assign_temp (type, 2, 0, 1));
    finish_expr_stmt (build_modify_expr (decl, INIT_EXPR, init));
  
    return decl;
Index: cp/method.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/method.c,v
retrieving revision 1.190.2.3
diff -c -p -r1.190.2.3 method.c
*** method.c	2001/02/21 14:56:12	1.190.2.3
--- method.c	2001/03/14 17:09:14
*************** make_thunk (function, delta, vcall_index
*** 373,380 ****
        DECL_DEFERRED_FN (thunk) = 0;
        /* So that finish_file can write out any thunks that need to be: */
        pushdecl_top_level (thunk);
-       /* Create RTL for this thunk so that its address can be taken.  */
-       make_decl_rtl (thunk, NULL);
      }
    return thunk;
  }
--- 373,378 ----
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.516.2.7
diff -c -p -r1.516.2.7 pt.c
*** pt.c	2001/03/01 14:10:45	1.516.2.7
--- pt.c	2001/03/14 17:09:20
*************** tsubst_friend_function (decl, args)
*** 4628,4635 ****
    if (TREE_CODE (new_friend) != TEMPLATE_DECL)
      {
        set_mangled_name_for_decl (new_friend);
!       DECL_RTL (new_friend) = 0;
!       make_decl_rtl (new_friend, NULL_PTR);
      }
        
    if (DECL_NAMESPACE_SCOPE_P (new_friend))
--- 4628,4634 ----
    if (TREE_CODE (new_friend) != TEMPLATE_DECL)
      {
        set_mangled_name_for_decl (new_friend);
!       SET_DECL_RTL (new_friend, NULL_RTX);
      }
        
    if (DECL_NAMESPACE_SCOPE_P (new_friend))
*************** tsubst_decl (t, args, type)
*** 5881,5888 ****
  		  set_mangled_name_for_template_decl (r);
  	      }
  	    
! 	    DECL_RTL (r) = 0;
! 	    make_decl_rtl (r, NULL_PTR);
  	    
  	    /* Like grokfndecl.  If we don't do this, pushdecl will
  	       mess up our TREE_CHAIN because it doesn't find a
--- 5880,5886 ----
  		  set_mangled_name_for_template_decl (r);
  	      }
  	    
! 	    SET_DECL_RTL (r, NULL_RTX);
  	    
  	    /* Like grokfndecl.  If we don't do this, pushdecl will
  	       mess up our TREE_CHAIN because it doesn't find a
*************** tsubst_decl (t, args, type)
*** 6049,6055 ****
  	/* Don't try to expand the initializer until someone tries to use
  	   this variable; otherwise we run into circular dependencies.  */
  	DECL_INITIAL (r) = NULL_TREE;
! 	DECL_RTL (r) = 0;
  	DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
  
  	/* For __PRETTY_FUNCTION__ we have to adjust the initializer.  */
--- 6047,6053 ----
  	/* Don't try to expand the initializer until someone tries to use
  	   this variable; otherwise we run into circular dependencies.  */
  	DECL_INITIAL (r) = NULL_TREE;
! 	SET_DECL_RTL (r, NULL_RTX);
  	DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
  
  	/* For __PRETTY_FUNCTION__ we have to adjust the initializer.  */
*************** regenerate_decl_from_template (decl, tmp
*** 9776,9782 ****
       details.  */
    DECL_TI_TEMPLATE (new_decl) = DECL_TI_TEMPLATE (decl);
    DECL_ASSEMBLER_NAME (new_decl) = DECL_ASSEMBLER_NAME (decl);
!   DECL_RTL (new_decl) = DECL_RTL (decl);
    DECL_USE_TEMPLATE (new_decl) = DECL_USE_TEMPLATE (decl);
  
    /* Call duplicate decls to merge the old and new declarations.  */
--- 9774,9780 ----
       details.  */
    DECL_TI_TEMPLATE (new_decl) = DECL_TI_TEMPLATE (decl);
    DECL_ASSEMBLER_NAME (new_decl) = DECL_ASSEMBLER_NAME (decl);
!   COPY_DECL_RTL (decl, new_decl);
    DECL_USE_TEMPLATE (new_decl) = DECL_USE_TEMPLATE (decl);
  
    /* Call duplicate decls to merge the old and new declarations.  */
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.189
diff -c -p -r1.189 semantics.c
*** semantics.c	2001/01/29 18:57:22	1.189
--- semantics.c	2001/03/14 17:09:22
*************** genrtl_named_return_value ()
*** 991,997 ****
  	 SImode but the DECL_RTL for the DECL_RESULT has DImode.  So,
  	 here, we use the mode the back-end has already assigned for
  	 the return value.  */
!       DECL_RTL (decl) = gen_reg_rtx (GET_MODE (DECL_RTL (decl)));
        if (TREE_ADDRESSABLE (decl))
  	put_var_into_stack (decl);
      }
--- 991,997 ----
  	 SImode but the DECL_RTL for the DECL_RESULT has DImode.  So,
  	 here, we use the mode the back-end has already assigned for
  	 the return value.  */
!       SET_DECL_RTL (decl, gen_reg_rtx (GET_MODE (DECL_RTL (decl))));
        if (TREE_ADDRESSABLE (decl))
  	put_var_into_stack (decl);
      }
*************** expand_body (fn)
*** 2373,2381 ****
        /* Or if this is a nested function.  */
        && !decl_function_context (fn))
      {
-       /* Give the function RTL now so that we can assign it to a
- 	 function pointer, etc.  */
-       make_decl_rtl (fn, NULL);
        /* Set DECL_EXTERNAL so that assemble_external will be called as
  	 necessary.  We'll clear it again in finish_file.  */
        if (!DECL_EXTERNAL (fn))
--- 2373,2378 ----
*************** genrtl_finish_function (fn)
*** 2691,2697 ****
  	 was an actual function definition.  */
        DECL_INITIAL (fn) = error_mark_node;
        for (t = DECL_ARGUMENTS (fn); t; t = TREE_CHAIN (t))
! 	DECL_RTL (t) = DECL_INCOMING_RTL (t) = NULL_RTX;
      }
  
    /* Let the error reporting routines know that we're outside a
--- 2688,2697 ----
  	 was an actual function definition.  */
        DECL_INITIAL (fn) = error_mark_node;
        for (t = DECL_ARGUMENTS (fn); t; t = TREE_CHAIN (t))
! 	{
! 	  SET_DECL_RTL (t, NULL_RTX);
! 	  DECL_INCOMING_RTL (t) = NULL_RTX;
! 	}
      }
  
    /* Let the error reporting routines know that we're outside a
Index: cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.232.2.2
diff -c -p -r1.232.2.2 tree.c
*** tree.c	2001/02/14 10:50:51	1.232.2.2
--- tree.c	2001/03/14 17:09:23
*************** cp_tree_equal (t1, t2)
*** 1955,1964 ****
  	 as being equivalent to anything.  */
        if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
  	   && DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
! 	   && DECL_RTL (TREE_OPERAND (t1, 0)) == 0)
  	  || (TREE_CODE (TREE_OPERAND (t2, 0)) == VAR_DECL
  	      && DECL_NAME (TREE_OPERAND (t2, 0)) == NULL_TREE
! 	      && DECL_RTL (TREE_OPERAND (t2, 0)) == 0))
  	cmp = 1;
        else
  	cmp = cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
--- 1955,1964 ----
  	 as being equivalent to anything.  */
        if ((TREE_CODE (TREE_OPERAND (t1, 0)) == VAR_DECL
  	   && DECL_NAME (TREE_OPERAND (t1, 0)) == NULL_TREE
! 	   && !DECL_RTL_SET_P (TREE_OPERAND (t1, 0)))
  	  || (TREE_CODE (TREE_OPERAND (t2, 0)) == VAR_DECL
  	      && DECL_NAME (TREE_OPERAND (t2, 0)) == NULL_TREE
! 	      && !DECL_RTL_SET_P (TREE_OPERAND (t2, 0))))
  	cmp = 1;
        else
  	cmp = cp_tree_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
Index: f/com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.110.2.1
diff -c -p -r1.110.2.1 com.c
*** com.c	2001/02/23 20:45:13	1.110.2.1
--- com.c	2001/03/14 17:09:31
*************** ffecom_member_phase2_ (ffestorag mst, ff
*** 7096,7107 ****
    TREE_ASM_WRITTEN (t) = 1;
    TREE_USED (t) = 1;
  
!   DECL_RTL (t)
!     = gen_rtx (MEM, TYPE_MODE (type),
! 	       plus_constant (XEXP (DECL_RTL (mt), 0),
! 			      ffestorag_modulo (mst)
! 			      + ffestorag_offset (st)
! 			      - ffestorag_offset (mst)));
  
    t = start_decl (t, FALSE);
  
--- 7096,7107 ----
    TREE_ASM_WRITTEN (t) = 1;
    TREE_USED (t) = 1;
  
!   SET_DECL_RTL (t,
! 		gen_rtx (MEM, TYPE_MODE (type),
! 			 plus_constant (XEXP (DECL_RTL (mt), 0),
! 					ffestorag_modulo (mst)
! 					+ ffestorag_offset (st)
! 					- ffestorag_offset (mst))));
  
    t = start_decl (t, FALSE);
  
*************** duplicate_decls (tree newdecl, tree oldd
*** 13686,13692 ****
  	}
  
        /* Keep the old rtl since we can safely use it.  */
!       DECL_RTL (newdecl) = DECL_RTL (olddecl);
  
        /* Merge the type qualifiers.  */
        if (DECL_BUILT_IN_NONANSI (olddecl) && TREE_THIS_VOLATILE (olddecl)
--- 13686,13692 ----
  	}
  
        /* Keep the old rtl since we can safely use it.  */
!       COPY_DECL_RTL (newdecl, olddecl);
  
        /* Merge the type qualifiers.  */
        if (DECL_BUILT_IN_NONANSI (olddecl) && TREE_THIS_VOLATILE (olddecl)
*************** start_decl (tree decl, bool is_top_level
*** 14330,14336 ****
    if (!top_level
    /* But not if this is a duplicate decl and we preserved the rtl from the
       previous one (which may or may not happen).  */
!       && DECL_RTL (tem) == 0)
      {
        if (TYPE_SIZE (TREE_TYPE (tem)) != 0)
  	expand_decl (tem);
--- 14330,14336 ----
    if (!top_level
    /* But not if this is a duplicate decl and we preserved the rtl from the
       previous one (which may or may not happen).  */
!       && !DECL_RTL_SET_P (tem))
      {
        if (TYPE_SIZE (TREE_TYPE (tem)) != 0)
  	expand_decl (tem);
Index: java/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.87.2.2
diff -c -p -r1.87.2.2 decl.c
*** decl.c	2001/02/23 20:45:12	1.87.2.2
--- decl.c	2001/03/14 17:09:32
*************** push_jvm_slot (index, decl)
*** 116,122 ****
       tmp = DECL_LOCAL_SLOT_CHAIN (tmp);
      }
    if (rtl != NULL)
!     DECL_RTL (decl) = rtl;
    else
      {
        if (index >= DECL_MAX_LOCALS (current_function_decl))
--- 116,122 ----
       tmp = DECL_LOCAL_SLOT_CHAIN (tmp);
      }
    if (rtl != NULL)
!     SET_DECL_RTL (decl, rtl);
    else
      {
        if (index >= DECL_MAX_LOCALS (current_function_decl))
Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.66.2.3
diff -c -p -r1.66.2.3 objc-act.c
*** objc-act.c	2001/03/07 00:30:56	1.66.2.3
--- objc-act.c	2001/03/14 17:09:36
*************** generate_static_references ()
*** 1981,1988 ****
  
        type = build_array_type (build_pointer_type (void_type_node), 0);
        decl = build_decl (VAR_DECL, ident, type);
-       make_decl_rtl (decl, 0);
        TREE_USED (decl) = 1;
        decls
  	= tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, decl, 1), decls);
      }
--- 1981,1988 ----
  
        type = build_array_type (build_pointer_type (void_type_node), 0);
        decl = build_decl (VAR_DECL, ident, type);
        TREE_USED (decl) = 1;
+       TREE_STATIC (decl) = 1;
        decls
  	= tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, decl, 1), decls);
      }


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