aboutsummaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 02350e1..ec66e77 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -8533,16 +8533,23 @@ schedule_insns (dump_file)
for (b = 0; b < n_basic_blocks; b++)
for (insn = basic_block_head[b];; insn = NEXT_INSN (insn))
{
- rtx link;
+ rtx link, prev;
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
{
- for (link = LOG_LINKS (insn); link; link = XEXP (link, 1))
+ prev = NULL_RTX;
+ link = LOG_LINKS (insn);
+ while (link)
{
rtx x = XEXP (link, 0);
if (INSN_BLOCK (x) != b)
- remove_dependence (insn, x);
+ {
+ remove_dependence (insn, x);
+ link = prev ? XEXP (prev, 1) : LOG_LINKS (insn);
+ }
+ else
+ prev = link, link = XEXP (prev, 1);
}
}