powerpc gcc strange assembler for bitfields

Florian Weimer fw@deneb.enyo.de
Fri Apr 22 07:21:00 GMT 2005

* 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.)

More information about the Gcc-help mailing list