diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-16 07:25:58 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-16 07:25:58 +0000 |
commit | cdf67cee599f86ece205d09a35ac8bcf9a9aad9c (patch) | |
tree | a72eeb1420381f51d00eb4b4f3f3e8f019444c21 /gcc/cgraphunit.c | |
parent | 82c0fd87ab0d6a22cc6fc6f7c968d4c479c82e24 (diff) | |
download | gcc-cdf67cee599f86ece205d09a35ac8bcf9a9aad9c.tar.gz |
PR middle-end/51929
* cgraphunit.c (verify_edge_corresponds_to_fndecl): If node is
a same_body_alias, also test whether e->callee isn't a former
or current clone of the decl this is a same body alias of.
* g++.dg/ipa/pr51929.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184301 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 99b82b2665a..516f187fedd 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -471,11 +471,17 @@ verify_edge_corresponds_to_fndecl (struct cgraph_edge *e, tree decl) return false; node = cgraph_function_or_thunk_node (node, NULL); - if ((e->callee->former_clone_of != node->decl) + if ((e->callee->former_clone_of != node->decl + && (!node->same_body_alias + || e->callee->former_clone_of != node->thunk.alias)) /* IPA-CP sometimes redirect edge to clone and then back to the former - function. This ping-pong has to go, eventaully. */ + function. This ping-pong has to go, eventually. */ && (node != cgraph_function_or_thunk_node (e->callee, NULL)) - && !clone_of_p (node, e->callee)) + && !clone_of_p (node, e->callee) + /* If decl is a same body alias of some other decl, allow e->callee to be + a clone of a clone of that other decl too. */ + && (!node->same_body_alias + || !clone_of_p (cgraph_get_node (node->thunk.alias), e->callee))) return true; else return false; |