From patchwork Mon Oct 14 08:29:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1176060 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-510887-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="IIPqolrh"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46sBZ03g43z9sPc for ; Mon, 14 Oct 2019 19:29:42 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=nDx7HFp7rihkcv2D323fsoiBbN2bZcm8z7EUPMfFhz+ vlvFiR8gYZ4A4OM0J3dEKBxIETRi6MBY0TzE2PwMDQz8s1xf8myDhOxqX87kOQLI sROmvwrH7LN0rvE32RgvsFl9Cw/6IG/78VXU0Fr7hPtzir6+kTO/F1VAG9k1Iy68 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=5BZcLK5JZWsGury72dOYVIeXuxI=; b=IIPqolrhizrq6RGSq qfkLSb+FlVa4ExsBKFY/TRL3D6RwxnjEIx5J+sgPxGHyDzWB/Ai8sETJgka/Vlst RyMxJChBIDYUW2BWEBkt3qVlzZVanUWVPFxawBrN3L3+KkHm9pcegy0wWsYibzFT 5hXSoBIHsVZu4zXg7g4sNXtg2w= Received: (qmail 40253 invoked by alias); 14 Oct 2019 08:29:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 40236 invoked by uid 89); 14 Oct 2019 08:29:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Mon, 14 Oct 2019 08:29:31 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6155410CC1F7 for ; Mon, 14 Oct 2019 08:29:30 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08BC75D9C9 for ; Mon, 14 Oct 2019 08:29:29 +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 x9E8TRTD000989 for ; Mon, 14 Oct 2019 10:29:28 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x9E8TRko000988 for gcc-patches@gcc.gnu.org; Mon, 14 Oct 2019 10:29:27 +0200 Date: Mon, 14 Oct 2019 10:29:27 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix up {in, task}_reduction handling with -std=c++17 (PR c++/92084) Message-ID: <20191014082927.GD15914@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes Hi! in_reduction and task_reduction clauses need to be handled the same as reduction clause. Fixed thusly, tested on x86_64-linux, committed to trunk. 2019-10-14 Jakub Jelinek PR c++/92084 * semantics.c (handle_omp_array_sections_1): Temporarily disable -fstrong-eval-order also for in_reduction and task_reduction clauses. * g++.dg/gomp/pr92084.C: New test. Jakub --- gcc/cp/semantics.c.jj 2019-10-11 09:35:14.415498936 +0200 +++ gcc/cp/semantics.c 2019-10-14 10:11:32.396100623 +0200 @@ -5068,7 +5068,9 @@ handle_omp_array_sections_1 (tree c, tre saying how many times the side-effects are evaluated is unspecified, makes int *a, *b; ... reduction(+:a[a = b, 3:10]) really unspecified. */ warning_sentinel s (flag_strong_eval_order, - OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION); + OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION + || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_IN_REDUCTION + || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_TASK_REDUCTION); ret = grok_array_decl (OMP_CLAUSE_LOCATION (c), ret, low_bound, false); return ret; } --- gcc/testsuite/g++.dg/gomp/pr92084.C.jj 2019-10-14 10:13:38.210217838 +0200 +++ gcc/testsuite/g++.dg/gomp/pr92084.C 2019-10-14 10:13:30.602331688 +0200 @@ -0,0 +1,11 @@ +// PR c++/92084 + +void bar (int *, int); +int baz (int); + +void +foo (int *x, int y) +{ +#pragma omp taskgroup task_reduction (*: x[baz (y)]) + bar (x, baz (y)); +}