[Patch, Fortran] PR fortran/35846: ICE on character array constructor

Tobias Burnus burnus@net-b.de
Sat Sep 20 16:39:00 GMT 2008


Hi Daniel,

Daniel Kraft wrote:
> this is a fix for PR fortran/35846 where character array constructor
> ICEd in certain situations because gfc_conv_string_length could be
> called with a charlength structure whose length was NULL. [...]
>
> After fixing the ICE, the problem with the global variables pointed out
> broke bounds-checking for the tests, which I fixed by saving & restoring
> their values.

I think you just made it more difficult to hit the bug rather than
fully fixing the bug. If one adds another nested constructor one
still gets:

internal compiler error: in gfc_conv_array_constructor_expr,
                         at fortran/trans-expr.c:3356

using the following program

implicit none
character(len=3) :: c(3)
c = 'a'
c = (/ (/ 'A'//(/ trim(c(1)), 'a' /)/)//'c', 'dcd' /)
print *, c(1)
print *, c(2)
print *, c(3)
end

NAG f95 and ifort print for this program:
 Aac
 Aac
 dcd

Tobias



More information about the Fortran mailing list