This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR25029 unbounded assumed size array references
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, patch <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Mon, 02 Jan 2006 13:45:26 +0100
- Subject: Re: [patch, fortran] PR25029 unbounded assumed size array references
- References: <43B62E5E.4060401@wanadoo.fr> <20060102010405.GA7545@troutmask.apl.washington.edu> <43B900D0.1010702@physik.uni-muenchen.de>
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