dwarf2out.c (gen_enumeration_type_die): If enum has a negative value, don't output...
authorJakub Jelinek <jakub@redhat.com>
Wed, 29 Mar 2000 18:32:04 +0000 (20:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 29 Mar 2000 18:32:04 +0000 (20:32 +0200)
* dwarf2out.c (gen_enumeration_type_die): If enum has a negative
value, don't output it as unsigned.

From-SVN: r32807

gcc/ChangeLog
gcc/dwarf2out.c

index 7cffb9fcb0357991381ebc69eb82dda326878e8c..6d2d771e5c84e4dbecf204df4e2001b8c4017c10 100644 (file)
@@ -1,3 +1,8 @@
+2000-03-29  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2out.c (gen_enumeration_type_die): If enum has a negative
+       value, don't output it as unsigned.
+
 Wed Mar 29 10:53:49 2000  Jeffrey A Law  (law@cygnus.com)
 
        * stmt.c (stmt_loop_nest_empty): Allow cfun->stmt to be NULL.
index eb9630c962864f648dd426b3a1db26b50c6a7fff..c493d54f572624d3eff7a9a689eb41fba27e9a9f 100644 (file)
@@ -7905,8 +7905,14 @@ gen_enumeration_type_die (type, context_die)
                              IDENTIFIER_POINTER (TREE_PURPOSE (link)));
 
          if (host_integerp (TREE_VALUE (link), 0))
-           add_AT_unsigned (enum_die, DW_AT_const_value,
-                            tree_low_cst (TREE_VALUE (link), 0));
+           {
+             if (tree_int_cst_sgn (TREE_VALUE (link)) < 0)
+               add_AT_int (enum_die, DW_AT_const_value,
+                           tree_low_cst (TREE_VALUE (link), 0));
+             else
+               add_AT_unsigned (enum_die, DW_AT_const_value,
+                                tree_low_cst (TREE_VALUE (link), 0));
+           }
        }
     }
   else