Bug 37597 - internal procedure fails to access host-associated module procedure
Summary: internal procedure fails to access host-associated module procedure
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Paul Thomas
URL:
Keywords: rejects-valid
Depends on:
Blocks: 32834
  Show dependency treegraph
 
Reported: 2008-09-20 06:56 UTC by Tobias Burnus
Modified: 2008-11-08 14:18 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-11-04 21:12:57


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2008-09-20 06:56:34 UTC
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/150847ad37d33cdb

The following is rejected with:
  Error: Symbol 'other_sub' at (1) has no IMPLICIT type

If one moves other_sub up in the module, it works.

 module foo
   implicit none
contains
   subroutine main_sub ()
     call internal_sub()
   contains
     subroutine internal_sub()
       call QAG(other_sub)
     end subroutine internal_sub
   end subroutine main_sub
   subroutine other_sub ()
   end subroutine other_sub
end module foo
Comment 1 Paul Thomas 2008-11-04 21:12:57 UTC
An 'obvious' fix is on the way.

Paul
Comment 2 Paul Thomas 2008-11-04 21:19:18 UTC
Subject: Bug 37597

Author: pault
Date: Tue Nov  4 21:17:53 2008
New Revision: 141588

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141588
Log:
2008-11-04  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/37597
        * parse.c (gfc_fixup_sibling_symbols ): Fixup contained, even
	when symbol not found.

2008-11-04  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/37597
        * gfortran.dg/host_assoc_call_5.f90: New test.



Added:
    trunk/gcc/testsuite/gfortran.dg/host_assoc_call_5.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/parse.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Paul Thomas 2008-11-08 14:18:42 UTC
Fixed on trunk and 4.3

Thanks for the report

Paul
Comment 4 Paul Thomas 2008-11-08 14:19:03 UTC
Subject: Bug 37597

Author: pault
Date: Sat Nov  8 14:17:35 2008
New Revision: 141708

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141708
Log:
2008-11-08  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/37597
        * parse.c (gfc_fixup_sibling_symbols ): Fixup contained, even
	when symbol not found.

2008-11-08  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/37597
        * gfortran.dg/host_assoc_call_5.f90: New test.



Added:
    branches/gcc-4_3-branch/gcc/testsuite/gfortran.dg/host_assoc_call_5.f90
Modified:
    branches/gcc-4_3-branch/gcc/fortran/ChangeLog
    branches/gcc-4_3-branch/gcc/fortran/parse.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog