------- Comment #16 from rguenth at gcc dot gnu dot org 2008-03-25 12:28 ------- The C/C++ standards say that if you access memory through int, the data has to be aligned suitably according to what the ABI specifies for alignment of int. If you mis-align the access on purpose you have to tell the compiler, one means of doing so is by using the aligned attribute or by using a packed structure. The vectorizer will then see the misalignment if it (hopefully) uses get_pointer_alignment (or TYPE_ALIGN or whatever is suitable).
It is not expected that the vectorizer can deal with the situation in the original report. For this reason I think this bugreport is invalid. char c[4]; *(int *)&c[0] the access invokes undefined behavior at runtime if you do not make sure c is properly aligned. On strict alignment targets this will fault regardless of vectorization or not. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35653