aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorIlya Enkovich <ilya.enkovich@intel.com>2015-04-08 10:44:59 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-04-08 10:44:59 +0000
commit4f5a53cc319d8b88eaff3ee07ac0a89e5782d850 (patch)
tree3b12f9e0a29bd3d514d93f2c8bdb05d2c21c7962 /gcc/cgraphunit.c
parent113c69ff2d41091359ec37789974cc47f1169e05 (diff)
downloadgcc-4f5a53cc319d8b88eaff3ee07ac0a89e5782d850.zip
gcc-4f5a53cc319d8b88eaff3ee07ac0a89e5782d850.tar.gz
gcc-4f5a53cc319d8b88eaff3ee07ac0a89e5782d850.tar.bz2
tree-chkp.h (chkp_insert_retbnd_call): New.
gcc/ * tree-chkp.h (chkp_insert_retbnd_call): New. * tree-chkp.c (chkp_insert_retbnd_call): New. * ipa-split.c (insert_bndret_call_after): Remove. (split_function): Use chkp_insert_retbnd_call. * cgraphunit.c (cgraph_node::expand_thunk): Build returned bounds for instrumented functions. gcc/testsuite/ * gcc/testsuite/gcc.target/i386/thunk-retbnd.c: New. From-SVN: r221917
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);
}