[RFC] Don't completely scalarize a record if it contains bit-field (PR tree-optimization/45144)
Jie Zhang
jie@codesourcery.com
Fri Jul 30 16:21:00 GMT 2010
PR tree-optimization/45144 shows an issue that SRA causes. I used
arm-none-eabi target as an example in PR tree-optimization/45144. But
the same issue can also been seen on x86_64-linux-gnu target using the
same test case in the PR.
SRA completely scalarizes a small record. But when the record is used
later as a whole, GCC has to make the record out of the scalar parts.
When the record contains bit-fields, GCC generates ugly code to assemble
the scalar parts into a record.
Until the aggregates copy propagation is implemented, I think it would
better to disable full scalarization for such records. The patch is
attached. It's bootstrapped on x86_64-linux-gnu and regression tested.
Is it OK for now? We can remove it after aggregates copy propagation is
implemented.
Will it be better to add bit-field check in type_consists_of_records_p
instead of using a new function "type_contains_bit_field_p"?
Regards,
--
Jie Zhang
CodeSourcery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-not-full-scalarize-bitfield.diff
Type: text/x-patch
Size: 2450 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100730/3472707e/attachment.bin>
More information about the Gcc-patches
mailing list