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/102385] [12 Regression] ICE: in single_pred_edge, at basic-block.h:350 under "-O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning"
Date: Fri, 17 Sep 2021 07:29:46 +0000	[thread overview]
Message-ID: <bug-102385-4-kND36iJAhZ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102385-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |rguenth at gcc dot gnu.org,
                   |                            |rsandifo at gcc dot gnu.org
            Summary|ICE: in single_pred_edge,   |[12 Regression] ICE: in
                   |at basic-block.h:350 under  |single_pred_edge, at
                   |"-O2 -fno-toplevel-reorder  |basic-block.h:350 under
                   |-fno-tree-ch -fno-tree-dce  |"-O2 -fno-toplevel-reorder
                   |-fno-tree-dominator-opts    |-fno-tree-ch -fno-tree-dce
                   |-fno-tree-dse               |-fno-tree-dominator-opts
                   |-fno-tree-loop-ivcanon      |-fno-tree-dse
                   |-fpredictive-commoning"     |-fno-tree-loop-ivcanon
                   |                            |-fpredictive-commoning"
           Keywords|                            |ice-on-valid-code,
                   |                            |needs-bisection, wrong-code
   Last reconfirmed|                            |2021-09-17
   Target Milestone|---                         |12.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Huh, the code is odd:

  basic_block exit_bb = single_pred (loop->latch);
  new_exit = find_edge (exit_bb, rest);
  new_exit->probability = profile_probability::always ()
                                .apply_scale (1, new_est_niter + 1);

but here we have a diamond after the block that exits the loop and thus
neither a single predecessor of the latch nor would that be something
resembling an exit block.  It looks like the code might have wanted
to use single_pred (rest) here plus eventually splitting the exit
edge in case it didn't have a single predecessor.

Richard, you refactored this, so likely caused this.

  reply	other threads:[~2021-09-17  7:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  7:15 [Bug tree-optimization/102385] New: " suochenyao at 163 dot com
2021-09-17  7:29 ` rguenth at gcc dot gnu.org [this message]
2021-09-17 10:10 ` [Bug tree-optimization/102385] [12 Regression] ICE: in single_pred_edge, at basic-block.h:350 under "-O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning" since r12-2429-g62acc72a957b5614 marxin at gcc dot gnu.org
2021-09-30 22:34 ` pinskia at gcc dot gnu.org
2021-09-30 22:34 ` pinskia at gcc dot gnu.org
2021-09-30 22:35 ` pinskia at gcc dot gnu.org
2021-09-30 22:36 ` pinskia at gcc dot gnu.org
2021-10-04 18:41 ` rsandifo at gcc dot gnu.org
2021-10-08 12:18 ` cvs-commit at gcc dot gnu.org
2021-10-08 12:20 ` rsandifo 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-102385-4-kND36iJAhZ@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).