https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85631
Bug ID: 85631
Summary: Runtime error message array bound mismatch with
nonzero optimization
Product: gcc
Version: 8.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: zeccav at gmail dot com
Target Milestone: ---
Host: x86_64-pc-linux-gnu
! Runtime error message on good Fortran
! gfortran -O -g -fcheck=bounds
! must be compiled and run
!At line 20 of file pcp2k.f
!Fortran runtime error: Array bound mismatch for dimension 1 of array
'__var_1_mma' (0/2)
!Error termination. Backtrace:
!#0 0x1496530ec2de in ???
!#1 0x1496530ece89 in ???
!#2 0x1496530ed26b in ???
!#3 0x40082d in MAIN__
! at /home/vitti/test/pcp2k.f:8
!#4 0x40086e in main
! at /home/vitti/test/pcp2k.f:9
integer, parameter :: N=2
real, dimension(:,:), pointer :: block_1, block_2
allocate(block_1(N,N),block_2(N,N))
block_1=0
block_2=0
block_1 = MATMUL(TRANSPOSE(block_1), block_2)
end