]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (tree_add_const_value_attribute): Only handle VAR_DECL and CONST_DECL.
authorJakub Jelinek <jakub@redhat.com>
Tue, 2 Sep 2008 19:59:58 +0000 (21:59 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 2 Sep 2008 19:59:58 +0000 (21:59 +0200)
* dwarf2out.c (tree_add_const_value_attribute): Only handle
VAR_DECL and CONST_DECL.

From-SVN: r139911

gcc/ChangeLog
gcc/dwarf2out.c

index d56cf0359a5d3b2044563faf7ad129ea151f165f..0a20825f0d7bf7cc004caaf223fbd366cd4fdbbf 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-02  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2out.c (tree_add_const_value_attribute): Only handle
+       VAR_DECL and CONST_DECL.
+
 2008-09-02  H.J. Lu  <hongjiu.lu@intel.com>
            Jakub Jelinek  <jakub@redhat.com>
 
index 3e1bd5a60f06f6214eefcbbff7c28b9cdd8490f7..ab68a00af6ac10cc8709ad6de64d35b84da69a9e 100644 (file)
@@ -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