PR 19893 & array_ref bug

Mark Mitchell mark@codesourcery.com
Wed Mar 16 22:02:00 GMT 2005


Steve Ellcey wrote:
> What do people think about this idea for changing the vect tests using
> gcc.dg/vect/vect-56.c as an example.  The arguments (pa, pb, pc) would
> remain afloat type (vs. float) but the arrays would be changed from
> 'array of aligned floats' to an array of floats where the actual array
> itself is aligned.

That makes sense to me.  (Independently of whether or not we continue to 
allow the brokenness currently in GCC, there is no reason to actively 
make use of it.)

> It seems like we are lying about the alignment of the pa, pb, pc
> arguments but I don't see a way around this.

Make them array arguments, instead of pointer arguments.  I'm not sure 
if GCC is smart enough to still vectorize them in that case, but that's 
the right way to express it.  An aligned array-of-floats decays to an 
aligned pointer-to-float, i.e., the pointer is known to be aligned, but 
the object pointed to is just a float not an aligned float.

 > If we changed GCC to pad
> the array elements (in order to obey the alignment request) wouldn't we
> actually break our ability to vectorize things?

Yes.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc mailing list