aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-09-06 12:13:37 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-09-06 10:13:37 +0000
commitfc11f321bbffb92287ee4f25aa70eab40f66a163 (patch)
treee167b438c335f3bc2a8367366839e99f406f78e4 /gcc/ipa-utils.c
parent9a6af4504b8bc9b03020b1e96a3bad56d9929916 (diff)
downloadgcc-fc11f321bbffb92287ee4f25aa70eab40f66a163.zip
gcc-fc11f321bbffb92287ee4f25aa70eab40f66a163.tar.gz
gcc-fc11f321bbffb92287ee4f25aa70eab40f66a163.tar.bz2
re PR middle-end/58094 (IPA devirt testsuite errors)
PR middle-end/58094 * cgraph.h (symtab_semantically_equivalent_p): Declare. * tree-tailcall.c: Include ipa-utils.h. (find_tail_calls): Use it. * ipa-pure-const.c (check_call): Likewise. * ipa-utils.c (recursive_call_p): New function. * ipa-utils.h (recursive_call_p): Dclare. * symtab.c (symtab_nonoverwritable_alias): Fix formatting. (symtab_semantically_equivalent_p): New function. * Makefile.in (tree-tailcall.o): Update dependencies. From-SVN: r202316
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);
+}