This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: target/6522: Incorrect struct offset for unaligned 64-bit fields in debug information
- From: Jakub Jelinek <jakub at redhat dot com>
- To: fred at nextnewgig dot com, gcc-bugs at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Fri, 3 May 2002 06:20:33 -0400
- Subject: Re: target/6522: Incorrect struct offset for unaligned 64-bit fields in debug information
- References: <20020430233038.27618.qmail@sources.redhat.com> <20020503013208.GA32526@nevyn.them.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, May 02, 2002 at 09:32:08PM -0400, Daniel Jacobowitz wrote:
> On Tue, Apr 30, 2002 at 11:30:38PM -0000, jakub@gcc.gnu.org wrote:
> > Synopsis: Incorrect struct offset for unaligned 64-bit fields in debug information
> >
> > State-Changed-From-To: open->feedback
> > State-Changed-By: jakub
> > State-Changed-When: Tue Apr 30 16:30:37 2002
> > State-Changed-Why:
> > You have not provided t64.cpp (or better t64.ii if t64.cpp
> > includes some headers).
> >
> > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6522
>
> I can confirm this in 3.1. It's present in 3.0, but worked in 2.95.3.
> It's quite annoying, since GDB can't infer the right answer.
Reproduced, looking into it.
> Here's another example:
>
> typedef __complex__ float cf;
> struct x { char c; cf f; } __attribute__ ((__packed__));
> struct unpacked_x { char c; cf f; };
>
> Compile and compare the debug info; it does not respect __packed__.
This testcase has wrong debug info in 2.95.3 and
2.96-RH, but looks correct in 3.0 and 3.1:
.ascii "f\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file
.byte 0x2 # DW_AT_decl_line
.long 0x4f # DW_AT_type
.byte 0x2 # DW_AT_data_member_location
.byte 0x23 # DW_OP_plus_uconst
.uleb128 0x1
^^^^^^^^^^^^^^^^^^^^
(this used to be 0x4 with older gcc's).
Jakub