This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Vector subscription patch
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Artem Shinkarov <artyom dot shinkaroff at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>
- Date: Wed, 20 Oct 2010 11:54:17 +0000 (UTC)
- Subject: Re: Vector subscription patch
- References: <AANLkTinBCvNWt3ymLHvGWVCJ-cPL84wX++bTy+EBVj5M@mail.gmail.com>
On Wed, 20 Oct 2010, Artem Shinkarov wrote:
> * c-family/c-common.h (c_common_mark_addressable_vec): Declare.
> * c-family/c-common.c (c_common_mark_addressable_vec): New function.
c-family/ has its own ChangeLog file.
> Index: gcc/doc/extend.texi
> ===================================================================
> --- gcc/doc/extend.texi (revision 165700)
> +++ gcc/doc/extend.texi (working copy)
> @@ -6310,6 +6310,11 @@ minus or complement operators on a vecto
> elements are the negative or complemented values of the corresponding
> elements in the operand.
>
> +Vectors can be subscripted as if the vector were an array with the same number
> +of elements and base type. Out of bound accesses invoke undefined behavior at
> +runtime. Warnings for out of bound accesses for vector subscription can be
> +enabled with @option{-Warray-bounds}.
I don't see any C++ changes in this patch, but I don't see any
documentation saying this feature is C-only either. If it's C-only, this
should be documented.
> + return 0[a]; /* { dg-error "" } */
'{ dg-error "" }' is generally bad; you should match at least some of the
message text.
--
Joseph S. Myers
joseph@codesourcery.com