This is the mail archive of the gcc-bugs@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]

[Bug fortran/40629] Host association problem



------- 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


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