From patchwork Sat Jul 13 06:34:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1131594 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-505046-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="x49e0Stj"; 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 45m0Qb2lwGz9s8m for ; Sat, 13 Jul 2019 16:35:03 +1000 (AEST) 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=axItrQJIqADpMZy9Rq5bk7VN0dcBQov9lebScJ0f3Qh OvPNEsYsbFVP+CSEMU7GPd0P5YrBtagA8ek20Fl97NLJpHTdUi4NGw2Xo2RTWAg8 1ipRlbcRAzvQutSBZ4YkbqbNireyRUskMawn848NgnFSDo65YNp3B7jYK9JgDUvU = 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=1UHQfvRosHVvgehIt6+vA6b+ZVc=; b=x49e0StjiIF+mzw8Z yPWhTGJObmB1dUGiAOBciP3h4ZmsyVi96TjGt/fEGkwx8QlKR9ZoH4JIJSAKUYL7 noNsZHbeCYEi2uNrx9QarT9GWprdlMJWLlGn2rgjOJEXC5Hu7yuCV0SEwU+ohvQu GdOBOL5MwWRds1we5rwWckF/eE= Received: (qmail 103440 invoked by alias); 13 Jul 2019 06:34:56 -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 103431 invoked by uid 89); 13 Jul 2019 06:34:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_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; Sat, 13 Jul 2019 06:34:55 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6365EC4ECF for ; Sat, 13 Jul 2019 06:34:54 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-236.ams2.redhat.com [10.36.116.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EF8260BFB for ; Sat, 13 Jul 2019 06:34:53 +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 x6D6YpaG009629 for ; Sat, 13 Jul 2019 08:34:52 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x6D6YpS5009628 for gcc-patches@gcc.gnu.org; Sat, 13 Jul 2019 08:34:51 +0200 Date: Sat, 13 Jul 2019 08:34:51 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix OpenMP target parallel reduction (task, ...) (PR c/91149) Message-ID: <20190713063451.GG2125@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! I've discovered a pasto, which breaks the following testcase. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk, will backport to 9.2 too. 2019-07-13 Jakub Jelinek PR c/91149 * c-omp.c (c_omp_split_clauses): Fix a pasto in OMP_CLAUSE_REDUCTION_TASK handling. * c-c++-common/gomp/reduction-task-3.c: New test. Jakub --- gcc/c-family/c-omp.c.jj 2019-07-12 09:46:35.824602187 +0200 +++ gcc/c-family/c-omp.c 2019-07-12 16:07:14.494672183 +0200 @@ -1667,7 +1667,7 @@ c_omp_split_clauses (location_t loc, enu } else if (code != OMP_SECTIONS && (mask & (OMP_CLAUSE_MASK_1 - << PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0 + << PRAGMA_OMP_CLAUSE_NUM_THREADS)) == 0 && (mask & (OMP_CLAUSE_MASK_1 << PRAGMA_OMP_CLAUSE_SCHEDULE)) == 0) { --- gcc/testsuite/c-c++-common/gomp/reduction-task-3.c.jj 2019-07-12 16:22:44.005562884 +0200 +++ gcc/testsuite/c-c++-common/gomp/reduction-task-3.c 2019-07-12 16:16:24.447324301 +0200 @@ -0,0 +1,12 @@ +/* PR c/91149 */ + +int r; + +void +foo (void) +{ + #pragma omp parallel reduction(task, +: r) + r++; + #pragma omp target parallel reduction(task, +: r) + r++; +}