This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION


On Monday 16 February 2004 16:33, Steven Bosscher wrote:
> A similar patch will go on mainline later today after
> bootstrapping.

Like so.

        * (c-decl.c, c-semantics.c, calls.c, cgraph.c, cgraphunit.c,
        function.c, integrate.c, print-tree.c, toplev.c, tree-optimize.c,
        tree.h): Replace DECL_SAVED_INSNS with DECL_STRUCT_FUNCTION.
        * ada/utils.c: Likewise.
        * cp/decl.c: Likewise.
        * f/com.c: Likewise.
        * java/class.c: Likewise.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.478
diff -c -3 -p -r1.478 c-decl.c
*** c-decl.c	16 Feb 2004 14:20:03 -0000	1.478
--- c-decl.c	17 Feb 2004 21:22:20 -0000
*************** merge_decls (tree newdecl, tree olddecl,
*** 1441,1447 ****
  	{
  	  DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
  	  DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
! 	  DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl);
  	  DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
  	  DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
  
--- 1441,1447 ----
  	{
  	  DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
  	  DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
! 	  DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl);
  	  DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
  	  DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
  
*************** finish_function (void)
*** 6066,6073 ****
        && current_function_returns_null)
      warning ("this function may return with or without a value");
  
!   /* We're leaving the context of this function, so zap cfun.  It's still in
!      DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation.  */
    cfun = NULL;
  
    /* ??? Objc emits functions after finalizing the compilation unit.
--- 6066,6074 ----
        && current_function_returns_null)
      warning ("this function may return with or without a value");
  
!   /* We're leaving the context of this function, so zap cfun.
!      It's still in DECL_STRUCT_FUNCTION , and we'll restore it in
!      tree_rest_of_compilation.  */
    cfun = NULL;
  
    /* ??? Objc emits functions after finalizing the compilation unit.
*************** c_pop_function_context (struct function 
*** 6240,6246 ****
  {
    struct language_function *p = f->language;
  
!   if (DECL_SAVED_INSNS (current_function_decl) == 0
        && DECL_SAVED_TREE (current_function_decl) == NULL_TREE)
      {
        /* Stop pointing to the local nodes about to be freed.  */
