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]

PR tree-optimization/24888 (twice declared vars in inliner)


Hi,
this patch avoids inliner from adding variables to unexpanded_var_list multiple
times that should save some memory/compilation time especially in cascaded
inlining.

:ADDPATCH middle-end:
Bootstrapped/regtested ppc-linux, OK?

2006-07-23  Jan Hubicka  <jh@suse.cz>
	PR tree-optimization/24888
	* tree-inline.c (expand_call_inline): Do not re-record variables.
	(declare_inline_vars): Add variable to unexpanded_var_list.
Index: tree-inline.c
===================================================================
*** tree-inline.c	(revision 115645)
--- tree-inline.c	(working copy)
*************** expand_call_inline (basic_block bb, tree
*** 2163,2172 ****
    /* Update callgraph if needed.  */
    cgraph_remove_node (cg_edge->callee);
  
-   /* Declare the 'auto' variables added with this inlined body.  */
-   record_vars (BLOCK_VARS (id->block));
    id->block = NULL_TREE;
    successfully_inlined = TRUE;
  
   egress:
    input_location = saved_location;
--- 2163,2170 ----
    /* Update callgraph if needed.  */
    cgraph_remove_node (cg_edge->callee);
  
    id->block = NULL_TREE;
    successfully_inlined = TRUE;
  
   egress:
    input_location = saved_location;
*************** declare_inline_vars (tree block, tree va
*** 2556,2562 ****
  {
    tree t;
    for (t = vars; t; t = TREE_CHAIN (t))
!     DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
  
    if (block)
      BLOCK_VARS (block) = chainon (BLOCK_VARS (block), vars);
--- 2555,2567 ----
  {
    tree t;
    for (t = vars; t; t = TREE_CHAIN (t))
!     {
!       DECL_SEEN_IN_BIND_EXPR_P (t) = 1;
!       gcc_assert (!TREE_STATIC (t) && !TREE_ASM_WRITTEN (t));
!       cfun->unexpanded_var_list =
! 	tree_cons (NULL_TREE, t,
! 		   cfun->unexpanded_var_list);
!     }
  
    if (block)
      BLOCK_VARS (block) = chainon (BLOCK_VARS (block), vars);


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