From dd4bf866adfea8d6f3ebb81c30c55624127415f6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 2 Sep 2008 21:59:58 +0200 Subject: dwarf2out.c (tree_add_const_value_attribute): Only handle VAR_DECL and CONST_DECL. * dwarf2out.c (tree_add_const_value_attribute): Only handle VAR_DECL and CONST_DECL. From-SVN: r139911 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d56cf03..0a20825 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-09-02 Jakub Jelinek + + * dwarf2out.c (tree_add_const_value_attribute): Only handle + VAR_DECL and CONST_DECL. + 2008-09-02 H.J. Lu Jakub Jelinek diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 3e1bd5a6..ab68a00 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11931,10 +11931,14 @@ native_encode_initializer (tree init, unsigned char *array, int size) static void tree_add_const_value_attribute (dw_die_ref var_die, tree decl) { - tree init = DECL_INITIAL (decl); + tree init; tree type = TREE_TYPE (decl); rtx rtl; + if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != CONST_DECL) + return; + + init = DECL_INITIAL (decl); if (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl) && init) /* OK */; else -- cgit v1.1