From patchwork Tue Oct 26 20:28:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Anlauf X-Patchwork-Id: 46675 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 705253858402 for ; Tue, 26 Oct 2021 20:28:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 705253858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635280134; bh=ce7Lwdm+8oUhv/O1zULhgnVAyhWRkQmgroWQUGy3REc=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=x1pXIH3DV89rDowRBLYBNSrj1Jiv/KUm7ev5H2DYUJF5D4uK9SwaWyGR54dEtDY+e 41sKyzBYkhCM+xbHYX8Q0wpyOgiqWTaDYVUaA2RApYOvtxfa4jPTYmoqKL/t2GOFP3 zcV51OYf4P4paW2pz9hnGcgztfzVrlXlqsP3YFZU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by sourceware.org (Postfix) with ESMTPS id EBF583858D39; Tue, 26 Oct 2021 20:28:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EBF583858D39 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [79.251.14.173] ([79.251.14.173]) by web-mail.gmx.net (3c-app-gmx-bs16.server.lan [172.19.170.68]) (via HTTP); Tue, 26 Oct 2021 22:28:06 +0200 MIME-Version: 1.0 Message-ID: To: fortran , gcc-patches Subject: [PATCH, committed] PR fortran/86551 - ICE on invalid code with select type Date: Tue, 26 Oct 2021 22:28:06 +0200 Importance: normal Sensitivity: Normal X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KhlDeMjoPJbQpCg4r0WVNinlZg4nvhbpIh+zzgkAy3KF+vQkgeI 1fkRsEI9OKC/F/DBo6WdZ9O6D4lwyY984FKDVsKj6SgQsrZRHUVV23gMMTLHI2l5R5jpfLCA1 wSRwa0V X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, 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: , X-Patchwork-Original-From: Harald Anlauf via Gcc-patches From: Harald Anlauf Reply-To: Harald Anlauf Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Dear Fortranners, as has been validated by others before and checked again, the underlying issue of this PR has been fixed before by an unknown commit. To ensure that it doesn't pop up again, and as suggested in the PR, I've packaged the testcase and committed as obvious. Thanks, Harald commit 0ec53a3df536f83ec72ef25b045768c06c363f86 Author: Harald Anlauf Date: Tue Oct 26 22:22:36 2021 +0200 Fortran: error recovery on invalid code with SELECT TYPE gcc/testsuite/ChangeLog: PR fortran/86551 * gfortran.dg/pr86551.f90: New test to verify that PR86551 remains fixed. diff --git a/gcc/testsuite/gfortran.dg/pr86551.f90 b/gcc/testsuite/gfortran.dg/pr86551.f90 new file mode 100644 index 00000000000..d96e17a1884 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr86551.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! PR fortran/86551 - ICE on invalid code with select type / end select type + +subroutine b + type :: t1 + end type t1 + class(t1) :: c2 + select type (d => c2) + end select type ! { dg-error "Syntax error" } +end ! { dg-error "END SELECT statement expected" } + +! { dg-prune-output "Unexpected end of file" }