This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bitfields accesses (causing problems to some ARM hardware)
- To: igor at windriver dot com
- Subject: Re: Bitfields accesses (causing problems to some ARM hardware)
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Thu, 18 May 00 21:26:04 EDT
- Cc: gcc at gcc dot gnu dot org
They have some ARM board and it's memory mapped IO ports could only be
accessed in 4-byte words. And they have a structure with bitfields
describing some control word on that IO bus. They want manage somehow
to use fullword access instructions (LDR & STR in ARM case) when
reading/modifing specific bitfield in that structure.
With some previous releases of GCC they got STRB instructions for both
cases. Newer release we are going to ship them is better, it's only
using STRB for first store. I found why.
The reason is that there is absolutely no guarantee which will be chosen
by GCC.
Do you have any suggestion how it should be handled. Could we fixed it
in that way that we will consider "volatile" for example and generate
code for that as for real bit-field. Or maybe do you know how to
change source to get desired effect.
You definitely need to say "volatile" if you care about such things.
I don't know if we currently handle this case, though.