Hi, When thunk is cloned, its callee is temporarily set to original thunks's target which is later also cloned. Thus we should be more careful when clonning node's thunks. Bootstrapped and tested on x86_64-unknown-linux-gnu. Applied to trunk.
Thanks, Ilya -- 2015-03-19 Ilya Enkovich <ilya.enkov...@intel.com> * ipa-chkp.c (chkp_maybe_create_clone): Don't try to clone instrumented thunks. diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index 3bea06a..a9933e2 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -592,7 +592,8 @@ chkp_maybe_create_clone (tree fndecl) /* Clone all thunks. */ for (e = node->callers; e; e = e->next_caller) if (e->caller->thunk.thunk_p - && !e->caller->thunk.add_pointer_bounds_args) + && !e->caller->thunk.add_pointer_bounds_args + && !e->caller->instrumentation_clone) { struct cgraph_node *thunk = chkp_maybe_create_clone (e->caller->decl);