re PR c/87028 (false positive -Wstringop-truncation strncpy with global variable...
authorJeff Law <law@gcc.gnu.org>
Wed, 5 Dec 2018 23:10:08 +0000 (16:10 -0700)
committerJeff Law <law@gcc.gnu.org>
Wed, 5 Dec 2018 23:10:08 +0000 (16:10 -0700)
commit665db3aeb48f0f0970bb0e01f37f9fd9fb013ea4
tree2c210ca46a2a9c1f9f7c1d5eb1b25887d17f511f
parentc43137e800bb9ca2ecda0a6b6189e0eb5c22f0d7
re PR c/87028 (false positive -Wstringop-truncation strncpy with global variable source string)

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.

From-SVN: r266833
gcc/ChangeLog
gcc/calls.c
gcc/gimple-low.c
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wstringop-truncation.c
gcc/testsuite/gcc.dg/Wstringop-truncation-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/fold-bcopy.c
gcc/testsuite/gcc.dg/strcmpopt_1.c
gcc/testsuite/gcc.dg/tree-ssa/pr79697.c