This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch 2/6] scalar-storage-order merge: C front-end
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Jun 2015 12:28:01 +0100
- Subject: Re: [patch 2/6] scalar-storage-order merge: C front-end
- Authentication-results: sourceware.org; auth=none
- References: <3247494 dot 5bgQPARZRk at polaris> <2396877 dot AqT21tpnmO at polaris>
Eric Botcazou <ebotcazou@adacore.com> writes:
> This is the C front-end + C family part.
>
> * doc/extend.texi (type attributes): Document scalar_storage_order.
> * doc/invoke.texi (Warnings): Document -Wno-scalar-storage-order.
> c-family/
> * c-common.c (c_common_attributes): Add scalar_storage_order.
> (handle_scalar_storage_order_attribute): New function.
> * c.opt (Wscalar-storage-order): New warning.
> c/
> * c-decl.c (finish_struct): If the structure has reverse scalar storage
> order, rewrite the type of array fields with scalar component.
> * c-typeck.c (build_unary_op) <ADDR_EXPR>: Remove left-overs. Issue
> errors on bit-fields and reverse SSO here and not...
> (c_mark_addressable): ...here.
>
> doc/extend.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++
> doc/invoke.texi | 6 +++++
> c-family/c.opt | 4 +++
> c-family/c-common.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-
> c/c-typeck.c | 53 +++++++++++++++++++++++++++++++-------------------
> c/c-decl.c | 45 +++++++++++++++++++++++++++++--------------
> 6 files changed, 175 insertions(+), 34 deletions(-)
Sorry for the nit, but:
> +@itemize
> +@item Taking the address of a scalar field of a @code{union} or a
> +@code{struct} with reverse scalar storage order is illegal and will
> +yield an error
> +@item Taking the address of an array field, whose component is scalar, of
> +a @code{union} or a @code{struct} with reverse scalar storage order is
> +permitted but will yield a warning, unless @option{-Wno-scalar-storage-order}
> +is specified
> +@item Taking the address of a @code{union} or a @code{struct} with reverse
> +scalar storage order is permitted
> +@end itemize
"illegal" -> "invalid" or "not permitted"
Thanks,
Richard