This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR16940 - module interfaces to contained procedures
- From: Tobias SchlÃter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: paulthomas2 at wanadoo dot fr
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 01 Jul 2005 19:07:57 +0200
- Subject: Re: [patch, fortran] PR16940 - module interfaces to contained procedures
- References: <12294954.1120218717650.JavaMail.www@wwinf0303>
Paul THOMAS wrote:
> This patch fixes the ICE that occurred with module interfaces to
> contained procedures, where implicit none was declared in the
> module.
>
> The problem arose because the symbol arrived in resolve_symbol,
> with next to nothing set, so that it was being identified as
> FL_VARIABLE by default. A few lines down, setting default type
> fails because of the implicit none. By looking in for the symbol
> name in parent namespaces and checking if it corresponds to an
> interface, the variable can be set to FL_PROCEDURE, which is set
> to no error on not finding an implicit type. This also makes the
> result look better in the parse tree. This incomplete sysmbol is
> ignored later on,when the interfaces are resolved.
The problem happens earlier. Note that if you add a 'use max_loc_mod to the
contained subroutine, the problem disappears, and as can be seen in the
debugger, in this case max_location indeed gets sym->attr.flavor ==
FL_PROCEDURE set.
Instead of your fix, we should correctly identify the symbol to use for
max_location as the one from the module included by the host (in this case the
program) when parsing the CALL. I have no idea what's going wrong, though,
except that generic interfaces seem to be full of errors.
- Tobi