From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 79832 invoked by alias); 10 Aug 2015 12:03:29 -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 79770 invoked by uid 48); 10 Aug 2015 12:03:24 -0000 From: "mexas at bristol dot ac.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67171] New: [6.0 regression] sourced allocation Date: Mon, 10 Aug 2015 12:03: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: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mexas at bristol dot ac.uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 cc target_milestone 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: 2015-08/txt/msg00634.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67171 Bug ID: 67171 Summary: [6.0 regression] sourced allocation Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mexas at bristol dot ac.uk CC: vehre at gcc dot gnu.org Target Milestone: --- program z implicit none real, allocatable :: d(:,:), tmp(:,:) integer :: i, errstat allocate( d( 100, 2 ), source = 0.0, stat=errstat ) d(:,1) = (/ ( real(i), i=1,100) /) d(:,2) = (/ ( real(2*i), i=1,100) /) write (*,*) d( 1, :) call move_alloc( from=d, to=tmp ) write (*,*) tmp( 1, :) allocate( d( 50, 2 ), source = tmp(1:50,:) , stat=errstat ) write (*,*) d( 1, :) deallocate( tmp ) end program z Correct output in gfortran 5: $ gfortran5 -Wl,-rpath=/usr/local/lib/gcc5 z.f90 $ ./a.out 1.00000000 2.00000000 1.00000000 2.00000000 1.00000000 2.00000000 Wrong output in gfortran 6: $ gfortran6 -Wl,-rpath=/usr/local/lib/gcc6 z.f90 $ ./a.out 1.00000000 2.00000000 1.00000000 2.00000000 4.00000000 0.00000000 This is on FreeBSD 10.1-RELEASE-p16 amd64