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]

Re: PATCH: PR middle-end/40147: Memory leak in revision 147436


On Thu, May 14, 2009 at 05:18:51PM +0200, Jakub Jelinek wrote:
> On Thu, May 14, 2009 at 05:14:00PM +0200, Jan Hubicka wrote:
> > > We have a memory leark since memory_identifier_string isn't marked with
> > > GTY(()). OK for trunk and 4.3/4.4 branches?
> > 
> > OK, thanks
> 
> Do you need GTY(()) markers in both places?  AFAIK you need it either
> in the header on the extern decl and in that case not on the definition
> in the .c file, or you don't put an extern decl in a header, add GTY(())
> marker to the local definition and ensure the .c file is scanner for GC (add
> gt-* include at the end of the file, add it to the makefile list).
> 

This is what I checked in.

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: ChangeLog
===================================================================
--- ChangeLog	(revision 147534)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2009-05-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR middle-end/40147
+	* 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]