summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2011-01-07 23:52:54 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2011-01-07 22:52:54 +0000
commit17afc0fe9c02a8fa207c2d0d8519fb5f5c339929 (patch)
tree62e093f14bafa3b6cc4c1294ee2d8b83b6769208 /gcc/ipa-inline.c
parentc12e816f5979685f9ef96e665cc1f752a3e54df9 (diff)
downloadgcc-17afc0fe9c02a8fa207c2d0d8519fb5f5c339929.tar.gz
re PR tree-optimization/46367 (ICE during cgraph edge cloning)
PR tree-optimization/46367 * g++.dg/torture/pr46367.C: New file. * ipa-inline.c (cgraph_clone_inlined_nodes): Use original function only when we can update original. (cgraph_mark_inline_edge): Sanity check. * ipa-prop.c (ipa_make_edge_direct_to_target): Sanity check. From-SVN: r168587
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 7ac50dd31bb..116abd6619a 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -232,6 +232,8 @@ cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
/* We may eliminate the need for out-of-line copy to be output.
In that case just go ahead and re-use it. */
if (!e->callee->callers->next_caller
+ /* Recursive inlining never wants the master clone to be overwritten. */
+ && update_original
/* FIXME: When address is taken of DECL_EXTERNAL function we still can remove its
offline copy, but we would need to keep unanalyzed node in the callgraph so
references can point to it. */
@@ -303,7 +305,11 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
struct cgraph_edge *curr = e;
int freq;
+ /* Don't inline inlined edges. */
gcc_assert (e->inline_failed);
+ /* Don't even think of inlining inline clone. */
+ gcc_assert (!e->callee->global.inlined_to);
+
e->inline_failed = CIF_OK;
DECL_POSSIBLY_INLINED (e->callee->decl) = true;
@@ -863,7 +869,6 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node,
master_clone = cgraph_clone_node (node, node->decl,
node->count, CGRAPH_FREQ_BASE, 1,
false, NULL);
- master_clone->needed = true;
for (e = master_clone->callees; e; e = e->next_callee)
if (!e->inline_failed)
cgraph_clone_inlined_nodes (e, true, false);