diff options
author | Jeff Law <law@gcc.gnu.org> | 2018-12-05 16:10:08 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2018-12-05 16:10:08 -0700 |
commit | 665db3aeb48f0f0970bb0e01f37f9fd9fb013ea4 (patch) | |
tree | 2c210ca46a2a9c1f9f7c1d5eb1b25887d17f511f /gcc/gimplify.c | |
parent | c43137e800bb9ca2ecda0a6b6189e0eb5c22f0d7 (diff) | |
download | gcc-665db3aeb48f0f0970bb0e01f37f9fd9fb013ea4.zip gcc-665db3aeb48f0f0970bb0e01f37f9fd9fb013ea4.tar.gz gcc-665db3aeb48f0f0970bb0e01f37f9fd9fb013ea4.tar.bz2 |
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
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 40fbaa2..d96ee43 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -3192,6 +3192,10 @@ maybe_fold_stmt (gimple_stmt_iterator *gsi) return false; else if ((ctx->region_type & ORT_HOST_TEAMS) == ORT_HOST_TEAMS) return false; + /* Delay folding of builtins until the IL is in consistent state + so the diagnostic machinery can do a better job. */ + if (gimple_call_builtin_p (gsi_stmt (*gsi))) + return false; return fold_stmt (gsi); } |