This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Incorrect bitfield aliasing with Tree SSA
> The "alias set of the field" would be that of its type, for example
> 'int'. Your patch will cause any indirect memory access through a
> pointer to 'int' to be deemed conflicting with any access to the
> field, which is precisely what DECL_NONADDRESSABLE_P is meant to
> avoid.
You are not answering my question of how the alias set of the field is
ever used in RTL if the purpose of the flag is *not* to use it (but
use its parent).
I read all the way to the end of this thread in the hope that things would be
clarified by the time I got back online. It's a little clearer, but there
was still no direct answer to that question and I think it's important that
there be.
The *whole point* here is that the "alias set of the field" is *not* used
in that case: it's not supposed to be.
I use the term in quotes because I don't really like to think of fields as
*having* an alias set. *Expressions*, more precisely the subset of those
that reference memory, are what have alias sets. get_alias_set does it
precisely right and the relevant function is component_uses_parent_alias_set.
If I have
struct foo {int i; float f;} bar;
and the first field is DECL_NONADDRESSABLE_P, what it means is that *for
every aliasing purpose*, a reference to that field is to be treated the
same way you'd treat a reference to the entire structure, meaning it
should have the alias set of BAR, which is exactly what get_alias_set does.