public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52452] New: INTRINSIC cannot be applied to gfortran's ETIME
@ 2012-03-01 15:44 roger.ferrer at bsc dot es
  2012-03-01 18:59 ` [Bug fortran/52452] [4.5/4.6/4.7 Regression] " burnus at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: roger.ferrer at bsc dot es @ 2012-03-01 15:44 UTC (permalink / raw)
  To: gcc-bugs

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,


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-22 21:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01 15:44 [Bug fortran/52452] New: INTRINSIC cannot be applied to gfortran's ETIME roger.ferrer at bsc dot es
2012-03-01 18:59 ` [Bug fortran/52452] [4.5/4.6/4.7 Regression] " burnus at gcc dot gnu.org
2012-03-02 11:00 ` burnus at gcc dot gnu.org
2012-03-02 15:04 ` [Bug fortran/52452] [4.5/4.6/4.7/4.8 " burnus at gcc dot gnu.org
2012-03-05 16:19 ` [Bug fortran/52452] [4.5/4.6/4.7 " jakub at gcc dot gnu.org
2012-03-06 17:08 ` burnus at gcc dot gnu.org
2012-03-06 17:10 ` burnus at gcc dot gnu.org
2012-03-06 17:37 ` burnus at gcc dot gnu.org
2012-03-22 21:22 ` burnus at gcc dot gnu.org
2012-03-22 21:24 ` [Bug fortran/52452] [4.5/4.6/4.7/4.8 " burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).