From: Stan Cox Date: Fri, 9 Aug 1996 20:51:08 +0000 (+0000) Subject: (gen_stdcall_suffix): Round parameter size up to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d5c883bbf7334aa4a9edd8ab7b0057a02f11f4b;p=gcc.git (gen_stdcall_suffix): Round parameter size up to PARM_BOUNDARY. From-SVN: r12608 --- 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);