OSDN Git Service

PR objc/43061
[pf3gnuchains/gcc-fork.git] / gcc / config / sol2-c.c
index fc527b1..601db97 100644 (file)
@@ -36,8 +36,8 @@ along with GCC; see the file COPYING3.  If not see
 /* cmn_err only accepts "l" and "ll".  */
 static const format_length_info cmn_err_length_specs[] =
 {
-  { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89 },
-  { NULL, FMT_LEN_none, STD_C89, NULL, FMT_LEN_none, STD_C89 }
+  { "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C89, 0 },
+  { NULL, FMT_LEN_none, STD_C89, NULL, FMT_LEN_none, STD_C89, 0 }
 };
 
 static const format_flag_spec cmn_err_flag_specs[] =
@@ -170,9 +170,10 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED)
       tree decl = identifier_global_value (t);
       if (decl && DECL_P (decl))
        {
-         tree init_list = build_tree_list (get_identifier ("init"),
-                                           NULL);
-         tree attrs = tree_cons (get_identifier ("used"), NULL, init_list);
+         tree attrs = build_tree_list (get_identifier ("init"),
+                                       NULL);
+         TREE_USED (decl) = 1;
+         DECL_PRESERVE_P (decl) = 1;
          decl_attributes (&decl, attrs, 0);
        }
       else
@@ -228,9 +229,10 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED)
       tree decl = identifier_global_value (t);
       if (decl && DECL_P (decl))
        {
-         tree fini_list = build_tree_list (get_identifier ("fini"),
-                                           NULL);
-         tree attrs = tree_cons (get_identifier ("used"), NULL, fini_list);
+         tree attrs = build_tree_list (get_identifier ("fini"),
+                                       NULL);
+         TREE_USED (decl) = 1;
+         DECL_PRESERVE_P (decl) = 1;
          decl_attributes (&decl, attrs, 0);
        }
       else