RFC/RFA: patch for PR 22156: improve SRA for bit-fields

Alexandre Oliva aoliva@redhat.com
Tue Mar 20 13:25:00 GMT 2007

On Mar 20, 2007, Alexandre Oliva <aoliva@redhat.com> wrote:

> I should probably have used a separate flag, but I started out
> misunderstanding how groups worked, and then, when I noticed I was
> looking for something entirely different, I had already started
> using the same flag.  I can change it if it bothers you.

Done in the patch below.

I've also fixed a couple of bugs that were present in the previous
version of the patch, one of which definitely caused a bootstrap
failure on x86 (surprisingly, not on x86_64): generate_one_element_ref
modified field instead of ret.  The other change was an improvement to
the recursion logic in generate_element_zero, which might refrain from
initializing field blocks unless called explicitly for it, and would
needlessly loop over their members instead of skipping them

The other change is an improvement to assignment to BIT_FIELD_REFs:
when assigning to the whole field block, we attempt to assign to the
entire variable, even if this means copying extraneous bits from the
source.  This should greatly improve the code generated to copy
partially-grouped data structures.

This is still undergoing testing, but I'd appreciate if people could
give it a spin on big-endian iron.  I've tried some testing of
embedded targets with simulators in a unified build tree, but it seems
that current dejagnu and the gcc/testsuite/<subdir> arrangements
aren't getting along together, and compilation fails to find newlib
headers in the newlib source tree.  I haven't been able to fix that
without breaking the GCC testsuite entirely, unfortunately.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-sra-bit-field-ref.patch
Type: text/x-patch
Size: 21010 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070320/eedfa8ea/attachment.bin>
-------------- next part --------------

Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

More information about the Gcc-patches mailing list