OSDN Git Service

Fix linux make profiledbootstrap.
[pf3gnuchains/gcc-fork.git] / gcc / cgraphunit.c
index 39a4e32..9e903e0 100644 (file)
@@ -400,7 +400,12 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data)
         by this function and re-examine whether the decl is actually used
         after rtl has been generated.  */
       if (TREE_STATIC (t))
-        cgraph_varpool_mark_needed_node (cgraph_varpool_node (t));
+       {
+         cgraph_varpool_mark_needed_node (cgraph_varpool_node (t));
+         if (lang_hooks.callgraph.analyze_expr)
+           return lang_hooks.callgraph.analyze_expr (tp, walk_subtrees, 
+                                                     data);
+       }
       break;
 
     case ADDR_EXPR:
@@ -792,8 +797,7 @@ cgraph_expand_function (struct cgraph_node *node)
   if (flag_unit_at_a_time)
     announce_function (decl);
 
-  /* Generate RTL for the body of DECL.  Nested functions are expanded
-     via lang_expand_decl_stmt.  */
+  /* Generate RTL for the body of DECL.  */
   lang_hooks.callgraph.expand_function (decl);
 
   /* Make sure that BE didn't give up on compiling.  */
@@ -1792,11 +1796,11 @@ cgraph_optimize (void)
    GENERIC statements.  */
 
 void
-cgraph_build_static_cdtor (char which, tree body)
+cgraph_build_static_cdtor (char which, tree body, int priority)
 {
   static int counter = 0;
   char which_buf[16];
-  tree decl, name;
+  tree decl, name, resdecl;
 
   sprintf (which_buf, "%c_%d", which, counter++);
   name = get_file_function_name_long (which_buf);
@@ -1805,7 +1809,11 @@ cgraph_build_static_cdtor (char which, tree body)
                     build_function_type (void_type_node, void_list_node));
   current_function_decl = decl;
 
-  DECL_RESULT (decl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+  resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+  DECL_ARTIFICIAL (resdecl) = 1;
+  DECL_IGNORED_P (resdecl) = 1;
+  DECL_RESULT (decl) = resdecl;
+
   allocate_struct_function (decl);
 
   TREE_STATIC (decl) = 1;
@@ -1846,6 +1854,6 @@ cgraph_build_static_cdtor (char which, tree body)
        fn = targetm.asm_out.constructor;
       else
        fn = targetm.asm_out.destructor;
-      fn (XEXP (DECL_RTL (decl), 0), DEFAULT_INIT_PRIORITY);
+      fn (XEXP (DECL_RTL (decl), 0), priority);
     }
 }