From: Eric Botcazou <ebotcazou@adacore.com>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch 6/6] scalar-storage-order merge: testsuite
Date: Thu, 18 Jun 2015 20:29:00 -0000 [thread overview]
Message-ID: <2795379.nNeUsDUHZn@polaris> (raw)
In-Reply-To: <558024E5.7080709@foss.arm.com>
> It appears that all the C tests check the specific syntactic form
> 'struct __attr_sso__ foo {...};'
>
> What is the impact of changing the location of __attr_sso__? Eg:
>
> struct foo {...} __attr_sso__;
None. What impact could it have?
> (Note that alignment attributes can have significant impact depending on
> where in the syntax the attribute is placed (I'm expecting this will be
> true here as well).
Ouch. This sounds like a bug to me.
> What about with typedefs?
It's ignored (with a warning) on typedefs.
> Can I apply the attribute to a previously laid out struct?
Example? Is that supported for other type attributes?
> Can I apply it to individual fields in the struct, eg:
>
> struct bar
> {
> int a;
> int __attr_sso__ b;
> };
No, but you can do this:
struct bar
{
int a;
struct __attr_sso__ foo
{
int b;
} s;
};
> Can I modify an existing struct to create an opposite endian variant? Eg.
>
> struct bar
> {
> int a;
> };
>
> struct wibble
> {
> struct __attr_sso__ bar a;
> };
The compiler accepts it, but apparently discards the attribute silently, which
looks like a bug to me. Let me investigate.
> Assuming mixed fields in a struct are possible, can it be applied to
> individual bitfields? What is the impact on mixing big and little
> endian bitfields in the same structure.
Mixing bitfields with different endianness is simply not possible, they would
be non-contiguous in one of the orders. The endianness can only be flipped on
storage unit boundaries, which is automatically enforced in the C family of
languages by the aggregate type constraint (but not in Ada, so we have a
specific check to that effect in the Ada compiler).
--
Eric Botcazou
next prev parent reply other threads:[~2015-06-18 20:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 8:46 [patch 0/6] scalar-storage-order merge Eric Botcazou
2015-06-16 8:52 ` [patch 1/6] scalar-storage-order merge: Ada front-end Eric Botcazou
2015-06-16 8:56 ` [patch 2/6] scalar-storage-order merge: C front-end Eric Botcazou
2015-06-16 9:07 ` Ramana Radhakrishnan
2015-06-16 9:11 ` Andrew Pinski
2015-06-18 19:16 ` Eric Botcazou
2015-06-16 11:39 ` Richard Sandiford
2015-06-18 19:17 ` Eric Botcazou
2015-06-16 21:25 ` Joseph Myers
2015-06-19 9:36 ` Eric Botcazou
2015-06-16 8:59 ` [patch 3/6] scalar-storage-order merge: C++ front-end Eric Botcazou
2015-06-16 9:24 ` [patch 4/6] scalar-storage-order merge: bulk Eric Botcazou
2015-06-16 9:53 ` [patch 5/6] scalar-storage-order merge: rest Eric Botcazou
2015-06-16 9:59 ` [patch 6/6] scalar-storage-order merge: testsuite Eric Botcazou
2015-06-16 13:30 ` Richard Earnshaw
2015-06-18 20:29 ` Eric Botcazou [this message]
2015-06-19 9:17 ` Eric Botcazou
2015-10-06 10:57 [patch 0/6] scalar-storage-order merge (2) Eric Botcazou
2015-10-06 11:08 ` [patch 6/6] scalar-storage-order merge: testsuite Eric Botcazou
2015-10-12 22:26 ` Jeff Law
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=2795379.nNeUsDUHZn@polaris \
--to=ebotcazou@adacore.com \
--cc=Richard.Earnshaw@foss.arm.com \
--cc=gcc-patches@gcc.gnu.org \
/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).