public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "abel at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/51106] [4.5/4.6 Regression] ICE in move_insn, at haifa-sched.c:2314
Date: Tue, 27 Mar 2012 13:52:00 -0000	[thread overview]
Message-ID: <bug-51106-4-VvRvYYTPPf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51106-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51106

--- Comment #16 from Andrey Belevantsev <abel at gcc dot gnu.org> 2012-03-27 13:28:03 UTC ---
So, something like the below patch, or even better -- as we want to fold all
RTL-build related pseudo passes into expand, make pass_instantiate_virtual_regs
also the expand part (thus, until the into_cfglayout pass), and then the new
cleanup_cfg will nicely work at the end of expand. 

diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index b86cc74..0c27d11 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2261,7 +2261,7 @@ purge_dead_edges (basic_block bb)
   edge e;
   rtx insn = BB_END (bb), note;
   bool purged = false;
-  bool found;
+  bool found, fallthru;
   edge_iterator ei;

   if (DEBUG_INSN_P (insn) && insn != BB_HEAD (bb))
@@ -2433,16 +2433,22 @@ purge_dead_edges (basic_block bb)
      as these are only created by conditional branches.  If we find such an
      edge we know that there used to be a jump here and can then safely
      remove all non-fallthru edges.  */
-  found = false;
+  found = fallthru = false;
   FOR_EACH_EDGE (e, ei, bb->succs)
-    if (! (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU)))
-      {
+    {
+      if (! (e->flags & (EDGE_COMPLEX | EDGE_FALLTHRU)))
        found = true;
-       break;
-      }
-
+      if (e->flags & (EDGE_FALLTHRU | EDGE_FAKE))
+       fallthru = true;
+    }
   if (!found)
     return purged;
+  if (!fallthru)
+    {
+      gcc_assert (single_succ_p (bb));
+      single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
+      return purged;
+    }

   /* Remove all but the fake and fallthru edges.  The fake edge may be
      the only successor for this block in the case of noreturn


  parent reply	other threads:[~2012-03-27 13:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-12 14:06 [Bug target/51106] New: [4.5 regression] " rl at hellgate dot ch
2012-01-03 11:50 ` [Bug target/51106] [4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2012-01-04 13:36 ` rguenth at gcc dot gnu.org
2012-01-19  9:35 ` abel at gcc dot gnu.org
2012-01-19 10:11 ` jakub at gcc dot gnu.org
2012-01-20  6:31 ` abel at gcc dot gnu.org
2012-01-20  7:34 ` [Bug target/51106] [4.5/4.6 " abel at gcc dot gnu.org
2012-01-29 17:25 ` dirtyepic at gentoo dot org
2012-02-06 12:11 ` abel at gcc dot gnu.org
2012-02-06 12:27 ` jakub at gcc dot gnu.org
2012-02-09 10:11 ` abel at gcc dot gnu.org
2012-02-09 10:18 ` abel at gcc dot gnu.org
2012-02-09 10:19 ` abel at gcc dot gnu.org
2012-03-25 12:48 ` olegendo at gcc dot gnu.org
2012-03-27 12:49 ` abel at gcc dot gnu.org
2012-03-27 13:05 ` dominiq at lps dot ens.fr
2012-03-27 13:15 ` abel at gcc dot gnu.org
2012-03-27 13:52 ` abel at gcc dot gnu.org [this message]
2012-03-27 13:55 ` rguenther at suse dot de
2012-03-27 14:11 ` abel at gcc dot gnu.org
2012-03-28  8:02 ` rguenther at suse dot de
2012-10-27 23:09 ` [Bug target/51106] [4.6 " davem at gcc dot gnu.org
2012-10-28 18:17 ` abel at gcc dot gnu.org
2012-11-27 15:46 ` dominiq at lps dot ens.fr
2013-03-22 14:44 ` jakub at gcc dot gnu.org
2013-05-31 10:58 ` jakub at gcc dot gnu.org
2013-10-16  9:51 ` jakub at gcc dot gnu.org
2014-05-22  9:03 ` rguenth at gcc dot gnu.org
2014-12-19 13:30 ` jakub at gcc dot gnu.org
2015-06-23  8:40 ` rguenth at gcc dot gnu.org
2021-08-08  6:05 ` 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-51106-4-VvRvYYTPPf@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).