From: Eric Botcazou <botcazou@adacore.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gcc@gcc.gnu.org, gdb@sourceware.org
Subject: Re: Issue with pointer types marked with scalar_storage_order
Date: Thu, 06 May 2021 16:07:52 +0200 [thread overview]
Message-ID: <4620030.GXAFRqVoOG@fomalhaut> (raw)
In-Reply-To: <20210506123308.GA27332@oc3748833570.ibm.com>
> I'm not really sure where exactly the bug is, because I'm not
> quite sure if pointer types actually *should* be byte swapped.
>
> On the one hand, the typical use case of scalar_storage_order
> is to simplify accessing binary data (read from a file or the
> network) that was generated on a "foreign" architecture that
> uses a different byte order. Those use cases are unlikely
> to involve any pointer types, since pointer values from a
> foreign system are typically not usable on the current
> system anyway.
>
> On the other hand, even the name of the attribute specifically
> refers to *scalar* types, and the C standard does classsify
> pointer types amongst the scalar type. So maybe this was
> originally intended?
I don't think so, the feature was first implemented for Ada and, in Ada,
pointer types (called access types) are *not* scalar types. So this indeed
looks like a small oversight in the implementation.
> Any comments or suggestions on what to do here?
I'm going to conduct some testing in Ada but, barring unexpected fallout, I
would be in favor of changing the GCC implementation. It's presumably a 1-
line change in the reverse_storage_order_for_component_p predicate.
--
Eric Botcazou
next prev parent reply other threads:[~2021-05-06 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 12:33 Ulrich Weigand via Gdb
2021-05-06 14:07 ` Eric Botcazou [this message]
2021-05-07 12:45 ` Ulrich Weigand via Gdb
2021-05-06 19:45 ` Tom Tromey
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=4620030.GXAFRqVoOG@fomalhaut \
--to=botcazou@adacore.com \
--cc=gcc@gcc.gnu.org \
--cc=gdb@sourceware.org \
--cc=uweigand@de.ibm.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