This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: powerpc gcc strange assembler for bitfields


* Nathan Sidwell:

> Pete James wrote:
>
>> So my questions are:
>> How can I force GCC to create code that works on the whole 16bit word?
>> Or is there another way of doing it?
>
> If it is important that you have exact control over the memory
> accesses, don't do the union of bitfields overlay trick.  Use
> explicit and/or masking.

Ahem, you (or Pete) should use explicit assembler instructions if you
want to make sure that you end up with certain instructions.

Future compiler versions might optimize the explicit masking as well.
(Even the volatile keyword would not prevent this.)


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