From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA72E3858C78; Thu, 4 May 2023 11:28:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA72E3858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683199701; bh=IsDAvbGHY8+0oT6spOgZ9S/pVVsqyGKkpPUWYbmb86c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HZ52u7Cl1t8x/1WZ49VyMxzzY1Ai81GYsg+uxdjP6UDc5SvMIjr9zHw2U+jSI7kyY RQXE28fmIiwEa9X2Q4hWO7L4m3nQ7/+0UKmDekXGum4WPC7wkPUuJre+URuAitlJsU JTh9vXKNhBbBv+p1VKN3HZX5pqGkh7toQHoIET6U= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109720] -Wmaybe-uninitialized triggering when I can see no path that would allow it Date: Thu, 04 May 2023 11:28:21 +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: 13.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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=3D109720 --- Comment #5 from Richard Biener --- We complain about the m_num_bits read. While PRE isolates it to BB3 even before PRE that happens unconditionally: [local count: 118111600]: nbits =3D{v} {CLOBBER}; _25 =3D MEM[(const struct DynamicBitSet &)&set]._size; nbits._size =3D _25; if (_25 <=3D 64) goto ; [67.00%] else goto ; [33.00%] [local count: 79134772]: _162 =3D MEM[(const struct DynamicBitSet &)&set].D.151332._fixedSizeBitSe= t; nbits.D.151332._fixedSizeBitSet =3D _162; goto ; [100.00%] ... [local count: 56691384]: _46 =3D (long unsigned int) _40; _47 =3D iftmp.2_49 + _46; MEM[(struct vector *)&nbits + 8B].D.150855._M_impl.D.150172._M_finish =3D= _47; _29 =3D MEM[(const struct dynamic_bitset &)&set + 8].m_num_bits; MEM[(struct dynamic_bitset *)&nbits + 8B].m_num_bits =3D _29; _60 =3D boost::dynamic_bitset<>::m_do_find_from (&nbits.D.151332._dynamicBitSet, 0); if (_60 !=3D 18446744073709551615) goto ; [66.92%] else goto ; [33.08%] [local count: 103222856]: # _63 =3D PHI <_60(12), _25(3)> _68 =3D MEM[(const struct dynamic_bitset *)&nbits + 8B].m_num_bits; PRE just sees the partial redundancy on the edge from BB12. The read is from dynamic_bitset::to_ulong(). It _looks_ like that maybe the range-for handling code exposes this in a way that doesn't properly short-cut this read (or that GCC short-circuits a test there). Difficult to identify in the preprocessed sources.=