From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E38113858C52; Sat, 4 Feb 2023 00:07:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E38113858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675469230; bh=PSGnWSi/iT7XVz6wv8aQHwVAKWq1+SVak/O9FW5aHgA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P5MJlr68CWRB+Di1qgK+QMi0ZBBCuGenxO8JMhxrSEKxTeoCYEwhUpR+6cu2Ur1oe yhkKbsV3VcOJIgVKkkOWc1yj+mELyOPAriFpvLEnVmdTh/5BEUzUJoE7VjZX4lSp6M QWchVu103taiDSgrwdnj2+f+5UeqeGGJzrWsnRKE= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108667] Spurious "may be used uninitialized [-Wmaybe-uninitialized]" warning Date: Sat, 04 Feb 2023 00:07:10 +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: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108667 --- Comment #1 from Andrew Pinski --- This is partly caused by not inlining everything as main is marked as called once. If instead I call main, main1, the warning goes away and the following call= is inlined now: std::_Function_handler >::_M_manager (&MEM[(st= ruct function *)&s + 32B].D.47025._M_functor, &D.47426.D.47025._M_functor, 2); The warning in this case is about D.47426 which does not have any initialization before the call here. Note the call with last operand as 2 does not actually do anything and just returns. I don't know the best way to solve this specific case as it depends on inli= ning heurstics. Question for the reporter, was this a reduction from some real code or did = you just notice the warning while testing some code?=