BugFix: mode_b lowering might create new control flow (if ir_create_cond_set() is...
[libfirm] / ir / be / arm / arm_new_nodes.c
index 0e9095e..c1af03c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -312,16 +312,16 @@ void set_fConst_value(ir_node *node, ir_tarval *tv)
        attr->tv = tv;
 }
 
-pn_Cmp get_arm_CondJmp_pnc(const ir_node *node)
+ir_relation get_arm_CondJmp_relation(const ir_node *node)
 {
        const arm_CondJmp_attr_t *attr = get_arm_CondJmp_attr_const(node);
-       return attr->pnc;
+       return attr->relation;
 }
 
-void set_arm_CondJmp_pnc(ir_node *node, pn_Cmp pnc)
+void set_arm_CondJmp_relation(ir_node *node, ir_relation relation)
 {
        arm_CondJmp_attr_t *attr = get_arm_CondJmp_attr(node);
-       attr->pnc = pnc;
+       attr->relation = relation;
 }
 
 int get_arm_SwitchJmp_n_projs(const ir_node *node)
@@ -420,14 +420,14 @@ static void init_arm_CopyB_attributes(ir_node *res, unsigned size)
        attr->size = size;
 }
 
-static int cmp_attr_arm(ir_node *a, ir_node *b)
+static int cmp_attr_arm(const ir_node *a, const ir_node *b)
 {
        (void) a;
        (void) b;
        return 0;
 }
 
-static int cmp_attr_arm_SymConst(ir_node *a, ir_node *b)
+static int cmp_attr_arm_SymConst(const ir_node *a, const ir_node *b)
 {
        const arm_SymConst_attr_t *attr_a;
        const arm_SymConst_attr_t *attr_b;
@@ -441,7 +441,7 @@ static int cmp_attr_arm_SymConst(ir_node *a, ir_node *b)
                || attr_a->fp_offset != attr_b->fp_offset;
 }
 
-static int cmp_attr_arm_CopyB(ir_node *a, ir_node *b)
+static int cmp_attr_arm_CopyB(const ir_node *a, const ir_node *b)
 {
        const arm_CopyB_attr_t *attr_a;
        const arm_CopyB_attr_t *attr_b;
@@ -454,7 +454,7 @@ static int cmp_attr_arm_CopyB(ir_node *a, ir_node *b)
        return attr_a->size != attr_b->size;
 }
 
-static int cmp_attr_arm_CondJmp(ir_node *a, ir_node *b)
+static int cmp_attr_arm_CondJmp(const ir_node *a, const ir_node *b)
 {
        (void) a;
        (void) b;
@@ -462,7 +462,7 @@ static int cmp_attr_arm_CondJmp(ir_node *a, ir_node *b)
        return 1;
 }
 
-static int cmp_attr_arm_SwitchJmp(ir_node *a, ir_node *b)
+static int cmp_attr_arm_SwitchJmp(const ir_node *a, const ir_node *b)
 {
        (void) a;
        (void) b;
@@ -470,7 +470,7 @@ static int cmp_attr_arm_SwitchJmp(ir_node *a, ir_node *b)
        return 1;
 }
 
-static int cmp_attr_arm_fConst(ir_node *a, ir_node *b)
+static int cmp_attr_arm_fConst(const ir_node *a, const ir_node *b)
 {
        const arm_fConst_attr_t *attr_a;
        const arm_fConst_attr_t *attr_b;
@@ -516,7 +516,7 @@ const arm_cmp_attr_t *get_arm_cmp_attr_const(const ir_node *node)
        return (const arm_cmp_attr_t*) get_irn_generic_attr_const(node);
 }
 
-static int cmp_attr_arm_load_store(ir_node *a, ir_node *b)
+static int cmp_attr_arm_load_store(const ir_node *a, const ir_node *b)
 {
        const arm_load_store_attr_t *attr_a;
        const arm_load_store_attr_t *attr_b;
@@ -524,8 +524,8 @@ static int cmp_attr_arm_load_store(ir_node *a, ir_node *b)
        if (cmp_attr_arm(a, b))
                return 1;
 
-       attr_a = get_arm_load_store_attr(a);
-       attr_b = get_arm_load_store_attr(b);
+       attr_a = get_arm_load_store_attr_const(a);
+       attr_b = get_arm_load_store_attr_const(b);
        if (attr_a->entity != attr_b->entity
                        || attr_a->entity_sign != attr_b->entity_sign
                        || attr_a->offset != attr_b->offset)
@@ -534,7 +534,7 @@ static int cmp_attr_arm_load_store(ir_node *a, ir_node *b)
        return 0;
 }
 
-static int cmp_attr_arm_shifter_operand(ir_node *a, ir_node *b)
+static int cmp_attr_arm_shifter_operand(const ir_node *a, const ir_node *b)
 {
        const arm_shifter_operand_t *attr_a;
        const arm_shifter_operand_t *attr_b;
@@ -542,8 +542,8 @@ static int cmp_attr_arm_shifter_operand(ir_node *a, ir_node *b)
        if (cmp_attr_arm(a, b))
                return 1;
 
-       attr_a = get_arm_shifter_operand_attr(a);
-       attr_b = get_arm_shifter_operand_attr(b);
+       attr_a = get_arm_shifter_operand_attr_const(a);
+       attr_b = get_arm_shifter_operand_attr_const(b);
        if (attr_a->shift_modifier != attr_b->shift_modifier
                        || attr_a->immediate_value != attr_b->immediate_value
                        || attr_a->shift_immediate != attr_b->shift_immediate)
@@ -552,7 +552,7 @@ static int cmp_attr_arm_shifter_operand(ir_node *a, ir_node *b)
        return 0;
 }
 
-static int cmp_attr_arm_cmp(ir_node *a, ir_node *b)
+static int cmp_attr_arm_cmp(const ir_node *a, const ir_node *b)
 {
        const arm_cmp_attr_t *attr_a;
        const arm_cmp_attr_t *attr_b;
@@ -560,15 +560,15 @@ static int cmp_attr_arm_cmp(ir_node *a, ir_node *b)
        if (cmp_attr_arm(a, b))
                return 1;
 
-       attr_a = get_arm_cmp_attr(a);
-       attr_b = get_arm_cmp_attr(b);
+       attr_a = get_arm_cmp_attr_const(a);
+       attr_b = get_arm_cmp_attr_const(b);
        if (attr_a->ins_permuted != attr_b->ins_permuted
                        || attr_a->is_unsigned != attr_b->is_unsigned)
                return 1;
        return 0;
 }
 
-static int cmp_attr_arm_farith(ir_node *a, ir_node *b)
+static int cmp_attr_arm_farith(const ir_node *a, const ir_node *b)
 {
        const arm_farith_attr_t *attr_a;
        const arm_farith_attr_t *attr_b;
@@ -595,6 +595,7 @@ static void arm_copy_attr(ir_graph *irg, const ir_node *old_node,
        memcpy(attr_new, attr_old, get_op_attr_size(get_irn_op(old_node)));
 
        /* copy out flags */
+       new_info->flags = old_info->flags;
        new_info->out_infos =
                DUP_ARR_D(reg_out_info_t, obst, old_info->out_infos);
        new_info->in_reqs = old_info->in_reqs;