This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Handle missing optional MASK for intrinsics
- From: Dominique d'Humières <dominiq at lps dot ens dot fr>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 31 Dec 2018 13:32:50 +0100
- Subject: Re: [patch, fortran] Handle missing optional MASK for intrinsics
Hi Thomas,
Another glitch: the following test (reduced from gfortran.dg/optional_absent_4.f90)
module z
implicit none
contains
subroutine findloc_4 (input, val, res, mask)
logical, intent(in), optional :: mask(:,:)
integer, intent(in) :: input(:,:)
integer, dimension(:), intent(out) :: res
integer, intent(in) :: val
integer :: n = 1
res = findloc(input, val, dim=n)
end subroutine findloc_4
end module z
program main
use z
implicit none
integer :: i2(2,3) = reshape([1,2,4,8,16,32], [2,3])
integer, dimension(3) :: res3
res3 = -2
call findloc_4 (i2, 4, res3)
end program main
gives at runtime
a.out(77719,0x10335e5c0) malloc: Incorrect checksum for freed object 0x7fb131403d50: probably modified after being freed.
Corrupt value: 0x0
a.out(77719,0x10335e5c0) malloc: *** set a breakpoint in malloc_error_break to debug
Program received signal SIGABRT: Process abort signal.
TIA,
Dominique