From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9745 invoked by alias); 17 Oct 2012 09:23:03 -0000 Received: (qmail 9644 invoked by uid 48); 17 Oct 2012 09:22:41 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/54932] Invalid loop code generated by Fortran FE for loops with bounds in HIGH(type) Date: Wed, 17 Oct 2012 09:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: 2012-10/txt/msg01527.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54932 --- Comment #3 from Richard Biener 2012-10-17 09:22:41 UTC --- "7.1.5.2.4 Evaluation of numeric intrinsic operations" "The execution of any numeric operation whose result is not defined by the arithmetic used by the processor is prohibited." Hm, the arithmetic used by the processor specifies that HUGE(i) + 1 is -INF. Does that mean the value after the loop should be the wrapped value? >>From the sentence above I do not read that the standard requires a specific behavior, just that it prohibits undefined behavior. Which means this is similar to C implementation specific behavior? Does the standard require us to be consistent there then? Currently GCC assumes signed overflow invokes undefined behavior.