https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85667
--- Comment #12 from H.J. Lu <hjl.tools at gmail dot com> --- I am testing this diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index ffda3e8fd21..f769cb8f75e 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3153,7 +3153,7 @@ function_arg_64 (const CUMULATIVE_ARGS *cum, machine_mode mode, static rtx function_arg_ms_64 (const CUMULATIVE_ARGS *cum, machine_mode mode, - machine_mode orig_mode, bool named, + machine_mode orig_mode, bool named, const_tree type, HOST_WIDE_INT bytes) { unsigned int regno; @@ -3173,7 +3173,10 @@ function_arg_ms_64 (const CUMULATIVE_ARGS *cum, machine_mode mode, if (TARGET_SSE && (mode == SFmode || mode == DFmode)) { if (named) - regno = cum->regno + FIRST_SSE_REG; + { + if (type == NULL_TREE || !AGGREGATE_TYPE_P (type)) + regno = cum->regno + FIRST_SSE_REG; + } else { rtx t1, t2; @@ -3253,7 +3256,8 @@ ix86_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) enum calling_abi call_abi = cum ? cum->call_abi : ix86_abi; if (call_abi == MS_ABI) - reg = function_arg_ms_64 (cum, mode, arg.mode, arg.named, bytes); + reg = function_arg_ms_64 (cum, mode, arg.mode, arg.named, + arg.type, bytes); else reg = function_arg_64 (cum, mode, arg.mode, arg.type, arg.named); }