This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/56997] Incorrect write to packed field when strict-volatile-bitfields enabled on aarch32
- From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jun 2013 20:27:27 +0000
- Subject: [Bug target/56997] Incorrect write to packed field when strict-volatile-bitfields enabled on aarch32
- Auto-submitted: auto-generated
- References: <bug-56997-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56997
--- Comment #9 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
1. you should never touch memory that lies outside the struct.
2. if you have to generate multiple accesses you should generate
code as if "volatile" was not used at all.
3. if -mno-unaligned-access is given you should not use accesses
that are larger than the struct's __attribute__((alignment(x)))
4. otherwise if unaligned accesses are allowed, you may generate an
unaligned ldr/str instruction.
Note: please do not use ldmia/stmia with unaligned addresses,
because that does still segfault even in ARMv7.
(that may be handled by a Linux IRQ but not for other O/S like eCos)