This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31139] sum(w_re(1:nn,1)*fi(i(1:nn, ii))) up to 3.5x slower than C version
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 05:33:28 -0000
- Subject: [Bug fortran/31139] sum(w_re(1:nn,1)*fi(i(1:nn, ii))) up to 3.5x slower than C version
- References: <bug-31139-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2007-03-12 05:33 -------
The problem here is obvious, in the Fortran case, there is a temp array being
created while in the C case, there is not. Also in the optimized C case, the
multiplication of the complex numbers is incorrect unless you add -ffast-math.
Actually I think in both C cases it is incorrect. Can someone try with
-ffast-math for both the C and Fortran cases?
complex * complex is not a simple cross product in FP world.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31139