------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-22 23:08 
-------
Note on the mainline now the loops are empty which is correct.
This testcase will produce code but I cannot reproduce this on PPC or on x86:
#ifdef MY_PURE
extern  double mycos (double) __attribute__ ((pure));
extern  double mysin (double) __attribute__ ((pure));
#elif defined MY_CONST
extern  double mycos (double) __attribute__ ((const));
extern  double mysin (double) __attribute__ ((const));
#else
extern  double mycos (double);
extern  double mysin (double);
#endif

struct my_complex
{
  double re;
  double im;
};


int main(void) {

  struct my_complex u[2048];
  int i;
  for (i = 0; i < 2048; ++i)
    {
      u[i].re = 1.0;
      u[i].im = 0.0;
    }

  for (i = 0; i < 2048; ++i) {
    struct my_complex *p = u;
    unsigned int j;
    for (j = 0; j < 2048; ++j) {
      double ur = p->re;
      double ui = p->im;
      double u2 = ur * ur + ui * ui;
      double cosv = mycos (u2);
      double sinv = mysin (u2);
      p->re = p->re * cosv - p->im * sinv;
      p->im = p->im * sinv +  p->re * cosv;
      ++p;
    }
  }
  for (i = 0; i < 2048; ++i) {
    f(u[i]);
  }
}


Does this still happen on SPARC also?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5739

Reply via email to