X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <4B028ED0.5070600@gmail.com> Date: Tue, 17 Nov 2009 11:53:52 +0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: gcc -ffast-math defect with tan(x) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com eric_backus AT agilent wrote: > > I get this output from both gcc-3 (which is 3.4.4) and from gcc-4 (which is 4.3.4), when -ffast-math is used. If I remove -ffast-math, I get the expected output of 0 for both d1 and d2. If I compile with -mno-cygwin on gcc-3, either with or without -ffast-math, I get the expected output of 0 for both d1 and d2. So the problem seems to be limited to -ffast-math, and to the cygwin (non-mingw32) platform, and perhaps to relatively recent versions of gcc. > > My completely uninformed guess is that this is a cygwin-specific defect in gcc. But I really don't know. > > Any ideas how I should deal with this would be helpful! Thanks for the STC. The difference between -ffast-math and -fno-fast-math is that the fast version calls the _f_tan newlib fast math function rather than tan. I think this is likely to be a calling-convention issue but I'm still debugging it. cheers, DaveK -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple