This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/85616] ARM target using -O2 may cause unaligned access
- From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 May 2018 15:12:20 +0000
- Subject: [Bug target/85616] ARM target using -O2 may cause unaligned access
- Auto-submitted: auto-generated
- References: <bug-85616-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85616
--- Comment #3 from ktkachov at gcc dot gnu.org ---
Though the example code given breaks C's strict aliasing rules, doesn't it?
bug_start is an array of chars (byte-aligned) but the stores to it are done as
ints, which expect word alignment, so this would be invoking undefined
behaviour.