From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3697385782E; Fri, 2 Apr 2021 19:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3697385782E From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/81958] [9/10/11 Regression] spurious -Wmaybe-uninitialized warning in gcc-8, or with -O1 Date: Fri, 02 Apr 2021 19:36:52 +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: 8.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: short_desc cf_known_to_fail cc cf_known_to_work cf_reconfirmed_on 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, 02 Apr 2021 19:36:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81958 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|spurious |[9/10/11 Regression] |-Wmaybe-uninitialized |spurious |warning in gcc-8, or with |-Wmaybe-uninitialized |-O1 |warning in gcc-8, or with | |-O1 Known to fail| |10.2.0, 11.0, 8.3.0, 9.3.0 CC| |msebor at gcc dot gnu.org Known to work| |7.3.0 Last reconfirmed|2017-09-30 00:00:00 |2021-4-2 --- Comment #4 from Martin Sebor --- Reconfirming with GCC 11 as a GCC 8 regression introduced in r249013. It fa= ils the same with -O1 and -O2. I think the warning seems to be doing what it's designed to do. The IL below annotated with my comments in bb 7 shows that there is a patch along which the use is uninitialized. void lpfc_debug_dump_all_queues (unsigned int maxidx) { unsigned long ivtmp.7; unsigned int eqidx; struct lpfc_queue * eq; struct lpfc_queue * cq_phba.0_1; struct lpfc_queue * _2; int _5; unsigned int _23; long unsigned int _24; [count: 0]: # .MEM_12 =3D VDEF <.MEM_11(D)> printk (); # VUSE <.MEM_12> cq_phba.0_1 =3D cq_phba; goto ; [0.00%] [count: 0]: # VUSE <.MEM_12> _2 =3D cq_phba.0_1->hba_eq; _24 =3D ivtmp.7_25 * 16; eq_16 =3D _2 + _24; # VUSE <.MEM_12> _5 =3D eq_16->queue_id; ivtmp.7_26 =3D ivtmp.7_25 + 1; if (_5 !=3D 0) goto ; [0.00%] else goto ; [0.00%] [count: 0]: goto ; [100.00%] [count: 0]: [count: 0]: # eq_7 =3D PHI # ivtmp.7_25 =3D PHI <0(2), ivtmp.7_26(8)> _23 =3D (unsigned int) ivtmp.7_25; if (maxidx_15(D) > _23) goto ; [0.00%] else goto ; [0.00%] [count: 0]: if (maxidx_15(D) =3D=3D _23) goto ; [0.00%] else goto ; [0.00%] [count: 0]: goto ; [100.00%] [count: 0]: # VUSE <.MEM_12> eq_18 =3D cq_phba.0_1->hba_eq; [count: 0]: ## eq_7(10) =3D PHI ## eq_7(10) =3D eq_14(D)(2) (unconditional: 2 -> 4) ## eq_9 =3D eq_7 =3D eq_14(D)(2) ## if (maxidx_15(D) <=3D _23 && maxidx_15(D) !=3D _23: 4 -> 5, 5 -> 10,= 10 -> 7) # eq_9 =3D PHI # .MEM_19 =3D VDEF <.MEM_12> printk (eq_9); [tail call] # VUSE <.MEM_19> return; } Before r249013 there is no uninitialized read from eq in the IL: ; Function lpfc_debug_dump_all_queues (lpfc_debug_dump_all_queues, funcdef_no=3D0, decl_uid=3D1800, cgraph_uid=3D0, symbol_order=3D1) lpfc_debug_dump_all_queues (unsigned int maxidx) { unsigned int eqidx; struct lpfc_queue * eq; struct lpfc_queue * prephitmp_1; unsigned long _2; int _5; struct lpfc_queue * _20; int _22; struct lpfc_queue * pretmp_23; struct lpfc_queue * pretmp_24; struct lpfc_queue * cq_phba.0_25; struct lpfc_queue * _26; unsigned long _28; [14.44%]: printk (); if (maxidx_15(D) !=3D 0) goto ; [92.50%] else goto ; [7.50%] [1.08%]: pretmp_23 =3D cq_phba; pretmp_24 =3D pretmp_23->hba_eq; goto ; [100.00%] [13.32%]: cq_phba.0_25 =3D cq_phba; _26 =3D cq_phba.0_25->hba_eq; _22 =3D _26->queue_id; if (_22 !=3D 0) goto ; [7.50%] else goto ; [92.50%] [12.32%]: goto ; [100.00%] [1.00%]: goto ; [100.00%] [79.18%]: _2 =3D (unsigned long) eq_29; _28 =3D _2 + 16; _20 =3D (struct lpfc_queue *) _28; _5 =3D MEM[base: _20, offset: 0B]; if (_5 !=3D 0) goto ; [7.50%] else goto ; [92.50%] [5.94%]: goto ; [100.00%] [73.24%]: [85.60%]: # eqidx_27 =3D PHI # eq_29 =3D PHI <_20(12), _26(10)> eqidx_17 =3D eqidx_27 + 1; if (maxidx_15(D) !=3D eqidx_17) goto ; [92.50%] else goto ; [7.50%] [6.42%]: [5.44%]: # prephitmp_1 =3D PHI <_26(13), pretmp_24(3)> [14.44%]: # eq_9 =3D PHI <_26(9), prephitmp_1(7), _20(11)> printk (eq_9); [tail call] return; }=