This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Virtual operands of &a[1]?
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 26 Nov 2003 13:58:44 +0100
- Subject: [tree-ssa] Virtual operands of &a[1]?
Hello,
consider the following code:
int *foo(int i)
{
static int *a[100];
int **ai = a;
return ai[1];
}
This is translated into
ai_1 = &a;
T.1_2 = ai_1 + 4B;
# VUSE <MT.1_3>;
return *T.1_2;
Dominator optimization makes
ai_1 = &a;
# VUSE <a>;
T.1_2 = &a[1];
# VUSE <a>;
return a[1];
from it. The VUSE on the 'T.1_2 = &a[1]' statement is IMHO unnecessary
and I would like to get rid of it. Is it correct to assume that
anything inside ADDR_EXPR never creates VUSEs?
Zdenek