------- Comment #2 from etienne_lorrain at yahoo dot fr 2008-08-17 19:31 ------- It is not related to bitfields, this also show the problem: struct color { unsigned char red, green, blue, transparent; } cur_color; static const struct color mycolor = { 200, 10, 30, 0 }; void fct(void) { cur_color = mycolor; } with gcc-4.3.1 cur_color is initialised with 4 "movb" (so address is encoded 4 times) and with gcc-4.2 with a 32 bits constant and a single "movl".
It seems to be the old problem of gcc not having a "write combining" pass (converting consecutive byte/word writes into single double word writes), and the "fix" of defining an intermediate variable is no more working. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37135