This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40629] Host association problem
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2009 19:05:20 -0000
- Subject: [Bug fortran/40629] Host association problem
- References: <bug-40629-17820@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pault at gcc dot gnu dot org 2009-07-08 19:05 -------
(In reply to comment #3)
> Created an attachment (id=18157)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18157&action=view) [edit]
> Fix for bug - not regtested yet
>
> This handles host_assoc_function_*.f90 correctly but is not yet regtested.
>
> The testcase will be something like:
>
> ! { dg-do run }
> ! Tests the fix for the bug PR40629, in which the reference to 'x'
> ! in 'upper' wrongly host-associated with the symbol 'x' at module
> ! leve rather than the function.
> !
> ! Contributed by Philippe Marguinaud <philippe.marguinaud@meteo.fr>
> !
> MODULE m
> REAL :: x = 0
> CONTAINS
>
>
>
>
>
>
> SUBROUTINE s
> call upper
> call lower
> CONTAINS
> SUBROUTINE upper
> y = x(3,1)
> if (int(y) .ne. 3) call abort
> END SUBROUTINE
> FUNCTION x(n, m)
> x = m*n
> END FUNCTION
> SUBROUTINE lower
> y = x(2,1)
> if (int(y) .ne. 3) call abort
> END SUBROUTINE
> END SUBROUTINE
> END MODULE
>
> use m
> call s
> end
> ! { dg-final { cleanup-modules "m" } }
>
>
> Paul
>
The last abort should happen on a value of 2, of course.
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40629