http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58676
Bug ID: 58676 Summary: Intrinsic functions not considered pure actual arguments Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: ian_harvey at bigpond dot com The following example, when compiled with recent trunk: MODULE m IMPLICIT NONE CONTAINS SUBROUTINE sub(proc) INTERFACE PURE FUNCTION proc(x) IMPLICIT NONE REAL, INTENT(IN) :: x REAL :: proc END FUNCTION proc END INTERFACE PRINT *, proc(0.0) END SUBROUTINE sub END MODULE m PROGRAM p USE m IMPLICIT NONE INTRINSIC :: sin CALL sub(sin) !xxx END PROGRAM p results in an error "Interface mismatch in dummy procedure 'proc' ... : Mismatch in PURE attribute", which I think (but maybe I've missed something) is erroneous. "All standard intrinsic functions are pure" (13.1p2) and "elemental intrinsic functions may be associated with a dummy procedure (which cannot be elemental)" (12.5.2.9p1) and `sin` is the relevant bullet-less specific for the generic sin (13.6). See also http://software.intel.com/en-us/forums/topic/476356 and perhaps pr41724.