From patchwork Tue Aug 4 12:26:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1340852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BLYsm5HyRz9sTC for ; Tue, 4 Aug 2020 22:27:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06A773850430; Tue, 4 Aug 2020 12:27:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id C8AC73857C49; Tue, 4 Aug 2020 12:26:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C8AC73857C49 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: C19houWb5VrEmxTTEs1gW7KjlEHdzf9Wmfj7Th+U4cKkZOHsZGwAcdU/0XaVWbGD7dIgplislL YD2kmrtvr6tvwP6X/900JOd9ZYzNL1xH2qLIiMImBwbKiPLpV8n4Qbg0QWnGIloNp4spKkl1Br zUy73QmAIzOmER9NO262LFlVyGex+76bducOOwIltwcytNdQ3EdK6qVcjM2G8jtq+MJToOPcO1 cQk+mL1WJ1vA7K9GlV1obsy7H4W79QUvc+xEJULryFerE9Dugmo8Qp1A3W7Byljx/v9E+ViE5w bL8= X-IronPort-AV: E=Sophos;i="5.75,433,1589270400"; d="diff'?scan'208";a="51708687" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 04 Aug 2020 04:26:56 -0800 IronPort-SDR: 8j4VHJ0E5sKeVLgV/igxyZcY7bc/lS4xD1WXoBIM8Da0Z4rcGoISrTcBJA61gu8/DCIVfGdUch 3O227uoaIjD0nEqz4UMGhu/NV8h45oZE/MD6UUHIbF8nCNmTBVoT5zx5sry8V65AZxIJVGjFHM YH0vfh9Ob8HU6SdX0wHl8Z1MxVFZVgHKZAuCxtyxQoqrFkwVuQuF7zxXcrQAnXIjwIFdn4yE60 hIQUuQuqyzPUDp292YJlnwhF9KjEHhfwZ2C0IqGUWu+etdaftnbzfxagucVM21KzpaKdcBW9yz b/I= To: gcc-patches , Jakub Jelinek , fortran From: Tobias Burnus Subject: [Patch] Fortran: Fix for OpenMP's 'lastprivate(conditional:' Message-ID: Date: Tue, 4 Aug 2020 14:26:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Follow-up to my 'lastprivate(conditional:' patch for a left-over problem which I kind mostly missed. Checking the dump also shows that it now works as expected. OK? Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter Fortran: Fix for OpenMP's 'lastprivate(conditional:' gcc/fortran/ChangeLog: * trans-openmp.c (gfc_trans_omp_do): Fix 'lastprivate(conditional:'. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/lastprivate-conditional-3.f90: Enable some previously disabled 'lastprivate(conditional:' dg-warnings. gcc/fortran/trans-openmp.c | 2 ++ gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90 | 12 ++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 98702b1aa22..7891a7e651b 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -4570,6 +4570,8 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock, { tree l = build_omp_clause (input_location, OMP_CLAUSE_LASTPRIVATE); + if (OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)) + OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (l) = 1; OMP_CLAUSE_DECL (l) = dovar_decl; OMP_CLAUSE_CHAIN (l) = omp_clauses; OMP_CLAUSE_LASTPRIVATE_STMT (l) = tmp; diff --git a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90 b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90 index 720fe9b64a8..932249c9225 100644 --- a/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/lastprivate-conditional-3.f90 @@ -27,14 +27,12 @@ subroutine foo end do !$omp end parallel - ! Error in eqiv. C code: "conditional 'lastprivate' on loop iterator 'i' ignored" - !$omp parallel do lastprivate (conditional: i) + !$omp parallel do lastprivate (conditional: i) ! { dg-warning "conditional 'lastprivate' on loop iterator 'i' ignored" } do i = 1, 32 end do !$omp end parallel do - ! Error in eqiv. C code: "conditional 'lastprivate' on loop iterator 'i' ignored" - !$omp parallel do collapse (3) lastprivate (conditional: i) + !$omp parallel do collapse (3) lastprivate (conditional: i) ! { dg-warning "conditional 'lastprivate' on loop iterator 'i' ignored" } do i = 1, 32 do j = 1, 32 do k = 1, 32 @@ -43,8 +41,7 @@ subroutine foo end do !$omp end parallel do - ! Error in eqiv. C code: "conditional 'lastprivate' on loop iterator 'j' ignored" - !$omp parallel do collapse (3) lastprivate (conditional: j) + !$omp parallel do collapse (3) lastprivate (conditional: j) ! { dg-warning "conditional 'lastprivate' on loop iterator 'j' ignored" } do i = 1, 32 do j = 1, 32 do k = 1, 32 @@ -53,8 +50,7 @@ subroutine foo end do !$omp end parallel do - ! Error in eqiv. C code: "conditional 'lastprivate' on loop iterator 'k' ignored" - !$omp parallel do collapse (3) lastprivate (conditional: k) + !$omp parallel do collapse (3) lastprivate (conditional: k) ! { dg-warning "conditional 'lastprivate' on loop iterator 'k' ignored" } do i = 1, 32 do j = 1, 32 do k = 1, 32