This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/37135] [4.3/4.4 Regression] code size increase for bit-fields assignment
- From: "etienne_lorrain at yahoo dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2008 19:31:26 -0000
- Subject: [Bug middle-end/37135] [4.3/4.4 Regression] code size increase for bit-fields assignment
- References: <bug-37135-1034@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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