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/100492] [12 Regression] wrong code at -O3 (generated code hangs)
Date: Mon, 10 May 2021 09:40:05 +0000	[thread overview]
Message-ID: <bug-100492-4-tRSTUvC5Xz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100492-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, no - there's an irreducible region inside the inner loop.  The logic

              /* In distribution of loop nest, if bb is inner loop's exit_bb,
                 we choose its exit edge/path in order to avoid generating
                 infinite loop.  For all other cases, we choose an arbitrary
                 path through the empty CFG part that this unnecessary
                 control stmt controls.  */
              if (gcond *cond_stmt = dyn_cast <gcond *> (stmt))
                {
                  if (inner_exit && inner_exit->flags & EDGE_TRUE_VALUE)
                    gimple_cond_make_true (cond_stmt);
                  else
                    gimple_cond_make_false (cond_stmt);
                  update_stmt (stmt);
                }

only works for conditions exiting the loop (where we asked for a single-exit
earlier) and for conditions not controlling a cycle (where it doesn't matter
which way we go).

There's no sweep over stmts qualifying a loop body, but
find_seed_stmts_for_distribution could be abused that way.  We could also
simply forcefully put this condition in all partitions or we could see
whether to use post-dominance we compute for control dependence can be
used to find the edge towards exit.

  parent reply	other threads:[~2021-05-10  9:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09 13:09 [Bug tree-optimization/100492] New: " zhendong.su at inf dot ethz.ch
2021-05-10  8:11 ` [Bug tree-optimization/100492] " rguenth at gcc dot gnu.org
2021-05-10  8:14 ` rguenth at gcc dot gnu.org
2021-05-10  8:34 ` [Bug tree-optimization/100492] [12 Regression] " jakub at gcc dot gnu.org
2021-05-10  8:44 ` rguenth at gcc dot gnu.org
2021-05-10  9:19 ` rguenth at gcc dot gnu.org
2021-05-10  9:40 ` rguenth at gcc dot gnu.org [this message]
2021-05-10  9:42 ` [Bug tree-optimization/100492] [10/11/12 " rguenth at gcc dot gnu.org
2021-05-10 11:06 ` cvs-commit at gcc dot gnu.org
2021-05-25  8:07 ` [Bug tree-optimization/100492] [10/11 " cvs-commit at gcc dot gnu.org
2021-06-16 14:24 ` [Bug tree-optimization/100492] [10 " cvs-commit at gcc dot gnu.org
2021-06-16 14:24 ` 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-100492-4-tRSTUvC5Xz@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).