[Patch,Fortran] Allow for zero-dimension explict-shaped arrays (PR30514)
Tobias Burnus
burnus@net-b.de
Sat Feb 3 12:46:00 GMT 2007
:ADDPATCH fortran:
gfortran failed for:
integer(1) :: i(1:-1)
i = 5
and it ends up in an endless loop, as FX found out, for
integer :: i(2:0), j(1:0)
integer, parameter :: k(2:0) = 0, l(1:0) = 0
i = k
j = l
Note that those arrays are valid:
See 5.1.2.5.1 Explicit-shape array:
"If the upper bound is less than the lower bound, the range is empty, the
extent in that dimension is zero, and the array is of zero size."
Bootstapped and regression tested on x86_64-unknown-linux-gnu.
Ok for the trunk and the usual week+ later for 4.2?
(It also affects 4.1, do we want to fix it there too [after the 4.1.x
release]?)
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zero-array.diff
Type: text/x-patch
Size: 1474 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070203/6e90a560/attachment.bin>
More information about the Fortran
mailing list