Commit 9acb4592 by Evgeny Kudryashov Committed by Alexander Monakov

ipa: fix dumping with deleted multiversioning nodes

2017-09-21  Evgeny Kudryashov <kudryashov@ispras.ru>

	* cgraph.c (delete_function_version): New, broken out from...
	(cgraph_node::delete_function_version): ...here.  Rename to
	cgraph_node::delete_function_version_by_decl.  Update all uses.
	(cgraph_node::remove): Call delete_function_version.

From-SVN: r253066
parent 765b3379
2017-09-21 Evgeny Kudryashov <kudryashov@ispras.ru>
* cgraph.c (delete_function_version): New, broken out from...
(cgraph_node::delete_function_version): ...here. Rename to
cgraph_node::delete_function_version_by_decl. Update all uses.
(cgraph_node::remove): Call delete_function_version.
2017-09-21 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81715
......@@ -190,30 +190,34 @@ cgraph_node::insert_new_function_version (void)
return version_info_node;
}
/* Remove the cgraph_function_version_info and cgraph_node for DECL. This
DECL is a duplicate declaration. */
void
cgraph_node::delete_function_version (tree decl)
/* Remove the cgraph_function_version_info node given by DECL_V. */
static void
delete_function_version (cgraph_function_version_info *decl_v)
{
cgraph_node *decl_node = cgraph_node::get (decl);
cgraph_function_version_info *decl_v = NULL;
if (decl_node == NULL)
return;
decl_v = decl_node->function_version ();
if (decl_v == NULL)
return;
if (decl_v->prev != NULL)
decl_v->prev->next = decl_v->next;
decl_v->prev->next = decl_v->next;
if (decl_v->next != NULL)
decl_v->next->prev = decl_v->prev;
if (cgraph_fnver_htab != NULL)
cgraph_fnver_htab->remove_elt (decl_v);
}
/* Remove the cgraph_function_version_info and cgraph_node for DECL. This
DECL is a duplicate declaration. */
void
cgraph_node::delete_function_version_by_decl (tree decl)
{
cgraph_node *decl_node = cgraph_node::get (decl);
if (decl_node == NULL)
return;
delete_function_version (decl_node->function_version ());
decl_node->remove ();
}
......@@ -1844,6 +1848,7 @@ cgraph_node::remove (void)
remove_callers ();
remove_callees ();
ipa_transforms_to_apply.release ();
delete_function_version (function_version ());
/* Incremental inlining access removed nodes stored in the postorder list.
*/
......
......@@ -1272,7 +1272,7 @@ public:
/* Remove the cgraph_function_version_info and cgraph_node for DECL. This
DECL is a duplicate declaration. */
static void delete_function_version (tree decl);
static void delete_function_version_by_decl (tree decl);
/* Add the function FNDECL to the call graph.
Unlike finalize_function, this function is intended to be used
......
......@@ -2566,7 +2566,7 @@ next_arg:;
DECL_FUNCTION_VERSIONED (newdecl) = 1;
/* newdecl will be purged after copying to olddecl and is no longer
a version. */
cgraph_node::delete_function_version (newdecl);
cgraph_node::delete_function_version_by_decl (newdecl);
}
if (TREE_CODE (newdecl) == FUNCTION_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