From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 338DA3857BA1; Thu, 26 May 2022 13:38:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 338DA3857BA1 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/105732] [9/10/11/12/13 Regression] internal compiler error: unspellable token PADDING Date: Thu, 26 May 2022 13:38:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: blocker X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: Thu, 26 May 2022 13:38:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105732 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #9 from Jakub Jelinek --- With a slightly modified testcase: #define m1(p1, p2, p3) p3 #define m2(p1, ...) 1 __VA_OPT__() #define M(...) m1(1, 2, m2) #if M(,)(,) #endif it started to ICE already with r8-6791-g60887f8c2df851 aka PR83708 fix. The r12-6155-g5545d1edcbdb17 change just turns that into the same tokens as before, while previously it wasn't. As __VA_OPT__() or __VA_OPT__(foo) in = both cases expands to nothing, 1##nothing is still 1 and the avoid_paste token is added afterwards to make sure token after __VA_OPT__() isn't emitted right after it without whitespace. It isn't immediately clear to me what should be eating the padding token so that cpp_parse_expr doesn't see it. Or is this a bug in cpp_parse_expr? I mean, other callers of cpp_get_token_with_location like e.g. in c_lex_with_flags handle CPP_PADDING by calling cpp_get_token_with_location again. Similarly scan_translation_unit when doing -E, token_streamer::stream just remembers there was padding and goes on (and takes that into account whether whitespace should be emitted or not).=