From 13157033d4fc1d109b1dc7c063bfa46638144df5 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 12 May 2011 19:40:29 +0200 Subject: [PATCH] re PR fortran/48972 (OPEN with Unicode file name) 2011-05-12 Tobias Burnus PR fortran/48972 * resolve.c (resolve_intrinsic): Don't resolve module intrinsics multiple times. 2011-05-12 Tobias Burnus PR fortran/48972 * gfortran.dg/iso_c_binding_compiler_3.f90: New. From-SVN: r173708 --- gcc/fortran/ChangeLog | 6 +++++ gcc/fortran/resolve.c | 4 +++ gcc/testsuite/ChangeLog | 5 ++++ .../gfortran.dg/iso_c_binding_compiler_3.f90 | 27 +++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/iso_c_binding_compiler_3.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f2dfe3f43ad..6a6fba08240 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2011-05-12 Tobias Burnus + + PR fortran/48972 + * resolve.c (resolve_intrinsic): Don't resolve module + intrinsics multiple times. + 2011-05-11 Tobias Burnus PR fortran/48889 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index a19b10399d6..3483bc77594 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1441,6 +1441,10 @@ resolve_intrinsic (gfc_symbol *sym, locus *loc) if (sym->formal) return SUCCESS; + /* Already resolved. */ + if (sym->from_intmod && sym->ts.type != BT_UNKNOWN) + return SUCCESS; + /* We already know this one is an intrinsic, so we don't call gfc_is_intrinsic for full checking but rather use gfc_find_function and gfc_find_subroutine directly to check whether it is a function or diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f609bbaf2f0..d7cb0bd8989 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-12 Tobias Burnus + + PR fortran/48972 + * gfortran.dg/iso_c_binding_compiler_3.f90: New. + 2011-05-12 Jason Merrill * g++.dg/cpp0x/constexpr-incomplete2.C: New. diff --git a/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_3.f90 b/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_3.f90 new file mode 100644 index 00000000000..d9f9dfdd791 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/iso_c_binding_compiler_3.f90 @@ -0,0 +1,27 @@ +! { dg-do compile } +! { dg-options "-Wall" } +! +! PR fortran/45823 +! +! We used to warn about +! "Type specified for intrinsic function" for this file +! + +use iso_c_binding +use iso_Fortran_env +implicit none +intrinsic sin +real :: x = 3.4 +print *, sin(x), c_sizeof(c_int), compiler_options(), compiler_version() +end + + +module test_mod + use iso_fortran_env +end module test_mod + +subroutine test +use test_mod +end subroutine test + +! { dg-final { cleanup-modules "test_mod" } } -- 2.30.2