This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33686] FORALL loop gives wrong result
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2007 20:02:55 -0000
- Subject: [Bug fortran/33686] FORALL loop gives wrong result
- References: <bug-33686-7816@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from pault at gcc dot gnu dot org 2007-10-08 20:02 -------
(In reply to comment #6)
Oh dear, oh dear, we are going to have to implement
PROGRAM TST
IMPLICIT NONE
INTEGER :: P(4),I
integer, allocatable :: Q(:)
P = (/2,4,1,3/)
allocate (Q(size(P)))
FORALL(I=1:4)
Q(P(I)) = I
END FORALL
P = Q
deallocate (Q)
PRINT *, P
END PROGRAM TST
when the dependency is detected. In fact, this should not be too bad. It can
be entirely enclosed within trans-stmt.c(generate_loop_for_temp_to_lhs). I have
some hotel room time coming up....
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33686