From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22036 invoked by alias); 12 Mar 2007 05:33:38 -0000 Received: (qmail 22005 invoked by uid 48); 12 Mar 2007 05:33:28 -0000 Date: Mon, 12 Mar 2007 05:33:00 -0000 Message-ID: <20070312053328.22004.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/31139] sum(w_re(1:nn,1)*fi(i(1:nn, ii))) up to 3.5x slower than C version In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01030.txt.bz2 ------- 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