aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-04-18 20:19:43 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2012-04-18 18:19:43 +0000
commit474ffc723e5888c328b33f3cefe972fbeda4548c (patch)
treede940ffb13e3d6461c2a64bbad989c58632316f5 /gcc/ipa.c
parentfade902a4b4e5af0441f0059116df27241c18574 (diff)
downloadgcc-474ffc723e5888c328b33f3cefe972fbeda4548c.zip
gcc-474ffc723e5888c328b33f3cefe972fbeda4548c.tar.gz
gcc-474ffc723e5888c328b33f3cefe972fbeda4548c.tar.bz2
cgraph.h (verify_symtab, [...]): Declare.
* cgraph.h (verify_symtab, verify_symtab_node, verify_symtab_base): Declare. * cgraphunit.c (verify_cgraph_node): Verify symtab base; do not verify cgraph hash and same comdat groups. (cgraph_optimize); Verify symbol table. * ipa.c (cgraph_remove_unreachable_nodes): Verify symbol table. (dissolve_same_comdat_group_list): Work on symtab nodes. (function_and_variable_visibility): Dissolve variable same comdat group lists, too. * symtab.c: Include timevar.h (verify_symtab_base, verify_symtab_node, verify_symtab): New functions. From-SVN: r186578
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 8741562..964b2b9 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -176,7 +176,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
bool changed = false;
#ifdef ENABLE_CHECKING
- verify_cgraph ();
+ verify_symtab ();
#endif
if (file)
fprintf (file, "\nReclaiming functions:");
@@ -467,7 +467,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
return changed;
#ifdef ENABLE_CHECKING
- verify_cgraph ();
+ verify_symtab ();
#endif
/* Reclaim alias pairs for functions that have disappeared from the
@@ -730,12 +730,12 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
/* Dissolve the same_comdat_group list in which NODE resides. */
static void
-dissolve_same_comdat_group_list (struct cgraph_node *node)
+dissolve_same_comdat_group_list (symtab_node node)
{
- struct cgraph_node *n = node, *next;
+ symtab_node n = node, next;
do
{
- next = cgraph (n->symbol.same_comdat_group);
+ next = n->symbol.same_comdat_group;
n->symbol.same_comdat_group = NULL;
n = next;
}
@@ -838,7 +838,7 @@ function_and_variable_visibility (bool whole_program)
all of them have to be, otherwise it is a front-end bug. */
gcc_assert (DECL_EXTERNAL (n->symbol.decl));
#endif
- dissolve_same_comdat_group_list (node);
+ dissolve_same_comdat_group_list ((symtab_node) node);
}
gcc_assert ((!DECL_WEAK (node->symbol.decl)
&& !DECL_COMDAT (node->symbol.decl))
@@ -865,7 +865,7 @@ function_and_variable_visibility (bool whole_program)
in the group and they will all be made local. We need to
dissolve the group at once so that the predicate does not
segfault though. */
- dissolve_same_comdat_group_list (node);
+ dissolve_same_comdat_group_list ((symtab_node) node);
}
if (node->thunk.thunk_p
@@ -936,6 +936,8 @@ function_and_variable_visibility (bool whole_program)
{
gcc_assert (in_lto_p || whole_program || !TREE_PUBLIC (vnode->symbol.decl));
cgraph_make_decl_local (vnode->symbol.decl);
+ if (vnode->symbol.same_comdat_group)
+ dissolve_same_comdat_group_list ((symtab_node) vnode);
vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
}
gcc_assert (TREE_STATIC (vnode->symbol.decl));