From patchwork Wed Jan 22 09:03:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1227125 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-517989-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.a=rsa-sha1 header.s=default header.b=QwTe7IZf; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=N16C5vi2; 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 482fZq2pv7z9sPJ for ; Wed, 22 Jan 2020 20:03:31 +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 :content-transfer-encoding; q=dns; s=default; b=Lz9rQIgO0tKJnT4e 2Uvw9w8X4psJ+Q0L611GTWzEJZrfFUsJZm/mBGKcbA22okMVo8yd1pubaKkJESJC Ixw8EplflUuyOu4yv87Ox22GN9EZosSPazxh2xPEHL/TnecMm7KDCAq4OrIGgZc0 XI9NHBxhQ5GMiq7pa1wWl02AI+M= 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 :content-transfer-encoding; s=default; bh=ev+wr7H2YX2VjR8sFyGs8v a7riU=; b=QwTe7IZfB8/+Tf9UE1ZPCf4JEgoS9gs/FwjfwiC87ERykcIv+G1HXO movPQPin1ADcGYghBKcIaPvq0yhG8c4ZJM/AYuTun31Si4BOLR9DfJ/QdgWM8bSs SSZxRcn9tXMsxCIalSRvu/wdvaw8z2B9nwB/gG89qCjdy/a/0uAFk= Received: (qmail 63184 invoked by alias); 22 Jan 2020 09:03:24 -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 63175 invoked by uid 89); 22 Jan 2020 09:03:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=unavailable version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-1.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Jan 2020 09:03:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579683797; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cib3hSznmahhhWEsvQ066i+KpV8H0tPG/SRQU/anwCw=; b=N16C5vi2fIrWZXwTwTg/gZfi7HtmrGqC3I6YYnOPaJycLLYLYa6FjiU0UAXEqFtBjVW2nD fqnuhX3GBzy4mXgVpzFWuoWOxwBBpTlJupDuIgVrrgvtimZeQV6nSrE76SiNTmtOouy6e1 Vbfm3sH//3mnHDCOz7yV6jGhrjLy+yM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-49-0My8oKFZPoCJEKNbYgjmNQ-1; Wed, 22 Jan 2020 04:03:13 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A1131005502; Wed, 22 Jan 2020 09:03:12 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4474A86432; Wed, 22 Jan 2020 09:03:12 +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 00M93AG4002864; Wed, 22 Jan 2020 10:03:10 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 00M93AjM002863; Wed, 22 Jan 2020 10:03:10 +0100 Date: Wed, 22 Jan 2020 10:03:10 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org Subject: [committed] openmp: Fix up !$omp target parallel handling Message-ID: <20200122090310.GF10088@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 User-Agent: Mutt/1.11.3 (2019-02-01) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-IsSubscribed: yes Hi! The PR93329 fix revealed we ICE on !$omp target parallel, this change fixes that. Another case where some OpenMP 4.5 support has been added, but I didn't have time to add corresponding testsuite coverage yet (~ backports of the C/C++ patches added when the C/C++ support has been added). Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk. 2020-01-22 Jakub Jelinek * parse.c (parse_omp_structured_block): Handle ST_OMP_TARGET_PARALLEL. * trans-openmp.c (gfc_trans_omp_target) : Call pushlevel first. * gfortran.dg/gomp/target-parallel1.f90: New test. * gfortran.dg/goacc/pr93329.f90: Enable commented out target parallel test. Jakub --- gcc/fortran/parse.c.jj 2020-01-12 11:54:36.594410678 +0100 +++ gcc/fortran/parse.c 2020-01-21 16:43:05.175529082 +0100 @@ -5231,6 +5231,9 @@ parse_omp_structured_block (gfc_statemen case ST_OMP_TARGET_DATA: omp_end_st = ST_OMP_END_TARGET_DATA; break; + case ST_OMP_TARGET_PARALLEL: + omp_end_st = ST_OMP_END_TARGET_PARALLEL; + break; case ST_OMP_TARGET_TEAMS: omp_end_st = ST_OMP_END_TARGET_TEAMS; break; --- gcc/fortran/trans-openmp.c.jj 2020-01-12 11:54:36.603410542 +0100 +++ gcc/fortran/trans-openmp.c 2020-01-21 16:56:13.041723952 +0100 @@ -5357,6 +5357,7 @@ gfc_trans_omp_target (gfc_code *code) { stmtblock_t iblock; + pushlevel (); gfc_start_block (&iblock); tree inner_clauses = gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_PARALLEL], --- gcc/testsuite/gfortran.dg/gomp/target-parallel1.f90.jj 2020-01-21 17:14:41.636075090 +0100 +++ gcc/testsuite/gfortran.dg/gomp/target-parallel1.f90 2020-01-21 17:14:27.292291382 +0100 @@ -0,0 +1,4 @@ +!$omp target parallel + print *, 'Hello, world' +!$omp end target parallel +end --- gcc/testsuite/gfortran.dg/goacc/pr93329.f90.jj 2020-01-21 16:33:03.043571159 +0100 +++ gcc/testsuite/gfortran.dg/goacc/pr93329.f90 2020-01-21 17:15:11.508624618 +0100 @@ -68,8 +68,8 @@ !$omp target exit data map(from: x) ! { dg-error "OMP TARGET EXIT DATA directive cannot be specified within" } !$acc end kernels !$acc kernels -!!$omp target parallel -!!$omp end target parallel +!$omp target parallel ! { dg-error "OMP TARGET PARALLEL directive cannot be specified within" } +!$omp end target parallel !$acc end kernels !$acc kernels !$omp target parallel do ! { dg-error "OMP TARGET PARALLEL DO directive cannot be specified within" }