https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93535

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
(testing clang++ -O2 -ffast-math is useful as well)
It would be more helpful if you could isolate some specific transformations
that gcc is missing, instead of one big benchmark.

For instance:

double f(int n){
  double d=0;
  for(int i=0;i<100000;++i)
    d+=2;
  return d;
}

With -O3 -ffast-math, gcc keeps the original scalar loop.

(on variants of the testcase) Clang unrolls the loop, so it can do d+=20 for
fewer iterations, or it vectorizes (strangely).
If it is going to get wrong results, they might as well go all in and replace
the loop with a multiplication return 2*100000.

The example above might not be representative at all of the benchmark.

Reply via email to