This is the mail archive of the gcc-patches@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]

Re: [patch, fortran] PR25029 unbounded assumed size array references


Tobi,



I won't have time before wednesday,

OK - Wednesday would be fine.

I haven't looked at the patch in depth
yet, but one case I'm worried about is calling LBOUND(a) where a is an assumed
size array inside an argument list.


You mean like:

subroutine foo (a)
real a(*)
call bar (a, LBOUND(a),2)
end subroutine foo
subroutine bar (b, i, j)
real b(i:j)
print *, i, j
print *, b(i:j)
end subroutine bar

real x(10)
x = 0.0
call foo (x)
end

???

This runs fine with other brand compilers but gfortran, patched or not, gives:

tobi.f90: In function ‘foo’:
tobi.f90:1: fatal error: gfc_todo: Not Implemented: Unable to determine rank of expression
compilation terminated.


If LBOUND (a) is replaced with LBOUND(a, 1), all is well.

The message is emitted from trans-array.c:2393

void
gfc_conv_ss_startstride (gfc_loopinfo * loop)
{
.....
if (loop->dimen == 0)
gfc_todo_error ("Unable to determine rank of expression");

Since scalarization is not needed here, I am not sure how we got to gfc_conv_ss_startstride.

I'll raise a PR.

Paul



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