From 2e9bb6ba99ec7db9f88a44dfec42c84ec1c7ea30 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 17 Apr 2011 18:37:07 +0200 Subject: re PR middle-end/20991 (ICE in cgraph_mark_reachable_node) * 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. * cp/class.c (cp_fold_obj_type_ref): Drop vtable_method. From-SVN: r172613 --- gcc/ChangeLog | 10 ++++++++++ gcc/cgraph.c | 1 - gcc/cgraph.h | 4 ---- gcc/cgraphunit.c | 1 - gcc/cp/ChangeLog | 4 ++++ gcc/cp/class.c | 2 -- gcc/gimple-fold.c | 5 ++++- gcc/lto-cgraph.c | 2 -- gcc/varasm.c | 3 +-- 9 files changed, 19 insertions(+), 13 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4af4017..f8287a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-04-17 Jan Hubicka + + * 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 PR lto/48538 diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 31c5b59..eb49bc7 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -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; diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 199349b..69fd19a 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -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 diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 6b3ddb5..adfb0d2 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -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; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index aae532a..cd71a1d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2011-04-17 Jan Hubicka + + * class.c (cp_fold_obj_type_ref): Drop vtable_method. + 2011-04-15 Rodrigo Rivas Costa Implement N3271 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 3216068..5578eb2 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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); } diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index f1eb98e..f629fd5 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -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. */ diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 7f0910b..c8b0797 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -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); diff --git a/gcc/varasm.c b/gcc/varasm.c index 40a38f5..e60c95e 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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) -- cgit v1.1