On Thu, Nov 12, 2020 at 11:29:21AM +0100, Jan Hubicka wrote: > > If OEP_ADDRESS is used also on non-addressable stuff, just to compare > > that two COMPONENT_REFs access the same memory, then just comparing > > DECL_BIT_FIELD_REPRESENTATIVE is not sufficient, you could have: > > struct S { int c; int a : 7, b : 1; }; > > struct T { int c; int a : 7, b : 1; }; > > and compare s->a vs. t->b with OEP_ADDRESS and the offsets of their > > DECL_BIT_FIELD_REPRESENATIVE is the same, yet we don't want to say > > the two bit-fields are the same. > > You are right, I was just thinking of that. I suppose it indeed makes > more sense to assert that there are no bitfields here and in the AO > comparsion take care of stripping the last bitfield reference and > handling it specially?
Or just compare DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET of the fields rather than their DECL_BIT_FIELD_REPRESENTATIVE? Jakub