From: Michael Beck Date: Mon, 18 Sep 2006 15:22:00 +0000 (+0000) Subject: IA32: align the stack at 32bit X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=6501140c2ad8e4175d1330d60574af987f1d6ded;p=libfirm IA32: align the stack at 32bit ABI: align stack parameters --- diff --git a/ir/be/beabi.c b/ir/be/beabi.c index 401503c5c..3d28942a7 100644 --- a/ir/be/beabi.c +++ b/ir/be/beabi.c @@ -407,11 +407,12 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp, i for(i = 0; i < n_params; ++i) { be_abi_call_arg_t *arg = get_call_arg(call, 0, i); assert(arg); - if(arg->on_stack) { - stack_size += arg->space_before; - stack_size = round_up2(stack_size, arg->alignment); - stack_size += get_type_size_bytes(get_method_param_type(mt, i)); - stack_size += arg->space_after; + if (arg->on_stack) { + int arg_size = get_type_size_bytes(get_method_param_type(mt, i)); + + stack_size += round_up2(arg->space_before, arg->alignment); + stack_size += round_up2(arg_size, arg->alignment); + stack_size += round_up2(arg->space_after, arg->alignment); obstack_int_grow(obst, i); n_pos++; } diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index 692f49b75..711c341ad 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -1623,7 +1623,8 @@ static void ia32_get_call_abi(const void *self, ir_type *method_type, be_abi_cal /* set stack parameters */ for (i = stack_idx; i < n; i++) { - be_abi_call_param_stack(abi, i, 1, 0, 0); + /* parameters on the stack are 32 bit aligned */ + be_abi_call_param_stack(abi, i, 4, 0, 0); }