From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 325 invoked by alias); 30 Jun 2011 17:29:07 -0000 Received: (qmail 314 invoked by uid 22791); 30 Jun 2011 17:29:06 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Jun 2011 17:28:53 +0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49586] Multiple initialization with DATA: Warning and initialization order X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr 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 Date: Thu, 30 Jun 2011 17:29:00 -0000 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: 2011-06/txt/msg03002.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49586 --- Comment #6 from Dominique d'Humieres 2011-06-30 17:28:48 UTC --- > Unfortunately, this patch breaks gfortran.fortran-torture/execute/data.f90 > compilation, it fails with a cryptic error. Confirmed. A reduced test is ! Program to test data statement program data call sub1() end subroutine sub1() integer i type tmp integer, dimension(4)::a real :: r end type type tmp1 type (tmp) t1(4) integer b end type type (tmp1) tmp2(2) ! Full array and scalar component initializer data tmp2(2)%t1(2)%r, tmp2(1)%t1(3)%a, tmp2(1)%b/220,136,137,138,139,10/ data tmp2(2)%t1(2)%a(3), tmp2(2)%t1(2)%a(1)/223,221/ end The error is emitted in show_loci in gcc/fortran/error.c when l1 == NULL || l1->lb == NULL With gdb I get Breakpoint 1, show_loci (l1=0x141d23260, l2=0x0) at ../../work/gcc/fortran/error.c:383 383 if (l1 == NULL || l1->lb == NULL) (gdb) p l1 $1 = (locus *) 0x141d23260 (gdb) p *l1 $2 = { nextc = 0x0, lb = 0x0 } (gdb) bt #0 show_loci (l1=0x141d23260, l2=0x0) at ../../work/gcc/fortran/error.c:383 #1 0x000000010002832d in error_print (type=0x100a46df1 "Error:", format0=0x100a63ad0 "non-constant initialization expression at %L", argp=0x7fff5fbfd128) at ../../work/gcc/fortran/error.c:627 Previous frame inner to this frame (gdb could not unwind past this frame)