renamed structures containing settings to ir_settings_*_t and place them in firm_types.h
[libfirm] / ir / be / beabi.c
index 781a7df..d27d18a 100644 (file)
@@ -1555,6 +1555,7 @@ static ir_node *create_be_return(be_abi_irg_t *env, ir_node *irn, ir_node *bl, i
 typedef struct lower_frame_sels_env_t {
        be_abi_irg_t *env;
        ir_entity    *value_param_list;  /**< the list of all value param entities */
+       ir_entity    *value_param_tail;  /**< the tail of the list of all value param entities */
 } lower_frame_sels_env_t;
 
 /**
@@ -1581,9 +1582,12 @@ static void lower_frame_sels_walker(ir_node *irn, void *data) {
                        exchange(irn, nw);
 
                        /* check, if it's a param sel and if have not seen this entity before */
-                       if (ptr == param_base && get_entity_link(ent) == NULL) {
+                       if (ptr == param_base &&
+                                       ent != ctx->value_param_tail &&
+                                       get_entity_link(ent) == NULL) {
                                set_entity_link(ent, ctx->value_param_list);
                                ctx->value_param_list = ent;
+                               if (ctx->value_param_tail == NULL) ctx->value_param_tail = ent;
                        }
                }
        }
@@ -1767,11 +1771,6 @@ static void modify_irg(be_abi_irg_t *env)
 
        /* set the links of all frame entities to NULL, we use it
           to detect if an entity is already linked in the value_param_list */
-       tp = get_irg_frame_type(irg);
-       for (i = get_class_n_members(tp) - 1; i >= 0; --i)
-               set_entity_link(get_class_member(tp, i), NULL);
-
-       /* same for the value_param type */
        tp = get_method_value_param_type(method_type);
        if (tp != NULL) {
                for (i = get_struct_n_members(tp) - 1; i >= 0; --i)
@@ -1781,6 +1780,7 @@ static void modify_irg(be_abi_irg_t *env)
        /* Convert the Sel nodes in the irg to frame load/store/addr nodes. */
        ctx.env              = env;
        ctx.value_param_list = NULL;
+       ctx.value_param_tail = NULL;
        irg_walk_graph(irg, lower_frame_sels_walker, NULL, &ctx);
 
        /* value_param_base anchor is not needed anymore now */
@@ -2233,6 +2233,7 @@ static int process_stack_bias(be_abi_irg_t *env, ir_node *bl, int bias)
        ir_node *irn;
 
        sched_foreach(bl, irn) {
+               int ofs;
 
                /*
                   Check, if the node relates to an entity on the stack frame.
@@ -2246,12 +2247,12 @@ static int process_stack_bias(be_abi_irg_t *env, ir_node *bl, int bias)
                        DBG((env->dbg, LEVEL_2, "%F has offset %d (including bias %d)\n", ent, offset, bias));
                }
 
-               /*
-                  If the node modifies the stack pointer by a constant offset,
-                  record that in the bias.
-                */
-               if(arch_irn_is(arch_env, irn, modify_sp)) {
-                       int ofs = arch_get_sp_bias(arch_env, irn);
+               if(omit_fp || be_is_IncSP(irn)) {
+                       /*
+                        * If the node modifies the stack pointer by a constant offset,
+                        * record that in the bias.
+                        */
+                       ofs = arch_get_sp_bias(arch_env, irn);
 
                        if(be_is_IncSP(irn)) {
                                if(ofs == BE_STACK_FRAME_SIZE_EXPAND) {