Commit f6516aee by Jim Wilson

(find_best_addr): Limit number of cse_gen_binary calls to

20 per iteration.

From-SVN: r6449
parent 239b043b
...@@ -2649,9 +2649,17 @@ find_best_addr (insn, loc) ...@@ -2649,9 +2649,17 @@ find_best_addr (insn, loc)
int best_rtx_cost = (COST (*loc) + 1) >> 1; int best_rtx_cost = (COST (*loc) + 1) >> 1;
struct table_elt *best_elt = elt; struct table_elt *best_elt = elt;
rtx best_rtx = *loc; rtx best_rtx = *loc;
int count;
/* This is at worst case an O(n^2) algorithm, so limit our search
to the first 32 elements on the list. This avoids trouble
compiling code with very long basic blocks that can easily
call cse_gen_binary so many times that we run out of memory. */
found_better = 0; found_better = 0;
for (p = elt->first_same_value; p; p = p->next_same_value) for (p = elt->first_same_value, count = 0;
p && count < 32;
p = p->next_same_value, count++)
if (! p->flag if (! p->flag
&& (GET_CODE (p->exp) == REG && (GET_CODE (p->exp) == REG
|| exp_equiv_p (p->exp, p->exp, 1, 0))) || exp_equiv_p (p->exp, p->exp, 1, 0)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment