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: PR middle-end/40147: Memory leak in revision 147436


We have a memory leark since memory_identifier_string isn't marked with
GTY(()). OK for trunk and 4.3/4.4 branches?

Thanks.


H.J.
---
Index: tree.h
===================================================================
--- tree.h	(revision 147534)
+++ tree.h	(working copy)
@@ -5190,6 +5190,9 @@ extern unsigned HOST_WIDE_INT highest_po
 
 void init_inline_once (void);
 
+/* In ipa-reference.c.  Used for parsing attributes of asm code.  */
+extern GTY(()) tree memory_identifier_string;
+
 /* Compute the number of operands in an expression node NODE.  For 
    tcc_vl_exp nodes like CALL_EXPRs, this is stored in the node itself,
    otherwise it is looked up from the node's code.  */
Index: ipa-reference.c
===================================================================
--- ipa-reference.c	(revision 147534)
+++ ipa-reference.c	(working copy)
@@ -157,7 +157,7 @@ enum initialization_status_t
   FINISHED
 };
 
-tree memory_identifier_string;
+GTY(()) tree memory_identifier_string;
 
 /* Vector where the reference var infos are actually stored. */
 DEF_VEC_P (ipa_reference_vars_info_t);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 147534)
+++ ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2009-05-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR middle-end/40147
+	* ipa-reference.c (memory_identifier_string): Add GTY(()).
+
+	* ipa-utils.h (memory_identifier_string): Moved to ...
+	* tree.h (memory_identifier_string): Here.  Add GTY(()).
+
 2009-05-14  Paolo Bonzini  <bonzini@gnu.org>
 
 	* doc/tm.texi (TARGET_LEGITIMATE_ADDRESS_P): Refer mainly to this
Index: ipa-utils.h
===================================================================
--- ipa-utils.h	(revision 147534)
+++ ipa-utils.h	(working copy)
@@ -23,9 +23,6 @@ along with GCC; see the file COPYING3.  
 #include "tree.h"
 #include "cgraph.h"
 
-/* Used for parsing attributes of asm code.  */
-extern tree memory_identifier_string;
-
 struct ipa_dfs_info {
   int dfn_number;
   int low_link;


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