This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal
- From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Jul 2017 14:57:01 +0000
- Subject: [Bug target/81273] Wrong code generated for ARM setting volatile struct field with a literal
- Auto-submitted: auto-generated
- References: <bug-81273-4@http.gcc.gnu.org/bugzilla/>
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.