diff options
author | Evgeny Kudryashov <kudryashov@ispras.ru> | 2017-09-21 12:54:38 +0000 |
---|---|---|
committer | Alexander Monakov <amonakov@gcc.gnu.org> | 2017-09-21 15:54:38 +0300 |
commit | 9acb459230318eb2f786dc0b974812884a2f3d54 (patch) | |
tree | ab2d39c2d809a1092c2c032f921a8d8bfd916544 /gcc | |
parent | 765b3379354e3018b5440693625f8aace232f44a (diff) | |
download | gcc-9acb459230318eb2f786dc0b974812884a2f3d54.zip gcc-9acb459230318eb2f786dc0b974812884a2f3d54.tar.gz gcc-9acb459230318eb2f786dc0b974812884a2f3d54.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cgraph.c | 31 | ||||
-rw-r--r-- | gcc/cgraph.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 |
4 files changed, 27 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c743c21..90dc208 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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 diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 8bffdec..3d0cefb 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -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. */ diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 7daca1e..1758e8b 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 858747e..50fa1ba 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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) |