public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "amonakov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/48273] [4.6/4.7 Regression] ICE: in create_copy_of_insn_rtx, at sel-sched-ir.c:5604 with -fsel-sched-pipelining -fselective-scheduling2 -march=core2
Date: Wed, 06 Apr 2011 14:40:00 -0000	[thread overview]
Message-ID: <bug-48273-4-N5GkRJCeCc@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48273-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Alexander Monakov <amonakov at gcc dot gnu.org> 2011-04-06 14:40:28 UTC ---
There's little value in allowing bookkeeping for calls, and the (untested yet)
patch below forces calls to be unique.  The test case also shows that our
remove_insns_that_need_bookkeeping function works incorrectly for infinite
loops (the single basic block dominates itself, and SPEC of the pipelined
instruction is not increased because there's no conditional branch). It's
possible to fix up that function by also looking at INSN_SCHED_TIMES, but the
simpler way is to forbid pipelining for infinite loops.

diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c
index 67484dd..95c1431 100644
--- a/gcc/sel-sched-ir.c
+++ b/gcc/sel-sched-ir.c
@@ -2905,6 +2905,7 @@ init_global_and_expr_for_insn (insn_t insn)
       if (CANT_MOVE (insn)
           || INSN_ASM_P (insn)
           || SCHED_GROUP_P (insn)
+      || CALL_P (insn)
           /* Exception handling insns are always unique.  */
           || (cfun->can_throw_non_call_exceptions && can_throw_internal
(insn))
           /* TRAP_IF though have an INSN code is control_flow_insn_p ().  */
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 0e8173b..415eaa4 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -6781,7 +6781,9 @@ sel_setup_region_sched_flags (void)
   bookkeeping_p = 1;
   pipelining_p = (bookkeeping_p
                   && (flag_sel_sched_pipelining != 0)
-          && current_loop_nest != NULL);
+          && current_loop_nest != NULL
+          /* Check that there is at least one exit.  */
+          && current_loop_nest->exits->next->e);
   max_insns_to_rename = PARAM_VALUE (PARAM_SELSCHED_INSNS_TO_RENAME);
   max_ws = MAX_WS;
 }


  parent reply	other threads:[~2011-04-06 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 13:47 [Bug target/48273] New: " zsojka at seznam dot cz
2011-03-24 16:37 ` [Bug target/48273] " rguenth at gcc dot gnu.org
2011-03-24 17:23 ` ubizjak at gmail dot com
2011-03-24 17:32 ` ubizjak at gmail dot com
2011-03-24 17:33 ` zsojka at seznam dot cz
2011-03-24 18:46 ` amonakov at gcc dot gnu.org
2011-04-06 14:40 ` amonakov at gcc dot gnu.org [this message]
2011-04-07  7:25 ` abel at gcc dot gnu.org
2011-04-07  8:00 ` abel at gcc dot gnu.org
2011-04-08 11:49 ` amonakov at gcc dot gnu.org
2011-06-12 13:05 ` [Bug target/48273] [4.6 " rguenth at gcc dot gnu.org
2011-06-27 16:27 ` jakub at gcc dot gnu.org
2011-06-28 12:20 ` amonakov at gcc dot gnu.org
2011-06-28 12:22 ` amonakov 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-48273-4-N5GkRJCeCc@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).