From a70f3820a01ab530ecaf8d8d9ad535d1586acd3a Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 14 Sep 2018 19:56:32 +0000 Subject: [PATCH] 2018-09-14 Bernd Edlinger msebor@redhat.com> revert: 2018-07-30 Bernd Edlinger * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal. From-SVN: r264332 --- gcc/ChangeLog | 8 ++++++++ gcc/tree-ssa-forwprop.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b9229e9..08843ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-09-14 Bernd Edlinger msebor@redhat.com> + + revert: + 2018-07-30 Bernd Edlinger + + * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL + terminated string literal. + 2018-09-14 Martin Sebor * builtins.c (unterminated_array): Handle ARRAY_REF. diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 6713398..b1ee598 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 + 1, src_buf); + new_str_cst = build_string_literal (src_len, src_buf); if (callee1) { /* If STMT1 is a mem{,p}cpy call, adjust it and remove -- 2.7.4