This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] extra copy
- From: Dan Nicolaescu <dann at ics dot uci dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 13 Nov 2003 11:46:38 -0800
- Subject: [tree-ssa] extra copy
When compiled with -DEXTRA the snippet below generates worse
code than when not using -DEXTRA
struct Complex_i
{
int re;
int im;
};
struct Complex_i Zi;
void bar()
{
struct Complex_i * factorpointer;
struct Complex_i factor;
factor.re = 123;
factor.im = 428;
#ifdef EXTRA
factorpointer = &factor; /* factorpointer is never used! */
#endif
Zi = factor;
}
Looking at the .generic dump when using -DEXTRA:
bar ()
{
struct Complex_i factor.1;
struct Complex_i * factorpointer;
struct Complex_i factor;
factor.re = 123;
factor.im = 428;
factorpointer = &factor;
factor.1 = factor; <- extra copy created here
Zi = factor.1;
}
and extra var "factor.1" and a copy statement are created.
The copyprop pass (or any other pass) does not get rid of the extra
copy, and the RTL optimizers don't do it either.
I don't know if this is a known issue, but it might ring a bell for
someone...