This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: alias: Varying struct and fixed scalar question
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Andreas Krebbel <krebbel1 at de dot ibm dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 1 Feb 2006 13:18:33 +0100
- Subject: Re: alias: Varying struct and fixed scalar question
- References: <20060201120207.GA3521@de.ibm.com>
On 2/1/06, Andreas Krebbel <krebbel1@de.ibm.com> wrote:
> Hi,
>
> in true_dependence (alias.c) a varying struct
> address is considered to never alias a fixed scalar value. This
> rule is triggered also in something like the following:
>
> struct foo { int n; };
> extern unsigned long c = 0;
>
> {
> int b;
>
> b = 2;
> ((struct foo*)(&b + c))->n = 3;
> }
I believe this is invalid due to the non-transitive alias relation
involved. I.e.
an access of an object of type struct foo through type int aliases, but not
the other way around.
Richard.