This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49479] New: [4.6/4.7 Regression] reshape / optionals / zero sized arrays
- From: "Joost.VandeVondele at pci dot uzh.ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Jun 2011 19:50:49 +0000
- Subject: [Bug fortran/49479] New: [4.6/4.7 Regression] reshape / optionals / zero sized arrays
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49479
Summary: [4.6/4.7 Regression] reshape / optionals / zero sized
arrays
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: Joost.VandeVondele@pci.uzh.ch
Currently, CP2K seems miscompiled with the 4.6 and 4.7 branches. The following
testcase is likely the issue:
MODULE M1
IMPLICIT NONE
CONTAINS
SUBROUTINE S1(data)
INTEGER, DIMENSION(:), INTENT(IN), &
OPTIONAL :: DATA
IF (PRESENT(data)) WRITE(6,*) SIZE(data)
END SUBROUTINE
SUBROUTINE S2(N)
INTEGER :: N
INTEGER, ALLOCATABLE, DIMENSION(:, :) :: blki
ALLOCATE(blki(3,N))
blki=0
CALL S1(RESHAPE(blki,(/3*N/)))
END SUBROUTINE
END MODULE
USE M1
CALL S2(0)
END
whereas gfortran 4.5 prints correctly 0, 4.6/4.7 print nothing.