diff options
author | Andrey Belevantsev <abel@ispras.ru> | 2009-05-29 19:33:17 +0400 |
---|---|---|
committer | Andrey Belevantsev <abel@gcc.gnu.org> | 2009-05-29 19:33:17 +0400 |
commit | da7ba240d63c597e65eb0b5ba4074969b89606e9 (patch) | |
tree | e67fc2320eecc0c03c624be2080407ae17cbd6bd /gcc | |
parent | 71dcd6099ae3f4147d80081042d33d5da3454d4d (diff) | |
download | gcc-da7ba240d63c597e65eb0b5ba4074969b89606e9.zip gcc-da7ba240d63c597e65eb0b5ba4074969b89606e9.tar.gz gcc-da7ba240d63c597e65eb0b5ba4074969b89606e9.tar.bz2 |
re PR rtl-optimization/40101 (200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752)
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.
From-SVN: r147977
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/sel-sched-ir.c | 4 | ||||
-rw-r--r-- | gcc/sel-sched.c | 20 |
3 files changed, 29 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26ceb86..ce0ac90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2009-05-29 Andrey Belevantsev <abel@ispras.ru> + + 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. + 2009-05-29 Richard Guenther <rguenther@suse.de> * tree-ssa-alias.c (nonaliasing_component_refs_p): Remove diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index d3f3562..655c873 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -3730,7 +3730,8 @@ get_seqno_of_a_pred (insn_t insn) return seqno; } -/* Find the proper seqno for inserting at INSN. */ +/* Find the proper seqno for inserting at INSN. Returns -1 if no predecessors + with positive seqno exist. */ int get_seqno_by_preds (rtx insn) { @@ -3749,7 +3750,6 @@ get_seqno_by_preds (rtx insn) for (i = 0, seqno = -1; i < n; i++) seqno = MAX (seqno, INSN_SEQNO (preds[i])); - gcc_assert (seqno > 0); return seqno; } diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index b1a33be..a7dedc5 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; |