This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Vector subscription patch


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]