This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/56519] New: DO CONCURRENT: wrongly accepts calls to impure intrinsics
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Mar 2013 11:11:52 +0000
- Subject: [Bug fortran/56519] New: DO CONCURRENT: wrongly accepts calls to impure intrinsics
- Auto-submitted: auto-generated
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