This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Committed] Eliminate no-op moves in expand_assignment
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: roger at eyesopen dot com (Roger Sayle)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Apr 2006 12:55:02 -0400 (EDT)
- Subject: Re: [Committed] Eliminate no-op moves in expand_assignment
>
>
> Whilst investigating PR middle-end/18041 I discovered that nowhere
> in GCC are we eliminating no-op bitfield assignments. For example,
> given the source code:
>
> typedef struct {
> unsigned int bit0 : 1;
> unsigned int bit1 : 1;
> } T;
>
> void foo(T *p)
> {
> p->bit1 = p->bit1;
> }
>
> on x86 with -O2 -fomit-frame-pointer mainline currently generates:
This should also fix PR 22538 which I filed after Daniel's patch
was committed and caused an ICE on the code in the bug report
(yes this actually does show up in GCC).
-- Pinski