------- Comment #5 from fxcoudert at gcc dot gnu dot org 2007-07-10 22:44 ------- It's a larger problem. The patch above avoids this ICE, but we have another one when using substring references of type string(:). The following code, with patched compiler, yields the other ICE:
character(*), parameter :: chrs = '-+.0123456789eEdD' character(*), parameter :: expr = '-+.0123456789eEdD' print *, index(chrs(:), expr) print *, index(chrs(14:), expr) print *, index(chrs(:12), expr) print *, index(chrs, expr(:)) print *, index(chrs, expr(1:)) print *, index(chrs, expr(:1)) contains function foo(expr) character(*), intent(in) :: expr character(*), parameter :: chrs = '-+.0123456789eEdD' integer :: foo foo = index(chrs(:), expr) foo = index(chrs(14:), expr) foo = index(chrs(:12), expr) foo = index(chrs, expr(:)) foo = index(chrs, expr(1:)) foo = index(chrs, expr(:1)) end function foo end This is because expr->ref is NULL in that later case (there's a comment somewhere to that effect), which is not dealt with later during translation. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32594