Actually xx is uninitialized, so value returned by main could
be anything. (BTW, I didn't see the original posting on what is the
problem.)
Sun
> -----Original Message-----
From: Jim Kingdon [mailto:jkingdon@xxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, May 09, 2001 1:09 PM
>
To: stuart@xxxxxxxxx; pro64-support@xxxxxxxxxxx
Subject: Re: unoptimized dead store
Looks
> interprocedural to me. The optimization
> is only possible if the compiler knows that
> the "glarp" function does not modify "a".
>
> (Look up "alias" in a compiler text, "restrict"
> in C99, similar rules for Fortran, &c).
>
> stuart@xxxxxxxxx wrote:
>
> > Clueless newbie here.
> >
> > Here's my test program:
> > ----------------------
> > int a, b ;
> >
> > main( int xx)
> > {
> > a = 2 ;
> > glarp( xx) ;
> > a++ ;
> > return a + b ;
> > }
> > glarp( int j)
> > {
> > extern int a ;
> >
> > if (j < 10)
> > bling( j-1) ;
> > }
> >
> > bling( int k)
> > {
> > extern int b ;
> >
> > b = k ;
> > }
>
|