OSDN Git Service

* tree.c (build_common_tree_nodes_2): Don't copy va_list_type_node
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Mar 2001 01:46:24 +0000 (01:46 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 11 Mar 2001 01:46:24 +0000 (01:46 +0000)
if it's a record type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40376 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree.c

index b6d072a..7fd1e0f 100644 (file)
@@ -1,3 +1,8 @@
+Sat Mar 10 22:42:05 2001  Alexandre Oliva  <aoliva@redhat.com>
+
+       * tree.c (build_common_tree_nodes_2): Don't copy va_list_type_node
+       if it's a record type.
+
 Sat Mar 10 17:52:54 2001  Christopher Faylor <cgf@cygnus.com>
 
        * config/i386/cygwin.h: Make ../w32api a system directory.  Reorganize
index db286c8..ae7f005 100644 (file)
@@ -4828,7 +4828,16 @@ build_common_tree_nodes_2 (short_double)
   {
     tree t;
     BUILD_VA_LIST_TYPE (t);
-    va_list_type_node = build_type_copy (t);
+
+    /* Many back-ends define record types without seting TYPE_NAME.
+       If we copied the record type here, we'd keep the original
+       record type without a name.  This breaks name mangling.  So,
+       don't copy record types and let c_common_nodes_and_builtins()
+       declare the type to be __builtin_va_list.  */
+    if (TREE_CODE (t) != RECORD_TYPE)
+      t = build_type_copy (t);
+
+    va_list_type_node = t;
   }
 
   V4SF_type_node = make_node (VECTOR_TYPE);