On Wed, 2005-10-12 at 09:51 -0400, Diego Novillo wrote:
> On Tuesday 11 October 2005 22:16, Daniel Berlin wrote:
> > On Tue, 2005-10-11 at 20:44 -0400, Diego Novillo wrote:
> > > On Tuesday 11 October 2005 20:30, Daniel Berlin wrote:
> > > > BTW, you are also screwing up the upwards fud-chains in cases where
> > > > it really does clobber A, since you'll get the exact same as above,
> > > > and thus, A_1 won't be linked to the may-def at the clobber site,
> > > > but to the "real def" that last occurs.
> > >
> > > No. Without GV, there *will* be a VMD for A at the call to foo().
> >
> > Uh, no, no there won't.
> > Look at get_call_expr_operands, at the not_read/not_written stuff.
> >
> You snipped too much from our original conversation. For the benefit of
> the list, the original code was:
>
> static int a;
> int q;
> static int foo ()
> {
> *q = 5;
> return *q;
> }
>
>
> int main(void)
> {
> a = 6;
> foo ();
> printf ("%d\n", a);
> }
>
> (I suppose you meant 'int *q', but that's OK). I said that if we decide
> *not* to use .GLOBAL_VAR (GV), we would get a V_MAY_DEF for 'a' at the
> call to foo(). The IPA info for 'a' better not think that foo() is
> harmless to 'a'.
I'll follow up to the rest, but
It does, because foo *is* harmless to a.
a is static.
It never has it's address taken in any function, thus there is no way
for *q to have modified a. We know this.
Thus, foo *is* harmless to a.
Please explain why you believe foo harms a.