From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2559 invoked by alias); 28 Jul 2009 14:43:33 -0000 Received: (qmail 2470 invoked by uid 48); 28 Jul 2009 14:43:16 -0000 Date: Tue, 28 Jul 2009 14:43:00 -0000 Message-ID: <20090728144316.2469.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/40876] OpenMP private variable referenced in a statement function In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus 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: 2009-07/txt/msg02255.txt.bz2 ------- Comment #4 from burnus at gcc dot gnu dot org 2009-07-28 14:43 ------- (In reply to comment #1) > I certainly can't reproduce any kind of segfault with this. Neither can I. Regarding both examples (comment 0 and comment 1), ifort 11.1 happily accepts both. I am not sure whether it is the correct interpretation according the standard, but http://publib.boulder.ibm.com/infocenter/lnxpcomp/v9v111/topic/com.ibm.xlf111.linux.doc/xlfopg/smpdirclauses.htm has: "The following example demonstrates the proper use of a PRIVATE variable that is used to define a statement function. A commented line shows the invalid use. Since J appears in a statement function, the statement function cannot be referenced within the parallel construct for which J is PRIVATE. INTEGER :: ARR(10), J = 17 ISTFNC() = J !$OMP PARALLEL DO PRIVATE(J) DO I = 1, 10 J=I ARR(I) = J ! ARR(I) = ISTFNC() **ERROR** A reference to ISTFNC would ! make the PRIVATE(J) clause ! invalid. END DO PRINT *, ARR END " However, I somehow read the standard differently such that already the "PRIVATE(J)" is invalid. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40876