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] 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... 


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