From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22964 invoked by alias); 5 May 2010 20:28:39 -0000 Received: (qmail 22840 invoked by uid 48); 5 May 2010 20:28:19 -0000 Date: Wed, 05 May 2010 20:28:00 -0000 Message-ID: <20100505202819.22839.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/43716] [4.6 Regression] Revision 158105 miscompiles doduc.f90 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mkuvyrkov 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: 2010-05/txt/msg00487.txt.bz2 ------- Comment #21 from mkuvyrkov at gcc dot gnu dot org 2010-05-05 20:28 ------- Dominique, Have you been able to identify if there is an invalid optimization? It seems using -ffast-math -ffinite-math-only is very error-prone. -ffast-math implies -fassociative-math, which can generate NaNs, and -ffinite-math-only can further worsen the precision by additional optimizations. It may not be obvious to a casual GCC user that -ffinite-math-only gives more freedom to the optimization passes, not restricts the compiler to keep all math finite. FYI, -fassociative-math Allow re-association of operands in series of floating-point operations. This violates the ISO C and C++ language standard by possibly changing computa- tion result. NOTE: re-ordering may change the sign of zero as well as ignore NaNs and inhibit or create underflow or overflow (and thus cannot be used on a code which relies on rounding behavior like (x + 2**52) - 2**52). May also reorder floating-point comparisons and thus may not be used when ordered comparisons are required. This option requires that both ‘-fno-signed-zeros’ and ‘-fno-trapping-math’ be in effect. Moreover, it doesn’t make much sense with ‘-frounding-math’. For Fortran the option is automatically enabled when both ‘-fno-signed-zeros’ and ‘-fno-trapping-math’ are in effect. The default is ‘-fno-associative-math’. ... -ffinite-math-only Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs. This option is not turned on by any ‘-O’ option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions. It may, however, yield faster code for programs that do not require the guarantees of these specifications. The default is ‘-fno-finite-math-only’. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43716