From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CBF3C383D810; Sat, 26 Jun 2021 15:17:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CBF3C383D810 From: "egallager at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/89976] [9/10/11/12 Regression] missing -Wuninitialized for struct member due to sra and TREE_NO_WARNING Date: Sat, 26 Jun 2021 15:17:53 +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: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: egallager at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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: Sat, 26 Jun 2021 15:17:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D89976 --- Comment #6 from Eric Gallager --- (In reply to Martin Sebor from comment #4) > In all cases and with -O1 and above, the uninitialized read is clearly > visible in the IL but it's suppressed because the variable (such as x$x in > case 1) has the TREE_NO_WARNING bit set. This appears to be regression > introduced in GCC 4.5 in r147980. >=20 > gcc -O1 -S -Wall -std=3Dc++14 -fdump-tree-uninit=3D/dev/stdout pr89976.C= =20 >=20 > ;; Function foo (_Z3foov, funcdef_no=3D3, decl_uid=3D2098, cgraph_uid=3D4, > symbol_order=3D3) >=20 > struct X foo () > { > int x$x; <<< TREE_NO_WARNING =3D=3D 1 > struct X D.2133; >=20 > [local count: 1073741824]: > D.2133.x =3D x$x_2(D); <<< uninitialized read > D.2133.y =3D 0; > return D.2133; >=20 > } >=20 >=20 >=20 > ;; Function main (main, funcdef_no=3D4, decl_uid=3D2129, cgraph_uid=3D5, > symbol_order=3D4) (executed once) >=20 > int main () > { > int x$x; <<< TREE_NO_WARNING =3D=3D 1 > struct X D.2156; > struct X x; >=20 > [local count: 1073741824]: > x =3D{v} {CLOBBER}; > return x$x_5(D); <<< uninitialized read >=20 > } did your TREE_NO_WARNING overhaul affect this at all?=