[Bug target/91927] -mstrict-align doesn't prevent unaligned accesses at -O2 and -O3 on AARCH64 targets
gr.audio at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 2 13:20:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91927
--- Comment #5 from Guillaume <gr.audio at gmail dot com> ---
I think I found a work-around for the time being.
If you define your packed structs with the 'volatile' qualifier, the bug
doesn't seem to show up. May not be completely ideal, but it appears to work,
and the reason why makes sense.
Like so: typedef volatile struct __attribute__((__packed__)) { ... }
Of course, would still be nice to fix the misalignment check...
More information about the Gcc-bugs
mailing list