[Patch, fortran] PR28873 and PR20067 - Cannot resolve subroutine calls when modules are used in different scopes
THOMAS Paul Richard 169137
Paul.Richard.THOMAS@cea.fr
Tue Aug 29 10:55:00 GMT 2006
:ADDPATCH fortran:
This is a fix for yet another regression of which I am the author. This time, in fixing
PR28201, I broke the legitimate use of different modules to carry different specific
procedures for a single generic interface.
The fix turned out to be easy; it turns out that the problem in PR28201 was not the use
association but, rather, that the search for specific procedures in the parent namespace
was returning a null symbol and this was producing the ICE. Thus, the correct fix here
was to refresh the symbol before the final ditch attempt to find a matching intrinsic. At
the same time, the subsequent error message was changed to reflect what actually is
happening in resolve_generic_s (and resolve_generic_f), thereby fixing PR20067.
At the same time, I have restructured the search in resolve_generic_s and resolve_specific_s
to give them the same form as their function counterparts:
for (;;)
{
resolve as appropriate
if MATCH_YES => return SUCCESS
else if MATCH_ERROR => return FAILURE
[generic:]
if no parent namespace => break
look for same name symbol in parent namespace
if symbol is NULL => break
[if !generic => goto generic]
}
This has no effect on the functionality but does improve maintainability.
The additional testcase is a slightly extended version of that offered by the reporter.
Regtested on Cygwin_NT/PIV: OK for trunk and 4.1?
Paul
2006-08-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/28873
REGRESSION FIX
PR fortran/20067
* resolve.c (resolve_generic_f): Make error message more
comprehensible.
(resolve_generic_s): Restructure search for specific procedures
to be similar to resolve_generic_f and change to similar error
message. Ensure that symbol reference is refreshed, in case
the search produces a NULL.
(resolve_specific_s): Restructure search, as above and as
resolve_specific_f. Ensure that symbol reference is refreshed,
in case the search produces a NULL.
2006-08-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20067
* gfortran.dg/used_types_5.f90: Change error message.
PR fortran/28873
* gfortran.dg/used_types_6.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr28873.diff
Type: application/octet-stream
Size: 5498 bytes
Desc: pr28873.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060829/8efe9ae0/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commit0829.msg
Type: application/octet-stream
Size: 735 bytes
Desc: commit0829.msg
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060829/8efe9ae0/attachment-0001.obj>
More information about the Gcc-patches
mailing list