summaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-23 08:56:02 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-23 08:56:02 +0000
commit8222ea4b6d0d19cd5cc860f24a02896577ff41cc (patch)
tree70f21e8dae3bc404f841f5e72c4f9b383cbea207 /gcc/ipa-inline-transform.c
parent5dec75684b8a6935aa1f7c18284342102bbe85f2 (diff)
downloadgcc-8222ea4b6d0d19cd5cc860f24a02896577ff41cc.tar.gz
2012-03-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 185727 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@185729 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 75b8e9daf11..32d8c167be1 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -336,8 +336,19 @@ save_inline_function_body (struct cgraph_node *node)
first_clone->ipa_transforms_to_apply);
first_clone->ipa_transforms_to_apply = NULL;
+ /* When doing recursive inlining, the clone may become unnecessary.
+ This is possible i.e. in the case when the recursive function is proved to be
+ non-throwing and the recursion happens only in the EH landing pad.
+ We can not remove the clone until we are done with saving the body.
+ Remove it now. */
+ if (!first_clone->callers)
+ {
+ cgraph_remove_node_and_inline_clones (first_clone, NULL);
+ first_clone = NULL;
+ }
#ifdef ENABLE_CHECKING
- verify_cgraph_node (first_clone);
+ else
+ verify_cgraph_node (first_clone);
#endif
return first_clone;
}