aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-utils.c')
-rw-r--r--gcc/ipa-utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index 0ea02ea..e2e1690 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -791,3 +791,14 @@ ipa_merge_profiles (struct cgraph_node *dst,
src->symbol.decl = oldsrcdecl;
}
+/* Return true if call to DEST is known to be self-recusive call withing FUNC. */
+
+bool
+recursive_call_p (tree func, tree dest)
+{
+ struct cgraph_node *dest_node = cgraph_get_create_node (dest);
+ struct cgraph_node *cnode = cgraph_get_create_node (func);
+
+ return symtab_semantically_equivalent_p ((symtab_node)dest_node,
+ (symtab_node)cnode);
+}