This is the mail archive of the
mailing list for the GCC project.
Re: Vector indexing patch
On Sat, Jun 5, 2010 at 3:10 AM, Richard Guenther
> On Fri, Jun 4, 2010 at 11:39 PM, Andrew Pinski <firstname.lastname@example.org> wrote:
>> On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov
>> <email@example.com> wrote:
>> + Â Â Âerror_at (loc, "index value is out of bound");
>> That is wrong. ÂThe Cell C/C++ language document says out of bounds
>> accesses are undefined (that is at runtime).
> I think we should implement whatever OpenCL specs and disregard
> whatever the (dead) Cell C/C++ language docs say. ÂThe project is
> to improve GCCs generic vector facility, not to implement the Cell
> language spec.
Except it makes no sense that:
vector int t;
is rejected but
vector int t;
const int tt = 55;
is accepted in C but rejected in C++.
This is why OpenCL spec is not very good here really and not
consistent with the rest of the C/C++ standard. In fact I would say
we should treat it as the same as arrays out of bounds where it is
just undefined at runtime rather than an error. This is what the Cell
C/C++ language spec is trying to do rather than something more
specific to vectors. The Cell C/C++ specifications was trying to be
as close to what the current C/C++ standard says about out of bounds
accesses rather than making up different rules.