This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC/RFA: patch for PR 22156: improve SRA for bit-fields
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Andrew Pinski" <pinskia at gmail dot com>
- Cc: "Richard Henderson" <rth at redhat dot com>, "Eric Botcazou" <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Apr 2007 04:58:12 -0300
- Subject: Re: RFC/RFA: patch for PR 22156: improve SRA for bit-fields
- References: <or648xoi7m.fsf@free.oliva.athome.lsd.ic.unicamp.br> <200703191249.52321.ebotcazou@adacore.com> <or8xdsihdy.fsf@free.oliva.athome.lsd.ic.unicamp.br> <oraby8gs5m.fsf@free.oliva.athome.lsd.ic.unicamp.br> <20070320234004.GB28738@redhat.com> <orejnjca8r.fsf@free.oliva.athome.lsd.ic.unicamp.br> <orvegqjhu5.fsf@free.oliva.athome.lsd.ic.unicamp.br> <de8d50360704161430j5f879c75wb69792183b074ebe@mail.gmail.com>
Sorry about the delay, I've been away, completely off-line, for the
past couple of days.
On Apr 16, 2007, "Andrew Pinski" <pinskia@gmail.com> wrote:
> SR.32D.2339_34 = SR.12D.2319_33(D) & 0x0fff0000000000000;
> in the early SRA.
> See how SR.12D.2319_33(D) is the default SSA name, that is the bug.
I don't quite see why this would be a bug.
main's tmp variable is initialized from the return value of sub.
Since sub's tmp scalarized, we can't implement this as a block copy.
This means we initialize each field separately.
But then, we've scalarized main's tmp to a single 64-bit integer
variable so, in order to assign to the bit-fields in it, we have to
explicitly preserve the other bits we don't touch.
That's what the & above does. The only way we could avoid it would be
to somehow know that we're doing an initialization or a full copy,
rather than a single-field assignment, such that we could refrain from
preserving bits that we're yet to overwrite.
I can think of a few possible ways to do it, but I don't understand
why this should be necessary. Could anyone give me an idea of why
these (D)s should cause any problem?
Could it perhaps be that the full-width BIT_FIELD_REF assignment is
introducing some too-wide shifts or triggering corner cases of
bit-selection instructions?
Thanks,
--
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}