[Committed] Eliminate no-op moves in expand_assignment

Andrew Pinski pinskia@physics.uc.edu
Mon Apr 17 16:55:00 GMT 2006


> 
> 
> 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



More information about the Gcc-patches mailing list