}
/* assume worst case: all remaining pairs build a cycle or chain */
- cycle->elems = xcalloc((n - n_pairs_done) * 2, sizeof(cycle->elems[0]));
+ cycle->elems = XMALLOCNZ(const arch_register_t*, (n - n_pairs_done) * 2);
cycle->n_elems = 2; /* initial number of elements is 2 */
cycle->elems[0] = pairs[start].in_reg;
cycle->elems[1] = pairs[start].out_reg;
int n, i, pn, do_copy, j, n_ops;
reg_pair_t *pairs;
const ir_edge_t *edge;
- perm_cycle_t *cycle;
ir_node *sched_point, *block, *in[2];
ir_node *arg1, *arg2, *res1, *res2;
ir_node *cpyxchg = NULL;
/* check for cycles and chains */
while (get_n_checked_pairs(pairs, n) < n) {
+ perm_cycle_t *cycle;
+
i = n_ops = 0;
/* go to the first not-checked pair */
while (pairs[i].checked) i++;
- cycle = xcalloc(1, sizeof(*cycle));
+ cycle = XMALLOCZ(perm_cycle_t);
cycle = get_perm_cycle(cycle, pairs, n, i);
DB((mod, LEVEL_1, "%+F: following %s created:\n ", irn, cycle->type == PERM_CHAIN ? "chain" : "cycle"));