This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR17741 - ICE in gfc_free_namespace, at fortran/symbol.c:2208
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: "François-Xavier Coudert" <fxcoudert at gmail dot com>, "Paul Thomas" <paulthomas2 at wanadoo dot fr>, patch <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 11 May 2006 23:30:57 +0100
- Subject: Re: [Patch, fortran] PR17741 - ICE in gfc_free_namespace, at fortran/symbol.c:2208
- References: <446396FE.9080501@wanadoo.fr> <19c433eb0605111314h346abc16mf4c3650a0706e95f@mail.gmail.com>
On Thursday 11 May 2006 21:14, François-Xavier Coudert wrote:
> > PR fortran/17741
> > * symbol.c(gfc_free_namespace): If the number of refs is
> > zero or less, emit an error and return instead of ICEing.
>
> Your patch doesn't apply cleanly. When patching myself, I get
>
> $ gfortran pr17741.f90
> In file pr17741.f90:4
>
> end subroutine
> 1
> Error: Expecting END FUNCTION statement at (1)
> Error: Unexpected end of file in 'pr17741.f90'
> Error: namespace bar has 0 references on being freed
>
>
> This isn't user-friendly at all.
I agree. The compiler has got itself confused and tried to do something that
should never happen. An ICE is the correct response.
The fact that this occurs when the user code is illegal is irrelevant. We've
already issued a separate error about that.
The proper solution is to fix whatever causes the double free.
Paul