This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32594] substring simplification leads to ICE
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2007 22:44:22 -0000
- Subject: [Bug fortran/32594] substring simplification leads to ICE
- References: <bug-32594-14607@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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