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

[Bug rtl-optimization/49148] Certain expressions take an extremely long time for no apparent reason


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

--- Comment #7 from John Peyton <jchthys at yahoo dot com> 2011-05-25 14:40:56 UTC ---
> Try -ffast-math (the default for ICC) which disables subnormals.

Thanks, this helped it run much faster!

I noticed it still takes longer to divide by 3.0 than by 4.0. More
specifically, the following line was fast:

     new[i] = (A[i-1] + 2*A[i] + A[i+1]) / 4.0;

The following line took about 4 times as long to run without -ffast-math:

     new[i] = (A[i-1] + A[i] + A[i+1]) / 3.0;

With -ffast-math, it was faster; however, it was still took about 2 times as
long as the division by 4.0 version. In addition, changing division by 3.0 to
multiplication by 0.333 or even 0.3 did not affect the speed.

Could this also be related to subnormal numbers, or is this just a different
issue?


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