------- Comment #2 from pluto at agmk dot net 2006-08-02 10:58 ------- (In reply to comment #0) > #define __REG32 volatile unsigend long > > typedef struct > { > __REG32 Bit0 :1; > __REG32 Bit1 :1; > ...etc... > __REG32 Bit31 :1; > }__Bitfield; > > #define ADDRESS <address of my register> > > #define REG (*( __REG32 *)(ADDRESS)) > #define REG_bit (*(__Bitfield *)®) > > When I access the register using the bitfield I get the code like the > following > > LCD_bit.Backlight=1; //?? > 358: e3a0320e mov r3, #-536870912 ; 0xe0000000 > 35c: e283390a add r3, r3, #163840 ; 0x28000 > 360: e5d32001 ldrb r2, [r3, #1] > 364: e3822004 orr r2, r2, #4 ; 0x4 > 368: e5c32001 strb r2, [r3, #1] >
this code isn't wrong. gcc doesn't know that is a register mapped into arm address space which requires full-word access. imo this is a dup of PR23623. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28568