summaryrefslogtreecommitdiff
path: root/gcc/tree-stdarg.c
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2015-12-10 16:01:42 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-12-10 16:01:42 +0000
commit64a948e9c2c34aea10e5a995f9e67bb6325ca7e8 (patch)
tree933bb83d196ac3eeaa156a457f6a2b08e24ee50a /gcc/tree-stdarg.c
parentda8006f341fc2a30d32fe7a1d9d540617ff5f8b6 (diff)
tree-chkp.c (chkp_call_returns_bounds_p): Return true for VA_ARG call.
gcc/ * tree-chkp.c (chkp_call_returns_bounds_p): Return true for VA_ARG call. (chkp_fixup_inlined_call): New. * tree-chkp.h (chkp_fixup_inlined_call): New. * tree-stdarg.c: Include tree-chkp.h. (expand_ifn_va_arg_1): Fixup bndret calls for removed VA_ARG calls. From-SVN: r231525
Diffstat (limited to 'gcc/tree-stdarg.c')
-rw-r--r--gcc/tree-stdarg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index f205ccbec9a..ea2ef1c4f1b 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-into-ssa.h"
#include "tree-cfg.h"
#include "tree-stdarg.h"
+#include "tree-chkp.h"
/* A simple pass that attempts to optimize stdarg functions on architectures
that need to save register arguments to stack on entry to stdarg functions.
@@ -1047,6 +1048,11 @@ expand_ifn_va_arg_1 (function *fun)
unsigned int nargs = gimple_call_num_args (stmt);
gcc_assert (useless_type_conversion_p (TREE_TYPE (lhs), type));
+ /* We replace call with a new expr. This may require
+ corresponding bndret call fixup. */
+ if (chkp_function_instrumented_p (fun->decl))
+ chkp_fixup_inlined_call (lhs, expr);
+
if (nargs == 3)
{
/* We've transported the size of with WITH_SIZE_EXPR here as