2007-01-10 Razya Ladelsky <razya@il.ibm.com>
authorrazya <razya@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 10:21:50 +0000 (10:21 +0000)
committerrazya <razya@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 10:21:50 +0000 (10:21 +0000)
        * function.c (get_last_funcdef_no): New function.
        * function.h (get_last_funcdef_no): Declare.
        * tree-inline.c (initialize_cfun): Add initialization.
        (tree_function_versioning): Cleanup.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120638 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c
gcc/function.h
gcc/tree-inline.c

index 3d8e36f..43e4b39 100644 (file)
@@ -1,3 +1,10 @@
+2007-01-10  Razya Ladelsky  <razya@il.ibm.com>
+        
+        * function.c (get_last_funcdef_no): New function.
+       * function.h (get_last_funcdef_no): Declare. 
+        * tree-inline.c (initialize_cfun): Add initialization.
+        (tree_function_versioning): Cleanup.
+       
 2007-01-10  Jan Hubicka  <jh@suse.cz>
 
        * tree-inline.c (setup_one_parameter): Do not propagate into abnormal
index b657e24..e941c7c 100644 (file)
@@ -3773,6 +3773,14 @@ debug_find_var_in_block_tree (tree var, tree block)
   return NULL_TREE;
 }
 \f
+
+/* Return value of funcdef and increase it.  */
+int
+get_next_funcdef_no(void) 
+{
+  return funcdef_no++;
+}
+
 /* Allocate a function structure for FNDECL and set its contents
    to the defaults.  */
 
@@ -3787,7 +3795,7 @@ allocate_struct_function (tree fndecl)
   cfun->stack_alignment_needed = STACK_BOUNDARY;
   cfun->preferred_stack_boundary = STACK_BOUNDARY;
 
-  current_function_funcdef_no = funcdef_no++;
+  current_function_funcdef_no = get_next_funcdef_no ();
 
   cfun->function_frequency = FUNCTION_FREQUENCY_NORMAL;
 
index e8039a7..e02077f 100644 (file)
@@ -599,4 +599,5 @@ extern bool reference_callee_copied (CUMULATIVE_ARGS *, enum machine_mode,
 
 extern void used_types_insert (tree);
 
+extern int get_next_funcdef_no (void);
 #endif  /* GCC_FUNCTION_H */
index 1e9a244..3775585 100644 (file)
@@ -1080,6 +1080,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count,
   /* Register specific tree functions.  */
   tree_register_cfg_hooks ();
   *new_cfun = *DECL_STRUCT_FUNCTION (callee_fndecl);
+  new_cfun->funcdef_no = get_next_funcdef_no ();
   VALUE_HISTOGRAMS (new_cfun) = NULL;
   new_cfun->unexpanded_var_list = NULL;
   new_cfun->cfg = NULL;
@@ -3303,7 +3304,13 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
   fold_cond_expr_cond ();
   if (gimple_in_ssa_p (cfun))
     {
+      free_dominance_info (CDI_DOMINATORS);
+      free_dominance_info (CDI_POST_DOMINATORS);
+      delete_unreachable_blocks ();
       update_ssa (TODO_update_ssa);
+      fold_cond_expr_cond ();
+      if (need_ssa_update_p ())
+        update_ssa (TODO_update_ssa);
     }
   free_dominance_info (CDI_DOMINATORS);
   free_dominance_info (CDI_POST_DOMINATORS);