From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25896 invoked by alias); 2 Dec 2011 16:38:36 -0000 Received: (qmail 25842 invoked by uid 22791); 2 Dec 2011 16:38:35 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Dec 2011 16:38:22 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/50904] [4.7 regression] pessimization when -fno-protect-parens is enabled by -Ofast Date: Fri, 02 Dec 2011 16:38:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-12/txt/msg00183.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50904 --- Comment #32 from Dominique d'Humieres 2011-12-02 16:37:37 UTC --- > And for the sake of completeness the evaluation of sub above and > > subroutine sub2(x) > real*8 x > x = (x + 2.d0**52) - 2.d0**52 > end subroutine sub2 > > should behave consistently if I read your Fortran standard > quotations correctly. According my reading of > "Once the interpretation of a numeric intrinsic operation is established, the > processor may evaluate any mathematically equivalent expression, provided that > the integrity of parentheses is not violated." this is different from > subroutine sub(x) > real*8 x, tem > tem = x + 2.d0**52 > x = tem - 2.d0**52 > end subroutine sub where 'x=tem-2.d0**52' can be evaluated as 'x=x+2.d0**52-2.d0**52' then as 'x' (as long as x and tmp are of the same kind(?)), while in the former case '(x + 2.d0**52) - 2.d0**52' is prohibited by the standard to be evaluated as 'x'. Note that if I replace 'tem = x + 2.d0**52' with 'tem = (x + 2.d0**52)', I get 1.0 unless I use -fno-protect-parens. All this has been discussed previously, but the only pr I have been to find is pr32172.