public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102381] unexpected -Wmaybe-uninitialized
Date: Fri, 17 Sep 2021 04:00:29 +0000	[thread overview]
Message-ID: <bug-102381-4-bX715gCmNp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102381-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102381

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-09-17

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

....

[AFTER NORMALIZATION -- [DEF]:
ipp_28 = PHI <ipp_23(17), ipp_11(D)(15)>
is guarded by :

i2.2_26 > 0 (.AND.) i1_10(D) != 0

....

[AFTER NORMALIZATION -- [USE]:
ipp_27 = PHI <ipp_28(21), ipp_23(18)>
is guarded by :

i1_10(D) != 0 (.AND.)  (.NOT.) i4_17 < prephitmp_25 (.AND.) _2 == 0
(.OR.)
i1_10(D) != 0 (.AND.)  (.NOT.) i4_17 < prephitmp_25 (.AND.) i3.0_1 & 1

...
  _2 = i3.0_1 & 1;

So there is a missing simplification
It should have been:

i1_10(D) != 0 (.AND.)  (.NOT.) i4_17 < prephitmp_25

prephitmp_25 is defined as:
  # prephitmp_25 = PHI <i2.2_26(17), i2.2_21(15)>
So i2.2_26 (as i2.2_21 is the one on the branch which would have been
uninitialized).
So we are down to:
i1_10(D) != 0 (.AND.)  (.NOT.) i4_17 < i2.2_26

i4_17 is the loop IV so it should be discarded.

  reply	other threads:[~2021-09-17  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  1:43 [Bug c/102381] New: " hv at crypt dot org
2021-09-17  4:00 ` pinskia at gcc dot gnu.org [this message]
2021-09-17  4:02 ` [Bug tree-optimization/102381] unexpected -Wmaybe-uninitialized with noreturn inside loop and conditional setting of variable pinskia 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-102381-4-bX715gCmNp@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: link
Be 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).