This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] PR16940 - module interfaces to contained procedures


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]