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/gimple-low.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/gimple-low.c')
-rw-r--r-- | gcc/gimple-low.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index c3777a1..b00e14f 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-low.h" #include "predict.h" #include "gimple-predict.h" +#include "gimple-fold.h" /* The differences between High GIMPLE and Low GIMPLE are the following: @@ -378,6 +379,12 @@ lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data) gsi_next (gsi); return; } + + /* We delay folding of built calls from gimplification to + here so the IL is in consistent state for the diagnostic + machineries job. */ + if (gimple_call_builtin_p (stmt)) + fold_stmt (gsi); } break; |