http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53300

--- Comment #5 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-05-10 
17:59:46 UTC ---
i am still somewhat in dark on root of this problem.  What may actually be
problem here is the fact that varpool no longer outputs constant pool decls
relying on constant pool code to manage them on its own.

Does the following hack avoid the problem? Perhaps during the years when
varpool
was outputting constant pool vars something broke in the code tracking when the
var is needed.

Index: varpool.c
===================================================================
--- varpool.c   (revision 187371)
+++ varpool.c   (working copy)
@@ -282,7 +282,8 @@ varpool_assemble_decl (struct varpool_no

   /* Constant pool is output from RTL land when the reference
      survive till this level.  */
-  if (DECL_IN_CONSTANT_POOL (decl))
+  if (DECL_IN_CONSTANT_POOL (decl)
+      && TREE_ASM_WRITTEN (decl))
     return false;

   /* Decls with VALUE_EXPR should not be in the varpool at all.  They

Reply via email to