builtins.c (std_canonical_va_list): Treat structure based va_list types.
authorKai Tietz <kai.tietz@onevision.com>
Tue, 15 Jul 2008 09:04:33 +0000 (09:04 +0000)
committerKai Tietz <ktietz@gcc.gnu.org>
Tue, 15 Jul 2008 09:04:33 +0000 (11:04 +0200)
2008-07-15  Kai Tietz  <kai.tietz@onevision.com>

* builtins.c (std_canonical_va_list): Treat structure based
va_list types.

From-SVN: r137819

gcc/ChangeLog
gcc/builtins.c

index 32438121f14615e25ea48c94282cc01af25b9b01..78c6f4388c74f8a75a05d37a9cfbe6da5787356d 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-15  Kai Tietz  <kai.tietz@onevision.com>
+
+       * builtins.c (std_canonical_va_list): Treat structure based
+       va_list types.
+
 2008-07-15  Ben Elliston  <bje@au.ibm.com>
 
        * emit-rtl.c (set_mem_attributes_minus_bitpos): Improve comment.
index 2d6ad2a1a34eed1d21fe5b9524ad32fdc27c1d44..60caa8126d800105b7a2c724e23c596bee1c6159 100644 (file)
@@ -4691,10 +4691,12 @@ std_canonical_va_list_type (tree type)
     type = TREE_TYPE (type);
   else if (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE(type)))
     type = TREE_TYPE (type);
-
   wtype = va_list_type_node;
   htype = type;
-  if (TREE_CODE (wtype) == ARRAY_TYPE)
+  /* Treat structure va_list types.  */
+  if (TREE_CODE (wtype) == RECORD_TYPE && POINTER_TYPE_P (htype))
+    htype = TREE_TYPE (htype);
+  else if (TREE_CODE (wtype) == ARRAY_TYPE)
     {
       /* If va_list is an array type, the argument may have decayed
         to a pointer type, e.g. by being passed to another function.