aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-strlen.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2018-03-12 18:04:16 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2018-03-12 12:04:16 -0600
commite9b9fa4cdaedd40ab429c0c98e8801ae039a33e9 (patch)
tree3fbe1a5f54834ad2c8f3f4f8d5572933ad7b9ae0 /gcc/tree-ssa-strlen.c
parentdf4cfec5540bfb982bfec374346493bed6608fa4 (diff)
downloadgcc-e9b9fa4cdaedd40ab429c0c98e8801ae039a33e9.zip
gcc-e9b9fa4cdaedd40ab429c0c98e8801ae039a33e9.tar.gz
gcc-e9b9fa4cdaedd40ab429c0c98e8801ae039a33e9.tar.bz2
PR tree-optimization/83456 - -Wrestrict false positive on a non-overlapping memcpy in an inline function
gcc/ChangeLog: PR tree-optimization/83456 * gimple-fold.c (gimple_fold_builtin_memory_op): Avoid warning for perfectly overlapping calls to memcpy. (gimple_fold_builtin_memory_chk): Same. (gimple_fold_builtin_strcpy): Handle no-warning. (gimple_fold_builtin_stxcpy_chk): Same. * tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Handle no-warning. gcc/c-family/ChangeLog: PR tree-optimization/83456 * gcc/c-family/c-common.c (check_function_restrict): Return bool. Restore checking of bounded built-in functions. (check_function_arguments): Also return the result of warn_for_restrict. * gcc/c-family/c-common.c (check_function_restrict): Return bool. * gcc/c-family/c-warn.c (warn_for_restrict): Return bool. gcc/testsuite/ChangeLog: PR tree-optimization/83456 * c-c++-common/Wrestrict-2.c: Remove test cases. * c-c++-common/Wrestrict.c: Same. * gcc.dg/Wrestrict-12.c: New test. * gcc.dg/Wrestrict-14.c: New test. From-SVN: r258455
Diffstat (limited to 'gcc/tree-ssa-strlen.c')
-rw-r--r--gcc/tree-ssa-strlen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 72f6a17..33004b6 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -1801,6 +1801,8 @@ bool
maybe_diag_stxncpy_trunc (gimple_stmt_iterator gsi, tree src, tree cnt)
{
gimple *stmt = gsi_stmt (gsi);
+ if (gimple_no_warning_p (stmt))
+ return false;
wide_int cntrange[2];