This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52452] New: INTRINSIC cannot be applied to gfortran's ETIME
- From: "roger.ferrer at bsc dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Mar 2012 15:26:32 +0000
- Subject: [Bug fortran/52452] New: INTRINSIC cannot be applied to gfortran's ETIME
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52452
Bug #: 52452
Summary: INTRINSIC cannot be applied to gfortran's ETIME
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: roger.ferrer@bsc.es
[Note for a possible duplicate: This bug may be related to #52333, but in that
one EXTERNAL and explicit INTERFACEs are involved (which is not the case in the
current bug).]
gfortran's ETIME can be used either as a FUNCTION or as a SUBROUTINE.
Explicitly specifying that it is an INTRINSIC name (using an
intrinsic-statement) works fine if the function version is used. But when using
the subroutine version, gfortran 4.6.2 complains:
Consider the following testcase
PROGRAM test_etime
IMPLICIT NONE
INTRINSIC :: etime
REAL(4) :: tarray(1:2)
REAL(4) :: result
CALL etime(tarray, result)
END PROGRAM test_etime
results in
$ gfortran -c test_etime.f90
test_etime.f90:3.22:
INTRINSIC :: etime
1
Error: FUNCTION attribute conflicts with SUBROUTINE attribute in 'etime' at (1)
Removing that line the compilation succeeds (and gfortran appropiately emits a
call to _gfortran_etime_sub). Using the function version works too with or
without an INTRINSIC statement.
[Note: I'm aware, as the documentation clearly states, that both forms cannot
be used in a single program unit. I'm just using one of them at a time]
Maybe it is my fault assuming too liberally the meaning of the INTRINSIC
statement/attribute.
Kind regards,