aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
AgeCommit message (Collapse)AuthorFilesLines
2001-03-27c-common.h (DECL_NUM_STMTS): New macro.Mark Mitchell1-7/+7
* c-common.h (DECL_NUM_STMTS): New macro. * c-decl.c (duplicate_decls): Copy DECL_NUM_STMTS, not DECL_FRAME_SIZE. (pushdecl): Likewise. * c-semantics.c (add_stmt): Update DECL_NUM_STMTS. * integrate.c (expand_inline_function): Don't check DECL_FRAME_SIZE. * print-tree.c (print_node): Don't print it. * toplev.c (rest_of_compilation): Don't try to inline when flag_no_inline is on. * tree.h (DECL_FRAME_SIZE): Remove. (tree_decl): Adjust accordingly. * Makefile.in (optimize.o): Depend on params.h. (duplicate_decls): Copy DECL_NUM_STMTS, not DECL_FRAME_SIZE. (init_decl_processing): Set flag_no_inline when doing inlining-on-trees. * optimize.c: Include params.h. (struct inline_data): Improve documentation of FNS. Add FIRST_INLINED_FN, INLINED_STMTS, and CLONING_P. (INSNS_PER_STMT): New macro. (remap_block): Use CLONING_P. (inlinable_function_p): Don't inline big functions. (expand_call_inline): Keep track of how much inlining we've done. (optimize_function): Set FIRST_INLINED_FN. (maybe_clone_body): Set CLONING_P. * semantics.c (simplify_aggr_init_exprs_r): Fix typing problems in tree nodes. (genrtl_finish_function): Clear DECL_DEFER_OUTPUT before calling rest_of_compilation. Clear DECL_RTL for local variables afterwards. (clear_decl_rtl): New function. * com.c (duplicate_decls): Don't copy DECL_FRAME_SIZE. * parse.h (DECL_END_SOURCE_LINE): Don't rely on DECL_FRAME_SIZE. From-SVN: r40859
2001-03-19Compute DECL_ASSEMBLER_NAME lazily.Mark Mitchell1-5/+39
* tree.h (DECL_ASSEMBLER_NAME): Compute it lazily. (DECL_ASSEMBLER_NAME_SET_P): New macro. (SET_DECL_ASSEMBLER_NAME): Likewise. (COPY_DECL_ASSEMBLER_NAME): Likewise. (set_decl_assembler_name): Declare. (lang_set_decl_assembler_name): Likewise. * tree.c (lang_set_decl_assembler_name): New variab.e (set_decl_assembler_name): New function. (init_obstacks): Set lang_set_decl_assembler_name. (build_decl): Don't set DECL_ASSEMBLER_NAME. * c-decl.c (duplicate_decls): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (builtin_function): Likewise. (finish_decl): Likewise. * dbxout.c (dbxout_type_methods): Likewise. * ggc-common.c (ggc_mark_trees): Likewise. * profile.c (output_func_start_profiler): Likewise. * varasm.c (make_decl_rtl): Likewise. * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (add_method): Remove optimization involving comparison of DECL_ASSEMBLER_NAME. (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (check_methods): Likewise. (build_clone): Likewise. (built_vtt): Likewise. * cp-tree.h (DECL_NEEDED_P): Likewise. * decl.c (pushtag): Likewise. (duplicate_decls): Likewise. (pushdecl): Likewise. (builtin_function): Likewise. (build_library_fn_1): Set DECL_LANGUAGE for library functions. (build_cp_library_fn): Likewise. (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (grokfndecl): Likewise. (grokvardecl): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. (cp_missing_return_ok_p): Likewise. * decl2.c (grokclassfn): Likewise. (check_classfn): Likewise. (finish_static_data_member_decl): Likewise. (grokfield): Likewise. * error.c (GLOBAL_IORD_P): Remove. (dump_global_iord): Improve output. (dump_decl): Avoid using DECL_ASSEMBLER_NAME. * except.c (nothrow_libfn_p): Summarily reject any function not in namespace-scope. * init.c (build_java_class_ref): Don't explicitly set DECL_ASSEMBLER_NAME after calling mangle_decl. * mangle.c (mangle_decl_string): Handle extern "C" functions. (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl. * method.c (set_mangled_name_for_decl): Don't explicitly set DECL_ASSEMBLER_NAME after calling mangle_decl. (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and IDENTIFIER_GLOBAL_VALUE for the thunk. * pt.c (set_mangled_name_for_template_decl): Remove. (check_explicit_specialization): Don't use it. (looup_template_class): Don't set DECL_ASSEMBLER_NAME. (tsubst_friend_function): Likewise. (tsubst_decl): Likewise. (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME. * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME, COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME where it's not necessary. (tinfo_base_init): Likewise. (create_real_tinfo_var): Likewise. * search.c (looup_field_1): Likewise. * semantics.c (finish_named_return_value): Likewise. * tree.c (init_tree): Set lang_set_decl_assembler_name. * com.c (builtin_function): Use SET_DECL_ASSEMBLER_NAME. * class.c (build_class_ref): Use SET_DECL_ASSEMBLER_NAME. (layout_class): Likewise. (layout_class_method): Likewise. (emit_register_classes): Likewise. * decl.c (builtin_function): Likewise. (give_name_to_locals): Likewise. From-SVN: r40642
2001-03-15varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME...Mark Mitchell1-2/+21
* varasm.c (assemble_alias): Use DECL_ASSEMBLER_NAME, not the contents of the RTL, to determine the name of the object. * tree.h (DECL_RTL): Allocate RTL lazily. (SET_DECL_RTL): New macro. (DECL_RTL_SET_P): Likewise. (COPY_DECL_RTL): Likewise. (DECL_RTL_IF_SET): Likewise. * varasm.c (make_decl_rtl): Add assertions about the kind of declaration we are processing. * c-decl.c (duplicate_decls): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. (start_decl): Likewise. (finish_decl): Likewise. * c-semantics.c (emit_local_var): Likewise. * calls.c (expand_call): Likewise. * dbxout.c (dbxout_symbol): Likewise. * emit-rtl.c (unshare_all_rtl): Likewise. (unshare_all_decls): Likewise. (reset_used_decls): Likewise. * expr.c (store_constructor): Likewise. (safe_from_p): Likewise. (expand_expr): Likewise. * function.c (put_var_into_stack): Likewise. (instantiate_decls_1): Likewise. (assign_parms): Likewise. (expand_function_start): Likewise. (expand_function_end): Likewise. * ggc-common.c (gcc_mark_trees): Likewise. * integrate.c (function_cannot_inline_p): Likewise. (copy_decl_for_inlining): Likewise. (expand_inline_function): Likewise. (integrate_parm_decls): Likewise. (integrate_decl_tree): Likewise. * print-tree.c (print_node): Likewise. * reg-stack.c (stack_result): Likewise. * stmt.c (label_rtx): Likewise. (expand_return): Likewise. (expand_decl): Likewise. (expand_decl_cleanup): Likewise. (expand_anon_union_decl): Likewise. * toplev.c (check_global_declarations): Likewise. (rest_of_decl_compilation): Likewise. * tree.c (simple_cst_equal): Likewise. * objc/objc-act.c (generate_static_references): Likewise. * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. * cp-tree.h (DECL_IN_MEMORY_P): Likewise. * decl.c (duplicate_decls): Likewise. (builtin_function): Likewise. (build_library_fn): Likewise. (build_cp_library_fn): Likewise. (check_initializer): Likewise. (cp_finish_decl): Likewise. * decl2.c (grokfield): Likewise. (grok_function_init): Remove #if 0'd code. (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. * friend.c (do_friend): Likewise. * init.c (get_temp_regvar): Likewise. * method.c (make_thunk): Likewise. * pt.c (tsubst_friend_function): Likewise. (tsubst_decl): Likewise. (regenerate_decl_from_template): Likewise. * semantics.c (genrtl_named_return_value): Likewise. (expand_body): Likewise. (genrtl_finish_function): Likewise. * tree.c (cp_tree_equal): Likewise. * com.c (ffecom_member_phase_2): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. (duplicate_decls): Likewise. (start_decl): Likewise. * class.c (build_static_field_ref): Likewise. (make_method_value): Likewise. (get_dispatch_table): Likewise. * decl.c (push_jvm_slot): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. From-SVN: r40482
2001-03-12emit-rtl.c (remove_unnecessary_notes): Reverse Richard Kenner's 2001-02-24 ↵Jeffrey Oldham1-6/+1
which broke building the Java library. 2001-03-12 Jeffrey Oldham <oldham@codesourcery.com> * emit-rtl.c (remove_unnecessary_notes): Reverse Richard Kenner's 2001-02-24 which broke building the Java library. * function.c (identify_blocks): Likewise. (all_blocks): Likewise. * integrate.c (integrate_decl_tree): Likewise. * print-tree.c (print_node): Likewise. * tree.h (BLOCK_NUMBER): Likewise. (struct tree_block): Likewise. From-SVN: r40431
2001-03-02print-rtl.c (print_rtx): Cast enums to int for comparison.John David Anglin1-1/+2
* print-rtl.c (print_rtx): Cast enums to int for comparison. * c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. From-SVN: r40193
2001-03-02stringpool.c (set_identifier): New function.Zack Weinberg1-0/+7
* stringpool.c (set_identifier): New function. * tree.h: Prototype it. * c-parse.in: Kill D_YES. If compiled for objc, call save_and_forget_protocol_qualifiers from init_reswords. * objc/objc-act.c (remember_protocol_qualifiers, forget_protocol_qualifiers): Don't diddle C_IS_RESERVED_WORD. Swap out the non-keyword IDENTIFIER_NODEs for keyword ones, or vice versa. (save_and_forget_protocol_qualifiers): New function. * c-lex.h: Prototype save_and_forget_protocol_qualifiers. From-SVN: r40170
2001-02-24tree.h (BLOCK_DEAD): New macro.Richard Kenner1-1/+6
* tree.h (BLOCK_DEAD): New macro. (struct tree_block): New flag, dead_flag. * print-tree.c (print_node, case 'b'): Print missing fields. * emit-rtl.c (remove_unnecessary_notes): Set BLOCK_DEAD. * function.c (identify_blocks): Enable test for misplaced notes. (all_blocks): Skip BLOCK_DEAD blocks. * integrate.c (integrate_decl_tree): Likewise. From-SVN: r40039
2001-02-21tree.h (DECL_UNINLINABLE): Move from C++ frontend.Jason Merrill1-3/+5
* tree.h (DECL_UNINLINABLE): Move from C++ frontend. (struct tree_decl): Add uninlinable bitfield. * c-decl.c (duplicate_decls): Set it. * integrate.c (function_cannot_inline_p): Check it. * cp-tree.h (struct lang_decl_flags): Remove uninlinable flag. (DECL_UNINLINABLE): Move to middle-end. * dwarf2out.c (add_name_and_src_coords_attributes): Don't add DW_AT_MIPS_linkage_name to abstract methods. (dwarf2out_abstract_function): Emit class context before calling set_decl_abstract_flags. Don't clear DECL_ABSTRACT. (gen_subprogram_die): Remove obsolete code. (gen_member_die): Don't include clones in the member list. (gen_decl_die): Emit abstract info for clone origin. * dwarfout.c (output_type): Don't include clones in the member list. * dbxout.c (dbxout_type_methods): Ignore abstract methods. * toplev.c (note_deferral_of_defined_inline_function): Don't clear DECL_ABSTRACT on a function that already has it set. * class.c (clone_function_decl): Set DECL_ABSTRACT on original fn. * decl.c (duplicate_decls): Preserve DECL_ABSTRACT. * class.c (build_clone): Set DECL_ABSTRACT_ORIGIN for the clone. * optimize.c (maybe_clone_body): Set DECL_ABSTRACT_ORIGIN for the parms and outer BLOCK. note_deferral_of_defined_inline_function. * dwarf2out.c (gen_formal_types_die): Also accept a FUNCTION_DECL. (get_subprogram_die): Pass it in. * method.c (implicitly_declare_fn): Don't set DECL_ARTIFICIAL on second parm of op=. From-SVN: r39945
2001-02-16tree.h (BLOCK_CHAIN): Use BLOCK_CHECK.Jason Merrill1-1/+1
* tree.h (BLOCK_CHAIN): Use BLOCK_CHECK. * optimize.c (remap_block): If we're compiling a clone, pass the new block to insert_block. From-SVN: r39761
2001-02-14stor-layout.c (is_pending_size, [...]): New functions.Jakub Jelinek1-0/+2
* stor-layout.c (is_pending_size, put_pending_size): New functions. (variable_size): Call put_pending_size. * tree.h (is_pending_size, put_pending_size): Add prototypes. * fold-const.c (extract_muldiv): If SAVE_EXPR is on the pending sizes list, put newly created SAVE_EXPR there as well. * gcc.c-torture/execute/20010209-1.c: New test. * config/ia64/ia64.c (last_group): Only 2 entries are needed. (errata_find_address_regs): load_group has only 2 entries. (errata_emit_nops): Likewise. shladd is not problematic. Clear last_group if nop was emitted. (fixup_errata): load_group has only 2 entries. Optimize. From-SVN: r39663
2001-02-06stor-layout.c (reference_types_internal): New variable.Richard Kenner1-0/+1
* stor-layout.c (reference_types_internal): New variable. (internal_reference_types): New function. (layout_type, case REFERENCE_TYPE): Make Pmode if internal. * tree.h (internal_reference_types): New declaration. From-SVN: r39491
2001-01-29* tree.h (TYPE_STUB_DECL): Add documentation.Richard Henderson1-0/+7
From-SVN: r39340
2001-01-29tree.c, tree.h (build_parse_node): Remove; was identical to build_nt.Joseph Myers1-1/+0
* tree.c, tree.h (build_parse_node): Remove; was identical to build_nt. * c-lang.c (start_cdtor), objc/objc-act.c (build_module_descriptor): Use build_nt instead of build_parse_node. cp: * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, make_reference_declarator, make_call_declarator), method.c (implicitly_declare_fn), parse.y (namespace_using_decl, notype_unqualified_id, expr_or_declarator, new_type_id, after_type_declarator, direct_after_type_declarator, notype_declarator, complex_notype_declarator, complex_direct_notype_declarator, qualified_id, notype_qualified_id, overqualified_id, direct_new_declarator, absdcl, direct_abstract_declarator, conversion_declarator), pt.c (tsubst), semantics.c (begin_constructor_declarator): Use build_nt instead of build_parse_node. From-SVN: r39332
2001-01-29stmt.c (estimate_case_costs): Use integer_minus_one_node.Kaveh R. Ghazi1-0/+2
* stmt.c (estimate_case_costs): Use integer_minus_one_node. * tree.c (build_common_tree_nodes_2): Set integer_minus_one_node. * tree.h (tree_index): Add new element TI_INTEGER_MINUS_ONE. (integer_minus_one_node): Define. ch: * ch-tree.h (integer_minus_one_node): Moved to top level gcc directory. * decl.c (integer_minus_one_node): Likewise. (init_decl_processing): Don't set integer_minus_one_node. cp: * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE. (minus_one_node): Moved to top level gcc directory. Renamed to integer_minus_one_node. * init.c (init_init_processing): Don't set minus_one_node. (build_vec_init): Use integer_minus_one_node. * rtti.c (get_tinfo_decl_dynamic): Likewise. From-SVN: r39325
2001-01-11c-common.h (CTI_VOID_LIST): Remove.Mark Mitchell1-0/+9
* c-common.h (CTI_VOID_LIST): Remove. (void_list_node): Likewise. * tree.h (TI_VOID_LIST_NODE): New enumeral. (void_list_node): New macro. * config/arm/arm.c (arm_init_builtins): Use void_list_node. * config/i386/i386.c (ix86_init_builtins): Likewise. * config/ia64a/ia64.c (ia64_init_builtins): Likewise. * class.c (finish_struct_1): Remove last argument in call to make_decl_rtl; use make_function_rtl instead of make_decl_rtl. * decl.c (builtin_function): Likewise. (build_cp_library_fn): Likewise. (check_initializer): Likewise. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (start_function): Likewise. * decl2.c (finish_anon_union): Likewise. * friend.c (do_friend): Likewise. * init.c (build_java_class_ref): Likewise. * method.c (make_thunk): Likewise. * pt.c (tsubst_friend_function): Likewise. * semantics.c (expand_body): Likewise. From-SVN: r38887
2001-01-10output.h (make_function_rtl): Remove prototype.Mark Mitchell1-1/+1
* output.h (make_function_rtl): Remove prototype. (make_decl_rtl): Likewise. * varasm.c (make_function_rtl): Remove. (make_decl_rtl): Determine top-levelness from DECL_CONTEXT, rather than from a third parameter. * tree.h (make_decl_rtl): Remove last parameter. * c-decl.c (builtin_function): Remove last argument in call to make_decl_rtl; use make_function_rtl instead of make_decl_rtl. (start_function): Likewise. * except.c (call_get_eh_context): Likewise. * expr.c (emit_block_move): Likewise. (clear_storage): Likewise. * profile.c (output_func_start_profiler): Likewise. * toplev.c (rest_of_decl_compilation): Likewise. * objc/objc-act.c (create_builtin_decl): Likewise. (synth_module_prologue): Likewise. (generate_static_reference): Likewise. (build_selector_reference_decl): Likewise. (build_class_reference_decl): Likewise. (build_objc_string_decl): Likewise. (build_protocol_reference): Likewise. * class.c (finish_struct_1): Remove last argument in call to make_decl_rtl; use make_function_rtl instead of make_decl_rtl. * decl.c (builtin_function): Likewise. (build_cp_library_fn): Likewise. (check_initializer): Likewise. (make_rtl_for_nonlocal_decl): Likewise. (cp_finish_decl): Likewise. (start_function): Likewise. * decl2.c (finish_anon_union): Likewise. * friend.c (do_friend): Likewise. * init.c (build_java_class_ref): Likewise. * method.c (make_thunk): Likewise. * pt.c (tsubst_friend_function): Likewise. * semantics.c (expand_body): Likewise. * com.c (ffecom_init_zero_): Remove last argument in call to make_decl_rtl; use make_function_rtl instead of make_decl_rtl. (ffecom_lookup_label_): Likewise. (builtin_function): Likewise. (start_function): Likewise. * class.c (build_utf8_ref): Remove last argument in call to make_decl_rtl; use make_function_rtl instead of make_decl_rtl. (build_class_ref): Likewise. (build_static_field_ref): Likewise. (get_dispatch_table): Likewise. (layout_class_method): Likewise. (emit_register_classes): Likewise. * constants.c (build_constant_data_ref): Likewise. * decl.c (builtin_function): Likewise. (create_primitive_vtable): Likewise. * expr.c (build_known_method_def): Likewise. (build_jni_stub): Likewise. (java_lang_expand_expr): Likewise. From-SVN: r38884
2001-01-10c-lang.c (lang_hooks): Update.Neil Booth1-8/+0
* c-lang.c (lang_hooks): Update. (lang_decode_option): Remove. (lang_init_options): Rename c_init_options. * toplev.c (main): Use lang_hooks for lang_init_options and lang_decode_option. * toplev.h (lang_hooks): Add 2 new hooks. * tree.h: Remove lang_init_options and lang_decode_option. * cp/cp-tree.h (lang_decode_option): Rename cxx_decode_option. * cp/decl2.c: Similarly. * cp/lex.c (lang_init_options): Rename cxx_init_options. (lang_hooks): Update. * f/com.c (f_init, f_finish): Rename ffe_init, ffe_finish for consistency. (lang_init_options): Rename ffe_init_options. (lang_hooks): Update. (lang_decode_option): Remove. * java/lang.c (lang_init_options): Rename java_init_options. (lang_decode_option): Rename java_decode_option. (lang_hooks): Update. * objc/objc-act.c (lang_init_options): Rename objc_init_options. (lang_decode_option): Rename objc_decode_option. (lang_hooks): Update. From-SVN: r38856
2001-01-09c-lang.c (lang_hooks): Update.Neil Booth1-5/+0
* c-lang.c (lang_hooks): Update. (lang_init): Rename c_init. (lang_finish): Remove. * toplev.c (compile_file): Use lang_hooks for lang_init () and lang_finish (). * toplev.h (lang_hooks): Add init () and finish (). * tree.h (lang_init, lang_finish): Remove. * cp/tree.h (lang_init, lang_finish): Remove. * cp/decl2.c (cxx_post_options, lang_hooks): Move to cp/lex.c. * cp/lex.c (cxx_init, cxx_finish, cxx_post_options, lang_hooks): New. (lang_init, lang_finish): Remove. * f/com.c (lang_init, lang_finish): Rename f_init, f_finish. (lang_hooks): Update. * java/lang.c (lang_init): Rename java_init. (lang_finish): Remove. (lang_hooks): Update. * objc/objc-act.c (lang_init): Rename objc_init. (lang_finish): Remove. (lang_hoooks): Update. From-SVN: r38828
2000-12-30alias.c (alias_sets_conflict_p): New function.Richard Kenner1-0/+4
* alias.c (alias_sets_conflict_p): New function. (mems_in_disjoint_alias_sets_p): Use it. (readonly_fields_p): Moved from expr.c; check for record type. (objects_must_conflict_p): New function. * calls.c (expand_call): Use assign_temp as much as possible, use readonly variant if assigned once, and don't set memory attributes. (emit_library_call_value_1, store_one_arg): Likewise. * integrate.c (expand_inline_function): Likewise. * stmt.c (expand_asm_operands, expand_return): Likewise. * expr.c (copy_blkmode_from_reg, store_constructor): Likewise. (store_field, save_noncopied_parts, expand_expr): Likewise. (expand_expr_unaligned): Likewise. (readonly_fields_p): Moved to alias.c. (safe_from_p): Rework handling of SAVE_EXPR. MEMs ony conflict if alias sets conflict; likewise for INDIRECT_REF. * function.c (struct temp_slot): Delete field ALIAS_SET; add TYPE. (assign_stack_for_temp): Use objects_must_confict_p. Set all memory attributes from type, if specified. (mark_temp_slot): Mark TYPE field. * tree.h (alias_sets_conflict_p, readonly_fields_p): New decls. (objects_must_conflict_p): Likewise. * stmt.c (expand_decl): Don't use assign_stack_temp in error case. (add_case_node): No need to copy nodes anymore. From-SVN: r38559
2000-11-27tree.h (mark_tree_hashtable): New function.Mark Mitchell1-0/+1
* tree.h (mark_tree_hashtable): New function. * tree.c (mark_tree_hashtable_entry): New function. (mark_tree_hashtable): Likewise. * tree.c (struct list_hash): Remove. (list_hash_table): Make it be an htab. (struct list_proxy): New type. (list_hash_eq): New function. (list_hash_pieces): Renamed from ... (list_hash): ... this. (list_hash_lookup): Remove. (list_hash_add): Remove. (hash_tree_cons): Use the generic hashtable. (mark_list_hash): Remove. (init_tree): Create the hashtable. From-SVN: r37783
2000-11-21c-common.c (c_unsafe_for_reeval): New function.Richard Henderson1-1/+5
* c-common.c (c_unsafe_for_reeval): New function. (add_c_tree_codes): Register it. * c-common.h: Declare it. * tree.c (lang_unsafe_for_reeval): New hook. (unsafe_for_reeval): Call it. * tree.h: Declare it. From-SVN: r37623
2000-11-17ggc.h: Delete ggc_add_string_root and ggc_mark_string.Zack Weinberg1-1/+0
* ggc.h: Delete ggc_add_string_root and ggc_mark_string. Add digit_vector and digit_string. * stringpool.c (digit_vector): New. (ggc_alloc_string): Use digit_string. * stmt.c (digit_strings): Delete. (init_stmt): Do not initialize digit_strings. (expand_asm_operands): Use ggc.h's digit_string macro. * toplev.c (mark_file_stack): Delete. (compile_file): Don't call init_tree_codes. (main): No need to make the file stack a GC root. * tree.c (init_tree_codes): Delete. * tree.h (init_tree_codes): Delete. * c-lex.c: Don't include ggc.h. (mark_splay_tree_node, mark_splay_tree): Delete. (init_c_lex): No need to ggc_strdup string constant. Don't add file_info_tree to GGC roots. (cb_enter_file, cb_rename_file): No need to ggc_strdup ip->nominal_fname. * Makefile.in (c-lex.o): No longer depends on $(GGC_H). * dbxout.c (dbxout_init), dwarf2out.c (dwarf2out_line), ggc-common.c (ggc_mark_rtx_children, ggc_mark_trees), varasm.c (mark_const_hash_entry, mark_pool_constant, init_varasm_once), xcoffout.c (xcoffout_source_file), i386.c (load_pic_register): Delete call(s) to ggc_add_string_root and/or ggc_mark_string. * except.c (create_rethrow_ref), profile.c (init_edge_profiler), toplev.c (compile_file), varasm.c (named_section, assemble_static_space, assemble_trampoline_template, output_constant_def, force_const_mem), i386.c (load_pic_register), ia64.c (ia64_encode_section_info), rs6000.c (rs6000_emit_load_toc_table, create_TOC_reference, rs6000_emit_prologue, rs6000_emit_epilogue), rs6000.md (load_toc_aix_si, load_toc_aix_di): Change ggc_alloc_string (var, -1) to ggc_strdup (var). * profile.c (output_func_start_profiler), tree.c (make_node), i386.c (load_pic_register): No need to ggc_strdup string constant. cp: * lex.c (mark_impl_file_chain): Delete. (init_parse): Remove call to ggc_add_string_root. No need to ggc_strdup a string constant. Do not add impl_file_chain to GC roots. (handle_pragma_implementation): No need to ggc_strdup main_filename. f: * lex.c (ffelex_hash_): Change ggc_alloc_string (var, -1) to ggc_strdup (var). java: * parse.y (goal): Remove call to ggc_add_string_root. From-SVN: r37522
2000-11-17stringpool.c: New file.Zack Weinberg1-1/+5
* stringpool.c: New file. * ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete. (ggc_alloc_string): Now in stringpool.o. * ggc-page.c, ggc-simple.c: Do not define or allocate empty_string. * ggc.h: Delete prototype of ggc_add_string_root. #define ggc_add_string_root and ggc_mark_string to nothing. Prototype init_stringpool and stringpool_statistics. (ggc_alloc_string): Returns a const char *. * tree.c (hash_table, do_identifier_warnings): Delete. (init_obstacks): Don't initialize the identifier hash table. (get_identifier, maybe_get_identifier, start_identifier_warnings, set_identifier_size): Now in stringpool.c. * tree.h (struct tree_string): Constify pointer field. (approx_sqrt): Prototype. * Makefile.in (stringpool.o): Add rule, mention in OBJS. * toplev.c (approx_sqrt): New function. (compile_file): Call stringpool_statistics if mem_report is on. (main): Call init_stringpool. * builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c (process_directive), c-typeck.c (constructor_asmspec, struct initializer_stack, start_init), except.c (create_rethrow_ref), stmt.c (digit_strings), toplev.c (decode_f_option), tree.c (built_in_filename), varasm,c (in_named_name, assemble_static_space, struct constant_descriptor, struct deferred_string, struct pool_constant, force_const_mem), i386.c (pic_label_name, global_offset_table_name), rs6000.c (rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *. * c-common.c (combine_strings): Combine strings in scratch buffer, then pass to build_string. * optabs.c (init_libfuncs), profile.c (init_edge_profiler, output_func_start_profiler), stmt.c (init_stmt), alpha.c (alpha_need_linkage), arm.c (arm_encode_call_attribute), i386.c (load_pic_register), ia64.c (ia64_encode_section_info), rs6000.c (rs6000_encode_section_info): Create string in scratch buffer, then pass to ggc_alloc_string. * stmt.c (expand_asm_operands): If we must adjust the constraint strings, do so by creating a new one, not by modifying the old one in place. Constify some char *s. * config/pa/pa.c (hppa_encode_label): Drop unnecessary second argument. Create string in scratch buffer, then pass to ggc_alloc_string. * config/pa/pa-protos.h: Update prototype. * config/pa/elf.h, config/pa/pa.h, config/pa/som.h: hppa_encode_label takes only one argument. * c-parse.in (if_prefix): Find the filename and line number at $-2 and $-1 respectively. * diagnostic.c (error_recursion): Add missing newline, use fputs, translate string. cp: * lex.c (struct impl_files, internal_filename): Constify a char *. java: * jcf-parse.c (get_constant), parse.y (do_merge_string_cste): Create string in scratch buffer, then pass to build_string. From-SVN: r37514
2000-11-15tree.c (build_type_no_quals): New function.Andrew Haley1-0/+1
2000-11-13 Andrew Haley <aph@redhat.com> * tree.c (build_type_no_quals): New function. * tree.h (build_type_no_quals): Declare. * c-common.c (c_get_alias_set): When considering type compatibility for pointer types, ignore cv-qualifiers anywhere in a pointer chain. From-SVN: r37479
2000-11-03Move fold_builtin declaration to proper headerBernd Schmidt1-0/+1
From-SVN: r37225
2000-11-01stmt.c (expand_start_null_loop): New.Richard Henderson1-0/+2
* stmt.c (expand_start_null_loop): New. (expand_end_null_loop): New. * c-semantics.c (genrtl_do_stmt): Use them. * tree.h: Declare them. From-SVN: r37186
2000-10-23expr.c (do_preexpand_calls): Remove.Mark Mitchell1-3/+0
* expr.c (do_preexpand_calls): Remove. (same_from_p): Don't use CALL_EXPR_RTL. (expand_expr): Don't call preexpand_calls, or use CALL_EXPR_RTL. (preexpand_calls): Remove. * tree.c (first_rtl_op): Remove CALL_EXPR case. (unsave_expr_1): Likewise. * tree.def (CALL_EXPR): Give it only two slots. * tree.h (CALL_EXPR_RTL): Remove. * optimize.c (copy_body_r): Don't treat CALL_EXPRs specially. From-SVN: r37012
2000-10-22tree.h (TYPE_IS_SIZETYPE): Add more documentation.Mark Mitchell1-3/+8
* tree.h (TYPE_IS_SIZETYPE): Add more documentation. * typeck.c (c_sizeof): Return an expression of `size_t' type, not one with TYPE_IS_SIZETYPE set. (dubious_conversion_warnings): Remove special-case code. From-SVN: r37006
2000-10-20* tree.h (DECL_ALIGN_UNIT): New macro.Mark Mitchell1-1/+3
From-SVN: r36964
2000-10-18Adding new option -ftrapv.Chandrakala Chavva1-0/+2
From-SVN: r36942
2000-10-13* tree.h (struct obstack): Declare.Richard Earnshaw1-0/+2
From-SVN: r36858
2000-10-13Remove obstacks.Mark Mitchell1-62/+4
* Makefile.in (ggc-callbacks.o): Remove target. (flow.o): Depend on GGC_H. * alias.c (init_alias_analysis): Remove ggc_p conditionals. (end_alias_analysis): Likewise. * basic-block.h (init_flow): New function. (allocate_reg_life_data): Declare. * bb-reorder.c (function_obstack): Replace with ... (flow_obstack): ... new variable. (fixup_reorder_chain): Use it. * c-decl.c (ggc_p): Remove. (caller-save.c): Don't call oballoc/obfree. * combine.c (struct undobuf): Remove storage. (try_combine): Don't call oballoc. (undo_all): Don't call obfree. * cse.c (insert): Use xmalloc, not oballoc. (cse_main): Adjust accordingly. * dwarf2out.c (save_rtx): Remove obstack code. (dwarf2out_init): Remove ggc_p conditionals. * emit-rtl.c (rtl_obstack): Remove. (gen_rtx_CONST_INT): Remove ggc_p conditionals. (make_insn_raw): Likewise. (emit_insn_before): Likewise. (emit_insn_after): Likewise. (emit_insn): Likewise. (gen_sequence): Likewise. (copy_insn_1): Remove handling of `b' RTL components. (init_emit_once): Remove ggc_p conditionals. * except.c (create_rethrow_ref): Don't fool with obstacks. (add_partial_entry): Likewise. (call_get_eh_context): Likewise. (begin_protect_partials): Likewise. (protect_with_terminate): Likewise. * explow.c (plus_constant_wide): Likewise. * expr.c (init_expr_once): Likewise. (emit_block_move): Likewise. (clear_storage): Likewise. (expand_expr): Likewise. * flow.c (function_obstack): Remove. (flow_obstack): New variable. (flow_firstobj): Likewise. (create_base_block): Use the flow_obstack. (split_block): Likewise. (split_edge): Likewise. (calculate_global_regs_live): Likewise. (allocate_bb_life_data): Make it static. Likewiwse. (init_flow): New function. (size_int_type_wide): Remove ggc_p conditionals. * function.c (push_function_context_to): Don't call save_tree_status. (pop_function_context_from): Or restore_tree_status. (assign_stack_local_1): Don't call push_obstacks. (find_fixup_replacement): Use xmalloc. (fixup_var_refs_insns): Free the storage. (insns_for_mem_walk): Don't mess with obstacks. (instantiate_decls): Likewise. (trampoline_address): Likewise. (expand_function_end): Likewise. * function.h (sturct function): Remove obstack-related variables. (save_tree_status): Don't declare. (restore_tree_status): Likewise. * gcse.c (compute_can_copy): Don't call oballoc/obfree. * genattrtab.c (operate_exp): Remove ggc_p conditionals. (simplify_cond): Likewise. (simplify_test_exp): Don't mess with obstacks. (optimize_attrs): Likewise. * gengenrtl.c (gendef): Don't include ggc_p conditionals. * ggc-callbacks.c (ggc_p): Remove. * ggc-none.c (ggc_p): Remove. * ggc.h (ggc_p): Don't declare. * integrate.c (save_for_inline): Don't mess with obstacks. (integrate_decl_tree): Likewise. (output_inline_function): Likewise. * lists.c (init_EXPR_INSN_LIST_cache): Likewise. * loop.c (temp_obstack): Remove. (rtl_obstack): Likewise. (init_loop): Don't mess with obstacks. (reg_address_cost): Free BIVs and GIVs. (check_insns_for_bivs): Use xmalloc, not oballoc. (find_mem_givs): Likewise. (record_biv): Likewise. (general_induction_var): Likewise. (product_cheap_p): Likewse. * optabs.c (init_one_libfunc): Remove ggc_p conditional. * print-tree.c (debug_tree): Don't use oballoc/obfree. (print_node): Likewise. * profile.c (output_func_start_profiler): Remove call to temporary_allocation. * reload1.c (eliminate_regs_in_insn): Don't mess with obstacks. * resource.c (mark_target_live_regs): Use xmalloc. (free_resource_info): Free the memory. * rtl.c (rtl_obstack): Remove. (rtvec_alloc): Don't mess with obstacks. (rtx_alloc): Likewise. (rtx_free): Remove. (copy_rtx): Don't handle `b' cases. (read_rtx): Use a local rtl_obstack. * rtl.h (oballoc): Remove. (obfree): Likewise. (pop_obstacks): Likewise. (push_obstacks): Likewise. (allocate_bb_life_data): Likewise. (allocate_reg_life_data): Likewise. (rtx_free): Likewise. * sdbout.c (sdbout_queue_anonymous_type): Use tree_cons, not saveable_tree_cons. * simplify-rtx.c (cselib_init): Don't mess with obstacks. * stmt.c (mark_block_nesting): Mark the label_chain. (epxand_label): Use ggc_alloc, not oballoc. (clear_last_expr): Don't mess with obstacks. (expand_decl_cleanup): Likewise. (expand_dcc_cleanup): Likewise. (expand_dhc_cleanup): Likewise. (expand_anon_union_decl): Likewise. (add_case_node): Use xmalloc, not oballoc. (free_case_nodes): New function. (expand_end_case): Call it. * stor-layout.c (layout_type): Don't mess with obstacks. (layout_type): Likewise. * toplev.c (wrapup_global_declarations): Likewise. (compile_file): Remove ggc_p conditionals. (rest_of_compilation): Call init_flow. Remove ggc_p conditionals. (decode_f_option): Remove ggc_p conditionals. * tree.c (function_maybepermanent_obstack): Remove. (maybepermanent_obstack): Likewise. (function_obstack): Likewise. (tmeporary_obstack): Likewise. (momentary_obstack): Likewise. (temp_decl_obstack): Likewise. (saveable_obstack): Likewise. (rtl_obstack): Likewise. (current_obstack): Likewise. (expression_obstack): Likewise. (struct obstack_stack): Likewise. (obstack_stack): Likewise. (obstack_stack_obstack): Likewise. (maybepermanent_firstobj): Likewise. (temporary_firstobj): Likewise. (momentary_firstobj): Likewise. (temp_decl_firstobj): Likewise. (momentary_function_firstobj): Likewise. (all_types_permanent): Likewise. (struct momentary_level): Likewise. (momentary_stack): Likewise. (init_obstacks): Remove initialization of removed obstacks. (save_tree_status): Remove. (restore_tree_status): Likewise. (temporary_allocation): Liekwise. (end_temporary_allocation): Liekwise. (resume_temporary_allocation): Likewise. (saveable_allocation): Likewise. (push_obstacks): Likewise. (push_obstacks_nochange): Likewise. (pop_obstacks): Likewise. (allocation_temporary_p): Likewise. (permanent_allocation): Likewise. (preserve_data): Likewise. (preserve_initializer): Likewise. (rtl_in_current_obstack): Likewise. (rtl_in_saveable_obstack): Likewise. (oballoc): Likewise. (obfree): Likewise. (savealloc): Likewise. (expralloc): Likewise. (print_obstack_name): Likewise. (debug_obstack): Likewise. (object_permanent_p): Likewise. (push_momentary): Likewise. (perserve_momentary): Likewise. (clear_momentary): Likewise. (pop_momentary): Likewise. (pop_momentary_nofree): Likewise. (suspend_momentary): Likewise. (resume_momentary): Likewise. (make_node): Don't set TREE_PERMANENT. (copy_node): Remove ggc_p conditionals. Don't set TYPE_OBSTACK. Don't set TREE_PERMANENT. (get_identifier): Remove ggc_p conditionals. (build_string): Likewise. (make_tree_vec): Likewise. (build_decl_list): Remove. (build_expr_list): Likewise. (tree_cons): Remove ggc_p conditionals. (decl_tree_cons): Remove. (expr_tree_cons): Likewise. (perm_tree_cons): Likewise. (temp_tree_cons): Likewise. (saveable_tree_cons): Likewise. (build1): Remove ggc_p conditionals. (build_parse_node): Likewise. (build_type_attribute_variant): Don't mess with obstacks. (build_type_copy): Likewise. (type_hash_canon): Likewise. (build_pointer_type): Likewise. (build_reference_type): Likewise. (build_index_type): Likewise. (build_range_type): Likewise. (dump_tree_statistics): Don't print obstack information. * tree.h (struct tree_common): Remove permanent_flag. (TREE_PERMANENT): Remove. (TREE_SET_PERMANENT): Likewise. (TYPE_OBSTACK): Likewise. (struct tree_type): Remove obstack. (oballoc): Remove. (savealloc): Likewise. (build_decl_list): Likewise. (build_expr_list): Likewise. (perm_tree_cons): Likewise. (temp_tree_cons): Likewise. (saveable_tree_cons): Likewise. (decl_tree_cons): Likewise. (expr_tree_cons): Likewise. (suspend_momentary): Likewise. (allocation_temporary_p): Likewise. (resume_momentary): Likewise. (push_obstacks_nochange): Likewise. (permanent_allocation): Likewise. (push_momentary): Likewise. (clear_momentary): Likewise. (pop_momentary): Likewise. (end_temporary_allocation): Likewise. (pop_obstacks): Likewise. (push_obstacks): Likewise. (pop_momentary_nofree): LIkewise. (preserve_momentary): Likewise. (saveable_allocation): Likewise. (temporary_allocation): Likewise. (resume_temporary_allocation): Likewise. (perserve_initializer): Likewise. (debug_obstack): Likewise. (rtl_in_current_obstack): Likewise. (rtl_in_saveable_obstack): Likewise. (obfree): Likewise. * varasm.c (current_obstack): Remove. (saveable_obstack): Remove. (rtl_obstack): Remove. (immed_double_const): Don't mess with obstacks. (immed_real_cons): Likewise. (output_constant_def): Likewise. (init_varasm_status): Use xcalloc. (mark_pool_constant): Mark the pool constant itself. (free_varasm_status): Free memory. (decode_rtx_const): Call bzero directly, rather than expanding it inline. (record_rtx_const): Don't mess with obstacks. (force_const_mem): Likewise. * config/arm/arm.c (arm_encode_call_attribute): Remove ggc_p conditionals. (aof_pic_entry): Likewise. * config/ia64/ia64.c (ia64_encode_section_info): Likewise. * config/m32r/m32r.c (m32r_encode_section_info): Likewise. * config/pa/pa.c (saveable_obstack): Remove. (rtl_obstack): Likewise. (current_obstack): Likewise. (output_call): Don't mess with obstacks. (hppa_encode_label): Remove ggc_p conditionals. * config/romp/romp.c (get_symref): Don't mess with obstacks. * config/rs6000/rs6000.c (output_toc): Remove ggc_p conditional. (rs6000_encode_section_info): Likewise. * config/sh/sh.c (get_fpscr_rtx): Likewise. From-SVN: r36856
2000-10-06builtins.c (is_valid_printf_arglist, [...]): Move functions from here ...Kaveh R. Ghazi1-3/+0
* builtins.c (is_valid_printf_arglist, expand_builtin_printf): Move functions from here ... * c-common.c (is_valid_printf_arglist, c_expand_builtin_printf): ... to here. (c_expand_builtin): New function. (init_function_format_info): Don't set `check_function_format_ptr'. (c_common_nodes_and_builtins): Set built_in_class type for printf/__builtin_printf to BUILT_IN_FRONTEND. (c_expand_expr): Handle CALL_EXPRs that are front-end builtins. * c-common.h (build_function_call): Declare. * expr.c (expand_expr): Pass builtins with class BUILT_IN_FRONTEND to `lang_expand_expr' rather than `expand_builtin'. * tree.c (check_function_format_ptr): Delete. * tree.h (check_function_format_ptr): Likewise. From-SVN: r36758
2000-10-06tree.c (tree_size): New function split out of copy_node.Geoff Keating1-0/+5
* tree.c (tree_size): New function split out of copy_node. (make_node): Remove obstack handling. Use tree_size. (copy_node): Use tree_size. * tree.h: Prototype tree_size. From-SVN: r36742
2000-09-19builtins.c (is_valid_printf_arglist, [...]): New functions.Kaveh R. Ghazi1-0/+3
* builtins.c (is_valid_printf_arglist, expand_builtin_printf): New functions. (expand_builtin_fputs): Set `target' parameter for `expand_expr'. (expand_builtin): Handle BUILT_IN_PUTCHAR, BUILT_IN_PUTS and BUILT_IN_PRINTF. * builtins.def (BUILT_IN_PUTCHAR, BUILT_IN_PUTS, BUILT_IN_PRINTF): New entries. * c-common.c (init_function_format_info): Handle __builtin_printf. Set `check_function_format_ptr'. (c_common_nodes_and_builtins): Set `puts_ftype' and `printf_ftype'. Declare __builtin_putchar, __builtin_puts, __builtin_printf and printf. * tree.c, tree.h (check_function_format_ptr): Declare. testsuite: * g++.old-deja/g++.other/virtual8.C: Declare printf correctly. From-SVN: r36540
2000-09-16function.h (no_debugging_symbols): New field.Richard Kenner1-7/+5
* function.h (no_debugging_symbols): New field. * integrate.c (save_for_inline): Renamed from save_for_inline_nocopy. Initialize no_debugging_symbols. (output_inline_function): Save and restore write_symbols and set from no_debugging_symbols. * toplev.c (rest_of_compilation): Call save_for_inline. * tree.h: Update comment. From-SVN: r36461
2000-09-12builtins.c (built_in_decls): New array.Kaveh R. Ghazi1-0/+3
* builtins.c (built_in_decls): New array. (expand_builtin_fputs): New function. (expand_builtin): Handle BUILT_IN_FPUTC and BUILT_IN_FPUTS. * builtins.def (BUILT_IN_FPUTC, BUILT_IN_FPUTS): New members. * c-common.c (c_common_nodes_and_builtins): Handle fputc/fputs. * tree.h (built_in_decls): New array. From-SVN: r36363
2000-09-10c-common.h (add_stmt): Change prototype.Mark Mitchell1-0/+3
* c-common.h (add_stmt): Change prototype. (RECHAIN_STMTS): New macro. (CASE_LABEL_DECL): Likewise. (genrtl_case_label): Change prototype. (c_expand_start_case): Remove prototype. (build_case_label): Change prototype. (decl_constant_value): Declare. * c-common.c (check_case_value): Handle C++'s extensions to C semantics. * c-commnon.def (CASE_LABEL): Add room for the CASE_LABEL_DECL field. * c-parse.in (stmt): Adjust handling of return statements and case laels. * c-semantics.c (add_stmt): Return the new statement. (genrtl_return_stmt): Take the RETURN_STMT as input, not the returned expression. Directly generate RTL, rather than calling c_expand_return. (genrtl_switch_stmt): Don't call c_expand_start_case. (build_case_label): Take the LABEL_DECL as input, too. (genrtl_case_label): Just call add_case_node. (expand_stmt): Adjust calls to genrtl_return_stmt and genrtl_case_label. * c-tree.h (c_expand_start_case): Declare. * c-typeck.c (decl_constant_value): Give it external linkage. (c_expand_return): Don't call expand_return or expand_null_return; use genrtl_return_stmt instead. * stmt.c (struct nesting): Remove num_ranges field. (add_case_node): Give it external linkage. (expand_start_case): Don't set num_ranges. (expand_start_case_dummy): Don't clear it. (pushcase): Rely on add_case_node to handle `default' labels. (add_case_node): Handle `default' labels. * tree.c (tree_int_cst_compare): New function. * tree.h (tree_int_cst_compare): Declare. (add_case_node): Likewise. * cp-tree.h (push_switch): Change prototype. (check_cp_case_value): Remove declaration. (decl_constant_value): Likewise. * decl.c (struct cp_switch): Add switch_stmt and cases. (case_compare): New function. (push_switch): Set switch_stmt. Initialize cases. (pop_switch): Clean up cases. (define_case_label): Rename to ... (finish_case_label): ... this. Do semantic analysis for case labels here. (start_function): Correct comment. * decl2.c (check_cp_case_value): Remove. * expr.c (do_case): Remove. * pt.c (tsubst_expr): Adjust call to finish_case_label. * semantics.c (genrtl_do_poplevel): Remove declaration. (RECHAIN_STMTS): Remove. (finish_break_stmt): Use build_break_stmt. (finish_continue_stmt): Use build_continue_stmt. (finish_switch_cond): Adjust condition here, rater than in c_expand_start_case. (finish_case_label): Remove. * typeck.c (c_expand_return): Remove. (c_expand_start_case): Likewise. From-SVN: r36305
2000-08-30tree.h (struct tree_int_cst): Wrap low and high in a sub-struct.Greg McGary1-4/+10
* tree.h (struct tree_int_cst): Wrap low and high in a sub-struct. (TREE_INT_CST_LOW, TREE_INT_CST_HIGH): Access through sub-struct. (TREE_INT_CST): New macro. * varasm.c (const_hash, compare_constant_1, record_constant_1): Use new macro TREE_INT_CST. From-SVN: r36076
2000-08-29top level:Zack Weinberg1-1/+1
* c-common.c (declare_function_name): Use func_id_node, function_id_node, and pretty_function_id_node. Do not make __func__ visible at file scope. * c-common.h (c_tree_index): Add CTI_FUNCTION_ID, CTI_PRETTY_FUNCTION_ID, and CTI_FUNC_ID. (function_id_node, pretty_function_id_node, func_id_node): New macros. * c-decl.c (init_decl_processing): Initialize function_id_node, pretty_function_id_node, and func_id_node. (c_make_fname_decl): Correct comment. * tree.h (struct tree_identifier): Constify pointer member. * c-decl.c (pushdecl, implicit_decl_warning): Constify a char *. * c-pragma.h (struct weak_syms): Constify name and value members. (add_weak): Constify arguments. * calls.c (special_function_p): Constify a char *. (expand_call): Remove variable which is initialized and then never used. * dependence.c (struct def_use, struct induction, struct subscript): Constify 'variable' member. (get_low_bound, have_induction_variable): Constify char * argument. (find_induction_variable): Add braces to avoid dangling else. (classify_dependence): Constify char * arrays. * profile.c (output_func_start_profiler): Constify a char *. * stor-layout.c (finalize_record_size): Constify a char *. * tree.c (is_attribute_p): Constify a char *. * varasm.c (add_weak, remove_from_pending_weak_list): Constify argument. * varasm.c (make_function_rtl, make_decl_rtl): Rearrange code for comprehensibility. Do not call get_identifier if we did not change the DECL_ASSEMBLER_NAME of the decl. Use alloca to create temporary string constants, not ggc_alloc_string. No need to copy result of ASM_FORMAT_PRIVATE_NAME. Use const char * to hold IDENTIFIER_POINTERs. ch: * inout.c (add_enum_to_list): Use DECL_NAME directly, don't get its IDENTIFIER_POINTER and immediately call get_identifier on it. * lex.c (yywrap): Constify a char *. cp: * class.c (build_secondary_vtable): Constify a char *. * decl.c (init_decl_processing): Initialize function_id_node, pretty_function_id_node, and func_id_node. * input.c (struct input_source): Constify 'str'. (feed_input): Constify first argument. * mangle.c (write_identifier): Constify argument. * pt.c (mangle_class_name_for_template): Constify argument. f: * ansify.c: Use #line, not # <number>. java: * jcf-parse.c (set_source_filename): Constify a char *. * jcf-write.c (append_innerclasses_attribute, make_class_file_name): Constify a char *. Don't recycle a variable for an unrelated purpose. * parse.y: (build_alias_initializer_parameter_list): Constify a char *. (breakdown_qualified): Do not modify IDENTIFIER_POINTER strings. From-SVN: r36055
2000-08-29calls.c (expand_call): Don't create a VAR_DECL just to throw it away.Mark Mitchell1-2/+0
* calls.c (expand_call): Don't create a VAR_DECL just to throw it away. * expr.c (expand_expr, case TARGET_EXPR): Don't call mark_addressable. * tree.h (get_file_function_name): Remove two duplicate declarations. * typeck.c (mark_addressable): Remove code that pokes around in RTL. From-SVN: r36038
2000-08-28[multiple changes]Jason Merrill1-0/+1
2000-08-28 Daniel Berlin <dberlin@redhat.com> * dwarf2out.c (DIE_LABEL_PREFIX): Remove leading "__". (print_die): If we don't know the offset of the target die, try the symbol. Add a trailing newline. (reverse_all_dies): New fn. (dwarf2out_finish): Call it. (break_out_includes): Reorganize for clarity. (add_sibling_attributes): Don't call reverse_die_lists. (output_comp_unit): Rename from output_comdat_comp_unit. Use for primary CU, too. * flags.h: Add flag_eliminate_dwarf2_dups. * toplev.c (f_options): Support -feliminate-dwarf2-dups. 2000-08-28 Jason Merrill <jason@redhat.com> * dwarf2.h (DW_TAG_GNU_BINCL, DW_TAG_GNU_EINCL): New tags. * dwarf2out.c: #include "md5.h". (DIE_LABEL_PREFIX): New macro. (dw_val_struct): Add 'external' flag to val_die_ref. (add_AT_die_ref, AT_ref): Adjust. (AT_ref_external, set_AT_ref_external): New fns. (build_abbrev_table): Call set_AT_ref_external. (value_format): Call AT_ref_external. (die_struct): Add die_symbol field. (new_die): Clear it. (dwarf_tag_name): Handle BINCL/EINCL. (dwarf2out_start_source_file): Add BINCL DIE. (dwarf2out_end_source_file): Add EINCL DIE. (push_new_compile_unit, pop_compile_unit, clear_die_sizes): New fns. (loc_checksum, attr_checksum, die_checksum): New fns. (is_type_die, is_comdat_die, is_symbol_die): New fns. (compute_section_prefix, assign_symbol_names): New fns. (gen_internal_sym, output_die_symbol, output_symbolic_ref): New fns. (output_die): Call output_die_symbol and AT_ref_external. (output_comdat_comp_unit): New fn, split out from... (dwarf2out_finish): ...here. Also call add_sibling_attributes for secondary CUs. (output_pubnames, output_aranges): Abort if we see entries from secondary CUs. * toplev.h: Declare file_name_nondirectory. * toplev.c (file_name_nondirectory): New fn, moved from C++ frontend. (rest_of_type_compilation): Call dwarf2out_decl if at toplevel. (debug_start_source_file): Call dwarf2out_start_source_file regardless of debug verbosity. (debug_end_source_file): Similarly. * tree.h: Declare clean_symbol_name. * tree.c (clean_symbol_name): Split out from... (get_file_function_name_long): ...here. * dwarf2out.c (new_loc_descr): Use calloc. (splice_child_die): Remove the die from the right parent. (gen_struct_or_union_die): Don't add AT_name to a specification DIE. gcc/cp: 2000-08-28 Jason Merrill <jason@redhat.com> * lex.c (file_name_nondirectory): Move to toplev.c. libiberty: 2000-08-28 Jason Merrill <jason@redhat.com> * Makefile.in (REQUIRED_OFILES): Add md5.o. (CFILES): Add md5.c. * md5.c: New file. include: 2000-08-28 Jason Merrill <jason@redhat.com> * md5.h: New file. gcc/cp: 2000-08-28 Jason Merrill <jason@redhat.com> * cp-tree.h (LOCAL_CLASS_P): New macro. * class.c (finish_struct_1): Use it. From-SVN: r36022
2000-08-25Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o.Mark Mitchell1-2/+0
* Makefile.in (C_AND_OBJC_OBJS): Remove c-iterate.o. (c-iterate.o): Remove target. * gcc/c-common.h (enum rid): Remove RID_ITERATOR. * gcc/c-decl.c (init_decl_processing): Remove call to init_iterators. (finish_decl): Don't handle iterators. (grokdeclarator): Likewise. * gcc/c-parse.gperf: Remove __iterator and __iterator__ keywords. * gcc/c-gperf.h: Regenerated. * gcc/c-iterate.c: Removed. * gcc/c-lex.c (init_lex): Don't handle iterators. * gcc/c-parse.in (primary): Remove pop_iterator_stack call. (compstmt_primary_start): Remove push_iterator_stack call. (stmt): Don't allow iterator statements. Replace iterator_expand with expand_expr_stmt. (all_iter_stmt): Remove. (all_iter_stmt_simple): Likewise. (all_iter_stmt_with_decl): Likewise. * gcc/c-tree.h (ITERATOR_P): Remove. (ITERATOR_BOUND_P): Likewise. (init_iterators): Remove declaration. (iterator_expand): Likewise. (iterator_for_loop_start): Likewise. (iterator_for_loop_end): Likewise. (iterator_for_loop_record): Likewise. (push_iterator_stack): Likewise. (pop_iterator_stack): Likewise. * gcc/c-typeck.c (decl_constant_value): Don't check ITERATOR_P. (readonly_warning): Likewise. * gcc/tree.h (ITERATOR_BOUND_P): Don't mention it. * Make-lang.in (cc1chill): Don't depend on c-iterate.o. * gcc.dg/noncompile/930622-2.c: Adjust error message. From-SVN: r35967
2000-08-24tree.h (enum tree_index): New member `TI_MAIN_IDENTIFIER'.Greg McGary1-0/+5
* tree.h (enum tree_index): New member `TI_MAIN_IDENTIFIER'. (MAIN_NAME_P, main_identifier_node): New macros. * c-common.c (c_common_nodes_and_builtins): Init main_identifier_node. * c-decl.c (start_decl, grokdeclarator, start_function, store_parm_decls, finish_function): Use MAIN_NAME_P. * config/avr/avr.c (function_prologue, function_epilogue): Likewise. * config/i386/cygwin.h (SUBTARGET_PROLOGUE): Likewise. * config/i386/win32.h (SUBTARGET_PROLOGUE): Likewise. * config/pdp11/pdp11.c (output_function_prologue): Likewise. From-SVN: r35945
2000-08-22(TYPE_RETURNS_STACK_DEPRESSED): Insert blank betweenAlexandre Oliva1-1/+1
`FUNCTION_TYPE_CHECK' and `(NODE)'. From-SVN: r35869
2000-08-15calls.c (ECF_SP_DEPRESSED): New macro.Richard Kenner1-1/+8
* calls.c (ECF_SP_DEPRESSED): New macro. (calls_function_1): Treat calling sp-depressed function as alloca. (emit_call_1): Don't adjust SP if calling sp-depressed function. (expand_call): Set ECF_SP_DEPRESSED if TYPE_RETURNS_STACK_DEPRESSED. If sp-depressed, ensure block saves and restores SP. * fold-const.c (extract_muldiv): Only check TYPE_IS_SIZETYPE for INTEGER_TYPE. * function.c (keep_stack_depressed): New function. (thread_prologue_and_epilogue_insns): Call it. * print-tree.c (print_node): Use HOST_WIDE_INT_PRINT_UNSIGNED to print DECL_OFFSET_ALIGN. Print no-force-blk and transparent-union flags properly. * stmt.c (expand_goto_internal): Don't restore stack if last block and function returns with sp depressed. (fixup_gotos): Likewise. (save_stack_pointer): New function, from code in expand_decl. (expand_decl): Call new function. * tree.h (TYPE_IS_SIZETYPE): Call INTEGER_TYPE_CHECK. (TYPE_RETURNS_STACK_DEPRESSED): New macro. (save_stack_pointer): New declaration. From-SVN: r35734
2000-08-12tree.h (DECL_OFFSET_ALIGN): Make the off_align field of the tree structure ↵Geoff Keating1-2/+9
an exponent rather than an... * tree.h (DECL_OFFSET_ALIGN): Make the off_align field of the tree structure an exponent rather than an explicit alignment so it doesn't overflow. (SET_DECL_OFFSET_ALIGN): New macro. * stor-layout.c (place_union_field): Use SET_DECL_OFFSET_ALIGN rather than DECL_OFFSET_ALIGN. (place_field): Likewise. * expmed.c (store_bit_field): Abort on align==0 to avoid antisocial machine behaviour. From-SVN: r35659
2000-08-05[multiple changes]Zack Weinberg1-1/+2
2000-08-04 Andreas Schwab <schwab@suse.de> * cppmain.c (cb_def_pragma): Skip the first two tokens from the token list, which are always `#' and `pragma'. 2000-08-04 Zack Weinberg <zack@wolery.cumb.org> * tree.c (tree_expr_nonnegative_p): Move to... * fold-const.c: ... here. Also handle BIND_EXPR and RTL_EXPR. (rtl_expr_nonnegative_p): New. * tree.h: Add prototype for rtl_expr_nonnegative_p. * real.h (CONST_DOUBLE_LOW, CONST_DOUBLE_HIGH, CONST_DOUBLE_MEM, CONST_DOUBLE_CHAIN: Move to... * rtl.h: ...here. Use XCINT/XCEXP. * Makefile.in: Remove toplev.o from OBJS. Add rule to make libbackend.a; add libbackend.a to STAGESTUFF. Add BACKEND variable. Use BACKEND when linking cc1, not OBJS. Add BACKEND to VOL_FILES. * objc/Make-lang.in (cc1obj): Link with $(BACKEND). ch: * Make-lang.in (cc1chill): Depend on $(BACKEND), not stamp-objlist. * Makefile.in (cc1chill): Link with $(BACKEND). Define BACKEND, eliminate C_OBJS (was commented out), OBJS, OBJDEPS. cp: * Make-lang.in (cc1plus): Depend on $(BACKEND), not stamp-objlist. * Makefile.in: Add C_OBJS, BACKEND; delete OBJS, OBJDEPS. (cc1plus): Link with $(BACKEND) and $(C_OBJS). f: * Make-lang.in (f771): Depend on $(BACKEND), not stamp-objlist. * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS. (f771): Link with $(BACKEND). java: * Make-lang.in (jc1, jv-scan): Depend on $(BACKEND), not stamp-objlist. * Makefile.in: Add BACKEND; delete OBJS, OBJDEPS. (jc1): Link with $(BACKEND). (jv-scan): Depend on version.o, not all of $(OBJS) or $(BACKEND). From-SVN: r35501
2000-07-27expr.h (get_alias_set, [...]): Delete prototypes.Rodney Brown1-1/+5
* expr.h (get_alias_set, lang_get_alias_set): Delete prototypes. * tree.h (get_alias_set, lang_get_alias_set): Prototype. From-SVN: r35293
2000-07-21diagnostic.c (trim_filename, [...]): Moved here from rtl.c.Zack Weinberg1-13/+5
* diagnostic.c (trim_filename, fancy_abort): Moved here from rtl.c. (fatal_function, set_fatal_function): Removed. (fatal): Don't prepare for or call the fatal_function. (diagnostic_lock, error_recursion): New. (diagnostic_for_decl, report_diagnostic): Guard against re-entering the error reporting routines. (fancy_abort): Assume function is not NULL. * errors.c (fancy_abort): New. Assume function is not NULL. * tradcpp.c (fancy_abort): Assume function is not NULL. * system.h: Provide default definition of __FUNCTION__. * rtl.h: Use __FUNCTION__ not __PRETTY_FUNCTION__ throughout. Always use __FUNCTION__ in definition of abort. * tree.h: Likewise. * varray.h: Likewise. * toplev.h: Likewise. Don't prototype set_fatal_function. From-SVN: r35170