From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BA5A63857C74; Wed, 31 Mar 2021 19:44:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA5A63857C74 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/67196] [9/10/11 Regression] loop-induced false positive from -Wmaybe-uninitialized Date: Wed, 31 Mar 2021 19:44:36 +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: 6.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: cf_reconfirmed_on cf_known_to_fail cc short_desc keywords 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: Wed, 31 Mar 2021 19:44:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D67196 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2015-08-12 00:00:00 |2021-3-31 Known to fail| |10.2.0, 11.0, 5.5.0, 6.4.0, | |7.2.0, 8.3.0, 9.1.0 CC| |msebor at gcc dot gnu.org Summary|Another false positive from |[9/10/11 Regression] |-Wmaybe-uninitialized |loop-induced false positive | |from -Wmaybe-uninitialized Keywords| |diagnostic --- Comment #3 from Martin Sebor --- Reconfirmed with GCC 11 as a regression introduced in r185913 (4.8.0 201203= 28). Nothing in the IL jumps out at me that could be used by the predicate analy= sis to rule out the false positive: the use in the return statement in bb 8 loo= ks unconditional. pr67196.c: In function =E2=80=98test=E2=80=99: pr67196.c:7:7: warning: =E2=80=98first_caption_idx=E2=80=99 may be used uni= nitialized in this function [-Wmaybe-uninitialized] 7 | int first_caption_idx; | ^~~~~~~~~~~~~~~~~ int test (int n) { int i; int first_caption_idx; int first_caption; int num_captions_in_row; int _1; _Bool _2; _Bool _3; _Bool _4; int _12; [local count: 118111600]: if (n_16(D) > 0) goto ; [89.00%] else goto ; [11.00%] [local count: 12992276]: goto ; [100.00%] [local count: 105119324]: [local count: 955630225]: # num_captions_in_row_25 =3D PHI # first_caption_27 =3D PHI # first_caption_idx_29 =3D PHI <<< (3) first_caption_idx_14(D) is uninitialized # i_31 =3D PHI _1 =3D some_test (i_31); if (_1 !=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 477815113]: goto ; [100.00%] [local count: 477815112]: num_captions_in_row_18 =3D num_captions_in_row_25 + 1; [local count: 955630225]: # num_captions_in_row_5 =3D PHI # first_caption_7 =3D PHI # first_caption_idx_9 =3D PHI <<< (= 2) i_19 =3D i_31 + 1; if (n_16(D) !=3D i_19) goto ; [89.00%] else goto ; [11.00%] [local count: 850510901]: goto ; [100.00%] [local count: 105119324]: _2 =3D first_caption_7 !=3D 0; _3 =3D num_captions_in_row_5 =3D=3D 1; _4 =3D _2 & _3; if (_4 !=3D 0) goto ; [38.20%] else goto ; [61.80%] [local count: 40157944]: goto ; [100.00%] [local count: 64961380]: [local count: 118111600]: # _12 =3D PHI <<< (= 1) return _12; <<< use }=