From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4217 invoked by alias); 28 Nov 2012 11:04:00 -0000 Received: (qmail 3621 invoked by uid 48); 28 Nov 2012 11:03:35 -0000 From: "burnus 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 11:04: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: burnus 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: CC 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/msg02708.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55501 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #9 from Tobias Burnus 2012-11-28 11:03:34 UTC --- (In reply to comment #7) > - if (tsource->expr_type != EXPR_CONSTANT > - || fsource->expr_type != EXPR_CONSTANT > - || mask->expr_type != EXPR_CONSTANT) > + if (mask->expr_type != EXPR_CONSTANT) > return NULL; That makes sense: If mask is a constant scalar, tsource or fsource can be used. That patch is pre-approved. However, at some point one has also to simplify: MERGE([1,2],[11,22], [.true.,.false.]) and for that case, all arguments have to be gfc_is_constant_expr(). At least Fortran 2008 requires that the processor can do such a simplification. (One could also handle the special case that mask is an array of only .true. or only .false.)