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: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2008 15:29:03 -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 #5 from jakub at gcc dot gnu dot org 2008-11-21 15:29 -------
4.4 compiles this (at least at -O2) into:
movb $70, conf
movb $-78, conf+1
movb $83, conf+2
movb $80, conf+3
so this looks then as a dup of PR22141. Testcase without the unnecessary
enum etc.:
union U
{
struct
{
unsigned f1 : 4;
unsigned f2 : 4;
unsigned f3 : 4;
unsigned f4 : 4;
unsigned f5 : 4;
unsigned f6 : 4;
unsigned f7 : 4;
unsigned f8 : 4;
} f;
unsigned g;
} u;
const union U def = { .f = { .f1 = 6, .f2 = 4, .f3 = 2, .f4 = 11,
.f5 = 3, .f6 = 5, .f7 = 0, .f8 = 5 } };
void fn1 (void)
{
u = def;
}
void fn3 (union U *);
void fn2 (void)
{
union U v = def;
fn3 (&v);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37135