Hi

In function dw2_output_indirect_constant_1 a new var decl is created. Only
When the variable is not PUBLIC it is allocated static storage. Does anybody
know why the variable is not allocated static storage by marking TREE_STATIC
when it is PUBLIC?

The following patch marks the STATIC flag in all cases. It can pass bootstrap
and regression test on x86-64.

Any comments?

thanks
Carrot


2013-05-09  Guozhi Wei  <car...@google.com>

        * dwarf2asm.c (dw2_output_indirect_constant_1): Mark new decl STATIC.


Index: dwarf2asm.c
===================================================================
--- dwarf2asm.c (revision 198794)
+++ dwarf2asm.c (working copy)
@@ -906,6 +906,7 @@
   DECL_IGNORED_P (decl) = 1;
   DECL_INITIAL (decl) = decl;
   TREE_READONLY (decl) = 1;
+  TREE_STATIC (decl) = 1;

   if (TREE_PUBLIC (id))
     {
@@ -914,8 +915,6 @@
       if (USE_LINKONCE_INDIRECT)
  DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
     }
-  else
-    TREE_STATIC (decl) = 1;

   sym_ref = gen_rtx_SYMBOL_REF (Pmode, sym);
   assemble_variable (decl, 1, 1, 1);

Reply via email to