aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-07-30 13:26:25 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2018-07-30 13:26:25 +0000
commitcff431d2d905e25197cf3c471c5131736381ef1d (patch)
treeb54ad00a4ba02714d998fd3dbd47bf084f280b50 /gcc
parentc4c5ad1d6d1e1e1fe7a1c2b3bb097cc269dc7306 (diff)
downloadgcc-cff431d2d905e25197cf3c471c5131736381ef1d.zip
gcc-cff431d2d905e25197cf3c471c5131736381ef1d.tar.gz
gcc-cff431d2d905e25197cf3c471c5131736381ef1d.tar.bz2
tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal.
2018-07-30 Bernd Edlinger <bernd.edlinger@hotmail.de> * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal. From-SVN: r263068
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-forwprop.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6a3a05b..20781df 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-30 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL
+ terminated string literal.
+
2018-07-30 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/85160
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 2efb5ac..5607811 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1391,7 +1391,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
src_buf, ptr1_align, false))
break;
- new_str_cst = build_string_literal (src_len, src_buf);
+ new_str_cst = build_string_literal (src_len + 1, src_buf);
if (callee1)
{
/* If STMT1 is a mem{,p}cpy call, adjust it and remove