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;
/**
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;
}
}
}
/* 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)
/* 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 */
ir_node *irn;
sched_foreach(bl, irn) {
+ int ofs;
/*
Check, if the node relates to an entity on the stack frame.
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) {