pro64-support
[Top] [All Lists]

Re: unoptimized dead store

To: stuart@xxxxxxxxx, pro64-support@xxxxxxxxxxx
Subject: Re: unoptimized dead store
From: Jim Kingdon <jkingdon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 May 2001 13:09:02 -0700
References: <200105091937.MAA16065@xxxxxxxxxxxxxx>
Sender: owner-pro64-support@xxxxxxxxxxx
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>