winnt.c (gen_stdcall_suffix): Quit summation of total parm size if a parm has incompl...
authorDanny Smith <dannysmith@users.sourceforge.net>
Thu, 18 Sep 2003 21:16:02 +0000 (21:16 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Thu, 18 Sep 2003 21:16:02 +0000 (21:16 +0000)
* config/i386/winnt.c (gen_stdcall_suffix): Quit summation of
total parm size if a parm has incomplete type.
(gen_fastcall_suffix): Likewise.

From-SVN: r71543

gcc/ChangeLog
gcc/config/i386/winnt.c

index b8d779dd9c1c9e3ab6a5ed3b7319103bbbc75866..4166ead77a73a7a55c26e85146f5375315530fae 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-18  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * config/i386/winnt.c (gen_stdcall_suffix): Quit summation of
+       total parm size if a parm has incomplete type.
+       (gen_fastcall_suffix): Likewise.
+
 2003-09-18  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * except.c (output_function_exception_table): Adjust last change
index 076a2934a78d0c3f5387f9fcb2a01b164b6bce1e..11a93a42ff15fd53c2d0c6203dd4c388d6cf600d 100644 (file)
@@ -420,7 +420,10 @@ gen_fastcall_suffix (tree decl)
       {
        tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
 
-       while (TREE_VALUE (formal_type) != void_type_node)
+       /* Quit if we hit an incomplete type.  Error is reported
+          by convert_arguments in c-typeck.c or cp/typeck.c.  */
+       while (TREE_VALUE (formal_type) != void_type_node
+              && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))   
          {
            int parm_size
              = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));
@@ -458,7 +461,10 @@ gen_stdcall_suffix (tree decl)
       {
        tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl));
 
-       while (TREE_VALUE (formal_type) != void_type_node)
+       /* Quit if we hit an incomplete type.  Error is reported
+          by convert_arguments in c-typeck.c or cp/typeck.c.  */
+       while (TREE_VALUE (formal_type) != void_type_node
+              && COMPLETE_TYPE_P (TREE_VALUE (formal_type)))   
          {
            int parm_size
              = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type)));