From 2b91eb32d64821bbbd8eb9def662e7199cb14173 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 2 Mar 2012 12:00:04 +0100 Subject: re PR fortran/52452 (INTRINSIC cannot be applied to gfortran's ETIME) 2012-03-02 Tobias Burnus PR fortran/52452 * resolve.c (resolve_intrinsic): Don't search for a function if we know that it is a subroutine. 2012-03-02 Tobias Burnus PR fortran/52452 * gfortran.dg/intrinsic_8.f90: New. From-SVN: r184778 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/resolve.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/intrinsic_8.f90 | 23 +++++++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/intrinsic_8.f90 (limited to 'gcc') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4867087..c1f9593 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2012-03-02 Tobias Burnus + + PR fortran/52452 + * resolve.c (resolve_intrinsic): Don't search for a + function if we know that it is a subroutine. + 2012-02-29 Paul Thomas PR fortran/52386 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4dcf9b1..824bc25 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -1496,7 +1496,7 @@ resolve_intrinsic (gfc_symbol *sym, locus *loc) if (sym->intmod_sym_id) isym = gfc_intrinsic_function_by_id ((gfc_isym_id) sym->intmod_sym_id); - else + else if (!sym->attr.subroutine) isym = gfc_find_function (sym->name); if (isym) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b17f456..c8a8f75 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-03-02 Tobias Burnus + + PR fortran/52452 + * gfortran.dg/intrinsic_8.f90: New. + 2012-03-01 Kai Tietz * gcc.dg/torture/pr47917.c: Make test using POSIX-printf diff --git a/gcc/testsuite/gfortran.dg/intrinsic_8.f90 b/gcc/testsuite/gfortran.dg/intrinsic_8.f90 new file mode 100644 index 0000000..a427c70 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_8.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! +! PR fortran/52452 +! +! Contributed by Roger Ferrer Ibanez +! +PROGRAM test_etime + IMPLICIT NONE + INTRINSIC :: etime + REAL(4) :: tarray(1:2) + REAL(4) :: result + + CALL etime(tarray, result) +END PROGRAM test_etime + +subroutine test_etime2 + IMPLICIT NONE + INTRINSIC :: etime + REAL(4) :: tarray(1:2) + REAL(4) :: result + + result = etime(tarray) +END subroutine test_etime2 -- cgit v1.1