From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 149A43846457; Wed, 31 Mar 2021 17:56:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 149A43846457 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/63943] wrong location for -Wmaybe-uninitialized in inlined function Date: Wed, 31 Mar 2021 17:56:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: manu 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, 31 Mar 2021 17:56:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D63943 --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Martin Sebor from comment #3) > As for using %K, I mostly agree. I actually have %G in my tree, but my g= oal > is to get rid of both and replace them with a new warning function like s= o: > https://gcc.gnu.org/pipermail/gcc-patches/2021-January/563862.html > and replace calls to warning() and warning_at() in the middle end with th= ose > to the new function. This makes it possible to control warnings at any > point in the lining stack and resolves bug like pr98871. That is great. It may be worth CCing David Malcolm, since he is the diagnos= tics maintainer. A couple of comments: * #include "tree.h" in diagnostic.c is not great. Ideally, diagnostic.c sho= uld be independent of trees so that other front-ends can use it without having = to use tree. We went through a lot of work to make the core diagnostics independent of any FE or Middle-end and only depend on line-map and options handling. The original plan is to move it to its own library/module, but I guess there has been little progress in the modular GCC. * There is a tree-diagnostic.c. Everything that depends on tree.h should be moved there. (again, if there was a modular GCC, this would be obvious but alas...) * Although it is more work, I think Richard and other middle-end reviewers would be more motivated to accept this if it removed completely percent_K_format. That is, rather than add yet-another-way, completely repl= aces the old %K with something better. * I don't contribute to GCC anymore, but rather than doing: diag_inlining_context dic (exp); warning (dic, opt, "%qD specified size %E may exceed maximum object size %E= ", func, bndrng[0], maxobjsize); I'd prefer: warning_at_inlined_context(exp, opt, "%qD specified size %E may exceed maxi= mum object size %E", func, bndrng[0], maxobjsize); This way, I don't need to know about class diag_inlining_context nor about another variable (dic). I just need to know about an alternative warning function and the magic is hidden from me. This function can live in tree-diagnostic.c which contains the tree-specific functions for diagnostic= s.=