This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/87028] false positive -Wstringop-truncation strncpy with global variable source string
- From: "law at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 05 Dec 2018 23:10:40 +0000
- Subject: [Bug c/87028] false positive -Wstringop-truncation strncpy with global variable source string
- Auto-submitted: auto-generated
- References: <bug-87028-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87028
--- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Wed Dec 5 23:10:08 2018
New Revision: 266833
URL: https://gcc.gnu.org/viewcvs?rev=266833&root=gcc&view=rev
Log:
PR c/87028
* calls.c (get_attr_nonstring_decl): Avoid setting *REF to
SSA_NAME_VAR.
* gcc/gimple-low.c (lower_stmt): Fold builtin calls here.
* gimplify (maybe_fold_stmt): Avoid folding builtin calls.
PR c/87028
* c-c++-common/Wstringop-truncation.c: Remove xfails.
* gcc.dg/Wstringop-truncation-5.c: New test.
* gcc.dg/strcmpopt_1.c: Adjust.
* gcc.dg/tree-ssa/pr79697.c: Same.
Added:
trunk/gcc/testsuite/gcc.dg/Wstringop-truncation-5.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/calls.c
trunk/gcc/gimple-low.c
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/c-c++-common/Wstringop-truncation.c
trunk/gcc/testsuite/gcc.dg/fold-bcopy.c
trunk/gcc/testsuite/gcc.dg/strcmpopt_1.c
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr79697.c