tree-ssa-forwprop.c (simplify_builtin_call): Don't create a not NUL terminated string...
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 30 Jul 2018 13:26:25 +0000 (13:26 +0000)
committerBernd Edlinger <edlinger@gcc.gnu.org>
Mon, 30 Jul 2018 13:26:25 +0000 (13:26 +0000)
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

gcc/ChangeLog
gcc/tree-ssa-forwprop.c

index 6a3a05b8ac034010668dee8699504a0ccfce3db5..20781df77c77684f5c4d87fdb63b7de6acb6b1d1 100644 (file)
@@ -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
index 2efb5acae8fd5f0b6c69992b69b05c619754798e..56078110b39970d5baf46fa10c3d103e98cbc0df 100644 (file)
@@ -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