This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/56519] New: DO CONCURRENT: wrongly accepts calls to impure intrinsics


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56519

             Bug #: 56519
           Summary: DO CONCURRENT: wrongly accepts calls to impure
                    intrinsics
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Based on
https://groups.google.com/d/topic/comp.lang.fortran/cZ1KQ_2Zt_c/discussion

The following program is accepted, but the intrinsic procedure is IMPURE.
(F2008:)

C825   A reference to a nonpure procedure shall not appear within a
       DO CONCURRENT construct.

Note: "All standard intrinsic functions are pure." (cf. F2008, 13.1). But only
some subroutines are pure. However, in intrinsics.c, the used intrinsic
subroutine is marked as CLASS_IMPURE! And in principle,
gfc_intrinsic_sub_interface checks for this â but it does not seem to work,
here. While it triggers in a URE subroutine.


implicit none
integer :: i
real :: array(123), val

do concurrent (i = 1:123)
  call random_number (val) ! INVALID: Impure but accepted
  array(i) = val

  !call foo(array) ! OK; rejected with:
  !       Subroutine call to 'foo' in DO CONCURRENT block at (1) is not PURE
end do
end


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]