This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bitfields accesses (causing problems to some ARM hardware)


    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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]