summaryrefslogtreecommitdiff
path: root/gcc/config/i386/winnt.c
diff options
context:
space:
mode:
authorStan Cox <coxs@gnu.org>1996-08-09 20:51:08 +0000
committerStan Cox <coxs@gnu.org>1996-08-09 20:51:08 +0000
commit3d5c883bbf7334aa4a9edd8ab7b0057a02f11f4b (patch)
treef922a50eb0ca1c382a20ff1a3a2cd66a42a22130 /gcc/config/i386/winnt.c
parenta1a478c5fec79ed87ecbb84463a0163c2eecd28c (diff)
downloadgcc-3d5c883bbf7334aa4a9edd8ab7b0057a02f11f4b.tar.gz
(gen_stdcall_suffix): Round parameter size up to
PARM_BOUNDARY. From-SVN: r12608
Diffstat (limited to 'gcc/config/i386/winnt.c')
-rw-r--r--gcc/config/i386/winnt.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c
index 3a7ebf1ba5d..9920b8d4f8d 100644
--- a/gcc/config/i386/winnt.c
+++ b/gcc/config/i386/winnt.c
@@ -44,13 +44,19 @@ gen_stdcall_suffix (decl)
if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl))))
== void_type_node)
{
- tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
+ tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
- while (TREE_VALUE (formal_type) != void_type_node)
- {
- total += TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
- formal_type = TREE_CHAIN (formal_type);
- }
+ while (TREE_VALUE (formal_type) != void_type_node)
+ {
+ int parm_size
+ = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
+ /* Must round up to include padding. This is done the same
+ way as in store_one_arg. */
+ parm_size = ((parm_size + PARM_BOUNDARY - 1)
+ / PARM_BOUNDARY * PARM_BOUNDARY);
+ total += parm_size;
+ formal_type = TREE_CHAIN (formal_type);
+ }
}
newsym = xmalloc (strlen (asmname) + 10);