diff options
author | abel <abel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-29 15:33:17 +0000 |
---|---|---|
committer | abel <abel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-29 15:33:17 +0000 |
commit | 961d3eb8ab8c235900db4f6d6aa82aa3ebcc3992 (patch) | |
tree | e67fc2320eecc0c03c624be2080407ae17cbd6bd /gcc/sel-sched.c | |
parent | bc3c318e362f6ac266baa6c018ff8cb00a05320e (diff) | |
download | gcc-961d3eb8ab8c235900db4f6d6aa82aa3ebcc3992.tar.gz |
PR rtl-optimization/40101
* sel-sched-ir.c (get_seqno_by_preds): Allow returning negative
seqno. Adjust comment.
* sel-sched.c (find_seqno_for_bookkeeping): Assert that when
inserting bookkeeping before a jump, the jump is not scheduled.
When no positive seqno found, provide a value. Add comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147977 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r-- | gcc/sel-sched.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index b1a33beb7d0..a7dedc5ef2d 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -4524,11 +4524,27 @@ find_seqno_for_bookkeeping (insn_t place_to_insert, insn_t join_point) if (INSN_P (next) && JUMP_P (next) && BLOCK_FOR_INSN (next) == BLOCK_FOR_INSN (place_to_insert)) - seqno = INSN_SEQNO (next); + { + gcc_assert (INSN_SCHED_TIMES (next) == 0); + seqno = INSN_SEQNO (next); + } else if (INSN_SEQNO (join_point) > 0) seqno = INSN_SEQNO (join_point); else - seqno = get_seqno_by_preds (place_to_insert); + { + seqno = get_seqno_by_preds (place_to_insert); + + /* Sometimes the fences can move in such a way that there will be + no instructions with positive seqno around this bookkeeping. + This means that there will be no way to get to it by a regular + fence movement. Never mind because we pick up such pieces for + rescheduling anyways, so any positive value will do for now. */ + if (seqno < 0) + { + gcc_assert (pipelining_p); + seqno = 1; + } + } gcc_assert (seqno > 0); return seqno; |