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: alias.c:nonoverlapping_component_refs_p




On Mon, 3 Dec 2001, Richard Kenner wrote:

>     Even for C I'm not sure this is always safe. For example, if we have a
>     struct in C with two tightly packed char's, then it may be the case
>     that writing to one field requires updating both (presumably using
>     masking to preserve the old value). How would one represent this kind
>     of aliasing?
>
> I believe you are right: this can occur even in C, though a more common
> example is bit fields: two MEMs made for accesses to two different bits in
> the same byte will certainly alias, but this code will say they won't.
>

Errr, try it.
I just did, and it says they alias.


struct test
{
	int a:4
	int b:3
	int c:1
};

Accesses to a, b, and c all get marked as "test+0", and conflict.

--Dan


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