pro64-support
[Top] [All Lists]

RE: unoptimized dead store

To: "'Jim Kingdon'" <jkingdon@xxxxxxxxxxxxxxxxxxxx>, stuart@xxxxxxxxx, pro64-support@xxxxxxxxxxx
Subject: RE: unoptimized dead store
From: "Chan, Sun C" <sun.c.chan@xxxxxxxxx>
Date: Wed, 9 May 2001 13:15:20 -0700
Sender: owner-pro64-support@xxxxxxxxxxx
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 ;

> > }

> 


<Prev in Thread] Current Thread [Next in Thread>