Chris Lattner <clattner@xxxxxxxxx> writes: > > union > > { > > vectortype v; > > float af[4]; > > } u; > > u.v = v; > > return u.af[0]; > > > > Ian > > Or, alternatively: > > vectortype v; > > elementtype e = ((elementtype*)&v)[1] Well, I don't recommend that in general. gcc currently has an exception to the aliasing rules, and treats vectortype* and elementtype* as being in the same alias set. But at my previous company, we got significantly better generated code in some cases by breaking that aliasing. In particular this aliasing forces a pointer to a vector of char to alias char* and therefore alias everything. But if the compiler breaks that aliasing, then your suggestion of using a cast will fail in some cases. Ian