* cgraph.c (cgraph_clone_node): Do not handle vtable_method
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 17 Apr 2011 16:37:07 +0000 (16:37 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 17 Apr 2011 16:37:07 +0000 (16:37 +0000)
* cgraph.h (struct cgraph_local_info): Drop vtable_method.
* cgraphunit.c (cgraph_copy_node_for_versioning): Drop vtable_method.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Drop vtable method.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Mention PR20991 in
gimple-fold.c
* varasm.c (mark_decl_referenced): Drop vtable_method handling code.
* cp/class.c (cp_fold_obj_type_ref): Drop vtable_method.

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

gcc/ChangeLog
gcc/cgraph.c
gcc/cgraph.h
gcc/cgraphunit.c
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/gimple-fold.c
gcc/lto-cgraph.c
gcc/varasm.c

index 4af4017..f8287a8 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-17  Jan Hubicka  <jh@suse.cz>
+
+       * cgraph.c (cgraph_clone_node): Do not handle vtable_method
+       * cgraph.h (struct cgraph_local_info): Drop vtable_method.
+       * cgraphunit.c (cgraph_copy_node_for_versioning): Drop vtable_method.
+       * lto-cgraph.c (lto_output_node, input_overwrite_node): Drop vtable method.
+       * gimple-fold.c (can_refer_decl_in_current_unit_p): Mention PR20991 in
+       gimple-fold.c
+       * varasm.c (mark_decl_referenced): Drop vtable_method handling code.
+
 2011-04-17  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR lto/48538
index 31c5b59..eb49bc7 100644 (file)
@@ -2161,7 +2161,6 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
   new_node->local = n->local;
   new_node->local.externally_visible = false;
   new_node->local.local = true;
-  new_node->local.vtable_method = false;
   new_node->global = n->global;
   new_node->rtl = n->rtl;
   new_node->count = count;
index 199349b..69fd19a 100644 (file)
@@ -95,10 +95,6 @@ struct GTY(()) cgraph_local_info {
   /* True when the function has been originally extern inline, but it is
      redefined now.  */
   unsigned redefined_extern_inline : 1;
-
-  /* True if the function is going to be emitted in some other translation
-     unit, referenced from vtable.  */
-  unsigned vtable_method : 1;
 };
 
 /* Information about the function that needs to be computed globally
index 6b3ddb5..adfb0d2 100644 (file)
@@ -1991,7 +1991,6 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
    new_version->local = old_version->local;
    new_version->local.externally_visible = false;
    new_version->local.local = true;
-   new_version->local.vtable_method = false;
    new_version->global = old_version->global;
    new_version->rtl = old_version->rtl;
    new_version->reachable = true;
index aae532a..cd71a1d 100644 (file)
@@ -1,3 +1,7 @@
+2011-04-17  Jan Hubicka  <jh@suse.cz>
+
+       * class.c (cp_fold_obj_type_ref): Drop vtable_method.
+
 2011-04-15  Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
 
        Implement N3271
index 3216068..5578eb2 100644 (file)
@@ -8402,8 +8402,6 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
                                  DECL_VINDEX (fndecl)));
 #endif
 
-  cgraph_get_node (fndecl)->local.vtable_method = true;
-
   return build_address (fndecl);
 }
 
index f1eb98e..f629fd5 100644 (file)
@@ -80,7 +80,10 @@ can_refer_decl_in_current_unit_p (tree decl)
     return true;
   /* We are not at ltrans stage; so don't worry about WHOPR.
      Also when still gimplifying all referred comdat functions will be
-     produced.  */
+     produced.
+     ??? as observed in PR20991 for already optimized out comdat virtual functions
+     we may not neccesarily give up because the copy will be output elsewhere when
+     corresponding vtable is output.  */
   if (!flag_ltrans && (!DECL_COMDAT (decl) || !cgraph_function_flags_ready))
     return true;
   /* If we already output the function body, we are safe.  */
index 7f0910b..c8b0797 100644 (file)
@@ -491,7 +491,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
   bp_pack_value (&bp, node->local.finalized, 1);
   bp_pack_value (&bp, node->local.can_change_signature, 1);
   bp_pack_value (&bp, node->local.redefined_extern_inline, 1);
-  bp_pack_value (&bp, node->local.vtable_method, 1);
   bp_pack_value (&bp, node->needed, 1);
   bp_pack_value (&bp, node->address_taken, 1);
   bp_pack_value (&bp, node->abstract_and_needed, 1);
@@ -927,7 +926,6 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
   node->local.finalized = bp_unpack_value (bp, 1);
   node->local.can_change_signature = bp_unpack_value (bp, 1);
   node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
-  node->local.vtable_method = bp_unpack_value (bp, 1);
   node->needed = bp_unpack_value (bp, 1);
   node->address_taken = bp_unpack_value (bp, 1);
   node->abstract_and_needed = bp_unpack_value (bp, 1);
index 40a38f5..e60c95e 100644 (file)
@@ -2201,8 +2201,7 @@ mark_decl_referenced (tree decl)
         definition.  */
       struct cgraph_node *node = cgraph_get_create_node (decl);
       if (!DECL_EXTERNAL (decl)
-         && (!node->local.vtable_method || !cgraph_global_info_ready
-             || !node->local.finalized))
+         && !node->local.finalized)
        cgraph_mark_needed_node (node);
     }
   else if (TREE_CODE (decl) == VAR_DECL)