--- 6241,6247 ----
  {
    struct language_function *p = f->language;
  
!   if (DECL_STRUCT_FUNCTION (current_function_decl) == 0
        && DECL_SAVED_TREE (current_function_decl) == NULL_TREE)
      {
        /* Stop pointing to the local nodes about to be freed.  */
Index: c-semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-semantics.c,v
retrieving revision 1.76
diff -c -3 -p -r1.76 c-semantics.c
*** c-semantics.c	31 Jan 2004 02:06:41 -0000	1.76
--- c-semantics.c	17 Feb 2004 21:22:22 -0000
*************** genrtl_scope_stmt (tree t)
*** 640,647 ****
  	{
  	  if (TREE_CODE (fn) == FUNCTION_DECL
  	      && DECL_CONTEXT (fn) == current_function_decl
! 	      && DECL_SAVED_INSNS (fn)
! 	      && DECL_SAVED_INSNS (fn)->saved_for_inline
  	      && !TREE_ASM_WRITTEN (fn)
  	      && TREE_ADDRESSABLE (fn))
  	    {
--- 640,647 ----
  	{
  	  if (TREE_CODE (fn) == FUNCTION_DECL
  	      && DECL_CONTEXT (fn) == current_function_decl
! 	      && DECL_STRUCT_FUNCTION (fn)
! 	      && DECL_STRUCT_FUNCTION (fn)->saved_for_inline
  	      && !TREE_ASM_WRITTEN (fn)
  	      && TREE_ADDRESSABLE (fn))
  	    {
Index: calls.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/calls.c,v
retrieving revision 1.320
diff -c -3 -p -r1.320 calls.c
*** calls.c	17 Feb 2004 18:32:32 -0000	1.320
--- calls.c	17 Feb 2004 21:22:31 -0000
*************** try_to_integrate (tree fndecl, tree actp
*** 1778,1788 ****
  	      rtx insn = NULL_RTX, seq;
  
  	      /* Look for a call in the inline function code.
! 	         If DECL_SAVED_INSNS (fndecl)->outgoing_args_size is
  	         nonzero then there is a call and it is not necessary
  	         to scan the insns.  */
  
! 	      if (DECL_SAVED_INSNS (fndecl)->outgoing_args_size == 0)
  		for (insn = first_insn; insn; insn = NEXT_INSN (insn))
  		  if (GET_CODE (insn) == CALL_INSN)
  		    break;
--- 1778,1788 ----
  	      rtx insn = NULL_RTX, seq;
  
  	      /* Look for a call in the inline function code.
! 	         If DECL_STRUCT_FUNCTION (fndecl)->outgoing_args_size is
  	         nonzero then there is a call and it is not necessary
  	         to scan the insns.  */
  
! 	      if (DECL_STRUCT_FUNCTION (fndecl)->outgoing_args_size == 0)
  		for (insn = first_insn; insn; insn = NEXT_INSN (insn))
  		  if (GET_CODE (insn) == CALL_INSN)
  		    break;
*************** try_to_integrate (tree fndecl, tree actp
*** 1806,1813 ****
  		     value of reg_parm_stack_space is wrong, but gives
  		     correct results on all supported machines.  */
  
! 		  int adjust = (DECL_SAVED_INSNS (fndecl)->outgoing_args_size
! 				+ reg_parm_stack_space);
  
  		  start_sequence ();
  		  emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX);
--- 1806,1814 ----
  		     value of reg_parm_stack_space is wrong, but gives
  		     correct results on all supported machines.  */
  
! 		  int adjust =
! 			(DECL_STRUCT_FUNCTION (fndecl)->outgoing_args_size
! 			 + reg_parm_stack_space);
  
  		  start_sequence ();
  		  emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX);
*************** expand_call (tree exp, rtx target, int i
*** 2194,2201 ****
        if (!flag_no_inline
  	  && fndecl != current_function_decl
  	  && DECL_INLINE (fndecl)
! 	  && DECL_SAVED_INSNS (fndecl)
! 	  && DECL_SAVED_INSNS (fndecl)->inlinable)
  	is_integrable = 1;
        else if (! TREE_ADDRESSABLE (fndecl))
  	{
--- 2195,2202 ----
        if (!flag_no_inline
  	  && fndecl != current_function_decl
  	  && DECL_INLINE (fndecl)
! 	  && DECL_STRUCT_FUNCTION (fndecl)
! 	  && DECL_STRUCT_FUNCTION (fndecl)->inlinable)
  	is_integrable = 1;
        else if (! TREE_ADDRESSABLE (fndecl))
  	{
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.43
diff -c -3 -p -r1.43 cgraph.c
*** cgraph.c	29 Jan 2004 00:34:09 -0000	1.43
--- cgraph.c	17 Feb 2004 21:22:33 -0000
*************** cgraph_remove_node (struct cgraph_node *
*** 235,241 ****
    if (node->next)
      node->next->previous = node->previous;
    DECL_SAVED_TREE (node->decl) = NULL;
!   DECL_SAVED_INSNS (node->decl) = NULL;
    DECL_ARGUMENTS (node->decl) = NULL;
    DECL_INITIAL (node->decl) = error_mark_node;
    slot = 
--- 235,241 ----
    if (node->next)
      node->next->previous = node->previous;
    DECL_SAVED_TREE (node->decl) = NULL;
!   DECL_STRUCT_FUNCTION (node->decl) = NULL;
    DECL_ARGUMENTS (node->decl) = NULL;
    DECL_INITIAL (node->decl) = error_mark_node;
    slot = 
Index: cgraphunit.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraphunit.c,v
retrieving revision 1.51
diff -c -3 -p -r1.51 cgraphunit.c
*** cgraphunit.c	8 Feb 2004 01:59:03 -0000	1.51
--- cgraphunit.c	17 Feb 2004 21:22:36 -0000
*************** cgraph_finalize_function (tree decl, boo
*** 232,238 ****
    /* We will never really output the function body, clear the SAVED_INSNS array
       early then.  */
    if (DECL_EXTERNAL (decl))
!     DECL_SAVED_INSNS (decl) = NULL;
  }
  
  /* Walk tree and record all calls.  Called via walk_tree.  */
--- 232,238 ----
    /* We will never really output the function body, clear the SAVED_INSNS array
       early then.  */
    if (DECL_EXTERNAL (decl))
!     DECL_STRUCT_FUNCTION (decl) = NULL;
  }
  
  /* Walk tree and record all calls.  Called via walk_tree.  */
*************** cgraph_mark_functions_to_output (void)
*** 481,487 ****
  	  && !DECL_EXTERNAL (decl))
  	node->output = 1;
        else
!         DECL_SAVED_INSNS (decl) = NULL;
      }
  }
  
--- 481,487 ----
  	  && !DECL_EXTERNAL (decl))
  	node->output = 1;
        else
!         DECL_STRUCT_FUNCTION (decl) = NULL;
      }
  }
  
*************** cgraph_remove_unreachable_nodes (void)
*** 861,867 ****
  	  int local_insns;
  	  tree decl = node->decl;
  
! 	  if (DECL_SAVED_INSNS (decl))
  	    local_insns = node->local.self_insns;
  	  else
  	    local_insns = 0;
--- 861,867 ----
  	  int local_insns;
  	  tree decl = node->decl;
  
! 	  if (DECL_STRUCT_FUNCTION (decl))
  	    local_insns = node->local.self_insns;
  	  else
  	    local_insns = 0;
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.494
diff -c -3 -p -r1.494 function.c
*** function.c	12 Feb 2004 20:48:21 -0000	1.494
--- function.c	17 Feb 2004 21:22:51 -0000
*************** allocate_struct_function (tree fndecl)
*** 6414,6420 ****
    if (fndecl == NULL)
      return;
  
!   DECL_SAVED_INSNS (fndecl) = cfun;
    cfun->decl = fndecl;
  
    result = DECL_RESULT (fndecl);
--- 6414,6420 ----
    if (fndecl == NULL)
      return;
  
!   DECL_STRUCT_FUNCTION (fndecl) = cfun;
    cfun->decl = fndecl;
  
    result = DECL_RESULT (fndecl);
*************** allocate_struct_function (tree fndecl)
*** 6439,6446 ****
  static void
  prepare_function_start (tree fndecl)
  {
!   if (fndecl && DECL_SAVED_INSNS (fndecl))
!     cfun = DECL_SAVED_INSNS (fndecl);
    else
      allocate_struct_function (fndecl);
    init_emit ();
--- 6439,6446 ----
  static void
  prepare_function_start (tree fndecl)
  {
!   if (fndecl && DECL_STRUCT_FUNCTION (fndecl))
!     cfun = DECL_STRUCT_FUNCTION (fndecl);
    else
      allocate_struct_function (fndecl);
    init_emit ();
Index: integrate.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/integrate.c,v
retrieving revision 1.247
diff -c -3 -p -r1.247 integrate.c
*** integrate.c	2 Feb 2004 00:17:16 -0000	1.247
--- integrate.c	17 Feb 2004 21:22:58 -0000
*************** copy_decl_for_inlining (tree decl, tree 
*** 414,421 ****
  }
  
  /* Make the insns and PARM_DECLs of the current function permanent
!    and record other information in DECL_SAVED_INSNS to allow inlining
!    of this function in subsequent calls.
  
     This routine need not copy any insns because we are not going
     to immediately compile the insns in the insn chain.  There
--- 414,421 ----
  }
  
  /* Make the insns and PARM_DECLs of the current function permanent
!    and record other information in DECL_STRUCT_FUNCTION to allow
!    inlining of this function in subsequent calls.
  
     This routine need not copy any insns because we are not going
     to immediately compile the insns in the insn chain.  There
*************** expand_inline_function (tree fndecl, tre
*** 642,648 ****
  			tree type, rtx structure_value_addr)
  {
    struct function *inlining_previous;
!   struct function *inl_f = DECL_SAVED_INSNS (fndecl);
    tree formal, actual, block;
    rtx parm_insns = inl_f->emit->x_first_insn;
    rtx insns = (inl_f->inl_last_parm_insn
--- 642,648 ----
  			tree type, rtx structure_value_addr)
  {
    struct function *inlining_previous;
!   struct function *inl_f = DECL_STRUCT_FUNCTION (fndecl);
    tree formal, actual, block;
    rtx parm_insns = inl_f->emit->x_first_insn;
    rtx insns = (inl_f->inl_last_parm_insn
*************** expand_inline_function (tree fndecl, tre
*** 953,959 ****
  	     incoming arg rtx values are expanded now so that we can be
  	     sure we have enough slots in the const equiv map since the
  	     store_expr call can easily blow the size estimate.  */
! 	  if (DECL_SAVED_INSNS (fndecl)->args_size != 0)
  	    copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0);
  	}
        else if (GET_CODE (loc) == REG)
--- 953,959 ----
  	     incoming arg rtx values are expanded now so that we can be
  	     sure we have enough slots in the const equiv map since the
  	     store_expr call can easily blow the size estimate.  */
! 	  if (DECL_STRUCT_FUNCTION (fndecl)->args_size != 0)
  	    copy_rtx_and_substitute (virtual_incoming_args_rtx, map, 0);
  	}
        else if (GET_CODE (loc) == REG)
*************** copy_rtx_and_substitute (rtx orig, struc
*** 1886,1892 ****
        regno = REGNO (orig);
        if (regno <= LAST_VIRTUAL_REGISTER
  	  || (map->integrating
! 	      && DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer == orig))
  	{
  	  /* Some hard registers are also mapped,
  	     but others are not translated.  */
--- 1886,1893 ----
        regno = REGNO (orig);
        if (regno <= LAST_VIRTUAL_REGISTER
  	  || (map->integrating
! 	      && DECL_STRUCT_FUNCTION (map->fndecl)->internal_arg_pointer
! 		 == orig))
  	{
  	  /* Some hard registers are also mapped,
  	     but others are not translated.  */
*************** copy_rtx_and_substitute (rtx orig, struc
*** 1904,1913 ****
  	  else if (regno == VIRTUAL_STACK_VARS_REGNUM)
  	    {
  	      rtx loc, seq;
! 	      int size = get_func_frame_size (DECL_SAVED_INSNS (map->fndecl));
  #ifdef FRAME_GROWS_DOWNWARD
  	      int alignment
! 		= (DECL_SAVED_INSNS (map->fndecl)->stack_alignment_needed
  		   / BITS_PER_UNIT);
  
  	      /* In this case, virtual_stack_vars_rtx points to one byte
--- 1905,1915 ----
  	  else if (regno == VIRTUAL_STACK_VARS_REGNUM)
  	    {
  	      rtx loc, seq;
! 	      int size
! 		= get_func_frame_size (DECL_STRUCT_FUNCTION (map->fndecl));
  #ifdef FRAME_GROWS_DOWNWARD
  	      int alignment
! 		= (DECL_STRUCT_FUNCTION (map->fndecl)->stack_alignment_needed
  		   / BITS_PER_UNIT);
  
  	      /* In this case, virtual_stack_vars_rtx points to one byte
*************** copy_rtx_and_substitute (rtx orig, struc
*** 1942,1954 ****
  	    }
  	  else if (regno == VIRTUAL_INCOMING_ARGS_REGNUM
  		   || (map->integrating
! 		       && (DECL_SAVED_INSNS (map->fndecl)->internal_arg_pointer
  			   == orig)))
  	    {
  	      /* Do the same for a block to contain any arguments referenced
  		 in memory.  */
  	      rtx loc, seq;
! 	      int size = DECL_SAVED_INSNS (map->fndecl)->args_size;
  
  	      start_sequence ();
  	      loc = assign_stack_temp (BLKmode, size, 1);
--- 1944,1956 ----
  	    }
  	  else if (regno == VIRTUAL_INCOMING_ARGS_REGNUM
  		   || (map->integrating
! 		       && (DECL_STRUCT_FUNCTION (map->fndecl)->internal_arg_pointer
  			   == orig)))
  	    {
  	      /* Do the same for a block to contain any arguments referenced
  		 in memory.  */
  	      rtx loc, seq;
! 	      int size = DECL_STRUCT_FUNCTION (map->fndecl)->args_size;
  
  	      start_sequence ();
  	      loc = assign_stack_temp (BLKmode, size, 1);
*************** set_decl_abstract_flags (tree decl, int 
*** 2956,2963 ****
      }
  }
  
! /* Output the assembly language code for the function FNDECL
!    from its DECL_SAVED_INSNS.  Used for inline functions that are output
     at end of compilation instead of where they came in the source.  */
  
  static GTY(()) struct function *old_cfun;
--- 2958,2965 ----
      }
  }
  
! /* Output the assembly language code for the function FNDECL from
!    its DECL_STRUCT_FUNCTION.  Used for inline functions that are output
     at end of compilation instead of where they came in the source.  */
  
  static GTY(()) struct function *old_cfun;
*************** output_inline_function (tree fndecl)
*** 2967,2973 ****
  {
    enum debug_info_type old_write_symbols = write_symbols;
    const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks;
!   struct function *f = DECL_SAVED_INSNS (fndecl);
  
    old_cfun = cfun;
    cfun = f;
--- 2969,2975 ----
  {
    enum debug_info_type old_write_symbols = write_symbols;
    const struct gcc_debug_hooks *const old_debug_hooks = debug_hooks;
!   struct function *f = DECL_STRUCT_FUNCTION (fndecl);
  
    old_cfun = cfun;
    cfun = f;
Index: print-tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-tree.c,v
retrieving revision 1.80
diff -c -3 -p -r1.80 print-tree.c
*** print-tree.c	5 Jan 2004 15:16:35 -0000	1.80
--- print-tree.c	17 Feb 2004 21:22:59 -0000
*************** print_node (FILE *file, const char *pref
*** 440,450 ****
  	    }
  	}
        else if (TREE_CODE (node) == FUNCTION_DECL
! 	       && DECL_SAVED_INSNS (node) != 0)
  	{
  	  indent_to (file, indent + 4);
  	  fprintf (file, "saved-insns " HOST_PTR_PRINTF,
! 		   (void *) DECL_SAVED_INSNS (node));
  	}
  
        /* Print the decl chain only if decl is at second level.  */
--- 440,450 ----
  	    }
  	}
        else if (TREE_CODE (node) == FUNCTION_DECL
! 	       && DECL_STRUCT_FUNCTION (node) != 0)
  	{
  	  indent_to (file, indent + 4);
  	  fprintf (file, "saved-insns " HOST_PTR_PRINTF,
! 		   (void *) DECL_STRUCT_FUNCTION (node));
  	}
  
        /* Print the decl chain only if decl is at second level.  */
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.878
diff -c -3 -p -r1.878 toplev.c
*** toplev.c	17 Feb 2004 18:32:36 -0000	1.878
--- toplev.c	17 Feb 2004 21:23:07 -0000
*************** wrapup_global_declarations (tree *vec, i
*** 1658,1665 ****
  
  	  if (TREE_CODE (decl) == FUNCTION_DECL
  	      && DECL_INITIAL (decl) != 0
! 	      && DECL_SAVED_INSNS (decl) != 0
! 	      && DECL_SAVED_INSNS (decl)->saved_for_inline
  	      && (flag_keep_inline_functions
  		  || (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
  		  || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
--- 1658,1665 ----
  
  	  if (TREE_CODE (decl) == FUNCTION_DECL
  	      && DECL_INITIAL (decl) != 0
! 	      && DECL_STRUCT_FUNCTION (decl) != 0
! 	      && DECL_STRUCT_FUNCTION (decl)->saved_for_inline
  	      && (flag_keep_inline_functions
  		  || (TREE_PUBLIC (decl) && !DECL_COMDAT (decl))
  		  || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
*************** rest_of_handle_inlining (tree decl)
*** 2677,2683 ****
  
    if (open_dump_file (DFI_rtl, decl))
      {
!       if (DECL_SAVED_INSNS (decl) && DECL_SAVED_INSNS (decl)->saved_for_inline)
  	fprintf (rtl_dump_file, ";; (integrable)\n\n");
        close_dump_file (DFI_rtl, print_rtl, insns);
      }
--- 2677,2684 ----
  
    if (open_dump_file (DFI_rtl, decl))
      {
!       if (DECL_STRUCT_FUNCTION (decl)
! 	  && DECL_STRUCT_FUNCTION (decl)->saved_for_inline)
  	fprintf (rtl_dump_file, ";; (integrable)\n\n");
        close_dump_file (DFI_rtl, print_rtl, insns);
      }
*************** rest_of_handle_inlining (tree decl)
*** 2747,2753 ****
        timevar_push (TV_INTEGRATION);
        save_for_inline (decl);
        timevar_pop (TV_INTEGRATION);
!       DECL_SAVED_INSNS (decl)->inlinable = inlinable;
        return true;
      }
  
--- 2748,2754 ----
        timevar_push (TV_INTEGRATION);
        save_for_inline (decl);
        timevar_pop (TV_INTEGRATION);
!       DECL_STRUCT_FUNCTION (decl)->inlinable = inlinable;
        return true;
      }
  
*************** rest_of_compilation (tree decl)
*** 3678,3684 ****
    if (! DECL_DEFER_OUTPUT (decl))
      {
        free_after_compilation (cfun);
!       DECL_SAVED_INSNS (decl) = 0;
      }
    cfun = 0;
  
--- 3679,3685 ----
    if (! DECL_DEFER_OUTPUT (decl))
      {
        free_after_compilation (cfun);
!       DECL_STRUCT_FUNCTION (decl) = 0;
      }
    cfun = 0;
  
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.11
diff -c -3 -p -r2.11 tree-optimize.c
*** tree-optimize.c	12 Feb 2004 16:33:07 -0000	2.11
--- tree-optimize.c	17 Feb 2004 21:23:08 -0000
*************** tree_rest_of_compilation (tree fndecl, b
*** 208,214 ****
    if (!cgraph_function_possibly_inlined_p (fndecl))
      {
        DECL_SAVED_TREE (fndecl) = NULL;
!       if (DECL_SAVED_INSNS (fndecl) == 0
  	  && !cgraph_node (fndecl)->origin)
  	{
  	  /* Stop pointing to the local nodes about to be freed.
--- 208,214 ----
    if (!cgraph_function_possibly_inlined_p (fndecl))
      {
        DECL_SAVED_TREE (fndecl) = NULL;
!       if (DECL_STRUCT_FUNCTION (fndecl) == 0
  	  && !cgraph_node (fndecl)->origin)
  	{
  	  /* Stop pointing to the local nodes about to be freed.
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.467
diff -c -3 -p -r1.467 tree.h
*** tree.h	11 Feb 2004 20:16:06 -0000	1.467
--- tree.h	17 Feb 2004 21:23:15 -0000
*************** struct tree_type GTY(())
*** 1375,1382 ****
     where the data was actually passed.  */
  #define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->decl.u2.r)
  
! /* For FUNCTION_DECL, if it is inline, holds the saved insn chain.  */
! #define DECL_SAVED_INSNS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f)
  
  /* For FUNCTION_DECL, if it is built-in,
     this identifies which built-in operation it is.  */
--- 1375,1383 ----
     where the data was actually passed.  */
  #define DECL_INCOMING_RTL(NODE) (PARM_DECL_CHECK (NODE)->decl.u2.r)
  
! /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
!    that describes the status of this function.  */
! #define DECL_STRUCT_FUNCTION(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.u2.f)
  
  /* For FUNCTION_DECL, if it is built-in,
     this identifies which built-in operation it is.  */
Index: ada/utils.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/utils.c,v
retrieving revision 1.43
diff -c -3 -p -r1.43 utils.c
*** ada/utils.c	5 Feb 2004 22:07:22 -0000	1.43
--- ada/utils.c	17 Feb 2004 21:23:26 -0000
*************** end_subprog_body (void)
*** 1929,1935 ****
         cico_list != 0; cico_list = TREE_CHAIN (cico_list))
      TREE_VALUE (cico_list) = 0;
  
!   if (DECL_SAVED_INSNS (current_function_decl) == 0)
      {
        /* Throw away DECL_RTL in any PARM_DECLs unless this function
  	 was saved for inline, in which case the DECL_RTLs are in
--- 1929,1935 ----
         cico_list != 0; cico_list = TREE_CHAIN (cico_list))
      TREE_VALUE (cico_list) = 0;
  
!   if (DECL_STRUCT_FUNCTION (current_function_decl) == 0)
      {
        /* Throw away DECL_RTL in any PARM_DECLs unless this function
  	 was saved for inline, in which case the DECL_RTLs are in
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1186
diff -c -3 -p -r1.1186 decl.c
*** cp/decl.c	16 Feb 2004 02:35:48 -0000	1.1186
--- cp/decl.c	17 Feb 2004 21:23:50 -0000
*************** duplicate_decls (tree newdecl, tree oldd
*** 1684,1690 ****
  	      && DECL_LANG_SPECIFIC (olddecl))
  	    {
  	      DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
! 	      DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl);
  	    }
  	}
  
--- 1684,1690 ----
  	      && DECL_LANG_SPECIFIC (olddecl))
  	    {
  	      DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
! 	      DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl);
  	    }
  	}
  
*************** finish_function (int flags)
*** 10861,10868 ****
        && (DECL_INLINE (fndecl) || processing_template_decl))
      warning ("no return statement in function returning non-void");
  
!   /* We're leaving the context of this function, so zap cfun.  It's still in
!      DECL_SAVED_INSNS, and we'll restore it in tree_rest_of_compilation.  */
    cfun = NULL;
    current_function_decl = NULL;
  
--- 10861,10869 ----
        && (DECL_INLINE (fndecl) || processing_template_decl))
      warning ("no return statement in function returning non-void");
  
!   /* We're leaving the context of this function, so zap cfun.
!      It's still in DECL_STRUCT_FUNCTION, and we'll restore it in
!      tree_rest_of_compilation.  */
    cfun = NULL;
    current_function_decl = NULL;
  
Index: f/com.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/f/com.c,v
retrieving revision 1.222
diff -c -3 -p -r1.222 com.c
*** f/com.c	3 Feb 2004 05:15:46 -0000	1.222
--- f/com.c	17 Feb 2004 21:24:18 -0000
*************** duplicate_decls (tree newdecl, tree oldd
*** 13402,13408 ****
  
        DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
        DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
!       DECL_SAVED_INSNS (newdecl) = DECL_SAVED_INSNS (olddecl);
        DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
      }
  
--- 13402,13408 ----
  
        DECL_RESULT (newdecl) = DECL_RESULT (olddecl);
        DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
!       DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl);
        DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
      }
  
*************** finish_function (int nested)
*** 13599,13605 ****
  
    if (TREE_CODE (fndecl) != ERROR_MARK
        && !nested
!       && DECL_SAVED_INSNS (fndecl) == 0)
      {
        /* Stop pointing to the local nodes about to be freed.  */
        /* But DECL_INITIAL must remain nonzero so we know this was an actual
--- 13599,13605 ----
  
    if (TREE_CODE (fndecl) != ERROR_MARK
        && !nested
!       && DECL_STRUCT_FUNCTION (fndecl) == 0)
      {
        /* Stop pointing to the local nodes about to be freed.  */
        /* But DECL_INITIAL must remain nonzero so we know this was an actual
*************** pop_f_function_context (void)
*** 13755,13761 ****
  	= TREE_VALUE (link);
  
    if (current_function_decl != error_mark_node
!       && DECL_SAVED_INSNS (current_function_decl) == 0)
      {
        /* Stop pointing to the local nodes about to be freed.  */
        /* But DECL_INITIAL must remain nonzero so we know this was an actual
--- 13755,13761 ----
  	= TREE_VALUE (link);
  
    if (current_function_decl != error_mark_node
!       && DECL_STRUCT_FUNCTION (current_function_decl) == 0)
      {
        /* Stop pointing to the local nodes about to be freed.  */
        /* But DECL_INITIAL must remain nonzero so we know this was an actual
*************** poplevel (int keep, int reverse, int fun
*** 14350,14356 ****
  	if (DECL_ABSTRACT_ORIGIN (decl) != 0
  	    && DECL_ABSTRACT_ORIGIN (decl) != decl)
  	  TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1;
! 	else if (DECL_SAVED_INSNS (decl) != 0)
  	  {
  	    push_function_context ();
  	    output_inline_function (decl);
--- 14350,14356 ----
  	if (DECL_ABSTRACT_ORIGIN (decl) != 0
  	    && DECL_ABSTRACT_ORIGIN (decl) != decl)
  	  TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1;
! 	else if (DECL_STRUCT_FUNCTION (decl) != 0)
  	  {
  	    push_function_context ();
  	    output_inline_function (decl);
Index: java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.176
diff -c -3 -p -r1.176 class.c
*** java/class.c	15 Jan 2004 10:24:25 -0000	1.176
--- java/class.c	17 Feb 2004 21:24:23 -0000
*************** finish_class (void)
*** 1710,1716 ****
    /* Emit deferred inline methods. */  
    for (method = type_methods; method != NULL_TREE; )
      {
!       if (! TREE_ASM_WRITTEN (method) && DECL_SAVED_INSNS (method) != 0)
  	{
  	  output_inline_function (method);
  	  /* Scan the list again to see if there are any earlier
--- 1710,1716 ----
    /* Emit deferred inline methods. */  
    for (method = type_methods; method != NULL_TREE; )
      {
!       if (! TREE_ASM_WRITTEN (method) && DECL_STRUCT_FUNCTION (method) != 0)
  	{
  	  output_inline_function (method);
  	  /* Scan the list again to see if there are any earlier


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