When putting things into a bit-field struct, extra
useless instructions are generated.
Harmless, but not very optimal.
gcc version 2.95.2 19991024
gcc -S -O2 bug.c
State-Changed-Why: Known problem. Unlikely to be fixed in the near future.
*** Bug 8013 has been marked as a duplicate of this bug. ***
This might be fixed by the patch proposed in:
My patch is unrelated to this.
This bug has now been fixed for gcc 4.0. For the testcase attached to the PR,
mainline now generates the following code on sparc-sun-solaris2.8 with -O2:
fun: ld [%sp+64], %o5
sll %o0, 2, %g1
mov %o5, %o0
or %g1, 2, %g1
st %g1, [%o5]
i.e. we've now eliminated the unnecessary "and" and "or" instructions, that
were present in 2.95.2 (and still present in 3.4.3).