https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92925

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> So I wonder why we bother to feed 'bitpos' to 
> set_mem_attributes_minus_bitpos when we expect the MEM_ATTRS to be
> created from solely 'T' (do we?) and then later apply 'bitpos' via
> adjust_address or friends.

Because we derive information from T itself for MEM_EXPR and MEM_OFFSET, which
means that we need to preventively subtract BITPOS as I showed; if we don't do
the latter, the outcome of adjust_address would be incorrect.  If we don't want
to pass BITPOS, then we need to get rid of all the cases setting APPLY_BITPOS
in set_mem_attributes_minus_bitpos, i.e. basically derive nothing from T.

That being said, I agree that the mechanism is fragile.

Reply via email to