This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR ipa/65432


Hello.

Following patch wraps symtab_node::{asm_}name with xstrdup_for_dump.

Ready for trunk?
Thanks,
Martin
>From 06d7667b7e2be23e21b3ea6599ebb2303074b310 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Wed, 18 Mar 2015 13:59:49 +0100
Subject: [PATCH] Fix PR ipa/65432

gcc/ChangeLog:

2015-03-18  Martin Liska  <mliska@suse.cz>

	PR ipa/65432
	* ipa-icf.c (sem_item_optimizer::read_section): Wrap symtab_node::name and
	symtab_node::asm_name with xstrdup_for_dump.
	* ipa-icf.h: Likewise.
---
 gcc/ipa-icf.c | 3 ++-
 gcc/ipa-icf.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 25b8306..476076d 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -1995,7 +1995,8 @@ sem_item_optimizer::read_section (lto_file_decl_data *file_data,
       gcc_assert (node->definition);
 
       if (dump_file)
-	fprintf (dump_file, "Symbol added:%s (tree: %p, uid:%u)\n", node->asm_name (),
+	fprintf (dump_file, "Symbol added:%s (tree: %p, uid:%u)\n",
+		 xstrdup_for_dump (node->asm_name ()),
 		 (void *) node->decl, node->order);
 
       if (is_a<cgraph_node *> (node))
diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h
index c51bb4a..6d03758 100644
--- a/gcc/ipa-icf.h
+++ b/gcc/ipa-icf.h
@@ -174,13 +174,13 @@ public:
   /* Gets symbol name of the item.  */
   const char *name (void)
   {
-    return node->name ();
+    return xstrdup_for_dump (node->name ());
   }
 
   /* Gets assembler name of the item.  */
   const char *asm_name (void)
   {
-    return node->asm_name ();
+    return xstrdup_for_dump (node->asm_name ());
   }
 
   /* Fast equality function based on knowledge known in WPA.  */
-- 
2.1.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]