public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] dwarf2out, v2: Fix up field_byte_offset [PR101378]
Date: Thu, 11 Nov 2021 09:51:55 +0100 (CET)	[thread overview]
Message-ID: <717521rr-8o93-517-p89n-6sq87n9275q9@fhfr.qr> (raw)
In-Reply-To: <20211111081930.GM2710@tucnak>

On Thu, 11 Nov 2021, Jakub Jelinek wrote:

> Hi!
> 
> Bootstrapped/regtested now successfully on x86_64-linux and i686-linux,
> verified the
> struct S { int e; int a : 1, b : 7, c : 8, d : 16; } s;
> struct T { int a : 1, b : 7; long long c : 8; int d : 16; } t;
> 
> int
> main ()
> {
>   s.c = 0x55;
>   s.d = 0xaaaa;
>   t.c = 0x55;
>   t.d = 0xaaaa;
>   s.e++;
> }
> testcase is compiled the same way as before again, ok for trunk?

OK, also for affected branches.

Thanks,
Richard.

> > 2021-11-10  Jakub Jelinek  <jakub@redhat.com>
> > 
> > 	PR debug/101378
> > 	* dwarf2out.c (field_byte_offset): Do the PCC_BITFIELD_TYPE_MATTERS
> > 	handling only for DECL_BIT_FIELD_TYPE decls.
> > 
> > 	* g++.dg/debug/dwarf2/pr101378.C: New test.
> > 
> > --- gcc/dwarf2out.c.jj	2021-11-05 10:19:46.339457342 +0100
> > +++ gcc/dwarf2out.c	2021-11-09 15:01:51.425437717 +0100
> > @@ -19646,6 +19646,7 @@ field_byte_offset (const_tree decl, stru
> >       properly dynamic byte offsets only when PCC bitfield type doesn't
> >       matter.  */
> >    if (PCC_BITFIELD_TYPE_MATTERS
> > +      && DECL_BIT_FIELD_TYPE (decl)
> >        && TREE_CODE (DECL_FIELD_OFFSET (decl)) == INTEGER_CST)
> >      {
> >        offset_int object_offset_in_bits;
> > --- gcc/testsuite/g++.dg/debug/dwarf2/pr101378.C.jj	2021-11-09 15:17:39.504975396 +0100
> > +++ gcc/testsuite/g++.dg/debug/dwarf2/pr101378.C	2021-11-09 15:17:28.067137556 +0100
> > @@ -0,0 +1,13 @@
> > +// PR debug/101378
> > +// { dg-do compile { target c++11 } }
> > +// { dg-options "-gdwarf-5 -dA" }
> > +// { dg-final { scan-assembler-times "0\[^0-9x\\r\\n\]* DW_AT_data_member_location" 1 } }
> > +// { dg-final { scan-assembler-times "1\[^0-9x\\r\\n\]* DW_AT_data_member_location" 1 } }
> > +// { dg-final { scan-assembler-times "2\[^0-9x\\r\\n\]* DW_AT_data_member_location" 1 } }
> > +// { dg-final { scan-assembler-not "-1\[^0-9x\\r\\n\]* DW_AT_data_member_location" } }
> > +
> > +struct E {};
> > +struct S
> > +{
> > +  [[no_unique_address]] E e, f, g;
> > +} s;
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)

      reply	other threads:[~2021-11-11  8:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  9:20 [PATCH] dwarf2out: " Jakub Jelinek
2021-11-10  9:29 ` Eric Botcazou
2021-11-10  9:52 ` Richard Biener
2021-11-10 11:03   ` Jakub Jelinek
2021-11-10 11:36     ` Richard Biener
2021-11-10 11:44       ` Jakub Jelinek
2021-11-11  8:19     ` [PATCH] dwarf2out, v2: " Jakub Jelinek
2021-11-11  8:51       ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=717521rr-8o93-517-p89n-6sq87n9275q9@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).