From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 10E2D385800F; Mon, 31 Jan 2022 14:50:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 10E2D385800F From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/104147] [9/10/11/12 Regression] C preprocessor may remove the standard required whitespace between the preprocessing tokens Date: Mon, 31 Jan 2022 14:50:28 +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: 12.0 X-Bugzilla-Keywords: wrong-code 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: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Mon, 31 Jan 2022 14:50:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104147 --- Comment #3 from Jakub Jelinek --- Looking at the PREV_WHITE uses, they look like: if (token->type =3D=3D CPP_PADDING) { avoid_paste =3D true; if (print.source =3D=3D NULL || (!(print.source->flags & PREV_WHITE) && token->val.source =3D=3D NULL)) print.source =3D token->val.source; return; } ... if (avoid_paste) { ... else if (print.source->flags & PREV_WHITE ... } else if (token->flags & PREV_WHITE) and stringify_arg has something similar. So, makes me wonder if funlike_invocation_p isn't just a copy & paste of those conditions, with the important difference that padding (what we remember) is not the source, but the token itself. I'd expect something like: if (padding =3D=3D NULL || padding->val.source =3D=3D NULL || (!(padding->val.source->flags & PREV_WHITE) && token->val.source =3D=3D NULL)) padding =3D token; instead.=