From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9E1463948828; Tue, 13 Apr 2021 20:24:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E1463948828 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/90307] -Wuninitialized only at -O1, not at -O2 Date: Tue, 13 Apr 2021 20:24:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: blocked cf_known_to_fail resolution bug_status target_milestone cc 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: Tue, 13 Apr 2021 20:24:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90307 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24639 Known to fail| |10.3.0 Resolution|--- |FIXED Status|NEW |RESOLVED Target Milestone|--- |11.0 CC| |msebor at gcc dot gnu.org --- Comment #3 from Martin Sebor --- GCC warns in both -O1 and -O2 since r11-7940. The IL shows the ctor is inl= ined now which is what makes the warning possible. Defining the ctor outside the class keeps GCC from inlining it which in turn defeats the warning as one might expect. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D24639 [Bug 24639] [meta-bug] bug to track all Wuninitialized issues=