summaryrefslogtreecommitdiff
path: root/gcc/builtins.def
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-15 17:26:10 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-15 17:26:10 +0000
commit1063acdeacf6bcc188454e095ece2951872e8704 (patch)
treeb55d26e2a650daf51259ff6f927c4f13e216f931 /gcc/builtins.def
parent4f3bff831367fbc16103d0039801ac81b7926107 (diff)
downloadgcc-1063acdeacf6bcc188454e095ece2951872e8704.tar.gz
* builtins.def (BUILT_IN_STPNCPY_CHK): New definition.
* builtins.c (expand_builtin, fold_builtin_4, maybe_emit_chk_warning): Add BUILT_IN_STPNCPY_CHK case. * gimple-fold.c (gimple_fold_builtin): Likewise. * tree-object-size.c (pass_through_call): Likewise. * tree-ssa-alias.c (ref_maybe_used_by_call_p_1, call_may_clobber_ref_p_1): Likewise. * tree-ssa-structalias.c (find_func_aliases_for_builtin_call, find_func_clobbers): Likewise. * tree.h (fold_builtin_strncpy_chk): Rename to fold_builtin_stxncpy_chk * builtins.c (fold_builtin_strncpy_chk): Likewise. Rewrite stpncpy_chk calls to strncpy_chk calls if returned value is ignored. * gcc.c-torture/execute/builtins/chk.h (stpncpy, stpncpy_disallowed): New definitions. * gcc.c-torture/execute/builtins/lib/chk.c (stpncpy_disallowed): Likewise. (stpncpy, __stpncpy_chk): New functions. * gcc.c-torture/execute/builtins/stpncpy-chk-lib.c: New file. * gcc.c-torture/execute/builtins/stpncpy-chk.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182378 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.def')
-rw-r--r--gcc/builtins.def1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/builtins.def b/gcc/builtins.def
index 616fca73597..b5ddace8d93 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -760,6 +760,7 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CON
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
+DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY_CHK, "__stpncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)