+2001-01-16 Richard Henderson <rth@redhat.com>
+
+ * flow.c (struct propagate_block_info): Add mem_set_list_len.
+ (MAX_MEM_SET_LIST_LEN): New.
+ (propagate_one_insn): Update mem_set_list_len.
+ (invalidate_mems_from_autoinc): Likewise.
+ (invalidate_mems_from_set): Likewise.
+ (mark_used_regs): Likewise.
+ (init_propagate_block_info): Likewise. Stop collecting memories
+ when we reach MAX_MEM_SET_LIST_LEN.
+ (mark_set_1): Likewise.
+
2001-01-16 Richard Henderson <rth@redhat.com>
* unroll.c (precondition_loop_p): Fail if no iteration
regset reg_cond_reg;
#endif
+ /* The length of mem_set_list. */
+ int mem_set_list_len;
+
/* Non-zero if the value of CC0 is live. */
int cc0_live;
int flags;
};
+/* Maximum length of pbi->mem_set_list before we start dropping
+ new elements on the floor. */
+#define MAX_MEM_SET_LIST_LEN 100
+
/* Store the data structures necessary for depth-first search. */
struct depth_first_search_dsS {
/* stack for backtracking during the algorithm */
/* Non-constant calls clobber memory. */
if (! CONST_CALL_P (insn))
- free_EXPR_LIST_list (&pbi->mem_set_list);
+ {
+ free_EXPR_LIST_list (&pbi->mem_set_list);
+ pbi->mem_set_list_len = 0;
+ }
/* There may be extra registers to be clobbered. */
for (note = CALL_INSN_FUNCTION_USAGE (insn);
pbi->bb = bb;
pbi->reg_live = live;
pbi->mem_set_list = NULL_RTX;
+ pbi->mem_set_list_len = 0;
pbi->local_set = local_set;
pbi->cond_local_set = cond_local_set;
pbi->cc0_live = 0;
mem = shallow_copy_rtx (mem);
#endif
pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
+ if (++pbi->mem_set_list_len >= MAX_MEM_SET_LIST_LEN)
+ break;
}
}
}
else
pbi->mem_set_list = next;
free_EXPR_LIST_node (temp);
+ pbi->mem_set_list_len--;
}
else
prev = temp;
else
pbi->mem_set_list = next;
free_EXPR_LIST_node (temp);
+ pbi->mem_set_list_len--;
}
else
prev = temp;
if (insn && GET_CODE (reg) == MEM)
invalidate_mems_from_autoinc (pbi, insn);
- if (GET_CODE (reg) == MEM && ! side_effects_p (reg)
+ if (pbi->mem_set_list_len < MAX_MEM_SET_LIST_LEN
+ && GET_CODE (reg) == MEM && ! side_effects_p (reg)
/* ??? With more effort we could track conditional memory life. */
&& ! cond
/* We do not know the size of a BLKmode store, so we do not track
reg = shallow_copy_rtx (reg);
#endif
pbi->mem_set_list = alloc_EXPR_LIST (0, reg, pbi->mem_set_list);
+ pbi->mem_set_list_len++;
}
}
else
pbi->mem_set_list = next;
free_EXPR_LIST_node (temp);
+ pbi->mem_set_list_len--;
}
else
prev = temp;
So for now, just clear the memory set list and mark any regs
we can find in ASM_OPERANDS as used. */
if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
- free_EXPR_LIST_list (&pbi->mem_set_list);
+ {
+ free_EXPR_LIST_list (&pbi->mem_set_list);
+ pbi->mem_set_list_len = 0;
+ }
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
We can not just fall through here since then we would be confused