From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2285B3951455; Wed, 24 Feb 2021 17:14:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2285B3951455 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99072] [modules] Compiling header unit with partial preprocessing (-E -fdirectives-only) twice causes CRC mismatch Date: Wed, 24 Feb 2021 17:14:41 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nathan at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Wed, 24 Feb 2021 17:14:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99072 --- Comment #6 from CVS Commits --- The master branch has been updated by Nathan Sidwell : https://gcc.gnu.org/g:a13be187cb2987db851b3f096f5319d5fe3a7301 commit r11-7366-ga13be187cb2987db851b3f096f5319d5fe3a7301 Author: Nathan Sidwell Date: Wed Feb 24 05:50:12 2021 -0800 c++: modules & -fpreprocessed [PR 99072] When we read preprocessed source, we deal with a couple of special location lines at the start of the file. These provide information about the original filename of the source and the current directory, so we can process the source in the same manner. When updating that code, I had a somewhat philosophical question: Should the line table contain evidence of the filename the user provided to the compiler? I figured to leave it there, as it did no harm. But this defect shows an issue. It's in the line table and our (non optimizing) line table serializer emits that filename. Which means if one re-preprocesses the original source to a differently-named intermediate file, the resultant CMI is different. Boo. That's a difference that doesn't matter, except the CRC matching then fails. We should elide the filename, so that one can preprocess to mktemp intermediate filenames for whatever reason. This patch takes the approach of expunging it from the line table -- so the line table will end up with exactly the same form. That seems a better bet than trying to fix up mismatching line tables in CMI emission. PR c++/99072 libcpp/ * init.c (read_original_filename): Expunge all evidence of the original filename. gcc/testsuite/ * g++.dg/modules/pr99072.H: New.=