pro64-support
[Top] [All Lists]

unoptimized dead store

To: pro64-support@xxxxxxxxxxx
Subject: unoptimized dead store
From: stuart@xxxxxxxxx
Date: Wed, 9 May 2001 12:37:28 -0700
Sender: owner-pro64-support@xxxxxxxxxxx
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 ;
}
----------------------

Here's my commandline:

% sgicc -O3 -IPA:inline=no -v -o test test.c >& log ; objdump -S test > test.dump ; more test.dump

I'm running this on a RedHat x86 box with NUE 1.0. My SGICC describes itself thusly:

 % sgicc -v
 SGIcc Compilers: Version 0.01.0-13

Here's my question:

I believe the store "a = 2" is dead, and that the SGICC
Interprocedural Analyzer should be able to discern this. If I allow
SGICC to use inlining (replace "-IPA:inline=no" with "-IPA"), this
store disappears. But then the deletion of this store isn't an
"interprocedural" optimization anymore :-) .

What am I missing? Why doesn't SGICC delete this store?

Thanks in advance,

stuart hastings

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