From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EE499385BC23; Tue, 30 Nov 2021 14:22:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE499385BC23 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99919] [9/10/11/12 Regression] bogus -Wmaybe-uninitialized with a _Bool bit-field Date: Tue, 30 Nov 2021 14:22:06 +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: 11.0 X-Bugzilla-Keywords: deferred, diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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: Tue, 30 Nov 2021 14:22:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99919 --- Comment #5 from Aldy Hernandez --- (In reply to Andrew Pinski from comment #4) > (In reply to Aldy Hernandez from comment #3) > > The warning on the above IL seems legit. > >=20 > > x_5 is initialized from b$i_11 when b & 1 =3D=3D 0, but the read from x= _5 > > happens when b & 2 !=3D 0. So the set and the read are predicated on t= wo > > different things. > >=20 > > Maybe I'm missing some subtle bit field thing. Does setting b.j somehow > > alter b.i? > b.j is (b&2)<<1. >=20 > If lower bit field acceses it is fixed (but also becomes more obvious what > the of b.j is: > _20 =3D VIEW_CONVERT_EXPR(b); > _21 =3D BIT_INSERT_EXPR <_20, b$j_15, 1 (1 bits)>; > VIEW_CONVERT_EXPR(b) =3D _21; > _3 =3D VIEW_CONVERT_EXPR(b); > _4 =3D _3 & 2; >=20 > So Mine for GCC 13. You're a rockstar. Thanks.=