This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Tree-ssa dead store elimination





Sorry if there is an obvious answer for this, but I'm not to familiar with
the tree-ssa phase.

My question is, why doesn't tree-ssa-dse.c do anything to the following
code?

int i,j,k,l;

void p1() {

i = 1;      /* Dead store */
j = 2;
i = k;      /* Dead store after copy prop */
if (i == 1)
  l = 999;
i = 0;
junk();

}


Here's the t65.dse2 output:

p1 ()
{
  int i.1;
  int k.0;

<bb 0>:
  i = 1;
  j = 2;
  k.0_6 = k;
  i = k.0_6;
  if (k.0_6 == 1) goto <L0>; else goto <L1>;

<L0>:;
  l = 999;

<L1>:;
  i = 0;
  junk ();
  return;

}



The first store does finally get elminated by the rtl lifetime analysis but
the second store remains.

-Pat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]