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/65244] Bogus -Wmaybe-uninitialized warning with posix_memalign() and -Og
Date: Tue, 30 Aug 2022 08:27:07 +0000	[thread overview]
Message-ID: <bug-65244-4-astWoOtWCH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65244-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
To trigger the diagnostic in GCC 12+ you also need -fno-thread-jumps.  The
issue
with this testcase is that we have

  <bb 4> [local count: 1073741824]:
  # ptr_2 = PHI <ptr_5(D)(7), _6(3)>
  if (_1 != 0)
    goto <bb 5>; [0.04%]
  else
    goto <bb 6>; [99.96%]

  <bb 5> [local count: 429496]:
  exit (1);

  <bb 6> [local count: 1073312329]:
  return ptr_2;

and predicate::init_from_control_deps does

          /* Skip if there is essentially one succesor.  */
          if (EDGE_COUNT (e->src->succs) == 2)
            {
              edge e1;
              edge_iterator ei1;
              bool skip = false;

              FOR_EACH_EDGE (e1, ei1, e->src->succs)
                {
                  if (EDGE_COUNT (e1->dest->succs) == 0)
                    {
                      skip = true;
                      break;
                    }
                }
              if (skip)
                continue;
            }

which causes us to ignore the _1 != 0 predicate on the use.  I'm not sure
what's the reason on this - we have put a limit on the number of edges in
the chain and the number of chains, so this can't be to remain within
such limit.  Simply skipping some predicates can also make the defined
domain larger which is against the intent of the pass.

Testing removal of this premature optimization(?).

  parent reply	other threads:[~2022-08-30  8:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27 18:51 [Bug c/65244] New: " ulfalizer at gmail dot com
2015-02-27 19:10 ` [Bug c/65244] " ulfalizer at gmail dot com
2015-02-27 21:02 ` manu at gcc dot gnu.org
2015-02-27 21:24 ` ulfalizer at gmail dot com
2015-02-27 21:48 ` manu at gcc dot gnu.org
2015-02-27 22:02 ` ulfalizer at gmail dot com
2015-02-27 22:07 ` howarth at bromo dot med.uc.edu
2015-02-27 23:04 ` ulfalizer at gmail dot com
2015-02-27 23:21 ` pinskia at gcc dot gnu.org
2015-02-28  1:24 ` manu at gcc dot gnu.org
2021-03-31 19:05 ` [Bug middle-end/65244] " msebor at gcc dot gnu.org
2022-08-30  8:27 ` rguenth at gcc dot gnu.org [this message]
2022-08-31  9:07 ` [Bug tree-optimization/65244] " rguenth at gcc dot gnu.org
2022-08-31 11:04 ` cvs-commit at gcc dot gnu.org
2022-08-31 11:04 ` 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-65244-4-astWoOtWCH@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).