[Patch, fortran] PR18082 - gfortran gets stuck in loop with automatic length characters

Erik Edelmann erik.edelmann@iki.fi
Wed Oct 12 19:44:00 GMT 2005


On Sat, Oct 08, 2005 at 07:47:39AM +0200, Paul Thomas wrote:
> :ADDPATCH fortran:
> 
> This gets stuck in a loop whilst trying to treat the assignments:
> 
> subroutine snafu (i)
> character*(i) :: c1, c2
> c1 = ""
> c2 = ""
> end subroutine snafu
> 
> Declaring c1 and c2 in separate statements clears the problem.
> The reason for the problem is that both symbols get assigned the same 
> typespec in decl.c(variable_decl) and so the same character length and 
> corresponding backend declaration.   This is not good for automatic 
> character lengths.   The attached patch fixes this by doling out a new 
> typespec for all except constant expressions.

It seems that PR 21459 suffers from a very similar problem.  Do
you think it would be hard to extend your patch to fix that one
as well?


        Erik

PS. It's a rather impressive array of patches you have submitted
lately :-)



More information about the Fortran mailing list