[Bug fortran/94070] Assumed-rank arrays – bounds mishandled, SIZE/SHAPE/UBOUND/LBOUND
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 1 08:34:54 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94070
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Some bound issues were fixed with PR99043 – but my bet is that the BIND(C)
issues still exist. (→ testcase (C + Fortran) attached to this PR).
* * *
Additionally: PR 94020 (duplicate of this PR) with attachment 47960 seems to be
mostly fixed, however for the following case, the result is wrong.
if 'lb' (or second argument to 'foo') is >= 0, size2 == 0 – otherwise, size2 >
0'.
Expected:
same result as for PRODUCT(SHAPE(ARRAY,KIND))
(→ 16.9.179 SIZE (ARRAY [, DIM, KIND]))
That is:
lb = 5 → shape = [5 -1] → -5
lb = -12 → shape = [5 - 1] → -5
implicit none
integer :: A(5,5)
call foo(a,-12)
call foo(a,0)
call foo(a,5)
contains
subroutine foo(x,lb)
integer :: lb
integer :: x(5,lb:*)
print *, size2(x)
if (size2(x) /= -5) stop 1
end
integer function size2(y)
integer :: y(..)
size2 = size(y)
end
end
More information about the Gcc-bugs
mailing list