From: Bernd Edlinger Date: Mon, 30 Jul 2018 13:26:25 +0000 (+0000) Subject: tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cff431d2d905e25197cf3c471c5131736381ef1d;p=gcc.git tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal. 2018-07-30 Bernd Edlinger * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string literal. From-SVN: r263068 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a3a05b8ac0..20781df77c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-07-30 Bernd Edlinger + + * tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL + terminated string literal. + 2018-07-30 Segher Boessenkool PR rtl-optimization/85160 diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 2efb5acae8f..56078110b39 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