From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14345 invoked by alias); 21 May 2013 12:31:14 -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 Received: (qmail 13595 invoked by uid 48); 21 May 2013 12:30:42 -0000 From: "vladimir.fuka at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57354] New: Wrong run-time assignment of allocatable array of derived type with allocatable component Date: Tue, 21 May 2013 12:31:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vladimir.fuka at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-05/txt/msg01443.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57354 Bug ID: 57354 Summary: Wrong run-time assignment of allocatable array of derived type with allocatable component Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: vladimir.fuka at gmail dot com Created attachment 30154 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30154&action=edit realloc.f90 source: type t integer,allocatable :: i end type type(t) :: e type(t), allocatable :: a(:) do i=1,100 e%i = i if (.not.allocated(a)) then a = [e] else a = [a, e] end if end do print *, (a(i)%i, i=1,size(a)) end gcc version 4.8.1 20130509 (prerelease) (GCC) expected result: 1,2..100 actual result: gfortran realloc.f90 ./a.out 32338624 32338560 32338496 32338432 32338368 32338304 32338240 32338176 32338112 32338048 32337920 32337856 32337792 32337728 32337664 32337600 32337536 32337472 32338016 32337952 32337232 32337168 32337104 32337040 32336976 32337408 32337344 32336816 32336752 32336688 32336624 32336096 32336032 32335968 32336912 32336512 32336448 32336384 32336352 32336288 32336224 32335872 32336160 32335680 32335248 32334864 32334528 32334240 32333952 32333888 32333952 32334240 32334528 32334864 32335248 32335680 32336160 32335872 32336224 32336288 32336352 32336384 32336448 32336512 32336912 32335968 32336032 32336096 32336624 32336688 32336752 32336816 32337344 32337408 32336976 32337040 32337104 32337168 32337232 32337952 32338016 32337472 32337536 32337600 32337664 32337728 32337792 32337856 32337920 32338048 32338112 32338176 32338240 32338304 32338368 32338432 32338496 32338560 32338624 100 (the garbage differs on each run)