This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/49479] New: [4.6/4.7 Regression] reshape / optionals / zero sized arrays


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]