From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18929 invoked by alias); 28 Nov 2012 12:22:20 -0000 Received: (qmail 18871 invoked by uid 48); 28 Nov 2012 12:22:03 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55501] [F03] ICE using MERGE in constant expr Date: Wed, 28 Nov 2012 12:22: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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: janus 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-11/txt/msg02714.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55501 --- Comment #11 from janus at gcc dot gnu.org 2012-11-28 12:22:02 UTC --- (In reply to comment #10) > The first two are runtime checks, which are basically identical. Here is a > reduced test case for these: > > implicit none > integer :: i(-1:1) = 0 > > print *, lbound(merge(i,i,.true.)) > print *, ubound(merge(i,i,.true.)) > > end > > Without the patch, this prints: > 1 > 3 > And with the patch: > -1 > 1 > > The output with the patch does look more reasonable to me. Or is there any > reason why the standard would demand the MERGE expression to have bounds of 1:3 > instead of -1:1 ? At least all of ifort, sunf95 and g95 agree with the first variant (1:3). [Btw, the bound_{2,7} test cases come from PR 29391.]