diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-06 10:13:37 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-06 10:13:37 +0000 |
commit | e9de52cc3cd2a99d4962779add31ebc9243a98ad (patch) | |
tree | e167b438c335f3bc2a8367366839e99f406f78e4 /gcc/ipa-utils.c | |
parent | ea03e543c51716b7e3e868ca8c54f308cdf59fd5 (diff) | |
download | gcc-e9de52cc3cd2a99d4962779add31ebc9243a98ad.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202316 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-utils.c')
-rw-r--r-- | gcc/ipa-utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c index 0ea02eab8cc..e2e169043bc 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); +} |