This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFC] Make the new var decl STATIC in function dw2_output_indirect_constant_1
- From: Carrot Wei <carrot at google dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 10 May 2013 11:27:21 -0700
- Subject: [RFC] Make the new var decl STATIC in function dw2_output_indirect_constant_1
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 <carrot@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);