From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 01718399C036; Fri, 16 Apr 2021 21:30:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 01718399C036 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/89976] [9/10/11 Regression] missing -Wuninitialized for struct member due to sra and TREE_NO_WARNING Date: Fri, 16 Apr 2021 21:30:55 +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: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW 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: component short_desc cf_reconfirmed_on cc cf_known_to_fail 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: Fri, 16 Apr 2021 21:30:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D89976 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Component|c++ |tree-optimization Summary|missing uninitialized |[9/10/11 Regression] |warning for uninitialized |missing -Wuninitialized for |struct member (VOPs) |struct member due to sra | |and TREE_NO_WARNING Last reconfirmed|2019-11-02 00:00:00 |2021-4-16 CC| |msebor at gcc dot gnu.org Known to fail| |10.2.0, 11.0, 4.5.3, 4.6.4, | |4.9.4, 5.5.0, 6.4.0, 7.2.0, | |8.3.0, 9.1.0 --- Comment #4 from Martin Sebor --- In all cases and with -O1 and above, the uninitialized read is clearly visi= ble 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 G= CC 4.5 in r147980. gcc -O1 -S -Wall -std=3Dc++14 -fdump-tree-uninit=3D/dev/stdout pr89976.C=20 ;; Function foo (_Z3foov, funcdef_no=3D3, decl_uid=3D2098, cgraph_uid=3D4, symbol_order=3D3) struct X foo () { int x$x; <<< TREE_NO_WARNING =3D=3D 1 struct X D.2133; [local count: 1073741824]: D.2133.x =3D x$x_2(D); <<< uninitialized read D.2133.y =3D 0; return D.2133; } ;; Function main (main, funcdef_no=3D4, decl_uid=3D2129, cgraph_uid=3D5, symbol_order=3D4) (executed once) int main () { int x$x; <<< TREE_NO_WARNING =3D=3D 1 struct X D.2156; struct X x; [local count: 1073741824]: x =3D{v} {CLOBBER}; return x$x_5(D); <<< uninitialized read }=