From patchwork Wed Dec 15 15:54:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frederik Harwath X-Patchwork-Id: 48981 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24E6F3858039 for ; Wed, 15 Dec 2021 16:19:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 3448D3857C71 for ; Wed, 15 Dec 2021 15:57:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3448D3857C71 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: 2PjFo07jSKfgsjy6ivcMX7rSbS9rCcnVq0YlChVH+zBhOxL55dg0jUO+Rlh7qggqYh3JZu60qQ 0EDVRX84s6/nGx7i6iWdayJ3WyJ5yF5Zt4d2nZYACOXRogkpbArZrrTIGEyX3+GgcAuoXew8TY qfXKNfyCUliVM7K8PBXcQo863warYdMwU64TJb5KC1g2Udebopu5+Enqytgf37TnjOOXXMJ2iQ +0BqVMPpKE30/TYa9Stjcy/tiSbfEQena0uynXKeudssVayywnaYLGvr7R9WP/nOb4Xx8EaD4Q qOyzda4s6DE3tQ/k3wwWkoul X-IronPort-AV: E=Sophos;i="5.88,207,1635235200"; d="scan'208";a="69584658" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 15 Dec 2021 07:57:30 -0800 IronPort-SDR: dmDL4DxklDNEh3F+b5INb3R9AhEskCYwYRv++6Z3tbu9D7RmxF+As+2oy5ZnFUfpbt+9ORBsgI g8sHIj+qQ3k+7UpaC4gVbC3YExSS67sF3ZMFQqsl6i30Zy/zOdN1/eoLftBC6j2dqLet1mruf8 zKEjkN3yyJcVom7NezXmmuBeCV46oHleYxm8GRntcueQWIdO9I+Ti/VqXiKvmP+66Qa/JE1Xfa 5U/ZpCtPO6xO9VnKFD+ElPsRK7ulXdY2790IY0laV/EYjHc+c9AkPf1AltuyAB6nKthDcTzERN BAs= From: Frederik Harwath To: Subject: [PATCH 39/40] openacc: Check type for references in reduction lowering Date: Wed, 15 Dec 2021 16:54:46 +0100 Message-ID: <20211215155447.19379-40-frederik@codesourcery.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211215155447.19379-1-frederik@codesourcery.com> References: <20211215155447.19379-1-frederik@codesourcery.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: thomas@codesourcery.com Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" gcc/ChangeLog: * omp-low.c (lower_oacc_reductions): Only create a reference if variable has pointer type. --- gcc/omp-low.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.33.0 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 diff --git a/gcc/omp-low.c b/gcc/omp-low.c index ae5cdfc5e260..2b8b848ec03a 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -7639,9 +7639,10 @@ lower_oacc_reductions (location_t loc, tree clauses, tree level, bool inner, if (omp_privatize_by_reference (orig)) { - outgoing = build_simple_mem_ref (outgoing); + if (POINTER_TYPE_P (TREE_TYPE (outgoing))) + outgoing = build_simple_mem_ref (outgoing); - if (!TREE_CONSTANT (incoming)) + if (POINTER_TYPE_P (TREE_TYPE (incoming))) incoming = build_simple_mem_ref (incoming); }