diff --ignore-space -c -r gcc-3.0.1/gcc/objc/objc-act.c gcc-3.0.1-patched/gcc/objc/objc-act.c *** gcc-3.0.1/gcc/objc/objc-act.c Fri Jun 29 13:20:43 2001 --- gcc-3.0.1-patched/gcc/objc/objc-act.c Sun Nov 11 15:20:34 2001 *************** *** 6807,6813 **** if (TYPE_MODE (type) == SFmode) obstack_1grow (&util_obstack, 'f'); else if (TYPE_MODE (type) == DFmode ! || TYPE_MODE (type) == TFmode) obstack_1grow (&util_obstack, 'd'); } --- 6807,6813 ---- if (TYPE_MODE (type) == SFmode) obstack_1grow (&util_obstack, 'f'); else if (TYPE_MODE (type) == DFmode ! || TYPE_MODE (type) == TFmode || TYPE_MODE (type) == XFmode) obstack_1grow (&util_obstack, 'd'); } *************** *** 7119,7125 **** char *buf; /* Synth the storage class & assemble the return type. */ ! sc_spec = tree_cons (NULL_TREE, ridpointers[(int) RID_STATIC], NULL_TREE); ret_spec = TREE_PURPOSE (TREE_TYPE (method)); decl_specs = chainon (sc_spec, ret_spec); --- 7119,7125 ---- char *buf; /* Synth the storage class & assemble the return type. */ ! sc_spec = tree_cons (NULL_TREE, ridpointers[(int) RID_EXTERN], NULL_TREE); ret_spec = TREE_PURPOSE (TREE_TYPE (method)); decl_specs = chainon (sc_spec, ret_spec); *************** *** 8362,8369 **** --- 8362,8398 ---- pushdecl (decl); rest_of_decl_compilation (decl, 0, 0, 0); + #if 1 + { + char *string_ref = (char *) alloca (strlen (string) + 5); + tree refdecl; + + sprintf (string_ref, "%s_ref", string); + + refdecl = build_decl (VAR_DECL, + get_identifier (string_ref), + const_ptr_type_node); + + TREE_PUBLIC (refdecl) = 0; + TREE_STATIC (refdecl) = 1; + TREE_READONLY (refdecl) = 1; + TREE_CONSTANT (refdecl) = 1; + DECL_CONTEXT (refdecl) = NULL_TREE; + DECL_ARTIFICIAL (refdecl) = 1; + exp = build1 (ADDR_EXPR, string_type_node, decl); + DECL_INITIAL (refdecl) = exp; + + make_decl_rtl (refdecl, 0); + assemble_variable (refdecl, 1, 0, 0); + } + #else + #ifdef __hpux__ /* Put the decl in the variable section. It may need relocation. */ variable_section (decl, 1); + #else + /* Make following constant read-only (why not)? */ + readonly_data_section (); + #endif exp = build1 (ADDR_EXPR, string_type_node, decl); *************** *** 8375,8380 **** --- 8404,8410 ---- /* Output a constant to reference this address. */ output_constant (exp, int_size_in_bytes (string_type_node)); + #endif } else { *************** *** 8414,8424 **** --- 8444,8475 ---- else { + #if 0 sprintf (string, "%sobjc_class_name_%s", (flag_next_runtime ? "." : "__"), class_name); + #ifdef __hpux__ readonly_data_section (); + #endif assemble_global (string); assemble_label (string); + #else + tree decl; + sprintf (string, "%sobjc_class_name_%s", + (flag_next_runtime ? "." : "__"), class_name); + + decl = build_decl (VAR_DECL, + get_identifier (string), + integer_type_node); + + TREE_PUBLIC (decl) = 1; + TREE_READONLY (decl) = 1; + TREE_CONSTANT (decl) = 1; + DECL_CONTEXT (decl) = 0; + DECL_SIZE (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; + make_decl_rtl (decl, 0); + assemble_variable (decl, 1, 0, 0); + #endif } } *************** *** 8448,8459 **** --- 8499,8534 ---- else { + #if 0 sprintf (string, "%sobjc_category_name_%s_%s", (flag_next_runtime ? "." : "__"), class_name, class_super_name); + #ifdef __hpux__ readonly_data_section (); + #endif assemble_global (string); assemble_label (string); + #else + tree decl; + + sprintf (string, "%sobjc_category_name_%s_%s", + (flag_next_runtime ? "." : "__"), + class_name, class_super_name); + + decl = build_decl (VAR_DECL, + get_identifier (string), + integer_type_node); + + TREE_PUBLIC (decl) = 1; + TREE_READONLY (decl) = 1; + TREE_CONSTANT (decl) = 1; + DECL_CONTEXT (decl) = 0; + DECL_SIZE (decl) = 1; + DECL_ARTIFICIAL (decl) = 1; + + make_decl_rtl (decl, 0); + assemble_variable (decl, 1, 0, 0); + #endif } } }