diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2015-01-27 09:09:28 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-01-27 09:09:28 +0000 |
commit | 3dd598be88193ee087ab51312b5e464b2d6e2891 (patch) | |
tree | a2bf30768dbb9420eeae351f01e4395ac6b1b049 /gcc/tree-chkp.c | |
parent | b30ea1387f8e26ad60bd4d71ba2006ea7e11a6ee (diff) | |
download | gcc-3dd598be88193ee087ab51312b5e464b2d6e2891.zip gcc-3dd598be88193ee087ab51312b5e464b2d6e2891.tar.gz gcc-3dd598be88193ee087ab51312b5e464b2d6e2891.tar.bz2 |
tree-chkp.c (chkp_call_returns_bounds_p): Fix handling of bounds narrowing...
gcc/
* tree-chkp.c (chkp_call_returns_bounds_p): Fix handling of
bounds narrowing, already instrumented calls and calls to
not instrumentable functions.
gcc/testsuite/
* gcc.target/i386/chkp-narrow-bounds.c: New.
From-SVN: r220154
Diffstat (limited to 'gcc/tree-chkp.c')
-rw-r--r-- | gcc/tree-chkp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index e7649ef..b0a3a15 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -2113,13 +2113,19 @@ chkp_call_returns_bounds_p (gcall *call) if (gimple_call_internal_p (call)) return false; + if (gimple_call_builtin_p (call, BUILT_IN_CHKP_NARROW_PTR_BOUNDS) + || chkp_gimple_call_builtin_p (call, BUILT_IN_CHKP_NARROW)) + return true; + + if (gimple_call_with_bounds_p (call)) + return true; + tree fndecl = gimple_call_fndecl (call); if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) return false; - if (fndecl - && lookup_attribute ("bnd_legacy", DECL_ATTRIBUTES (fndecl))) + if (fndecl && !chkp_instrumentable_p (fndecl)) return false; if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL) |