public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-81958-4-uzZAjNGpNc@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-81958-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81958 Martin Sebor <msebor at gcc dot gnu.org> 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 <msebor at gcc dot gnu.org> --- Reconfirming with GCC 11 as a GCC 8 regression introduced in r249013. It fails 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; <bb 2> [count: 0]: # .MEM_12 = VDEF <.MEM_11(D)> printk (); # VUSE <.MEM_12> cq_phba.0_1 = cq_phba; goto <bb 4>; [0.00%] <bb 3> [count: 0]: # VUSE <.MEM_12> _2 = cq_phba.0_1->hba_eq; _24 = ivtmp.7_25 * 16; eq_16 = _2 + _24; # VUSE <.MEM_12> _5 = eq_16->queue_id; ivtmp.7_26 = ivtmp.7_25 + 1; if (_5 != 0) goto <bb 9>; [0.00%] else goto <bb 8>; [0.00%] <bb 9> [count: 0]: goto <bb 7>; [100.00%] <bb 8> [count: 0]: <bb 4> [count: 0]: # eq_7 = PHI <eq_14(D)(2), eq_16(8)> # ivtmp.7_25 = PHI <0(2), ivtmp.7_26(8)> _23 = (unsigned int) ivtmp.7_25; if (maxidx_15(D) > _23) goto <bb 3>; [0.00%] else goto <bb 5>; [0.00%] <bb 5> [count: 0]: if (maxidx_15(D) == _23) goto <bb 6>; [0.00%] else goto <bb 10>; [0.00%] <bb 10> [count: 0]: goto <bb 7>; [100.00%] <bb 6> [count: 0]: # VUSE <.MEM_12> eq_18 = cq_phba.0_1->hba_eq; <bb 7> [count: 0]: ## eq_7(10) = PHI <eq_14(D)(2), eq_16(8)> ## eq_7(10) = eq_14(D)(2) (unconditional: 2 -> 4) ## eq_9 = eq_7 = eq_14(D)(2) ## if (maxidx_15(D) <= _23 && maxidx_15(D) != _23: 4 -> 5, 5 -> 10, 10 -> 7) # eq_9 = PHI <eq_7(10), eq_18(6), eq_16(9)> # .MEM_19 = 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=0, decl_uid=1800, cgraph_uid=0, symbol_order=1) 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; <bb 2> [14.44%]: printk (); if (maxidx_15(D) != 0) goto <bb 4>; [92.50%] else goto <bb 3>; [7.50%] <bb 3> [1.08%]: pretmp_23 = cq_phba; pretmp_24 = pretmp_23->hba_eq; goto <bb 7>; [100.00%] <bb 4> [13.32%]: cq_phba.0_25 = cq_phba; _26 = cq_phba.0_25->hba_eq; _22 = _26->queue_id; if (_22 != 0) goto <bb 9>; [7.50%] else goto <bb 10>; [92.50%] <bb 10> [12.32%]: goto <bb 6>; [100.00%] <bb 9> [1.00%]: goto <bb 8>; [100.00%] <bb 5> [79.18%]: _2 = (unsigned long) eq_29; _28 = _2 + 16; _20 = (struct lpfc_queue *) _28; _5 = MEM[base: _20, offset: 0B]; if (_5 != 0) goto <bb 11>; [7.50%] else goto <bb 12>; [92.50%] <bb 11> [5.94%]: goto <bb 8>; [100.00%] <bb 12> [73.24%]: <bb 6> [85.60%]: # eqidx_27 = PHI <eqidx_17(12), 0(10)> # eq_29 = PHI <_20(12), _26(10)> eqidx_17 = eqidx_27 + 1; if (maxidx_15(D) != eqidx_17) goto <bb 5>; [92.50%] else goto <bb 13>; [7.50%] <bb 13> [6.42%]: <bb 7> [5.44%]: # prephitmp_1 = PHI <_26(13), pretmp_24(3)> <bb 8> [14.44%]: # eq_9 = PHI <_26(9), prephitmp_1(7), _20(11)> printk (eq_9); [tail call] return; }
next parent reply other threads:[~2021-04-02 19:36 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-81958-4@http.gcc.gnu.org/bugzilla/> 2021-04-02 19:36 ` msebor at gcc dot gnu.org [this message] 2021-04-08 14:24 ` rguenth at gcc dot gnu.org 2021-06-01 8:09 ` [Bug tree-optimization/81958] [9/10/11/12 " rguenth at gcc dot gnu.org 2022-01-21 13:52 ` rguenth at gcc dot gnu.org 2022-05-27 9:37 ` [Bug tree-optimization/81958] [10/11/12/13 " rguenth at gcc dot gnu.org 2022-06-28 10:33 ` jakub at gcc dot gnu.org 2023-03-30 12:53 ` rguenth at gcc dot gnu.org 2023-07-07 10:32 ` [Bug tree-optimization/81958] [11/12/13/14 " rguenth at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-81958-4-uzZAjNGpNc@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).