From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14456 invoked by alias); 29 Oct 2006 20:02:26 -0000 Received: (qmail 13966 invoked by alias); 29 Oct 2006 20:02:14 -0000 Date: Sun, 29 Oct 2006 20:02:00 -0000 Message-ID: <20061029200214.13965.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/24978] ICE in gfc_assign_data_value_range In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sgk at troutmask dot apl dot washington dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-10/txt/msg02486.txt.bz2 List-Id: ------- Comment #7 from sgk at troutmask dot apl dot washington dot edu 2006-10-29 20:02 ------- Subject: Re: ICE in gfc_assign_data_value_range > Should we simply avoid the ice, perhaps accepting the invalid code or do we > want to search for duplicates in the DATA statements and generate an error? > > Also, > > Is this valid?: > > real :: a(5,5) > DATA a(1,1), a(3,1), a(1,2), a(3,3) /2*1.0, 2*2.0/ > DATA a(2,1) /2.5/ > > In other words, no overlap in the DATA statements. It is a big difference if > we have to search element by element. I suspect this is why this is not a > constraint on the compiler, but is a restriction on the programmer, so to > speak. > NAG compiles the following code: real :: a(5,5) DATA a(1,1), a(3,1), a(1,2), a(3,3) /2*1.0, 2*2.0/ DATA a(2,1) /2.5/ print *, a(1,1), a(3,1), a(1,2), a(3,3), a(2,1) end program and gives the expected output. If a(2,1) is changed to a(3,3), then NAG generates laptop:kargl[209] f95 -o z t.f90 Error: t.f90, line 3: Element no. 13 of object A already initialised Errors in declarations, no further processing for $main$ [f95 error termination] -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24978