This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/49148] Certain expressions take an extremely long time for no apparent reason
- From: "jchthys at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 May 2011 14:40:59 +0000
- Subject: [Bug rtl-optimization/49148] Certain expressions take an extremely long time for no apparent reason
- Auto-submitted: auto-generated
- References: <bug-49148-4@http.gcc.gnu.org/bugzilla/>
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?