This is the mail archive of the gcc-patches@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]

Re: [tree-ssa] Re: PATCH: [gcc3.5 improvement branch] Very Simple constant propagation



On Jan 15, 2004, at 3:28 PM, Jan Hubicka wrote: [caroline's example:]
The test code for this problem is:

float *a, *b;

float  foo () {
  int i;
  float sum = 1.0;
  for (i = 0; i < 4; i++)
     sum *= a[i]/b[i];
}
And here is proposed patch.
Bootstrap/regress on i386 in progress, OK if it passes?

I doubt it. The point of the code you're removing is to replace the division
with multiplication inside the loop in cases like this (-ffast-math):


extern void bar(double);
void foo(float b) {
   int i;
   for (i=0; i<10; i++)
     bar(i/b);
}

Your patch fixes Caroline's example, but I suspect it breaks this one.


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