From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2699 invoked by alias); 8 Oct 2007 20:03:06 -0000 Received: (qmail 2570 invoked by uid 48); 8 Oct 2007 20:02:55 -0000 Date: Mon, 08 Oct 2007 20:03:00 -0000 Message-ID: <20071008200255.2569.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/33686] FORALL loop gives wrong result In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pault at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-10/txt/msg00691.txt.bz2 ------- 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