Re: BIT_FIELD_REF considered harmful

2006-02-23 Thread Diego Novillo
Ian Lance Taylor wrote: > Any thoughts on whether this is a good idea? > I agree. Long ago I had a similar situation with CCP not being able to do some trivial propagation because a variable of an enum type was being accessed with BIT_FIELD_REFs hiding the real values. I will try to find my mes

BIT_FIELD_REF considered harmful

2006-02-23 Thread Ian Lance Taylor
Currently, when we see code that compares a bitfield to a constant, in some cases we will turn the bitfield from a COMPONENT_REF into a BIT_FIELD_REF. For example, this test case is based on PR 22563: struct s { int a : 3; }; struct s g; int foo () { g.a = 2; return g.a != 2; } In .003t.