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 15:27:25 -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> <orabx31nqj.fsf@free.oliva.athome.lsd.ic.unicamp.br> <de8d50360704200109n6709f041jf96178bd00395481@mail.gmail.com>
On Apr 20, 2007, "Andrew Pinski" <pinskia@gmail.com> wrote:
> On 4/20/07, Alexandre Oliva <aoliva@redhat.com> wrote:
>> 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?
> Yes because they are using uninitialized variables, anything can
> happen so later passes are causing that weird stuff to happen.
But how is this different from setting a bit-field in a
formerly-uninitialized word? What you're seeing is the same, just
expressed in a slightly different way.
> Bernd's reload patch is just one example where GCC assumes
> uninitialized variables have an undefined value so it can use any
> register
And that would be correct behavior.
> and cause undefined behavior after that.
Now this would be a problem. But if it was, why wasn't it a problem
before? Just because the variable used to be in memory?
--
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}