From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30162 invoked by alias); 10 Feb 2013 19:59:54 -0000 Received: (qmail 30069 invoked by uid 48); 10 Feb 2013 19:59:38 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51976] [F2003] Support deferred-length character components of derived types (allocatable string length) Date: Sun, 10 Feb 2013 19:59: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: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pault 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: 2013-02/txt/msg00990.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51976 --- Comment #8 from Dominique d'Humieres 2013-02-10 19:59:37 UTC --- With the patch in comment #7 most of the duplicates compile and run, but: pr49050 which gives pr49050.f90:13.10: item = item_type('key') 1 Error: No initializer for component '_key' given in the structure constructor at (1)! (note that the original code at http://gcc.gnu.org/ml/fortran/2011-05/msg00129.html compiles but segfault at runtime); pr51550 which gives an ICE gimplification failed: 0 constant 0> pr51550.f90: In function 'add_key_only': pr51550.f90:64:0: internal compiler error: gimplification failed allocate( character(len=len(key)) :: value%key ) ^ and a similar error for the test in comment #6 type t character(len=:), pointer :: str end type t type(t), pointer :: strarray(:), strarray2(:) allocate(strarray(3), strarray2(3)) allocate(character(len=5) :: strarray(1)%str, strarray2(1)%str) allocate(character(len=7) :: strarray(2)%str, strarray2(2)%str) allocate(character(len=2) :: strarray(2)%str, strarray2(3)%str) ! forall(i=1:3) strarray2(i)%str = strarray(i)%str print *, (len(strarray2(i)%str), i=1,3) end gimplification failed: 0 constant 0> pr51976_1.f90: In function 'MAIN__': pr51976_1.f90:7:0: internal compiler error: gimplification failed allocate(character(len=5) :: strarray(1)%str, strarray2(1)%str) ^ If the FORALL is uncommented, the ICE is pr51976_1.f90: In function 'MAIN__': pr51976_1.f90:11:0: internal compiler error: in gfc_add_modify_loc, at fortran/trans.c:159 forall(i=1:3) strarray2(i)%str = strarray(i)%str ^ At runtime the test attached to pr48654 gives a segmentation fault (fixed by the revised patch sent privately). The iso_varying_string I have in store also compiles and run (limited testing).