aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2011-03-14 21:07:22 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-03-14 21:07:22 +0100
commitde888d9027079b9a38b068a4c58a8563a4a4d600 (patch)
treee82c884105511edf160c6ea4422ba0988d643447 /gcc
parentf4e749b49840f856b460fdf2a8e501d4436fbc16 (diff)
downloadgcc-de888d9027079b9a38b068a4c58a8563a4a4d600.zip
gcc-de888d9027079b9a38b068a4c58a8563a4a4d600.tar.gz
gcc-de888d9027079b9a38b068a4c58a8563a4a4d600.tar.bz2
re PR debug/47946 (Dwarf uses 64-bits to refer to a structure offset unnecessarily)
PR debug/47946 * dwarf2out.c (add_bit_offset_attribute): If bit_offset is negative, emit it as add_AT_int instead of add_AT_unsigned. From-SVN: r170956
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/dwarf2out.c9
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0c9102c..a9d4d62 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,10 @@
-2011-01-14 Tom Tromey <tromey@redhat.com>
+2011-03-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47946
+ * dwarf2out.c (add_bit_offset_attribute): If bit_offset is negative,
+ emit it as add_AT_int instead of add_AT_unsigned.
+
+2011-03-14 Tom Tromey <tromey@redhat.com>
* unwind-dw2.c: Include sys/sdt.h if it exists.
(_Unwind_DebugHook): Use STAP_PROBE2.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index dfe1086..3319c61 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1,6 +1,6 @@
/* Output Dwarf2 format symbol table information from GCC.
Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Gary Funck (gary@intrepid.com).
Derived from DWARF 1 implementation of Ron Guilmette (rfg@monkeys.com).
@@ -17685,7 +17685,7 @@ add_bit_offset_attribute (dw_die_ref die, tree decl)
HOST_WIDE_INT bitpos_int;
HOST_WIDE_INT highest_order_object_bit_offset;
HOST_WIDE_INT highest_order_field_bit_offset;
- HOST_WIDE_INT unsigned bit_offset;
+ HOST_WIDE_INT bit_offset;
/* Must be a field and a bit field. */
gcc_assert (type && TREE_CODE (decl) == FIELD_DECL);
@@ -17718,7 +17718,10 @@ add_bit_offset_attribute (dw_die_ref die, tree decl)
? highest_order_object_bit_offset - highest_order_field_bit_offset
: highest_order_field_bit_offset - highest_order_object_bit_offset);
- add_AT_unsigned (die, DW_AT_bit_offset, bit_offset);
+ if (bit_offset < 0)
+ add_AT_int (die, DW_AT_bit_offset, bit_offset);
+ else
+ add_AT_unsigned (die, DW_AT_bit_offset, (unsigned HOST_WIDE_INT) bit_offset);
}
/* For a FIELD_DECL node which represents a bit field, output an attribute