https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66804

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Fei Yang from comment #4)
> (In reply to Markus Trippelsdorf from comment #2)
> > You're invoking undefined behavior:
> 
> test.c:34:12: runtime error: store to
> > misaligned address 0x000000401c8c for type 'unsigned char *', which requires
> > 8 byte alignment
> 0x000000401c8c: note: pointer points here
>   00 00 00 00 00
> > 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
> > 00 00 00
>               ^ 
> 
> So your testcase is invalid.
> 
> Any reference? The testcase works fine without vectorization. thanks

It works fine without vectorization because on x86 unaligned non-vector
accesses do not trap.

Still the C standard says that pointers have to be suitably aligned.

Reply via email to