Vector subscription patch

Artem Shinkarov artyom.shinkaroff@gmail.com
Wed Oct 20 11:37:00 GMT 2010


This is a patch which was never reviewed and commited because of my
license issues. Now my copyright assignment is solved.


The patch allows to index vectors the same way as arrays.
Bound-checking is enabled when -Warray-bounds is on.


ChangeLog:

2010-10-20  Artjoms Sinkarovs <artyom.shinakroff@gmail.com>
     Andrew Pinski <pinskia@gmail.com>

     * c-family/c-common.h (c_common_mark_addressable_vec): Declare.
     * c-family/c-common.c (c_common_mark_addressable_vec): New function.
     * c-typeck.c (build_array_ref): Handle subscripting of vectors.

     testsuite/
     * gcc.c-torture/execute/vector-subscript-1.c: Likewise.
     * gcc.c-torture/execute/vector-subscript-2.c: Likewise.
     * gcc.c-torture/execute/vector-subscript-3.c: New testcase.
     * gcc.dg/vector-subscript-1.c: Likewise.
     * gcc.dg/vector-subscript-2.c: Likewise.
     * gcc.dg/vector-subscript-3.c: New testcase.
     * gcc.dg/array-8.c: Adjust.

     doc/
     * extend.texi: New paragraph


bootstrapped and tested on x86_64_unknown-linux


Ok?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subscript.c_v3.diff
Type: text/x-diff
Size: 10658 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101020/3196ed11/attachment.bin>


More information about the Gcc-patches mailing list