vector bug?

Segher Boessenkool
Fri Mar 19 15:38:00 GMT 2004

>   v4si a = *(v4si*)ins, b = {1, 2, 3, 4}, c;

>   *(v4si*)vals = c;

You can't do this.  Your accessing an object of one type
(int) as an other type (v4si).

You'll have to go through a union to do this safely
(this is a GCC extension).  Like:

	union { v4si v; int i[4]; } convert;
	convert.v = c;

...and then print convert.i[0] etc.


More information about the Gcc-help mailing list