This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PR18082 - gfortran gets stuck in loop with automatic length characters
- From: Erik Edelmann <erik dot edelmann at iki dot fi>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Oct 2005 22:00:00 +0300
- Subject: Re: [Patch, fortran] PR18082 - gfortran gets stuck in loop with automatic length characters
- References: <20051004174704.GA18656@acclab.helsinki.fi> <43475D7B.3020103@wanadoo.fr>
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 :-)