public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/81958] [10/11/12/13 Regression] spurious -Wmaybe-uninitialized warning in gcc-8, or with -O1 Date: Thu, 30 Mar 2023 12:53:09 +0000 [thread overview] Message-ID: <bug-81958-4-RoMgoSNqgi@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 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization --- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- We see <bb 4> [count: 0]: # eq_7 = PHI <eq_14(D)(2), eq_16(8)> # ivtmp.7_23 = PHI <0(2), ivtmp.7_24(8)> _25 = (unsigned int) ivtmp.7_23; if (maxidx_15(D) > _25) goto <bb 3>; [0.00%] else goto <bb 5>; [0.00%] // loop exit <bb 5> [count: 0]: if (maxidx_15(D) == _25) goto <bb 6>; [0.00%] else goto <bb 10>; [0.00%] <bb 7> [count: 0]: # eq_9 = PHI <eq_7(10), eq_18(6), eq_16(9)> printk (eq_9); [tail call] return; and the appearant uninit use is on the 10->7 edge, when maxidx != _25 but at the same time maxidx > _25. We don't realize that the maxidx == _25 condition is always true. The possible easiest way is probably to rewrite the in-loop condition to maxid != _25 somewhere (ivcanon?). uninit analysis itself just sees maxid <= _25 && maxid ==_25 as the initialized cases - it could possibly analyze how _25 evolves when defined in a loop to further optimize this to true.
next prev parent reply other threads:[~2023-03-30 12:53 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 ` [Bug tree-optimization/81958] [9/10/11 " msebor at gcc dot gnu.org 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 [this message] 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-RoMgoSNqgi@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).