diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2012-02-14 23:26:47 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2012-02-14 23:26:47 +0000 |
commit | b75f962c90d61cef8241be46c68103b6dd803b72 (patch) | |
tree | 8d227cbc0a5c0e3b40c96092b667476e44770a86 | |
parent | 5cd3514cddd76e0a33208f85c3a623c7fb53470c (diff) | |
download | gcc-b75f962c90d61cef8241be46c68103b6dd803b72.zip gcc-b75f962c90d61cef8241be46c68103b6dd803b72.tar.gz gcc-b75f962c90d61cef8241be46c68103b6dd803b72.tar.bz2 |
haifa-sched.c (prune_ready_list): Ensure that if there is a sched-group insn...
* haifa-sched.c (prune_ready_list): Ensure that if there is a
sched-group insn, it either remains alone or the entire list is
pruned.
From-SVN: r184238
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/haifa-sched.c | 23 |
2 files changed, 25 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fe12544..1536017 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-02-15 Bernd Schmidt <bernds@codesourcery.com> + + * haifa-sched.c (prune_ready_list): Ensure that if there is a + sched-group insn, it either remains alone or the entire list is + pruned. + 2012-02-14 Jonathan Wakely <jwakely.gcc@gmail.com> * doc/install.texi (Prerequisites): Fix grammar. diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index d7d0b38..b6a8b0c 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -1,6 +1,6 @@ /* Instruction scheduling pass. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by, and currently maintained by, Jim Wilson (wilson@cygnus.com) @@ -3945,6 +3945,7 @@ prune_ready_list (state_t temp_state, bool first_cycle_insn_p, bool shadows_only_p, bool modulo_epilogue_p) { int i; + bool sched_group_found = false; restart: for (i = 0; i < ready.n_ready; i++) @@ -3953,13 +3954,27 @@ prune_ready_list (state_t temp_state, bool first_cycle_insn_p, int cost = 0; const char *reason = "resource conflict"; - if (modulo_epilogue_p && !DEBUG_INSN_P (insn) - && INSN_EXACT_TICK (insn) == INVALID_TICK) + if (DEBUG_INSN_P (insn)) + continue; + + if (SCHED_GROUP_P (insn) && !sched_group_found) + { + sched_group_found = true; + if (i > 0) + goto restart; + } + + if (sched_group_found && !SCHED_GROUP_P (insn)) + { + cost = 1; + reason = "not in sched group"; + } + else if (modulo_epilogue_p && INSN_EXACT_TICK (insn) == INVALID_TICK) { cost = max_insn_queue_index; reason = "not an epilogue insn"; } - if (shadows_only_p && !DEBUG_INSN_P (insn) && !SHADOW_P (insn)) + else if (shadows_only_p && !SHADOW_P (insn)) { cost = 1; reason = "not a shadow"; |