aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 77ef9ed..2315ba8 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1585,6 +1585,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
int i;
tree resdecl;
tree restmp = NULL;
+ tree resbnd = NULL;
gcall *call;
greturn *ret;
@@ -1701,6 +1702,17 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
gsi_insert_after (&bsi, call, GSI_NEW_STMT);
if (!alias_is_noreturn)
{
+ if (instrumentation_clone
+ && !DECL_BY_REFERENCE (resdecl)
+ && restmp
+ && BOUNDED_P (restmp))
+ {
+ resbnd = chkp_insert_retbnd_call (NULL, restmp, &bsi);
+ create_edge (get_create (gimple_call_fndecl (gsi_stmt (bsi))),
+ as_a <gcall *> (gsi_stmt (bsi)),
+ callees->count, callees->frequency);
+ }
+
if (restmp && !this_adjusting
&& (fixed_offset || virtual_offset))
{
@@ -1770,6 +1782,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
ret = gimple_build_return (restmp);
else
ret = gimple_build_return (resdecl);
+ gimple_return_set_retbnd (ret, resbnd);
gsi_insert_after (&bsi, ret, GSI_NEW_STMT);
}