From 3d5c883bbf7334aa4a9edd8ab7b0057a02f11f4b Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Fri, 9 Aug 1996 20:51:08 +0000 Subject: [PATCH] (gen_stdcall_suffix): Round parameter size up to PARM_BOUNDARY. From-SVN: r12608 --- gcc/config/i386/winnt.c | 18 ++++++++++++------ 1 file 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); -- 2.30.2