From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB2463858C83; Wed, 19 Apr 2023 20:25:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB2463858C83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681935927; bh=sYGfFUTgmYoOX8v6uyJdaGFzvp8Fs5vBelhacMEQI4k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vBlIqlUIWnCRrg8t1qn1gSIg+Mg+3az91Q1pK4+RyNU5nDcjCWfrtX47SOT8982F0 OCvN37Mi6DqxwyiUgdtHFmt6CYefBs2NCJHo1RPfOIN/IKbGymy83h7ZT9lTSVPjrW r39kjAWs87wBLy8/J87d3R8nKW1Esrb83aKHWQFM= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109559] [12/13/14 Regression] Unexpected -Wmaybe-uninitialized warning when inlining with system header Date: Wed, 19 Apr 2023 20:25:27 +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: 14.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc keywords target_milestone 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109559 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Unexpected |[12/13/14 Regression] |-Wmaybe-uninitialized |Unexpected |warning when inlining with |-Wmaybe-uninitialized |system header |warning when inlining with | |system header Keywords| |diagnostic Target Milestone|--- |12.3 --- Comment #1 from Marek Polacek --- Started with r12-1992.=20=20 We have an inlining context containing locations for each call site along the inlining stack: struct inlining_info. It has a stack of locations, and a flag that says whether all of them come from a system header. If so, we don't warn: 1548 if (!report_warning_p && diagnostic->m_iinfo.m_allsyslocs) 1549 /* Bail if the warning is not to be reported because all locations 1550 in the inlining stack (if there is one) are in system headers. = */ 1551 return false; but in this test diagnostic->m_iinfo.m_allsyslocs is false because the inli= ning causes that the outermost context is the un.cc file, which is not a system header. It looks like this is a failure to propagate the sysp flag when inlining a function.=