[Bug target/85616] ARM target using -O2 may cause unaligned access
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue May 8 09:43:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85616
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Using
*(unsigned int *) &buf_start[0]
you are telling GCC that &buf_start[0] is aligned to 4 bytes. You have to
use sth like
typedef myint unsigned int __attribute__((aligned(1)));
*(myint *) &buf_start[0]
More information about the Gcc-bugs
mailing list