From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17800 invoked by alias); 28 Nov 2012 09:16:30 -0000 Received: (qmail 17723 invoked by uid 48); 28 Nov 2012 09:16:14 -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 09:16: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: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Status Last reconfirmed CC Summary Ever Confirmed 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/msg02681.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55501 janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2012-11-28 CC| |janus at gcc dot gnu.org Summary|ICE using MERGE in constant |[F03] ICE using MERGE in |expr |constant expr Ever Confirmed|0 |1 --- Comment #2 from janus at gcc dot gnu.org 2012-11-28 09:16:13 UTC --- I can confirm this error. It occurs with all gfortran versions I tried (starting from 4.3 up to the current trunk). Slightly compactified test case: module test type MPI_Datatype integer :: mpi_val end type type(MPI_Datatype) :: MPI_INTEGER = merge(MPI_Datatype(4), MPI_Datatype(8), .false.) end module Apparently the declaration needs to be in a module for the error to occur, and also derived types need to be involved. Using -std=f95, the test case is correctly rejected (without ICE): type(MPI_Datatype) :: MPI_INTEGER = merge(MPI_Datatype(4), MPI_Datatype(8), . 1 Error: Fortran 2003: Elemental function as initialization expression with non-integer/non-character arguments at (1)