From: Richard Biener <richard.guenther@gmail.com>
To: Eric Botcazou <botcazou@adacore.com>
Cc: Tom Tromey <tromey@adacore.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix debug info for enumeration types with reverse Scalar_Storage_Order
Date: Wed, 10 Jan 2024 12:54:37 +0100 [thread overview]
Message-ID: <CAFiYyc3p4W+RdJJwaXp_ckTBB1gqV8W5GX3dHsHKR0+_b3Hw7w@mail.gmail.com> (raw)
In-Reply-To: <1875304.tdWV9SEqCh@fomalhaut>
On Wed, Jan 10, 2024 at 12:53 PM Eric Botcazou <botcazou@adacore.com> wrote:
>
> > Can you elaborate on the DIE order constraint and why it was chosen? That
> > is,
> >
> > + /* The DIE with DW_AT_endianity is placed right after the naked DIE.
> > */ + if (reverse)
> > + {
> > + gcc_assert (type_die);
> > ...
> >
> > and
> >
> > + /* The DIE with DW_AT_endianity is placed right after the naked DIE.
> > */ + if (reverse_type)
> > + {
> > + dw_die_ref after_die
> > + = modified_type_die (type, cv_quals, false, context_die);
> > + gen_type_die (type, context_die, true);
> > + gcc_assert (after_die->die_sib
> > + && get_AT_unsigned (after_die->die_sib,
> > DW_AT_endianity)); + return after_die->die_sib;
> >
> > ?
>
> That's preexisting though, see line 13730 where there is a small blurb.
>
> The crux of the matter is that there is no scalar *_TYPE node with a reverse
> SSO, so there is nothing to equate with for the DIE carrying DW_AT_endianity,
> unlike for type variants (the reverse SSO is on the enclosing aggregate type
> instead but this does not match the way DWARF describes it).
>
> Therefore, in order to avoid building a new DIE with DW_AT_endianity each
> time, the DIE with DW_AT_endianity is placed right after the naked DIE, so
> that the lookup done at line 13730 for reverse SSO is immediate.
Hmm, I see. The patch is OK then.
Thanks,
Richard.
> > Likewise the extra argument to the functions is odd - is that not available
> > on the tree type?
>
> No, for the reason described above, so the extra parameter is preexisting for
> base_type_die, modified_type_die and add_type_attribute.
>
> --
> Eric Botcazou
>
>
prev parent reply other threads:[~2024-01-10 11:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-09 20:17 Eric Botcazou
2024-01-10 9:37 ` Richard Biener
2024-01-10 11:53 ` Eric Botcazou
2024-01-10 11:54 ` 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=CAFiYyc3p4W+RdJJwaXp_ckTBB1gqV8W5GX3dHsHKR0+_b3Hw7w@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=botcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=tromey@adacore.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).