aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-05-22 00:40:55 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-05-22 00:40:55 -0400
commit5b018c651a9ba855b19e60ad354c21400cc343a2 (patch)
treee22fe7615ee1389c780a25cb850770d52956f4b2 /gcc/dwarf2out.c
parentb42bf620b07490e672d5930fd68378adec3f1a8b (diff)
downloadgcc-5b018c651a9ba855b19e60ad354c21400cc343a2.zip
gcc-5b018c651a9ba855b19e60ad354c21400cc343a2.tar.gz
gcc-5b018c651a9ba855b19e60ad354c21400cc343a2.tar.bz2
re PR c++/49092 (ice in tree_add_const_value_attribute)
PR c++/49092 * dwarf2out.c (tree_add_const_value_attribute_for_decl): Check for static storage duration. From-SVN: r174024
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 b85a55e..55453a3 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)