Re: Vector indexing patch

2010-06-05 Thread Joseph S. Myers
On Sat, 5 Jun 2010, Andrew Pinski wrote: > 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. Thi

Re: Vector indexing patch

2010-06-05 Thread Andrew Pinski
On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov wrote: > This is a reworked patch of Andrew Pinski "Subscripting on vector > types" in terms of GSoC 2010 [Artjoms Sinkarovs]. > > This patch allows to index individual elements of vector type in C. > For example: vec[i], where vec is a vector with

Re: Vector indexing patch

2010-06-05 Thread Andrew Pinski
On Sat, Jun 5, 2010 at 1:51 PM, Richard Guenther wrote: > Sure - we can simply emit a warning here if you prefer. Only with -Warray-bounds enabled like the rest of the C/C++ front-ends do :). Thanks, Andrew Pinski

Re: Vector indexing patch

2010-06-05 Thread Richard Guenther
On Sat, Jun 5, 2010 at 10:49 PM, Andrew Pinski wrote: > On Sat, Jun 5, 2010 at 3:10 AM, Richard Guenther > wrote: >> On Fri, Jun 4, 2010 at 11:39 PM, Andrew Pinski wrote: >>> On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov >>> wrote: >>> >>> +      error_at (loc, "index value is out of bound")

Re: Vector indexing patch

2010-06-05 Thread Andrew Pinski
On Sat, Jun 5, 2010 at 3:10 AM, Richard Guenther wrote: > On Fri, Jun 4, 2010 at 11:39 PM, Andrew Pinski wrote: >> On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov >> wrote: >> >> +      error_at (loc, "index value is out of bound"); >> >> That is wrong.  The Cell C/C++ language document says ou

Re: Vector indexing patch

2010-06-05 Thread Richard Guenther
On Tue, Jun 1, 2010 at 9:21 PM, Artem Shinkarov wrote: > This is a reworked patch of Andrew Pinski "Subscripting on vector > types" in terms of GSoC 2010 [Artjoms Sinkarovs]. > > This patch allows to index individual elements of vector type in C. > For example: vec[i], where vec is a vector with a

Re: Vector indexing patch

2010-06-05 Thread Richard Guenther
On Fri, Jun 4, 2010 at 11:39 PM, Andrew Pinski wrote: > On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov > 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 thi

Re: Vector indexing patch

2010-06-04 Thread Andrew Pinski
On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov 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). Thanks, Andrew Pinski

Re: Vector indexing patch

2010-06-04 Thread Joseph S. Myers
On Fri, 4 Jun 2010, Richard Guenther wrote: > The mark_addressable_vector change was at least semi-ugly. I think > it is reasonable to require a constant index for register qualified vectors. What does the Cell document describing the extension being implemented by the original patch say here?

Re: Vector indexing patch

2010-06-04 Thread Richard Guenther
On Fri, Jun 4, 2010 at 6:38 PM, Joseph S. Myers wrote: > On Tue, 1 Jun 2010, Artem Shinkarov wrote: > >> This is a reworked patch of Andrew Pinski "Subscripting on vector >> types" in terms of GSoC 2010 [Artjoms Sinkarovs]. > > We can't consider it without a copyright assignment. > >> The document

Re: Vector indexing patch

2010-06-04 Thread Joseph S. Myers
On Tue, 1 Jun 2010, Artem Shinkarov wrote: > This is a reworked patch of Andrew Pinski "Subscripting on vector > types" in terms of GSoC 2010 [Artjoms Sinkarovs]. We can't consider it without a copyright assignment. > The documentation was not changed. May be there could be some more > ideas to