This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]