From patchwork Tue Oct 31 13:18:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 160111 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp232652vqg; Tue, 31 Oct 2023 06:19:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFn6Tg3QanYsvA4TGL/sPDHB78jrfT/5qjwA6ADZhJAK8wdkNnOZJjxSe4+8OLH6gCsKQn X-Received: by 2002:a67:ac01:0:b0:457:c7ae:fb28 with SMTP id v1-20020a67ac01000000b00457c7aefb28mr1481870vse.13.1698758365703; Tue, 31 Oct 2023 06:19:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698758365; cv=pass; d=google.com; s=arc-20160816; b=S1y3GvnhhpcFDLg316ItNhoCSMjqWESNMEQdkFsr7DKzmY+hmSDTSedbl0dx1Bu92q Nsp0eabBM4dPjtdIGQh3lXP/fasByKGOZUzZrXwPkDlgKq8nq9uVtp5MH3H2wb9J1t+6 atQVRuKP7PMliYRSl0Xm4oCiyjSaJHYruqMHx0+VbiMCDMHl1lKzODBoQ6hy9PfjF6mj ijfFxmpiImKXqzIewlM3nN/k5PU9WKa7EVqm+46DQpfAkTTbWj6v9wkjhi5uVozOsO1t xAP37bpbpFeNvrHxlc/xw9ex3AqaKu/RlWzYviOZbQrAXg/O7R6jWKAMv0kUNzm2DpC8 yZKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:arc-filter:dmarc-filter:delivered-to; bh=WCG/sqVdKuZk8Zt9RXMVYR9tTbYSERNsnw510tCFWcE=; fh=8G0fvw9kezX2+yjwifXgHvTII1omy92vRpR1R+rFCOA=; b=IiWDa1xmSWbJGaV1r2aDFpUTsgfk6cu/iTCNuTM+CEqZFlR32upj62RE4a1zqZimug bIP077RZmznwXc+PjwT5njXD9ivnnHtuA1EIIb4WbC8JMMZKYVEQbdDS31U200e7ctLg xu5JPsVlorkH183Q9wW8uNW94y1I8mUReXNuHofa3Phh005O83zr7oegoqpnhmSMibdY 2kEMcXR+M6izNUqoYXdNDQqCiu9oJ1JHw645hFhCaHz1wWL3mqPAgZSZxeyNcOGM0OHY 1e8SDTVqq/fetDOVwi++EPPVtjK5uF8QWzbFdjnZZScMXN9IQsaDXg+eL5KOzCukA3p4 PT5A== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s16-20020a67c390000000b00457adf3b49dsi101626vsj.233.2023.10.31.06.19.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 06:19:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 67C2B3858C2B for ; Tue, 31 Oct 2023 13:19:25 +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 774893858D1E for ; Tue, 31 Oct 2023 13:19:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 774893858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 774893858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.137.252 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698758342; cv=none; b=ERMLIZU9UIgnmC/EgyX9zMHduVYEpMvAvR8dTH25Uc8ihn9k0iUUtHzQlHKmXAzGwALXh/mqGNnB8A936+NGmtmmtHqXjnuCB9ARvGQqZrw9zE1HRNwsww/Ef23LUCtUExZFGOcB5rrOhQqsVzxt4S5LaiQBwe23Q7b+zLmCZVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698758342; c=relaxed/simple; bh=WCG/sqVdKuZk8Zt9RXMVYR9tTbYSERNsnw510tCFWcE=; h=Message-ID:Date:MIME-Version:To:From:Subject; b=JHsMwXkzTpavB+ChWrxtxEpniIGeg+wI/JY0jcNg1iKPDR/O6+9+bifFKDaqHODgFpZ1tYAuYsYPJBcC305+8Wt8brPC7m6IWqXpy/UwmJmiRrli5dbGRCD9tlbHIrmwwUcB+MLFIurmj+ObYxr6HEV5z51WPku4ggU0qbTsKag= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: QsxBw0FsSWaZ5t19Cbg4cQ== X-CSE-MsgGUID: mN1PL+VgR/+U+b6UzPKuFQ== X-IronPort-AV: E=Sophos;i="6.03,265,1694764800"; d="diff'?scan'208";a="21397936" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Oct 2023 05:18:57 -0800 IronPort-SDR: QLspH3UlFnLkGH8SmidYC6i0D4vpdp0+hGF9DMtDfUE5aTAB34pJonkK2rhlc0ydPPoYxE7QSg xSCKhxifeIWnRR6S4oL9IzxDpGUB90COx+++BxBW6/xsrRrjcyDZyP0fltW/xpPhbYQ7uqQta/ Nde29m5UGzGZVJ9CvsmSjMsKv7HXjqJAJ5RuVwF4SFs6DAj2VTRM3tVqDLwZcBJVHo1K0hY7sc kly6c7JDDthjZcxFO1scogvKQJBcsDvuQNpZtsUywiHnxfeCCNiQ+sELSsicIzAPnJiJOZ45gl jhU= Message-ID: <56e022f9-06c8-4656-bcdf-b052fd0cae04@codesourcery.com> Date: Tue, 31 Oct 2023 14:18:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches From: Tobias Burnus Subject: [OG13][committed] OpenMP/Fortran: Fix parsing of metadirectives with BLOCK X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781277251606509291 X-GMAIL-MSGID: 1781277251606509291 This is an OG13-only patch as metadirectives are not yet on mainline. I think it is a side effect of the backported my mainline patch that fixed strictly-nested blocks that was backported to OG13 on Oct 8, 2023 in OG13 commit 36e5f02e64bd4b5b1eaf89993a63c56b01cd4e7c. Tobias ----------------- 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 commit 46feedaddf8e4d82b7a24557c7bb4c8c3ee287a0 Author: Tobias Burnus Date: Tue Oct 31 12:03:44 2023 +0100 OpenMP/Fortran: Fix parsing of metadirectives with BLOCK Probably a fallout of the backport of r14-4471-g6a8edd50a149f1 Fortran/OpenMP: Fix handling of strictly structured blocks This showed up as parsing error/fail with libgomp.fortran/metadirective-1.f90 libgomp.fortran/metadirective-6.f90 gcc/fortran/ * decl.cc (gfc_match_end): Handle unnamed END BLOCK with metadirectives. --- gcc/fortran/ChangeLog.omp | 5 +++++ gcc/fortran/decl.cc | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp index 6b30302428f..e20a88b8740 100644 --- a/gcc/fortran/ChangeLog.omp +++ b/gcc/fortran/ChangeLog.omp @@ -1,3 +1,8 @@ +2023-10-31 Tobias Burnus + + * decl.cc (gfc_match_end): Handle unnamed END BLOCK with + metadirectives. + 2023-10-30 Tobias Burnus * trans-openmp.cc (gfc_trans_omp_clauses): Avoid gfc_evaluate_now diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc index 783c39438e8..4c04e64d37c 100644 --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -8409,6 +8409,9 @@ gfc_match_end (gfc_statement *st) && state_data->sym->abr_modproc_decl; } while (state == COMP_OMP_METADIRECTIVE); + + if (startswith (block_name, "block@")) + block_name = NULL; } break; default: