From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1657 invoked by alias); 7 Dec 2006 20:01:06 -0000 Received: (qmail 1586 invoked by uid 48); 7 Dec 2006 20:00:51 -0000 Date: Thu, 07 Dec 2006 20:01:00 -0000 Message-ID: <20061207200051.1585.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/30038] Call to sin(x), cos(x) should be transformed to sincos(x) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus 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: 2006-12/txt/msg00638.txt.bz2 ------- Comment #10 from burnus at gcc dot gnu dot org 2006-12-07 20:00 ------- Using the three patches: http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00500.html http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00499.html http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00476.html gfortran is able to use sincos - and does so for my example (comment #0; the example, however, cannot be vectorized). For fatigue.f90 I have the following timings: gfortran: 21s ifort: 11s sunf95: 8.3s The timings for gfortran don't change with the patch as sincos is NOT used. If I make it obvious for the compiler that I have the same argument by using: mySin = sin( ... ) myCos = cos( ... ) expr = ... * mySin then sincos is used and the execution time drops to 8.7s. (And remains unchanged for ifort and sunf95.) The unmodified source looks like: coefficient = (radius(n) / radius_of_curvature) & * sin(twopi * real(spin_frequency,LONGreal) * time) strain_tensor(1,1,n) = - coefficient * Poissons_ratio strain_tensor(2,2,n) = - coefficient * Poissons_ratio strain_tensor(3,3,n) = coefficient ! coefficient = twopi * real(spin_frequency,LONGreal) & * (radius(n) / radius_of_curvature) & * cos(twopi * real(spin_frequency,LONGreal) * time) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30038