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: [PATCH] Tree SRA and atomicity/volatility


On 1/8/07, Eric Botcazou <ebotcazou@adacore.com> wrote:
> > 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.

Oh, so the only problem you see are for structure copies that are decomposed by SRA? Still, middle-end support for this kind of stuff could be useful - maybe using volatile bitfields instead of a volatile structure type.

struct val {
 volatile unsigned val1 : 8;
 volatile unsigned val2 : 8;
};

(at the moment accesses to the above are also decomposed by expand).

Richard.


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