OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / cgraph.h
index 78ab3e1..7abfb8a 100644 (file)
@@ -580,10 +580,10 @@ struct cgraph_node * cgraph_copy_node_for_versioning (struct cgraph_node *,
 struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
                                                VEC(cgraph_edge_p,heap)*,
                                                VEC(ipa_replace_map_p,gc)*,
-                                               bitmap, bitmap, basic_block,
-                                               const char *);
-void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*, bool, bitmap,
-                              bitmap, basic_block);
+                                               bitmap, bool, bitmap,
+                                               basic_block, const char *);
+void tree_function_versioning (tree, tree, VEC (ipa_replace_map_p,gc)*,
+                              bool, bitmap, bool, bitmap, basic_block);
 void record_references_in_initializer (tree, bool);
 bool cgraph_process_new_functions (void);
 void cgraph_process_same_body_aliases (void);
@@ -935,6 +935,7 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
   gcc_assert (!node->global.inlined_to);
   return (!node->needed && !node->address_taken
          && !node->reachable_from_other_partition
+         && !DECL_VIRTUAL_P (node->decl)
          && !DECL_STATIC_CONSTRUCTOR (node->decl)
          && !DECL_STATIC_DESTRUCTOR (node->decl)
          && !node->local.externally_visible);
@@ -946,10 +947,13 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
 static inline bool
 varpool_can_remove_if_no_refs (struct varpool_node *node)
 {
+  if (DECL_EXTERNAL (node->decl))
+    return true;
   return (!node->force_output && !node->used_from_other_partition
-         && (flag_toplevel_reorder || DECL_COMDAT (node->decl)
-             || DECL_ARTIFICIAL (node->decl))
-         && (DECL_COMDAT (node->decl) || !node->externally_visible));
+         && ((DECL_COMDAT (node->decl)
+              && !varpool_used_from_object_file_p (node))
+             || (flag_toplevel_reorder && !node->externally_visible)
+             || DECL_HAS_VALUE_EXPR_P (node->decl)));
 }
 
 /* Return true when all references to VNODE must be visible in ipa_ref_list.