aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-10-15 03:20:55 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-10-15 01:20:55 +0000
commit97ba0040a84c942562074621f4b550774e0c38e7 (patch)
tree02fe16310bd09fdf1d3c23fde7236a1aa760fb1b /gcc/cgraph.c
parent23ac8b8d6aac34d9c9014c95a70b09e0e43e039e (diff)
downloadgcc-97ba0040a84c942562074621f4b550774e0c38e7.zip
gcc-97ba0040a84c942562074621f4b550774e0c38e7.tar.gz
gcc-97ba0040a84c942562074621f4b550774e0c38e7.tar.bz2
re PR rtl-optimization/45621 (ICE: verify_cgraph_node failed: inlined_to pointer is set but no predecessors found with -fipa-cp-clone -flto)
PR middle-end/45621 * g++.dg/lto/pr45621.h : New. * g++.dg/lto/pr45621_0.C: New. * g++.dg/lto/pr45621_1.C: New. * cgraph.c (cgraph_update_edges_for_call_stmt_node): When new call is redirected to clone, be happy. * cgraph.h (cgraph node): Enable former_clone_of unconditinally. * cgraphunit.c (verify_cgraph_node, cgraph_materialize_clone): Handle former_clone_of unconditinally. From-SVN: r165492
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 7293b6d..465e9af 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1241,9 +1241,18 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
{
/* See if the edge is already there and has the correct callee. It
might be so because of indirect inlining has already updated
- it. */
- if (new_call && e->callee && e->callee->decl == new_call)
- return;
+ it. We also might've cloned and redirected the edge. */
+ if (new_call && e->callee)
+ {
+ struct cgraph_node *callee = e->callee;
+ while (callee)
+ {
+ if (callee->decl == new_call
+ || callee->former_clone_of == new_call)
+ return;
+ callee = callee->clone_of;
+ }
+ }
/* Otherwise remove edge and create new one; we can't simply redirect
since function has changed, so inline plan and other information