summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-22 04:40:55 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-22 04:40:55 +0000
commitb622b5f5872f072c0625b5223713ea8a20e1864a (patch)
treee22fe7615ee1389c780a25cb850770d52956f4b2 /gcc/dwarf2out.c
parent8447804f44ed11ba77054620daed0e48c1724420 (diff)
downloadgcc-b622b5f5872f072c0625b5223713ea8a20e1864a.tar.gz
PR c++/49092
* dwarf2out.c (tree_add_const_value_attribute_for_decl): Check for static storage duration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174024 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b85a55ec67c..55453a3622c 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -17719,7 +17719,9 @@ tree_add_const_value_attribute_for_decl (dw_die_ref var_die, tree decl)
if (!decl
|| (TREE_CODE (decl) != VAR_DECL
- && TREE_CODE (decl) != CONST_DECL))
+ && TREE_CODE (decl) != CONST_DECL)
+ || (TREE_CODE (decl) == VAR_DECL
+ && !TREE_STATIC (decl)))
return false;
if (TREE_READONLY (decl)