tree.c (build_common_tree_nodes_2): Don't copy va_list_type_node if it's a record...
authorAlexandre Oliva <aoliva@redhat.com>
Sun, 11 Mar 2001 01:46:24 +0000 (01:46 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Sun, 11 Mar 2001 01:46:24 +0000 (01:46 +0000)
* tree.c (build_common_tree_nodes_2): Don't copy va_list_type_node
if it's a record type.

From-SVN: r40376

gcc/ChangeLog
gcc/tree.c

index b6d072ab5e1bc52721b2c4bb6c75a96dc3cbfb61..7fd1e0f7c4df37ddd2e4d17abdef320d6b9dcbc6 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 db286c859e2f4f692711232a1a1e5e6d3796926f..ae7f005becda2fc0207173b7fb90058b92c732a0 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);