This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Tree-ssa dead store elimination
- From: Pat Haugen <pthaugen at us dot ibm dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 13 Apr 2005 16:12:58 -0500
- Subject: 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