> > Exactly. Gigi makes sure that a full-word load is always possible, but
> > it relies on the side-effectness for keeping it together.
>
> I don't see where the tree-ssa part of the middle-end guarantees this and
> also expand does not seem to honor this as then we'd get a full load
> for every component load. It looks to me that for a component write
> you then need a read-modify-write cycle as we get for targets that
> don't support sub-word loads/stores and/or strict-alignment targets.
I'm not sure I understand, maybe my wording was ambiguous. Gigi has all the
magic to support atomicity (type wrapping, alignment tweaking, countermeasure
for problematic targets, e.g. Alpha, and so on) and generates the full-word
access on its own. The only requirement is for the middle-end to fully honor
the TREE_THIS_VOLATILE and TREE_SIDE_EFFECTS flags.