Commit 2e9bb6ba by Jan Hubicka Committed by Jan Hubicka

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
parent beb628e1
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> 2011-04-17 Eric Botcazou <ebotcazou@adacore.com>
PR lto/48538 PR lto/48538
......
...@@ -2161,7 +2161,6 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq, ...@@ -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 = n->local;
new_node->local.externally_visible = false; new_node->local.externally_visible = false;
new_node->local.local = true; new_node->local.local = true;
new_node->local.vtable_method = false;
new_node->global = n->global; new_node->global = n->global;
new_node->rtl = n->rtl; new_node->rtl = n->rtl;
new_node->count = count; new_node->count = count;
......
...@@ -95,10 +95,6 @@ struct GTY(()) cgraph_local_info { ...@@ -95,10 +95,6 @@ struct GTY(()) cgraph_local_info {
/* True when the function has been originally extern inline, but it is /* True when the function has been originally extern inline, but it is
redefined now. */ redefined now. */
unsigned redefined_extern_inline : 1; 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 /* Information about the function that needs to be computed globally
......
...@@ -1991,7 +1991,6 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version, ...@@ -1991,7 +1991,6 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
new_version->local = old_version->local; new_version->local = old_version->local;
new_version->local.externally_visible = false; new_version->local.externally_visible = false;
new_version->local.local = true; new_version->local.local = true;
new_version->local.vtable_method = false;
new_version->global = old_version->global; new_version->global = old_version->global;
new_version->rtl = old_version->rtl; new_version->rtl = old_version->rtl;
new_version->reachable = true; new_version->reachable = true;
......
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> 2011-04-15 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Implement N3271 Implement N3271
......
...@@ -8402,8 +8402,6 @@ cp_fold_obj_type_ref (tree ref, tree known_type) ...@@ -8402,8 +8402,6 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
DECL_VINDEX (fndecl))); DECL_VINDEX (fndecl)));
#endif #endif
cgraph_get_node (fndecl)->local.vtable_method = true;
return build_address (fndecl); return build_address (fndecl);
} }
......
...@@ -80,7 +80,10 @@ can_refer_decl_in_current_unit_p (tree decl) ...@@ -80,7 +80,10 @@ can_refer_decl_in_current_unit_p (tree decl)
return true; return true;
/* We are not at ltrans stage; so don't worry about WHOPR. /* We are not at ltrans stage; so don't worry about WHOPR.
Also when still gimplifying all referred comdat functions will be 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)) if (!flag_ltrans && (!DECL_COMDAT (decl) || !cgraph_function_flags_ready))
return true; return true;
/* If we already output the function body, we are safe. */ /* If we already output the function body, we are safe. */
......
...@@ -491,7 +491,6 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, ...@@ -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.finalized, 1);
bp_pack_value (&bp, node->local.can_change_signature, 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.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->needed, 1);
bp_pack_value (&bp, node->address_taken, 1); bp_pack_value (&bp, node->address_taken, 1);
bp_pack_value (&bp, node->abstract_and_needed, 1); bp_pack_value (&bp, node->abstract_and_needed, 1);
...@@ -927,7 +926,6 @@ input_overwrite_node (struct lto_file_decl_data *file_data, ...@@ -927,7 +926,6 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
node->local.finalized = bp_unpack_value (bp, 1); node->local.finalized = bp_unpack_value (bp, 1);
node->local.can_change_signature = 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.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->needed = bp_unpack_value (bp, 1);
node->address_taken = bp_unpack_value (bp, 1); node->address_taken = bp_unpack_value (bp, 1);
node->abstract_and_needed = bp_unpack_value (bp, 1); node->abstract_and_needed = bp_unpack_value (bp, 1);
......
...@@ -2201,8 +2201,7 @@ mark_decl_referenced (tree decl) ...@@ -2201,8 +2201,7 @@ mark_decl_referenced (tree decl)
definition. */ definition. */
struct cgraph_node *node = cgraph_get_create_node (decl); struct cgraph_node *node = cgraph_get_create_node (decl);
if (!DECL_EXTERNAL (decl) if (!DECL_EXTERNAL (decl)
&& (!node->local.vtable_method || !cgraph_global_info_ready && !node->local.finalized)
|| !node->local.finalized))
cgraph_mark_needed_node (node); cgraph_mark_needed_node (node);
} }
else if (TREE_CODE (decl) == VAR_DECL) else if (TREE_CODE (decl) == VAR_DECL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment