This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/42804] ICE with -fcheck=bounds and type bound procedure call on array element
- From: "janus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jan 2010 17:24:47 -0000
- Subject: [Bug fortran/42804] ICE with -fcheck=bounds and type bound procedure call on array element
- References: <bug-42804-17837@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from janus at gcc dot gnu dot org 2010-01-19 17:24 -------
We probably have the same trouble with procedure pointer components, which can
also have passed-object arguments.
However, when trying to construct an analogous PPC test case, I came across
another bug. Here is the test case with a PPC instead of a TBP:
MODULE ModA
IMPLICIT NONE
TYPE, PUBLIC :: A
PROCEDURE(a_proc),pointer :: Proc
END TYPE A
CONTAINS
SUBROUTINE a_proc(this, stat)
CLASS(A), INTENT(INOUT) :: this
INTEGER, INTENT(OUT) :: stat
WRITE (*, *) 'a_proc'
stat = 0
END SUBROUTINE a_proc
END MODULE ModA
PROGRAM ProgA
USE ModA
IMPLICIT NONE
INTEGER :: ierr
INTEGER :: i
TYPE(A), ALLOCATABLE :: arr(:)
ALLOCATE(arr(2))
DO i = 1, 2
arr(i)%proc => a_proc
CALL arr(i)%Proc(ierr)
END DO
END PROGRAM ProgA
Compiling this gives:
CALL arr(i)%Proc(ierr)
1
Error: Passed-object at (1) must be scalar
Now, the passed-object is obviously scalar (it's an element of an array), so
this surely is a bug.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42804