aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2014-03-21 13:59:35 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2014-03-21 13:59:35 +0100
commit3d8d00439b8507ebb9c89949d44133bbdcde333f (patch)
tree9a7d70708594301be7def95ae86b5e51f4577ef8 /gcc/cgraph.c
parentd833415cdac558ab5da28048154d119856b62ad6 (diff)
downloadgcc-3d8d00439b8507ebb9c89949d44133bbdcde333f.zip
gcc-3d8d00439b8507ebb9c89949d44133bbdcde333f.tar.gz
gcc-3d8d00439b8507ebb9c89949d44133bbdcde333f.tar.bz2
re PR ipa/59176 (ICE edge points to wrong declaration / verify_cgraph_node failed)
2014-03-21 Martin Jambor <mjambor@suse.cz> PR ipa/59176 * cgraph.h (symtab_node): New flag body_removed. * ipa.c (symtab_remove_unreachable_nodes): Set body_removed flag when removing bodies. * symtab.c (dump_symtab_base): Dump body_removed flag. * cgraph.c (verify_edge_corresponds_to_fndecl): Skip nodes which had their bodies removed. testsuite/ * g++.dg/torture/pr59176.C: New test. From-SVN: r208748
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 577352f..abfd63c 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2604,8 +2604,13 @@ verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl)
node = cgraph_get_node (decl);
/* We do not know if a node from a different partition is an alias or what it
- aliases and therefore cannot do the former_clone_of check reliably. */
- if (!node || node->in_other_partition || e->callee->in_other_partition)
+ aliases and therefore cannot do the former_clone_of check reliably. When
+ body_removed is set, we have lost all information about what was alias or
+ thunk of and also cannot proceed. */
+ if (!node
+ || node->body_removed
+ || node->in_other_partition
+ || e->callee->in_other_partition)
return false;
node = cgraph_function_or_thunk_node (node, NULL);