sh.c (sh_build_builtin_va_list): Set tree type name of RECORD.
authorKaz Kojima <kkojima@gcc.gnu.org>
Mon, 7 Jun 2010 22:15:47 +0000 (22:15 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Mon, 7 Jun 2010 22:15:47 +0000 (22:15 +0000)
* config/sh/sh.c (sh_build_builtin_va_list): Set tree type
name of RECORD.

From-SVN: r160409

gcc/ChangeLog
gcc/config/sh/sh.c

index 2037e82dca20fd95765d1e094748b2f50bc4693c..6268186dbd662a0e7e8f94fc6e70293aa2260614 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-07  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * config/sh/sh.c (sh_build_builtin_va_list): Set tree type
+       name of RECORD.
+
 2010-06-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * doc/sourcebuild.texi (Effective-Target Keywords, Other
index abd579ae1a7ad8a37a4d20e8c11bb6b4556f7434..e186a108fb45c6218314cfc6b0f4c724408d149b 100644 (file)
@@ -7636,13 +7636,15 @@ static tree
 sh_build_builtin_va_list (void)
 {
   tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
-  tree record;
+  tree record, type_decl;
 
   if (TARGET_SH5 || (! TARGET_SH2E && ! TARGET_SH4)
       || TARGET_HITACHI || sh_cfun_attr_renesas_p ())
     return ptr_type_node;
 
   record = (*lang_hooks.types.make_type) (RECORD_TYPE);
+  type_decl = build_decl (BUILTINS_LOCATION,
+                         TYPE_DECL, get_identifier ("__va_list_tag"), record);
 
   f_next_o = build_decl (BUILTINS_LOCATION,
                         FIELD_DECL, get_identifier ("__va_next_o"),
@@ -7668,6 +7670,8 @@ sh_build_builtin_va_list (void)
   DECL_FIELD_CONTEXT (f_next_fp_limit) = record;
   DECL_FIELD_CONTEXT (f_next_stack) = record;
 
+  TREE_CHAIN (record) = type_decl;
+  TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_next_o;
   TREE_CHAIN (f_next_o) = f_next_o_limit;
   TREE_CHAIN (f_next_o_limit) = f_next_fp;