public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/56181] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1581 with -ftracer
Date: Tue, 05 Feb 2013 16:34:00 -0000	[thread overview]
Message-ID: <bug-56181-4-ZouKD9ys5a@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56181-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-05 16:33:45 UTC ---
Hmm, maybe I should have put it this way: we don't want to duplicate a BB,
which may be a preheader.  Does it sound sane?  Thus, something like

--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -217,6 +217,21 @@ find_trace (basic_block bb, basic_block *trace)
   return i;
 }

+/* Return true if basic block BB may be a preheader.  */
+
+static bool
+maybe_preheader_p (basic_block bb)
+{
+  edge e;
+  edge_iterator ei;
+
+  FOR_EACH_EDGE (e, ei, bb->succs)
+    if (e->dest->loop_father->header == e->dest)
+      return true;
+
+  return false;
+}
+
 /* Look for basic blocks in frequency order, construct traces and tail
duplicate
    if profitable.  */

@@ -310,7 +325,8 @@ tail_duplicate (void)
          not profitable and it might create a loop with multiple
          entries or at least rotate the loop.  */
           && (!current_loops
-          || bb2->loop_father->header != bb2))
+          || bb2->loop_father->header != bb2)
+          && !maybe_preheader_p (bb2))
         {
           edge e;
           basic_block copy;


  parent reply	other threads:[~2013-02-05 16:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-02 11:08 [Bug rtl-optimization/56181] New: " antoine.balestrat at gmail dot com
2013-02-02 17:40 ` [Bug rtl-optimization/56181] " mpolacek at gcc dot gnu.org
2013-02-04 10:01 ` [Bug rtl-optimization/56181] [4.8 Regression] " rguenth at gcc dot gnu.org
2013-02-05 12:16 ` mpolacek at gcc dot gnu.org
2013-02-05 12:22 ` mpolacek at gcc dot gnu.org
2013-02-05 15:54 ` mpolacek at gcc dot gnu.org
2013-02-05 15:59 ` rguenth at gcc dot gnu.org
2013-02-05 16:34 ` mpolacek at gcc dot gnu.org [this message]
2013-02-06 10:46 ` rguenth at gcc dot gnu.org
2013-02-06 14:21 ` rguenth at gcc dot gnu.org
2013-02-06 14:32 ` rguenth at gcc dot gnu.org
2013-02-06 14:56 ` rguenth at gcc dot gnu.org
2013-02-06 15:55 ` rguenth at gcc dot gnu.org
2013-02-06 16:00 ` rguenth at gcc dot gnu.org
2013-02-08 11:01 ` rguenth at gcc dot gnu.org
2013-02-08 11:01 ` rguenth at gcc dot gnu.org
2013-02-12 21:33 ` jbglaw@lug-owl.de
2013-02-13  9:28 ` rguenth at gcc dot gnu.org
2013-02-13 13:04 ` rguenth at gcc dot gnu.org
2013-02-13 20:23 ` jbglaw@lug-owl.de

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-56181-4-ZouKD9ys5a@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).