Valarrays and [altivec] vectors (was Re: [PATCH]: Handle vector modes in genopinit.c, c-typeck.c)

Gabriel Dos Reis gdr@codesourcery.com
Fri Nov 30 06:21:00 GMT 2001


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:

| On 30 Nov 2001, Gabriel Dos Reis wrote:
| 
| > That is a constraint violation in C++ as well, but then what should
| > happen if that constraint is violated? In C++, it is an undefined
| > behaviour.  What do you propose for C?
| 
| A hard compile-time error.

OK.

[...]

| I don't think in C we need to handle indexing a vector by another vector
| (which in any case might be ambiguous if we stick to C convention that
| a[b] and b[a] are the same).

It is arguable whether that convention should be retained for non
scalar value of the index -- I for one don't think that convention is
that useful in modern programs.  However, being able to index an array
by another array is certainly useful in modern computations (graphics,
numerics,...)

-- Gaby
CodeSourcery, LLC                       http://www.codesourcery.com



More information about the Gcc-patches mailing list