Do not emit cld in the CopyB prologue. The ABI mandates that DF is cleared, so do...
[libfirm] / ir / be / belower.c
index 44a310b..ea759db 100644 (file)
@@ -225,7 +225,7 @@ static perm_cycle_t *get_perm_cycle(perm_cycle_t *cycle, reg_pair_t *pairs, int
        }
 
        /* 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;
@@ -290,7 +290,6 @@ static void lower_perm_node(ir_node *irn, void *walk_env) {
        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;
@@ -367,11 +366,13 @@ static void lower_perm_node(ir_node *irn, void *walk_env) {
 
        /* 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"));