summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-07-02 02:07:28 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-07-02 02:07:28 +0000
commit39173548ef5e08f4a593382ae44042e76be6f375 (patch)
tree4b7fed61e920b41d368b481f726229b1eb4530f1
parente0a9557c69bf91d9e0c02b195bfb5e7ed6c5af5c (diff)
downloadppe42-gcc-39173548ef5e08f4a593382ae44042e76be6f375.tar.gz
ppe42-gcc-39173548ef5e08f4a593382ae44042e76be6f375.zip
* dwarfout.c (field_byte_offset): Correctly compute the object's
byte offset for the first bit of a field which crosses an alignment boundary on a !BYTES_BIG_ENDIAN target. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27921 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarfout.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8bdff9c99e9..c3ef1de4260 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 2 03:05:44 1999 Jeffrey A Law (law@cygnus.com)
+
+ * dwarfout.c (field_byte_offset): Correctly compute the object's
+ byte offset for the first bit of a field which crosses an alignment
+ boundary on a !BYTES_BIG_ENDIAN target.
+
Fri Jul 2 01:36:36 1999 Robert Lipe <robertlipe@usa.net>
* fixinc.svr4: Fix <arpa/inet.h> by deleting protos for htons and
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 2a1b482f8f8..9c419a8bca1 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -2106,8 +2106,16 @@ field_byte_offset (decl)
negative. Gdb fails when given negative bit offsets. We avoid this
by recomputing using the first bit of the bitfield. This will give
us an object which does not completely contain the bitfield, but it
- will be aligned, and it will contain the first bit of the bitfield. */
- if (object_offset_in_bits > bitpos_int)
+ will be aligned, and it will contain the first bit of the bitfield.
+
+ However, only do this for a BYTES_BIG_ENDIAN target. For a
+ ! BYTES_BIG_ENDIAN target, bitpos_int + field_size_in_bits is the first
+ first bit of the bitfield. If we recompute using bitpos_int + 1 below,
+ then we end up computing the object byte offset for the wrong word of the
+ desired bitfield, which in turn causes the field offset to be negative
+ in bit_offset_attribute. */
+ if (BYTES_BIG_ENDIAN
+ && object_offset_in_bits > bitpos_int)
{
deepest_bitpos = bitpos_int + 1;
object_offset_in_bits
OpenPOWER on IntegriCloud