This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50521] -fstrict-volatile-bitfields is not strict
- From: "henrik at henriknordstrom dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Oct 2011 17:46:15 +0000
- Subject: [Bug c/50521] -fstrict-volatile-bitfields is not strict
- Auto-submitted: auto-generated
- References: <bug-50521-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50521
--- Comment #12 from Henrik NordstrÃm <henrik at henriknordstrom dot net> 2011-10-28 17:46:15 UTC ---
Regarding the double load. In a statement like a = b, both a & be should be
individually accessed even if they refer to the same storage. So
bitfield.bits.a = bitfield.bits.c should load the bitfield variable twice, once
for reading the rvalue and once for masking the lvalue assignment.
See 7.1.7.5 second and third paragraph and the note just after.
Regarding STRICT_ALIGNMENT, not strictly needed on ARM i think. Smaller
accesses than the base type is acceptable, as long as it's aligned to the
matching access size (8/16/32/64 bit) and on ARMv7 unaligned access is allowed,
but at a performance penalty. And this change is technically unrelated to
strict-volatile-bitfields even if there is overlap.