This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc, powerpc and bit field operations
- From: Rycerz Roman-G11565 <roman dot rycerz at motorola dot com>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 29 Oct 2003 15:27:36 -0600
- Subject: gcc, powerpc and bit field operations
Hi..
I am using gcc-2.95 and am having trouble with bit field operations.
I have no trouble defining and compiling progs, but during execution I have problems.
No matter how I define a bit field
unsigned char : 4;
unsigned short : 4;
unsigned int : 4;
the compiled code always uses word length instructions so if the fields are all contained in 16bit... a 32bit are accessed.
This usually not a problem but when mapped to hardware I get access exception because the adjacent 16bits are protected..
Is the a way to fix this or is the what "non-portable" means (among other things)
roman