From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33685 invoked by alias); 1 Sep 2017 13:11:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33664 invoked by uid 89); 1 Sep 2017 13:11:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Sep 2017 13:11:32 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A01BC058EC0; Fri, 1 Sep 2017 13:11:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5A01BC058EC0 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub@redhat.com Received: from tucnak.zalov.cz (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03D5566831; Fri, 1 Sep 2017 13:11:30 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id v81DBRVE007665; Fri, 1 Sep 2017 15:11:27 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id v81DBO2h007664; Fri, 1 Sep 2017 15:11:24 +0200 Date: Fri, 01 Sep 2017 13:11:00 -0000 From: Jakub Jelinek To: dbroemmel Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: Patch for [Bug fortran/81841] [5/6/7/8 Regression] THREADPRIVATE (OpenMP) wrongly rejected in BLOCK DATA Message-ID: <20170901131124.GK2323@tucnak> Reply-To: Jakub Jelinek References: <2f2d738f-90d7-0efe-1caf-7e3a6387b0eb@daswigwam.de> <20170901120842.GJ2323@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00047.txt.bz2 On Fri, Sep 01, 2017 at 02:27:40PM +0200, dbroemmel wrote: > > This is wrong. Runtime testcases for OpenMP belong into libgomp/testsuite/. > Well, that's a path where I found some Fortran OpenMP stuff, I didn't > look for other places. > > > That said, I fail to see why such a large testcase is needed, wouldn't a > > simple > > ! PR fortran/81841 > > ! { dg-do compile } > > > > block data > > implicit none > > integer :: int2 > > real :: flt2 > > common /c_block_2/ int2, flt2 > > !$OMP THREADPRIVATE(/c_block_2/) > > data int2, flt2 /2, 2.2/ > > end block data > > > > testcase in gfortran.dg/gomp/ be sufficient here? > That would suffice and is the first testcase I added to PR81841. It was > suggested I could add runtime tests as well, so I tried. If you really need a testcase, it would be enough to do something like: use omp_lib !$omp parallel num_threads(2) int2 = omp_get_thread_num () !$omp barrier if (int2 != omp_get_thread_num ()) call abort !$omp end parallel or so to ensure it has the threadprivate property by writing something different to it in each thread and after barrier verifying it has the expected value in each thread. Jakub