From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8CB73858D3C; Fri, 11 Mar 2022 14:07:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8CB73858D3C From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/104623] [11/12 Regression] ICE in cp_parser_skip_to_pragma_eol, at cp/parser.cc:4107 Date: Fri, 11 Mar 2022 14:07:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Mar 2022 14:07:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104623 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Created attachment 52607 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D52607&action=3Dedit gcc12-pr104623.patch The problem is that the function purges the tokens, from the token after CPP_PRAGMA until CPP_PRAGMA_EOL (the latter inclusive). But CPP_PRAGMA is = not purged. So, next time we tentatively parse it we ICE because CPP_PRAGMA is= n't followed by CPP_PRAGMA_EOL anymore (because purged tokens are ignored). I have tried various things, purging also the pragma_tok token or changing second argument of cp_parser_skip_to_pragma_eol to NULL in cp_parser_skip_to_end_of_statement and cp_parser_skip_to_end_of_block_or_statement but both regressed various testcases. This at least in quick check-g++ testing didn't regress anything.=