Sparc optimization problems

Keith Refson Keith.Refson@earth.ox.ac.uk
Tue May 2 07:03:00 GMT 2000


This is not strictly a bug bug an optimization/performance issue.  It
arose when I was investigating why a large floating-point code runs
30% slower on a sparc-sun-solaris2.8 system when compiled using gcc
2.95.2 compares with egcs-2.91.60 19981201. 

A look at the assembler output generated by the following snippet
reveals why:

-------------- next part --------------
void      qsincos(coshx,sinhx,cosky,sinky,coslz,sinlz,chg,
		  qcoskr,qsinkr,nsites)
double coshx[], sinhx[], cosky[], sinky[], coslz[], sinlz[],
     chg[], qcoskr[], qsinkr[];
int  nsites;
{
   int is;
   double qckr;
   
   for(is = 0; is < nsites; is++)
   {
      qckr =       chg[is]*( (coshx[is]*cosky[is] - sinhx[is]*sinky[is])*coslz[is] 
                           - (sinhx[is]*cosky[is] + coshx[is]*sinky[is])*sinlz[is]);
      qsinkr[is] = chg[is]*( (sinhx[is]*cosky[is] + coshx[is]*sinky[is])*coslz[is] 
   	                   + (coshx[is]*cosky[is] - sinhx[is]*sinky[is])*sinlz[is]);
      qcoskr[is] = qckr;
   }
}


More information about the Gcc-bugs mailing list