[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal
rearnsha at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 3 14:57:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81273
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution|--- |INVALID
--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
The compiler gave you what you asked for (though it might not have been what
you wanted, or even expected). Optimization is irrelevant here.
Just because the address you finally assigned to the structure was aligned
doesn't mean that the compiler can change the access pattern for a volatile
object. You'd hardly expect that changing base_addr to 0x3f000001 would change
the sequence of loads and stores generated, surely? And don't forget that
unaligned accesses to DEVICE memory are undefined.
More information about the Gcc-bugs
mailing list