OSDN Git Service

* cgraph.c (cgraph_mark_address_taken_node): No longer imply needed flag.
[pf3gnuchains/gcc-fork.git] / gcc / tree-profile.c
index 3d681e0..6c2d1bd 100644 (file)
@@ -1,6 +1,6 @@
 /* Calculate branch probabilities, and basic block execution counts.
    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
    Free Software Foundation, Inc.
    Contributed by James E. Wilson, UC Berkeley/Cygnus Support;
    based on some ideas from Dain Samples of UC Berkeley.
@@ -83,6 +83,7 @@ tree_init_ic_make_global_vars (void)
   DECL_ARTIFICIAL (ic_void_ptr_var) = 1;
   DECL_INITIAL (ic_void_ptr_var) = NULL;
   varpool_finalize_decl (ic_void_ptr_var);
+  varpool_mark_needed_node (varpool_node (ic_void_ptr_var));
 
   gcov_type_ptr = build_pointer_type (get_gcov_type ());
   ic_gcov_type_ptr_var
@@ -94,6 +95,7 @@ tree_init_ic_make_global_vars (void)
   DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1;
   DECL_INITIAL (ic_gcov_type_ptr_var) = NULL;
   varpool_finalize_decl (ic_gcov_type_ptr_var);
+  varpool_mark_needed_node (varpool_node (ic_gcov_type_ptr_var));
 }
 
 static void
@@ -343,7 +345,7 @@ tree_gen_ic_func_profiler (void)
   gimple stmt1, stmt2;
   tree tree_uid, cur_func;
 
-  if (!c_node->needed)
+  if (cgraph_only_called_directly_p (c_node))
     return;
 
   tree_init_edge_profiler ();