From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 664CE3885533; Wed, 13 Jul 2022 17:48:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 664CE3885533 From: "lhyatt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/106274] Loss of macro tracking information with -flto Date: Wed, 13 Jul 2022 17:48:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: diagnostic, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: lhyatt 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: --- 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, 13 Jul 2022 17:48:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106274 --- Comment #4 from Lewis Hyatt --- (In reply to Richard Biener from comment #1) > I'm not sure to what extent this is still required with respect to the > diagnostic context though - you'd have to try. Thanks for the explanation, the general nature of it makes sense to me now. There is one current testcase (g++.dg/20090121-1.C) which demonstrates that it's not OK to simply skip calling tree_diagnostics_defaults () entirely for -flto... For that testcase, the -Wuninitialized diagnostic calling back into the C+ frontend (cp_printer) would ICE after ipa-free-lang-data pass if so. It seems like it should be doable to address this, maybe frontends could specify how they want ipa-free-lang-data to adjust their diagnostic context= , so it wouldn't have to be all or nothing. I can look into that sometime, perha= ps it would help with enabling this pass to run during non-LTO compilation as well.=