summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-08 17:17:52 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-08 17:17:52 +0000
commitb437daf41754afff274e689c4eddeb291a0e679e (patch)
tree7dfa5d5d22a7a192d98aea40e41add3c292cc255 /gcc/tree-inline.c
parent7302546d02e4127d26720b6cf8c1ccf5a4216971 (diff)
downloadgcc-b437daf41754afff274e689c4eddeb291a0e679e.tar.gz
PR middle-end/40102
* cgraph.c (cgraph_create_edge_including_clones): Also asume that the original node might've been modified. * tree-inline.c (copy_bb): Do not assume that all clones are the same. PR middle-end/40102 * g++.dg/torture/pr40102.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index f79424d9756..18c2c0307de 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1508,11 +1508,14 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
gcc_unreachable ();
}
+ edge = cgraph_edge (id->src_node, orig_stmt);
/* Constant propagation on argument done during inlining
may create new direct call. Produce an edge for it. */
- if (!edge && is_gimple_call (stmt)
- && (fn = gimple_call_fndecl (stmt)) != NULL
- && !cgraph_edge (id->dst_node, stmt))
+ if ((!edge
+ || (edge->indirect_call
+ && id->transform_call_graph_edges == CB_CGE_MOVE_CLONES))
+ && is_gimple_call (stmt)
+ && (fn = gimple_call_fndecl (stmt)) != NULL)
{
struct cgraph_node *dest = cgraph_node (fn);