aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2009-01-06 16:04:25 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2009-01-06 15:04:25 +0000
commit9aa5c1b2acb324d7d221f7d919e976110cdeedfc (patch)
treeddd0047f2295a95e1ee60d5eb419ff46e616fc54
parentf7556aaec3e41bc2314849dbd5de482ebf87a0d1 (diff)
downloadgcc-9aa5c1b2acb324d7d221f7d919e976110cdeedfc.zip
gcc-9aa5c1b2acb324d7d221f7d919e976110cdeedfc.tar.gz
gcc-9aa5c1b2acb324d7d221f7d919e976110cdeedfc.tar.bz2
i386.h (ACCUMULATE_OUTGOING_ARGS): Enable for MSABI
* i386.h (ACCUMULATE_OUTGOING_ARGS): Enable for MSABI * i386.c (init_cumulative_args): Disallow calls of MSABI functions when accumulate outgoing args is off. Co-Authored-By: Kai Tietz <kai.tietz@onevision.com> From-SVN: r143118
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/i386.c3
-rw-r--r--gcc/config/i386/i386.h8
3 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9c9a5fa..b1edf5e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-06 Jan Hubicka <jh@suse.cz>
+ Kai Tietz <kai.tietz@onevision.com>
+
+ * i386.h (ACCUMULATE_OUTGOING_ARGS): Enable for MSABI
+ * i386.c (init_cumulative_args): Disallow calls of MSABI functions when
+ accumulate outgoing args is off.
+
2009-01-06 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/38742
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index c698ee3..d6fca32 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4639,6 +4639,9 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
else
cum->call_abi = ix86_function_type_abi (fntype);
/* Set up the number of registers to use for passing arguments. */
+
+ if (cum->call_abi == MS_ABI && !ACCUMULATE_OUTGOING_ARGS)
+ sorry ("ms_abi attribute require -maccumulate-outgoing-args or subtarget optimization implying it");
cum->nregs = ix86_regparm;
if (TARGET_64BIT)
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index a1da0a75..a853ed6 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1509,9 +1509,13 @@ enum reg_class
be computed and placed into the variable
`crtl->outgoing_args_size'. No space will be pushed onto the
stack for each call; instead, the function prologue should increase the stack
- frame size by this amount. */
+ frame size by this amount.
+
+ MS ABI seem to require 16 byte alignment everywhere except for function
+ prologue and apilogue. This is not possible without
+ ACCUMULATE_OUTGOING_ARGS. */
-#define ACCUMULATE_OUTGOING_ARGS TARGET_ACCUMULATE_OUTGOING_ARGS
+#define ACCUMULATE_OUTGOING_ARGS (TARGET_ACCUMULATE_OUTGOING_ARGS || ix86_cfun_abi () == MS_ABI)
/* If defined, a C expression whose value is nonzero when we want to use PUSH
instructions to pass outgoing arguments. */