From 87300e8c8102f83f8770da9a1d8758970bf28949 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 28 Nov 2007 01:20:34 +0000 Subject: [PATCH] re PR target/34001 (Incorrect x86 fastcall behavior) 2007-11-27 H.J. Lu Joey Ye PR target/34001 * config/i386/i386.c (function_arg_32): Don't pass aggregate arguments in ECX/EDX for fastcall. Co-Authored-By: Joey Ye From-SVN: r130488 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4c11ddd03c..9262b26e729 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-11-27 H.J. Lu + Joey Ye + + PR target/34001 + * config/i386/i386.c (function_arg_32): Don't pass aggregate + arguments in ECX/EDX for fastcall. + 2007-11-28 Rask Ingemann Lambertsen * config/i386/linux.h (CRT_GET_RFIB_DATA): Add Intel syntax inline diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index a81ee3d0929..afed858a7f5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4253,10 +4253,13 @@ function_arg_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode, int regno = cum->regno; /* Fastcall allocates the first two DWORD (SImode) or - smaller arguments to ECX and EDX. */ + smaller arguments to ECX and EDX if it isn't an + aggregate type . */ if (cum->fastcall) { - if (mode == BLKmode || mode == DImode) + if (mode == BLKmode + || mode == DImode + || (type && AGGREGATE_TYPE_P (type))) break; /* ECX not EAX is the first allocated register. */ -- 2.30.2