This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Reverted patch for PR 39010
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org, hongjiu dot lu at intel dot com
- Date: Sat, 31 Jan 2009 13:58:52 -0500
- Subject: [lto] Reverted patch for PR 39010
HJ,
I had to revert the patch you committed for PR 39010. It had
caused 478 regressions on x86_64 and 625 on i686. Presumably,
there are other places where we are off by one.
Diego.
Revert
2009-01-30 H.J. Lu <hongjiu.lu@intel.com>
PR lto/39010
* lto-function-out.c (output_string): Properly handle the
trailing '\0'.
(output_tree_flags): Updated.
Index: lto-function-out.c
===================================================================
--- lto-function-out.c (revision 143817)
+++ lto-function-out.c (working copy)
@@ -280,9 +280,9 @@ output_string (struct output_block *ob,
struct string_slot *new_slot
= (struct string_slot *) xmalloc (sizeof (struct string_slot));
unsigned int i;
- char *new_string = (char *) xmalloc (len + 1);
+ char *new_string = (char *) xmalloc (len);
- memcpy (new_string, string, len + 1);
+ memcpy (new_string, string, len);
new_slot->s = new_string;
new_slot->len = len;
new_slot->slot_num = start;
@@ -530,7 +530,7 @@ output_tree_flags (struct output_block *
{
LTO_DEBUG_TOKEN ("file");
output_string (ob, ob->main_stream,
- file_to_write, strlen (file_to_write));
+ file_to_write, strlen (file_to_write) + 1);
}
if (line_to_write != -1)
{