From 3a5037034aef9b046a69c288052367db7122f174 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 28 Jun 2007 12:29:19 +0000 Subject: [PATCH] variadic functions have always cdelc calling convention [r14810] --- ir/be/ia32/bearch_ia32.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ir/be/ia32/bearch_ia32.c b/ir/be/ia32/bearch_ia32.c index 077919058..eb7df1177 100644 --- a/ir/be/ia32/bearch_ia32.c +++ b/ir/be/ia32/bearch_ia32.c @@ -1608,10 +1608,15 @@ static void ia32_get_call_abi(const void *self, ir_type *method_type, be_abi_cal /* set parameter passing style */ be_abi_call_set_flags(abi, call_flags, &ia32_abi_callbacks); - cc = get_method_calling_convention(method_type); - if (get_method_additional_properties(method_type) & mtp_property_private) { - /* set the calling conventions to register parameter */ - cc = (cc & ~cc_bits) | cc_reg_param; + if (get_method_variadicity(method_type) == variadicity_variadic) { + /* pass all parameters of a variadic function on the stack */ + cc = cc_cdecl_set; + } else { + cc = get_method_calling_convention(method_type); + if (get_method_additional_properties(method_type) & mtp_property_private) { + /* set the calling conventions to register parameter */ + cc = (cc & ~cc_bits) | cc_reg_param; + } } n = get_method_n_params(method_type); for (i = regnum = 0; i < n; i++) { -- 2.20.1