re PR debug/11279 (DWARF-2 output mishandles large enums)
authorMark Mitchell <mark@codesourcery.com>
Sun, 20 Jul 2003 07:24:58 +0000 (07:24 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 20 Jul 2003 07:24:58 +0000 (07:24 +0000)
PR debug/11279
* dwarf2out.c (gen_enumeration_type_die): Remember that
enumerators can be unsigned.

From-SVN: r69605

gcc/ChangeLog
gcc/dwarf2out.c

index 0905e540d5f29f07354a4aa07d820938648a7d88..2123f9cde7f07da8d701544ab5766b542bfa7cd4 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-20  Mark Mitchell  <mark@codesourcery.com>
+
+       PR debug/11279
+       * dwarf2out.c (gen_enumeration_type_die): Remember that
+       enumerators can be unsigned.
+
 2003-07-19  Zack Weinberg  <zack@codesourcery.com>
 
        * c-decl.c (named_labels, shadowed_labels, label_level_chain)
index 368927168d2217411d1850499ebf4b855f6e0372..591d2da653908c3157d2338523499ad36285e033 100644 (file)
@@ -10325,14 +10325,15 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
          add_name_attribute (enum_die,
                              IDENTIFIER_POINTER (TREE_PURPOSE (link)));
 
-         if (host_integerp (TREE_VALUE (link), 0))
+         if (host_integerp (TREE_VALUE (link), 
+                            TREE_UNSIGNED (TREE_TYPE (TREE_VALUE (link)))))
            {
              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));
+                                tree_low_cst (TREE_VALUE (link), 1));
            }
        }
     }