diff options
author | Jeff Law <law@redhat.com> | 2015-02-11 16:29:11 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2015-02-11 16:29:11 -0700 |
commit | 3f9b5ffb41e5967c1fc4cfcc3f181a5c6f20ab85 (patch) | |
tree | 1dfe645fc06da450f2a1aba1a08b1dbb40021bf2 /gcc/haifa-sched.c | |
parent | b06479fd41cf0460cc28aea063a28f1e8c0d95a3 (diff) | |
download | gcc-3f9b5ffb41e5967c1fc4cfcc3f181a5c6f20ab85.zip gcc-3f9b5ffb41e5967c1fc4cfcc3f181a5c6f20ab85.tar.gz gcc-3f9b5ffb41e5967c1fc4cfcc3f181a5c6f20ab85.tar.bz2 |
re PR target/63347 (m68k misoptimisation with -fschedule-insns)
PR target/63347
* haifa-sched.c (prune_ready_list): If we have a SCHED_GROUP_P insn
that needs to be queued, just queue it for a single cycle.
PR target/63347
* gcc.target/m68k/pr63347.c: New test.
From-SVN: r220632
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 75d2421..64c8c9c1 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -6291,7 +6291,15 @@ prune_ready_list (state_t temp_state, bool first_cycle_insn_p, if (SCHED_GROUP_P (insn) && cost > min_cost_group) min_cost_group = cost; ready_remove (&ready, i); - queue_insn (insn, cost, reason); + /* Normally we'd want to queue INSN for COST cycles. However, + if SCHED_GROUP_P is set, then we must ensure that nothing + else comes between INSN and its predecessor. If there is + some other insn ready to fire on the next cycle, then that + invariant would be broken. + + So when SCHED_GROUP_P is set, just queue this insn for a + single cycle. */ + queue_insn (insn, SCHED_GROUP_P (insn) ? 1 : cost, reason); if (i + 1 < n) break; } |