g95 coarray bug & question

2 views
Skip to first unread message

Jared Ahern

unread,
May 29, 2009, 2:59:16 PM5/29/09
to gg95
Hey folks,

A couple things:

1) Do you need to use the version of g95 bundled with the coarray
code, or can you use an updated version?

2) Does anyone have any luck compiling this code? I get an internal
compiler error.

PROGRAM error1
IMPLICIT NONE
TYPE Vec
REAL, ALLOCATABLE :: c(:)
END TYPE Vec
TYPE LongVec
TYPE(Vec), ALLOCATABLE :: x[:]
END TYPE LongVec
TYPE(LongVec) :: a
ALLOCATE(a%x[*])
ALLOCATE(a%x%c(5)) ! error is here
END PROGRAM error1

I filed a bug with Andy, but haven't heard back yet.

Thanks,
Jared

Damian Rouson

unread,
May 29, 2009, 6:36:44 PM5/29/09
to gg...@googlegroups.com
I believe the draft Fortran 2008 standard prohibits co-array
components inside serived type. Is it possible this is causing your
problem?


Damian

Jared Ahern

unread,
May 30, 2009, 4:50:29 PM5/30/09
to gg95
I believe that allocatable components are allowed, as per 4.5.2 and
4.5.4 of the draft standard. There is also a blurb about it on page 7
of John Reid's N1724.pdf paper on coarrays in F08.

Plus, I get an internal compiler error, not a syntax error, so clearly
there's a bug in g95, even if my code is invalid. I can make the code
above work by changing the declaration of the "x" component to be:

TYPE(Vec), ALLOCATABLE :: x(:)[:]

and allocating appropriately. It's just silly to allocate x(1)[*]
when you don't need to.
Reply all
Reply to author
Forward
0 new messages