[Bug optimization/15256] New: [tree-ssa] Optimize manual bitfield manipilation.
kazu at cs dot umass dot edu
Mon May 3 08:03:00 GMT 2004
It would be nice if we can convert foo into bar.
foo (unsigned int eax)
unsigned int edx = eax & 1;
edx ^= 1;
eax &= -2;
eax |= edx;
bar (unsigned int eax)
return eax ^ 1;
The last SSA form looks like:
unsigned int edx;
edx_2 = eax_1 & 1;
edx_3 = edx_2 ^ 1;
eax_4 = eax_1 & 0fffffffe;
eax_5 = eax_4 | edx_3;
This testcase is inspired by
This sequence of four instructions is a little too tough for the combiner to
chew as it only considers three insturctions at one time.
Note that some people manually implement bitfields
without relying on ":" in a struct.
Summary: [tree-ssa] Optimize manual bitfield manipilation.
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
More information about the Gcc-bugs