Commit Graph

125 Commits

Author SHA1 Message Date
Diego Novillo 953ff28998 [multiple changes]
2006-01-18  Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* libgomp: New directory.
	* Makefile.def: Add target_module libgomp.
	* Makefile.in: Regenerate.
	* configure.in (target_libraries): Add target-libgomp.
	* configure: Regenerate.


contrib/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* gcc_update (files_and_dependencies): Add libgomp files.


gcc/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Aldy Hernandez  <aldyh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* omp-low.c: New file.
	* c-omp.c: New file.

2006-01-18  Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* doc/invoke.texi: Document -fopenmp.
	* tree-dump.h (debug_function): Declare.

	* hooks.c (hook_bool_tree_bool_false): New function.
	(hook_tree_tree_null): Remove.
	(hook_tree_tree_tree_null): New.
	* hooks.h: Update to match.

	* tree-pretty-print.c (debug_tree_chain): New.
	(print_generic_expr): Handle TDF_CHAIN.
	(dump_generic_node): Handle BLOCK.
	Do not abort with incomplete SWITCH_EXPRs.
	Do not dump body of an OpenMP directive if TDF_SLIM is given.
	<case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't
	print space after directive name.
	<OMP_FOR>: Handle printing OMP_FOR_PRE_BODY.
	Handle OMP_MASTER and OMP_ORDERED.
	Handle printing of OMP_BODY just in one place, goto
	dump_omp_body in the rest of OMP_* nodes that have
	OMP_BODY.
	Don't handle clause nodes here.  Update omp statements to
	use dump_omp_clauses.
	Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION,
	OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC,
	OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF,
	GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED,
	GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE,
	GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE.
	Adjust output for GOMP_PARALLEL.
	(dump_omp_clauses): New.
	(print_declaration): Dump DECL_VALUE_EXPR.
	(op_symbol_1): Split out of op_symbol.
	(dumping_stmts): Remove.  Update all users.

	* cgraph.c (cgraph_analyze_queue): New.
	(cgraph_add_new_function): New.
	* cgraph.h (cgraph_analyze_queue): Declare.
	(cgraph_add_new_function): Declare.
	(cgraph_lower_function): Remove.

	* tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_*
	nodes.  Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS
	and TYPE_P nodes in its default clause.
	(empty_body_p): New.
	(tree_range_check_failed): New.
	(build5_stat): New.

	* tree.h (OMP_CLAUSE_REDUCTION_INIT,
	OMP_CLAUSE_REDUCTION_MERGE,
	OMP_CLAUSE_REDUCTION_PLACEHOLDER,
	OMP_CLAUSE_PRIVATE_DEBUG,
	OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY,
	OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY,
	OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND,
	OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL,
	OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR,
	OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR,
	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT,
	OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT,
	OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC,
	OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST,
	OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE
	OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY,
	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY,
	OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New.
	(TREE_RANGE_CHECK): New.
	(empty_body_p): Declare.
	(enum omp_clause_default_kind): New.
	(build_string_literal): Declare.
	(enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New.
	(build5_stat, build5): Declare.

	* tree-pass.h (TDF_CHAIN): Define.
	* tree-pass.h (PROP_gimple_lomp): Define.
	(pass_lower_omp): Declare.

	* diagnostic.h (debug_tree_chain): Declare.

	* builtins.c (get_builtin_sync_mode): Use 0 as last argument to
	mode_for_size.
	(expand_builtin): Handle sync BUILT_IN_*_16 builtins.
	* builtins.c (build_string_literal): Make extern.

	* gcc.c (include_spec_function): New.
	(static_spec_functions): Add it.
	(main): Move load of libgomp.spec ...
	(LINK_COMMAND_SPEC): ... here.
	(link_gomp_spec): New.
	(static_specs): Include it.
	(LINK_COMMAND_SPEC): Add link_gomp.
	(GOMP_SELF_SPECS): New.
	(driver_self_specs): Include it.
	(switch_matches): Don't mark inline.
	(main): Load libgomp.spec.

	* tree-gimple.c (is_gimple_stmt): True for OMP_MASTER,
	OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION,
	and OMP_SINGLE, OMP_FOR and OMP_PARALLEL.

	* tree-gimple.h (enum omp_parallel): Declare.
	(determine_parallel_type): Declare.
	(omp_firstprivatize_variable): Declare.
	(omp_reduction_init): Declare.
	(diagnose_omp_structured_block_errors): Declare.
	(struct walk_stmt_info): Add want_return_expr.
	(struct walk_stmt_info): Add want_bind_expr, want_locations.
	(find_omp_clause): Declare.
	(insert_field_into_struct): Declare.
	(struct walk_stmt_info): Move from tree-nested.c
	(walk_stmts): Declare.

	* c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP
	to 200505.

	* cgraphunit.c (cgraph_lower_function): Make static.
	(cgraph_finalize_pending_functions): New.
	(cgraph_finalize_function): Call it.
	(cgraph_finalize_compilation_unit): Likewise.

	* builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
	BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
	(BT_FN_UINT_UINT): New.
	(DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7,
	DEF_FUNCTION_TYPE_VAR_4): Document.
	(BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT,
	BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR,
	BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT,
	BT_FN_VOID_OMPFN_PTR_UINT_UINT,
	BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
	BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New.

	* builtins.def: Update DEF_BUILTIN comment to include COND argument.
	Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins
	into separate files.
	(DEF_GOMP_BUILTIN): New.
	(BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER,
	BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END,
	BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END,
	BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT,
	BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT,
	BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END,
	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
	BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT,
	BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END,
	BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START,
	BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New.
	* sync-builtins.def: New file, moved from builtins.def.
	* omp-builtins.def: New file, moved from builtins.def.

	* c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.

	* gimple-low.c (lower_function_body): Clear data.
	(lower_stmt): Do not handle COMPOUND_EXPR.
	Remove call to print_node_brief.

	* c-tree.h (c_finish_omp_clauses): New prototype.
	(C_DECL_THREADPRIVATE_P): Define.
	(lookup_name_no_remap, c_omp_remap_private): Remove
	(c_begin_omp_parallel, c_finish_omp_parallel): Update.
	(check_for_loop_decls): Update decl.
	(lookup_name_no_remap, c_omp_remap_private): Declare.
	(build_indirect_ref, build_modify_expr, pushdecl,
	pushdecl_top_level): Move to c-common.h.

	* dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp
	before the switch, but just in the 2 places that need it.

	* c-decl.c (diagnose_mismatched_decls): Do not check for
	mismatched thread-local attributes when OLDDECL is marked
	threadprivate and NEWDECL has no thread-local attributes.
	(merge_decls): Merge C_DECL_THREADPRIVATE_P.
	(c_gimple_diagnostics_recursively): Rename from
	c_warn_unused_result_recursively.  Invoke
	diagnose_omp_structured_block_errors.
	(check_for_loop_decls): Return a singular decl found.

	* langhooks.c (lhd_omp_predetermined_sharing): Return
	OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls.
	(lhd_omp_firstprivatize_type_sizes): New.
	(lhd_omp_assignment): New.
	(lhd_omp_predetermined_sharing): New.

	* langhooks.h (struct gimplify_omp_ctx): Forward declare.
	(struct lang_hooks_for_types): Add
	omp_firstprivatize_type_sizes, omp_privatize_by_reference,
	omp_predetermined_sharing, omp_disregard_value_expr,
	omp_private_debug_clause, omp_clause_default_ctor,
	omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor.

	(c_finish_omp_clauses): New.
	(c_finish_bc_stmt): Diagnose break within omp for.
	(c_begin_omp_parallel, c_finish_omp_parallel): New.
	(build_unary_op): Return error_mark after reporting
	a readonly_error.
	(build_modify_expr): Likewise.

	* gimplify.c: Include optabs.h and pointer-set.h.
	(enum gimplify_omp_var_data): Declare.
	(struct gimplify_omp_ctx): Declare.
	(struct gimplify_ctx): Add fields prev_context, combined_pre_p
	and combined_ctxp.
	(gimplify_ctxp, gimplify_omp_ctxp): New local variables.
	(push_gimplify_context, pop_gimplify_context): Allow nesting.
	(splay_tree_compare_decl_uid): New.
	(new_omp_context): New.
	(delete_omp_context): New.
	(gimple_add_tmp_var): Call omp_add_variable.
	(gimplify_bind_expr): Likewise.
	(gimplify_var_or_parm_decl): If omp_notice_variable returned
	true, disregard DECL_VALUE_EXPR on the decl if any.
	(gimplify_expr_in_ctx): New.
	(omp_firstprivatize_variable, omp_firstprivatize_type_sizes
	omp_add_variable, omp_notice_variable, omp_is_private
	gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1
	gimplify_adjust_omp_clauses, gimplify_omp_parallel
	gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p
	gimplify_omp_atomic_fetch_op, goa_stabilize_expr
	gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex
	gimplify_omp_atomic): New.
	(gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
	OMP_CRITICAL and OMP_ATOMIC.
	(gimplify_body): Verify gimplify_ctxp is empty after gimplification.

	* c-pragma.h (enum pragma_kind): Add
	PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER,
	PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR,
	PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED,
	PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR,
	PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION,
	PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE,
	PRAGMA_OMP_THREADPRIVATE.

	* tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
	OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE,
	OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE,
	OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION,
	OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE,
	OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS,
	OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT,
	OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define.

	* print-tree.c (print_node): Dump DECL_VALUE_EXPR.

	* tree-ssa-dce.c (find_control_dependence): Do not assume that
	ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR).

	* tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for
	OpenMP directives.
	(struct nesting_info): Add field_map,
	suppress_expansion, debug_var_chain.
	(create_nesting_tree): Initialize them.
	(lookup_field_for_decl): Use field_map.
	(get_nonlocal_debug_decl, get_local_debug_decl): New.
	(convert_local_omp_clauses): New.
	(finalize_nesting_tree_1): Add debug_var_chain to toplevel block.
	(walk_body): Split out of walk_function.
	(convert_nonlocal_omp_clauses, convert_local_omp_clauses): New.
	(convert_nonlocal_reference): Handle omp statements.
	(convert_local_reference): Likewise.
	(unnest_nesting_tree_1): Split out of finalize_nesting_tree_1.
	(unnest_nesting_tree): New.
	(lower_nested_functions): Call it.
	(insert_field_into_struct): Make extern.
	(struct walk_stmt_info): Move to tree-gimple.h.
	(walk_stmts): Make extern.

	* omp-builtins.def: New file.

	* tree-iterator.c (expr_only): Clarify comment.

	* c-common.h (pushdecl_top_level, pushdecl,
	build_modify_expr, build_indirect_ref,
	c_finish_omp_master, c_finish_omp_critical,
	c_finish_omp_ordered, c_finish_omp_barrier,
	c_finish_omp_atomic, c_finish_omp_flush,
	c_finish_omp_for, c_split_parallel_clauses,
	omp_clause_default_kind, c_omp_sharing_predetermined,
	c_omp_remap_decl): Declare.

	* Makefile.in (BUILTINS_DEF): Add omp-builtins.def.
	(OBJS-common): Add omp-low.o.
	(c-omp.o, omp-low.o): Add.
	(gimplify.o): Add dependency on $(OPTABS_H).
	(GTFILES): Add omp-low.c.
	(gt-stringpool.h): Add.

	* tree-cfg.c (set_bb_for_stmt): Do not update the
	block-to-labels map if we are currently expanding to RTL.
	(tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P
	checks.
	Handle IDENTIFIER_NODE.
	(tree_verify_flow_info): Do not ICE when emitting error
	messages about invalid labels.
	(dump_function_to_file): Reset CFUN before emitting the body
	of the function.
	(debug_function): New.

	* passes.c (init_optimization_passes): Schedule
	pass_lower_omp.

	* langhooks-def.h (lhd_omp_predetermined_sharing,
	lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes):
	Declare.
	(LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
	(LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE,
	LANG_HOOKS_OMP_PREDETERMINED_SHARING,
	LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
	LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE,
	LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR,
	LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
	LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP,
	LANG_HOOKS_OMP_CLAUSE_DTOR): Define.
	(LANG_HOOK_DECLS): Use them.


2006-01-18  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
	    Richard Henderson  <rth@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>

	* c-parser.c (pragma_omp_clause): Define.
	(c_parser_declaration_or_fndef): Document OpenMP syntax.
	(c_parser_compound_statement): Likewise.
	(c_parser_statement): Likewise.
	(c_parser_pragma): Handle omp pragmas.
	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
	OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define.
	(c_parser_omp_clause_name, check_no_duplicate_clause,
	c_parser_omp_variable_list,
	c_parser_omp_var_list_parens, c_parser_omp_clause_copyin,
	c_parser_omp_clause_copyprivate,
	c_parser_omp_clause_default,
	c_parser_omp_clause_firstprivate, c_parser_omp_clause_if,
	c_parser_omp_clause_lastprivate,
	c_parser_omp_clause_nowait,
	c_parser_omp_clause_num_threads,
	c_parser_omp_clause_ordered, c_parser_omp_clause_private,
	c_parser_omp_clause_reduction,
	c_parser_omp_clause_schedule, c_parser_omp_clause_shared,
	c_parser_omp_all_clauses, c_parser_omp_structured_block,
	c_parser_omp_atomic, c_parser_omp_barrier,
	c_parser_omp_critical, c_parser_omp_flush,
	c_parser_omp_for_loop, c_parser_omp_for,
	c_parser_omp_master, c_parser_omp_ordered,
	c_parser_omp_sections_scope, c_parser_omp_sections,
	c_parser_omp_parallel, c_parser_omp_single,
	c_parser_omp_construct, c_parser_omp_threadprivate): New.
	* c-pragma.c (init_pragma): Do omp pragma registration here.
	* c.opt (fopenmp): New flag.


2006-01-18  Eric Christopher  <echristo@apple.com>

	* gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif.
	* config/darwin.h (GOMP_SELF_SPECS): Define.


testsuite/

2006-01-18  Richard Henderson  <rth@redhat.com>
            Aldy Hernandez  <aldyh@redhat.com>
	    Jakub Jelinek  <jakub@redhat.com>
            Diego Novillo  <dnovillo@redhat.com>
            Uros Bizjak  <uros@kss-loka.si>

	* testsuite/gcc.dg/gomp: New directory.

From-SVN: r109902
2006-01-18 14:21:25 -05:00
Gabor Loki 38109dab82 rtl-factoring.c: Add sequence abstraction algorithm.
2006-01-16  Gabor Loki <loki@gcc.gnu.org>

	* rtl-factoring.c : Add sequence abstraction algorithm.
	* cfgcleanup.c (outgoing_edges_match): Extra checks.
	(try_crossjump_to_edge): Avoid deleting preserve label when redirecting
	ABNORMAL edges.
	(block_has_preserve_label): New function.
	* common.opt: Register new pass.
	* Makefile.in: Ditto.
	* passes.c: Ditto.
	* timevar.def: Ditto.
	* tree-pass.h: Ditto.
	* emit-rtl.c (make_jump_insn_raw): Remove forward decl.
	* rtl.h (make_jump_insn_raw): Add forward decl.
	* doc/invoke.texi: Add documentation for
																	                  -frtl-abstract-sequences.

From-SVN: r109750
2006-01-16 15:56:47 +00:00
Paolo Bonzini bc23502b7f re PR tree-optimization/23109 (compiler generates wrong code leading to spurious division by zero with -funsafe-math-optimizations (instead of -ftrapping-math))
gcc:
2006-01-11  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/23109
	PR tree-optimization/23948
	PR tree-optimization/24123

	* Makefile.in (tree-ssa-math-opts.o): Adjust dependencies.
        * tree-cfg.c (single_noncomplex_succ): New.
        * tree-flow.h (single_noncomplex_succ): Declare it.
        * tree-ssa-math-opts.c (enum place_reciprocal): Remove.
        * tree-ssa-math-opts.c (enum place_reciprocal): Remove.
        (struct occurrence, occ_head, occ_pool, is_divide_by, compute_merit,
	insert_bb, register_division_in, insert_reciprocals,
	replace_reciprocal, free_bb): New.
        (execute_cse_reciprocals_1): Rewritten.
        (execute_cse_reciprocals): Adjust calls to execute_cse_reciprocals_1.
        Do not commit any edge insertion.  Always compute dominators and
        create the allocation pool.
        * target-def.h (TARGET_MIN_DIVISIONS_FOR_RECIP_MUL): New.
	* target.h (struct gcc_target): Add min_divistions_for_recip_mul.
	* targhooks.c (default_min_divistions_for_recip_mul): New.
	* targhooks.h (default_min_divistions_for_recip_mul): New prototype.
        * passes.c (init_optimization_passes): Run recip after tree loop
        optimizations.
        * doc/tm.texi (Misc): Document TARGET_MIN_DIVISIONS_FOR_RECIP_MUL.

gcc/testsuite:
2006-01-11  Paolo Bonzini  <bonzini@gnu.org>
        
        PR tree-optimization/23109
        PR tree-optimization/23948
        PR tree-optimization/24123

        * gcc.dg/tree-ssa/recip-3.c, gcc.dg/tree-ssa/recip-4.c,
        gcc.dg/tree-ssa/recip-5.c, gcc.dg/tree-ssa/recip-6.c,
        gcc.dg/tree-ssa/recip-7.c, gcc.dg/tree-ssa/pr23109.c,
        g++.dg/tree-ssa/pr23948.C: New testcases.
        * gcc.dg/tree-ssa/recip-2.c, gcc.dg/tree-ssa/pr23234.c: Provide
	three divisions in order to do the optimization.

From-SVN: r109578
2006-01-11 13:02:18 +00:00
Richard Guenther 3f519b3517 tree-pass.h (TODO_remove_unused_locals): Define.
2006-01-05  Richard Guenther  <rguenther@suse.de>
	    Diego Novillo  <dnovillo@redhat.com>

	* tree-pass.h (TODO_remove_unused_locals): Define.
	* gimple-low.c (expand_var_p, remove_useless_vars,
	pass_remove_useless_vars): Remove.  Update all users.
	* tree-ssa-live.c (mark_all_vars_used_1): Handle SSA names.
	(remove_unused_locals): New function.
	* tree-flow.h (remove_unused_locals): Declare.
	* passes.c (execute_todo): Call remove_unused_locals if
	TODO_remove_unused_locals is set.
	* tree-into-ssa.c (pass_build_ssa): Add TODO_remove_unused_locals.
	* tree-ssa-dce.c (pass_dce): Likewise.
	* tree-outof-ssa.c (pass_del_ssa): Likewise.

	* gcc.dg/tree-ssa/loop-11.c: Deal with removed vars pass.
	* gcc.dg/tree-ssa/loop-8.c: Likewise.
	* gcc.dg/tree-ssa/loop-1.c: Likewise.
	* gcc.dg/tree-ssa/pr23294.c: Likewise.
	* gcc.dg/tree-ssa/pr21985.c: Likewise.
	* gcc.dg/tree-ssa/loop-14.c: Likewise.
	* gcc.dg/tree-ssa/loop-2.c: Likewise.
	* gcc.dg/tree-ssa/loop-3.c: Likewise.
	* gcc.dg/tree-ssa/loop-4.c: Likewise.
	* gcc.dg/tree-ssa/pr21171.c: Likewise.
	* gcc.dg/tree-ssa/loop-5.c: Likewise.
	* gcc.dg/tree-ssa/loop-10.c: Likewise.
	* gcc.dg/tree-ssa/loop-6.c: Likewise.
	* treelang/compile/extravar.tree: Likewise.
	* g++.dg/tree-ssa/ssa-cast-1.C: Likewise.
	* g++.dg/tree-ssa/pointer-reference-alias.C: Likewise.
	* g++.dg/tree-ssa/ssa-sra-1.C: Likewise.
	* g++.dg/tree-ssa/ssa-sra-2.C: Likewise.
	* gcc.dg/tree-ssa/20031106-6.c: Disable SRA.

Co-Authored-By: Diego Novillo <dnovillo@redhat.com>

From-SVN: r109379
2006-01-05 13:53:54 +00:00
Daniel Berlin c90186eb1a tree.h (VALUE_HANDLE_VUSES): New.
2005-12-29  Daniel Berlin  <dberlin@dberlin.org>

	* tree.h (VALUE_HANDLE_VUSES): New.
	(struct tree_value_handle): Add vuses.

	* tree-vn.c (struct val_expr_pair_d): Remove stmt, add vuses.
	(vn_compute): Remove stmt argument.
	Don't use vuses in hash value computation.
	(val_expr_pair_eq): Compare vuse lists.
	(copy_vuses_from_stmt): New function.
	(shared_vuses_from_stmt): Ditto.
	(vn_add): Rewrite in terms of vn_add_with_vuses.
	(vn_add_with_vuses): New function.
	(vn_lookup): Rewrite in terms of vn_lookup_with_vuses.
	(vn_lookup_with_vuses): New function.
	(vuses_compare): New function.
	(print_creation_to_file): Ditto.
	(vn_lookup_or_add): Rewrite to handle vuses.
	(sort_vuses): New function.
	(vn_lookup_or_add_with_vuses): Ditto.
	(vn_init): Initialize shared_lookup_vuses.
	(vn_delete): Free shared_lookup_vuses.

	* tree-ssa-pre.c: Update todo list.
	(bb_value_sets_t): Add rvuse_in, rvuse_out, rvuse_gen, and
	rvuse_kill.
	(RVUSE_IN): New macro.
	(RVUSE_GEN): Ditto.
	(RVUSE_KILL): Ditto.
	(RVUSE_OUT): Ditto.
	(modify_expr_node_pool): New function.
	(pretemp): New.
	(storetemp): Ditto.
	(mergephitemp): Ditto.
	(prephitemp): Ditto.
	(struct expr_pred_trans_d): Add vuses member.
	(expr_pred_trans_eq): Compare vuses.
	(phi_trans_lookup): Add vuses argument.
	(phi_trans_add): Ditto.
	(translate_vuses_through_block): New function.
	(phi_translate): Use vuses to ask about those expressions that can
	have vuses.
	Properly translate virtual uses through phis, and use
	vn_lookup_or_add_with vuses.  Handle tcc_reference.
	(phi_translate_set): Don't add pointless translations to the
	cache.
	(get_representative): New function.
	(vuses_dies_in_block_x): Ditto.
	(valid_in_set): Add block argument.  Check virtual use validity.
	(clean): Add block argument. Update call to valid_in_set
	(compute_antic_aux): Update call to clean.
	(dump_bitmap_of_names): New function.
	(compute_vuse_representatives): Ditto.
	(compute_rvuse): Ditto.
	(can_value_number_call): Modified to accept calls with vuses.
	(can_value_number_operation): New function.
	(can_PRE_operation): Ditto.
	(need_creation): New vector of stores that may need creation.
	(find_or_generate_expression): use can_PRE_operation.
	(create_expression_by_pieces): Handle INDIRECT_REF.
	Only create one temp until we have to change types.
	Mark new vars for renaming.
	(insert_into_preds_of_block): Ignore loopiness of loads.
	Use can_PRE_operation.
	Only create one temp until we have to chnge types.
	(insert_aux): Use can_PRE_operation.
	Don't pass name to insert_into_preds_of_block.
	(insert_extra_phis): Only use one temp until we have to change
	types.
	(poolify_tree): New function.
	(modify_expr_template): New var.
	(poolify_modify_expr): New function.
	(insert_fake_stores): Ditto.
	(realify_fake_stores): Ditto.
	(compute_avail): Use can_value_number_operation.
	(mark_operand_necessary): Return NULL for non-SSA names.
	(remove_dead_inserted_code): Update comment.
	(init_pre): Initialize pretemp, need_creation, storetemp,
	mergephitemp, prephitemp.
	Create modify_expr_node_pool.
	(fini_pre): Free modify_expr_node_pool and need_creation array.
	(execute_pre): Call insert_fake_stores, compute_rvuse, and
	realify_fake_stores. 
	* tree-flow.h (vn_compute): Fix prototype.
	(vn_add): Ditto.
	(vn_lookup): Ditto.
	(sort_vuses): New.
	(vn_lookup_or_add_with_vuses): Ditto.
	(vn_add_with_vuses): Ditto.
	(vn_lookup_with_vuses): Ditto.
	* passes.c (pass_may_alias): Add.

From-SVN: r109180
2005-12-30 18:43:00 +00:00
Daniel Berlin 097d5d18f0 tree-pass.h (pass_eliminate_useless_stores): Remove.
2005-12-23  Daniel Berlin  <dberlin@dberlin.org>

	* tree-pass.h (pass_eliminate_useless_stores): Remove.
	* tree-ssa-pre.c (is_copy_stmt): Ditto.
	(follow_copies_till_vuse): Ditto.
	(do_eustore): Ditto.
	(gate_eustores): Ditto.
	(pass_eliminate_useless_stores): Ditto.
	* passes.c (init_optimization_passes): Ditto.

From-SVN: r109034
2005-12-24 04:42:48 +00:00
Jeff Law 0e0ed59411 tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove reassociation code.
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove
	reassociation code.
	* passes.c (init_optimization_passes): Run reassociation again
	after loop optimizations.

	* tree-ssa-dom.c (thread_across_edge): Canonicalize condition
	if necessary.
	(optimize_stmt): Ditto.
	(canonicalize_comparison): New function.
	* tree-ssa-operands.c (swap_tree_operands): Make external.
	(get_expr_operands): Stop auto-canonicalization.
	* tree-ssa-reassoc.c: Rewrite.
	(init_optimization_passes): 
	* tree-flow.h (swap_tree_operands): Prototype.
	* Makefile.in (tree-ssa-reassoc.o): Update dependencies.

	* gcc.dg/tree-ssa/ssa-pre-2.c: Update due to reassociation changes.
	* gcc.dg/tree-ssa/reassoc-1.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-2.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-3.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-4.c: Likewise.
	* gcc.dg/tree-ssa/reassoc-5.c: New.
	* gcc.dg/tree-ssa/reassoc-6.c: New.
	* gcc.dg/tree-ssa/reassoc-7.c: New.
	* gcc.dg/tree-ssa/reassoc-8.c: New.
	* gcc.dg/tree-ssa/reassoc-9.c: New.
	* gcc.dg/tree-ssa/reassoc-10.c: New.
	* gcc.dg/tree-ssa/reassoc-11.c: New.

From-SVN: r108425
2005-12-12 12:59:16 -07:00
Diego Novillo dd97d271a4 passes.c (init_optimization_passes): Document sequencing of passes.
* passes.c (init_optimization_passes): Document
	sequencing of passes.

From-SVN: r107425
2005-11-23 13:05:38 -05:00
Richard Henderson 4989673889 re PR tree-optimization/24300 (segfault in operand_equal_p with -ftree-vectorize)
PR tree-opt/24300
        * Makefile.in (tree-ssa-dce.o): Depend on CFGLOOP_H.
        * tree-ssa-dce.c: Include cfgloop.h.
        (tree_ssa_dce_loop, pass_dce_loop): New.
        * tree-pass.h (pass_dce_loop): Declare it.
        * passes.c (init_optimization_passes): Use it.

From-SVN: r105250
2005-10-11 12:18:24 -07:00
Richard Henderson 5872662b0b re PR middle-end/24049 (compiler error: Segmentation fault In function 'DESX_CBCUpdate')
PR 24049
        * passes.c (init_optimization_passes): Move pass_lower_vector_ssa
        under pass_vectorize.  Clear TODO_ggc_collect from the dce pass
        under pass_vectorize.

From-SVN: r105029
2005-10-06 01:41:47 -07:00
Jeff Law f20731b7ca passes.c (init_optimization_passes): Replace copy propagation passes immediately after DOM with phi-only copy...
* passes.c (init_optimization_passes): Replace copy propagation
        passes immediately after DOM with phi-only copy propagation
        pases.  Add phi-only copy propagation pass after first DOM pass.
        * tree-pass.h (pass_phi_only_copy_prop): Declare.
        * tree-ssa-copy.c (init_copy_prop): Accept new PHI_ONLY argument.
        If true, then mark all non-control statements with DONT_SIMULATE_AGAIN.
        (execute_copy_prop): Accept new PHI_ONLY argument.  Pass it along
        to init_copy_prop.  Callers updated.
        (do_phi_only_copy_prop): New function.
        (pass_phi_only_copy_prop): New pass descriptor.

From-SVN: r104705
2005-09-27 12:47:27 -06:00
Richard Henderson b1e8be1060 tree-pass.h, [...]: Revert last change.
* tree-pass.h, tree-flow.h, tree-ssa-dce.c: Revert last change.
        * tree-ssa-loop.c (pass_vect_dce): Remove.
        * passes.c (init_optimization_passes): Add pass_dce as a sub-pass
        of pass_vectorize.

From-SVN: r104382
2005-09-17 17:03:26 -07:00
Richard Henderson 8fe07c4206 tree-pass.h (pass_vect_dce): Declare.
* tree-pass.h (pass_vect_dce): Declare.
        * passes.c (init_optimization_passes): Add it.
        * tree-flow.h (tree_ssa_dce): Declare.
        * tree-ssa-dce.c (tree_ssa_dce): Export.
        * tree-ssa-loop.c (tree_vectorize): Move current_loops check ...
        (gate_tree_vectorize): ... here.
        (pass_vect_dce): New.

From-SVN: r104376
2005-09-17 14:46:20 -07:00
Paolo Bonzini 6a4e47783a re PR middle-end/23903 (Duplicate dump file numbers)
2005-09-16  Paolo Bonzini  <bonzini@gnu.org>

	PR 23903

	* passes.c (init_optimization_passes): Register dump files for
	IPA passes first.

From-SVN: r104343
2005-09-16 15:11:21 +00:00
Richard Henderson db5f8b93fe re PR debug/23190 (debug info omitted for uninitialized variables (stabs))
PR debug/23190
        * toplev.c (wrapup_global_declaration_1): Split out ...
        (wrapup_global_declaration_2): ... from ...
        (wrapup_global_declarations): ... here.  Return bool.
        (check_global_declaration_1): Split out ...
        (check_global_declarations): from here.
        (emit_debug_global_declarations): New.
        * toplev.h (wrapup_global_declaration_1, wrapup_global_declaration_2,
        check_global_declaration_1, emit_debug_global_declarations): Declare.
        * c-decl.c (c_write_global_declarations_1): Don't create a vector
        of decls.  Call wrapup_global_declaration_1,
        wrapup_global_declaration_2, check_global_declaration_1 directly.
        (c_write_global_declarations_2): New.
        (ext_block): New.
        (c_write_global_declarations): Call c_write_global_declarations_2.
        * langhooks.c (write_global_declarations): Call
        emit_debug_global_declarations.
        * cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Don't
        remove decls that have DECL_RTL_SET_P.
        * passes.c (rest_of_decl_compilation): Invoke
        cgraph_varpool_finalize_decl for all but functions.
cp/
        * decl.c (wrapup_globals_for_namespace): Call
        emit_debug_global_declarations.
        * decl2.c (cp_finish_file): Likewise.

From-SVN: r104065
2005-09-08 17:47:05 -07:00
Jakub Jelinek 5e34206b7e tree-pass.h (TDF_GRAPH): Define.
* tree-pass.h (TDF_GRAPH): Define.
	* tree-dump.c (dump_options): Don't set TDF_GRAPH in "all".
	* passes.c (finish_optimization_passes): Only call
	finish_graph_dump_file if TDF_GRAPH is set.
	(execute_one_pass): Only call clean_graph_dump_file if dump_file !=
	NULL.  Set TDF_GRAPH bit.
	(execute_todo): Call print_rtl_graph_with_bb if TDF_GRAPH is set.

	* gcc.dg/20050811-1.c: New test.
	* gcc.dg/20050811-2.c: New test.

From-SVN: r103304
2005-08-20 18:03:58 +02:00
Diego Novillo c4f548b8c5 re PR tree-optimization/22037 (internal compiler error: verify_ssa failed)
PR 22037
	* tree-cfg.c (replace_uses_by): Call mark_new_vars_to_rename.
	(tree_merge_blocks): Propagate anything allowed by
	may_propagate_copy.
	Clarify documentation.
	* passes.c (execute_todo): If cleanup_tree_cfg invalidated the
	SSA form, schedule an update if necessary.

testsuite/ChangeLog

	PR 22037
	* g++.dg/tree-ssa/pr22037.C:

From-SVN: r102740
2005-08-04 14:16:41 -04:00
Razya Ladelsky 57fb53415e Makefile.in: Add ipcp.c, ipa-prop.h, ipa-prop.c.
* Makefile.in: Add ipcp.c, ipa-prop.h, ipa-prop.c. Remove integrate.h
	dependency from tree-inline.o.
	Add ipa-prop.h dependency to tree-inline.o and cgraphunit.o.
        * common.opt: Add ipa-cp flag.
        * timevar.def: Add IPCP optimization.
        * tree-optimize.c (init_tree_optimization_passes): Schedule
	pass_ipa_cp.
	* tree-pass.h (pass_ipa_cp): Declare.
        * cgraph.h (update_call_expr, cgraph_copy_node_for_versioning,
        cgraph_function_versioning): New declarations.
	* cgraphunit.c: Add include to ipa-prop.h.
        (update_call_expr, cgraph_copy_node_for_versioning,
	cgraph_function_versioning): New functions.
        * integrate.c (copy_decl_for_inlining): Remove.
        * tree-inline.c: Remove include to integrate.h, Add include ipa-prop.h.
        (struct inline_data): Add versioning_p, ipa_info, new fields.
        (remap_decl, mark_local_for_remap_r, setup_one_parameter,
	declare_return_variable): Replace calls to copy_decl_for_inlining with
        copy_decl_for_dup.
        (copy_body_r, copy_bb, copy_cfg_body, copy_tree_r, inlining_p): Add
	versioning support.
        (copy_decl_for_dup): Rename from copy_decl_for_inlining.
	Add argument VERSIONING.
        (copy_arguments_for_versioning, copy_static_chain,
	function_versionable_p, tree_versionable_function_p,
	tree_function_versioning, replace_ref_tree): New functions.
	* tree-inline.h: Include varray.h.
        (tree_versionable_function_p,  tree_function_versioning,
	tree copy_decl_for_dup): New declarations.

From-SVN: r102625
2005-08-01 07:42:09 +00:00
Jan Hubicka 8a76829ccf Makefile.in (rtl-profile.o): Kill all traces of it.
* Makefile.in (rtl-profile.o): Kill all traces of it.
	* common.opt (fspeculative-prefetching, ftree-based-profiling): Kill.
	* coverage.h (rtl_coverage_counter_ref): Kill.
	* opts.c (flag_speculative_prefetching_set): Kill.
	(flag_loop_optimize_set): New.
	(common_handle_option): Disable loop optimizer when profiling;
	do not handle speculative prefetching.
	* passes.c (init_optimization_passes): Replace pass_profiling combo
	by branch_prob pass.
	* profile.c (compute_value_histograms): Update for simplified value
	profiles.
	(rtl_register_profile_hooks): Kill.
	(pass_profiling): Kill.
	(rest_of_handle_branch_prob): Do not profile.
	* toplev.c (process_options): Remove speculative prefetching.
	* toplev.h (flag_tree_based_profiling): Kill.
	* tree-profile.c (prepare_instrumented_value,
	tree_gen_interval_profiler, tree_gen_pow2_profiler,
	tree_gen_one_value_profiler, do_tree_profiling): Update for
	simplified datastructures.
	* value-prof.c: Add comment that speculative prefetching was dropped;
	update rest of file for simplified datastructures.
	(NOPREFETCH_RANGE_MIN, NOPREFETCH_RANGE_MAX,
	rtl_divmod_values_to_profile, insn_prefetch_values_to_profile,
	find_mem_reference_1, find_mem_reference_2, find_mem_reference,
	rtl_values_to_profile, rtl_divmod_fixed_value, rtl_mod_pow2,
	rtl_mod_subtract, gen_speculative_prefetch,
	rtl_divmod_fixed_value_transform, rtl_mod_pow2_value_transform,
	rtl_mod_subtract_transform, speculative_prefetching_transform): Kill.
	(gate_handle_value_profile_transformations,
	rest_of_handle_value_profile_transformations,
	pass_value_profile_transformations): Kill.
	* value-prof.h (histogram_value_t): Remove IL based unions.
	(rtl_register_value_prof_hooks, rtl_register_profile_hooks,
	rtl_profile_hooks): Remove hooks.

	* invoke.texi (-ftree-based-profiling, -fspeculative-prefetching): Kill.

	* inliner-1.c: Do not dump everything.
	* tree-prof.exp: Do not pass -ftree-based-profiling.
	* bprob.exp: Likewise.

From-SVN: r102522
2005-07-28 21:48:38 +00:00
Steven Bosscher ef11c83902 re PR debug/20161 (ICE with dwarf for incomplete element type argument)
PR debug/20161
	* passes.c (rest_of_decl_compilation): If decl is a type and
	we have encountered errors, don't emit debug information.

From-SVN: r102452
2005-07-28 01:24:19 +00:00
Daniel Berlin 6a9a79a866 Makefile.in: Removed tree-promote-statics.c
2005-07-19  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* Makefile.in: Removed tree-promote-statics.c
	* tree-promote-statics.c: Removed.
	* common.opt: Removed flag-promote-statics.
	* opts.c: Ditto.
	* passes.c: Removed tree-promote-statics pass.
	* tree-pass.h: Ditto.
	* timevar.def: Removed TV_PROMOTE_STATICS.


2005-07-19  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* gcc.dg/tree-ssa/sra-2.c: Changed back to -O1 and added xfail.

Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>

From-SVN: r102165
2005-07-19 18:46:15 +00:00
Steven Bosscher 9fa264571d loop-init.c (rest_of_handle_loop2): Remove.
* loop-init.c (rest_of_handle_loop2): Remove.
	(rtl_loop_init, rtl_loop_done, rtl_move_loop_invariants,
	rtl_unswitch, rtl_unroll_and_peel_loops, rtl_doloop): New functions.
	(pass_rtl_loop_init, pass_rtl_loop_done,
	pass_rtl_move_loop_invariants, pass_rtl_unswitch,
	pass_rtl_unroll_and_peel_loops, pass_rtl_doloop): New passes.
	* tree-ssa-loop.c (pass_loop, pass_loop_init, pass_loop_done,
	pass_unswitch): Rename to pass_tree_loop, pass_tree_loop_init,
	pass_tree_loop_done, and pass_tree_unswitch.
	(gate_loop): Rename to gate_tree_loop.
	* passes.c (init_optimization_passes): Update for renamed tree
	loop passes.  Add the new loop2 passes as subpasses of loop2.
	* tree-pass.h: Add extern declarations for the new loop2 subpasses.
	Update for the renamed tree loop passes.

From-SVN: r102149
2005-07-19 00:44:45 +00:00
Daniel Berlin 45159bf654 tree-optimize.c (init_tree_optimization_passes): Add pass_eliminate_useless_stores pass.
2005-07-12  Daniel Berlin  <dberlin@dberlin.org>

	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_eliminate_useless_stores pass.
	* tree-pass.h (pass_eliminate_useless_stores): New pass structure.
	* tree-ssa-pre.c (is_copy_stmt): New function.
	(follow_copies_till_vuse): Ditto.
	(do_eustores): Ditto.
	(gate_eustores): Ditto.

From-SVN: r102112
2005-07-17 17:13:53 +00:00
Daniel Berlin ea900239f4 Makefile.in: Added rules for ipa-pure-const.c...
2005-07-16  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* Makefile.in: Added rules for ipa-pure-const.c, ipa-reference.c,
	ipa-reference.h, ipa-utils.c, ipa-utils.h, ipa-type-escape.c,
	ipa-type-escape.h, tree-promote-statics.c
	* ipa-pure-const.c, ipa-reference.c, ipa-reference.h, ipa-utils.c,
	ipa-utils.h, ipa-type-escape.c, ipa-type-escape.h,
	tree-promote-statics.c: new files.
	* alias.c: (nonlocal_mentioned_p_1, nonlocal_mentioned_p,
	nonlocal_referenced_p_1, nonlocal_referenced_p, nonlocal_set_p_1,
	int nonlocal_set_p, mark_constant_function): Deleted.
	(rest_of_handle_cfg): Removed call to mark_constant_function.
        (nonoverlapping_component_refs_p): Added calls to support
	type based aliasing.
        * tree-ssa-alias.c (may_alias_p,
	compute_flow_insensitive_aliasing): Ditto.
	* calls.c (flags_from_decl_or_type): Removed reference to
	cgraph_rtl_info.
	(flags_from_decl_or_type): Support ECF_POINTER_NO_CAPTURE attribute.
	* c-common.c (handle_pointer_no_capture_attribute): New function
	and added pointer_no_capture attribute.
      	* c-typeck.c (convert_arguments): Make builtins tolerant of having
	too many arguments.  This is necessary for Spec 2000.
	* cgraph.h (const_function, pure_function): Removed.
	* common.opt: Added "fipa-pure-const", "fipa-reference",
	"fipa-type-escape", and "ftree-promote-static".
	* opts.c: Ditto.
	* passes.c: Added ipa and tree-promote-statics passes.
	* timevar.def: Added TV_IPA_PURE_CONST, TV_IPA_REFERENCE,
	TV_IPA_TYPE_ESCAPE, and TV_PROMOTE_STATICS.
	* tree.h: Support ECF_POINTER_NO_CAPTURE attribute.
	* tree-dfa.c (referenced_var_lookup_if_exists): New function.
	* tree-flow.h: Added exposed sra calls and addition of
	reference_vars_info field for FUNCTION_DECLS.
	* tree-pass.h: Added passes.
	* tree-sra.c: (sra_init_cache): New function.
	(sra_insert_before, sra_insert_after) Made public.
	(type_can_be_decomposed_p): Renamed from type_can_be_decomposed_p
	and made public.
	* tree-ssa-alias.c (dump_alias_stats): Added stats for type based
	aliasing. (may_alias_p): Added code to use type escape analysis to
	improve alias sets.
	* tree-ssa-operands.c (add_call_clobber_ops): Added parameter and
	code to prune clobbers of static variables based on information
	produced in ipa-reference pass.  Changed call clobbering so that
	statics are not marked as clobbered if the call does not clobber
	them.


2005-07-16  Danny Berlin <dberlin@dberlin.org>
	    Kenneth Zadeck <zadeck@naturalbridge.com>

	* gcc.dg/tree-ssa/ssa-dce-2.c: Changed dg-options to run at -O2
	since pure const detection cannot run at -O1 in c compiler.
	* gcc.dg/tree-ssa/20030714-1.c Changed scanning patterns because we
	can now optimize this case properly.
	* gcc.dg/tree-ssa/sra-2.c: Changed to -O3 and removed xfail
	because we now pass.
	* gcc.dg/vect/vect-92.c: Removed out of bounds array access.

Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>

From-SVN: r102098
2005-07-16 18:56:53 +00:00
Zdenek Dvorak b7eae7b8d1 tree-flow.h (remove_empty_loops, [...]): Declare.
* tree-flow.h (remove_empty_loops, single_dom_exit): Declare.
	* passes.c (init_optimization_passes): Add pass_empty_loop.
	* tree-pass.h (pass_empty_loop): Declare.
	* tree-ssa-loop-ivcanon.c (empty_loop_p, remove_empty_loop,
	try_remove_empty_loop, remove_empty_loops): New functions.
	* tree-ssa-loop-ivopts.c (single_dom_exit): Export.
	* tree-ssa-loop.c (tree_ssa_empty_loop, pass_empty_loop): New.

	* gcc.dg/tree-ssa/loop-10.c: New test.

From-SVN: r101901
2005-07-11 23:59:17 +00:00
Diego Novillo e8ca415995 Makefile.in (tree-ssa-alias.o): Depend on tree-ssa-structalias.h
* Makefile.in (tree-ssa-alias.o): Depend on tree-ssa-structalias.h
	* tree-cfg.c (CHECK_OP): Only test for is_gimple_val.
	* tree-dfa.c (dump_subvars_for): New.
	(debug_subvars_for): New.
	(dump_variable): Show subvariables if VAR has them.
	* tree-flow-inline.h (get_subvar_at): New.
	(overlap_subvar): Change offset and size to unsigned HOST_WIDE_INT.
	* tree-flow.h (struct ptr_info_def): Remove field pt_malloc.
	Update all users.
	(struct subvar): Change fields offset and size to unsigned
	HOST_WIDE_INT.
	(dump_subvars_for): Declare.
	(debug_subvars_for): Declare.
	(get_subvar_at): Declare.
	(okay_component_ref_for_subvars): Change 2nd and 3rd argument
	to unsigned HOST_WIDE_INT *.
	(overlap_subvar): Likewise.
	* tree-gimple.c (is_gimple_reg): Always return false for
	SFTs and memory tags.
	* tree-pass.h (pass_build_pta, pass_del_pta): Remove.
	Update all callers.
	* tree-ssa-alias.c: Include tree-ssa-structalias.h.
	(compute_may_aliases): Call compute_points_to_sets.
	(collect_points_to_info_for): Remove.
	(compute_points_to_and_addr_escape): Remove.
	(delete_alias_info): Call delete_points_to_sets.
	(compute_flow_sensitive_aliasing): If the call to
	find_what_p_points_to returns false, call set_pt_anything.
	(add_may_alias): Set TREE_ADDRESSABLE when adding a new alias.
	(set_pt_anything): Clear pi->pt_vars.
	(set_pt_malloc): Remove.
	(merge_pointed_to_info): Remove.
	(add_pointed_to_expr): Remove.
	(add_pointed_to_var): Remove.
	(collect_points_to_info_r): Remove.
	(is_escape_site): Make extern.
	(create_sft): New.
	(create_overlap_variables_for): Call it.
	* tree-ssa-copy.c (merge_alias_info): Never merge
	flow-sensitive alias information.
	* tree-ssa-operands.c (get_expr_operands): Adjust variables
	offset and size to be unsigned HOST_WIDE_INT.
	(add_to_addressable_set): Rename from note_addressable.
	Set TREE_ADDRESSABLE as the variables are added to the set.
	Update all users.
	(add_stmt_operand): Do not try to micro-optimize unmodifiable
	operands into VUSEs when adding V_MAY_DEFs for members in an
	alias set.
	* tree-ssa-operands.h (add_to_addressable_set): Declare.
	* tree-ssa-structalias.c: Include tree-ssa-structalias.h last.
	(struct variable_info): Add bitfield is_heap_var.
	(var_anyoffset, anyoffset_tree, anyoffset_id): Declare.
	(new_var_info): Initialize is_heap_var.
	(get_constraint_for): Add HEAP variables to the symbol table.
	Mark them with is_heap_var.
	(update_alias_info): New.  Taken mostly from the old
	compute_points_to_and_addr_escape.
	(handle_ptr_arith): New.
	(find_func_aliases): Call update_alias_info.
	Call handle_ptr_info for tcc_binary expressions.
	Call mark_stmt_modified.
	(create_variable_info_for): If DECL has subvars, do not create
	variables for its subvars.  Always add all the fields.
	(set_uids_in_ptset): If the solution includes ANYOFFSET and
	SFTs, then add all the SFTs of the structure.
	If VI->DECL is an aggregate with subvariables, add the SFT at
	VI->OFFSET.
	(find_what_p_points_to): If VI is an artificial variable,
	translate to bitfields in SSA_NAME_PTR_INFO.
	If the solution is empty, set pi->pt_vars to NULL
	(init_base_vars): Create ANYOFFSET.
	(compute_points_to_sets): Rename from create_alias_vars.
	Make extern.
	(pass_build_pta): Remove.
	(delete_points_to_sets): Rename from delete_alias_vars.
	(pass_del_pta): Remove.
	* tree-ssa-structalias.h (struct alias_info): Move from
	tree-ssa-alias.h.
	(NUM_REFERENCES, NUM_REFERENCES_CLEAR, NUM_REFERENCES_INC,
	NUM_REFERENCES_SET): Likewise.
	(compute_points_to_sets, delete_points_to_sets): Declare.

testsuite/ChangeLog

	* gcc.dg/tree-ssa/pta-fp.c: Use -fdump-tree-alias1.

From-SVN: r101841
2005-07-09 20:28:01 -04:00
Diego Novillo 563cb6be0f re PR tree-optimization/21356 (Dominance error after aggressive dead code elimination (cd_dce))
PR 21356
	PR 22332
	* passes.c (execute_todo): Cleanup the CFG before updating
	SSA.

From-SVN: r101832
2005-07-09 13:35:05 -04:00
Daniel Berlin 820cc88fbd Makefile.in (TREE_H): Add treestruct.def.
2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Makefile.in (TREE_H): Add treestruct.def.
	(c-decl.o): Add pointer-set.h
	* c-decl.c (diagnose_mismatched_decls): Don't attempt to look at
	visibility on regular DECL's.
	(merge_decls): Fix the copying of decl nodes of various types for
	the new structures.  Don't update RTL, section name, weak status,
	etc, on DECL's without RTL.
	(grokdeclarator): DECL_ARG_TYPE_AS_WRITTEN is gone.
	Don't check volatile on non-variable types.
	(store_parm_decls_oldstyle): Use pointer_set instead of DECL_WEAK
	to check whether we have seen arguments.
	* c-objc-common.c (c_tree_printer): Reverse order of tests so that
	flag is checked before field (flag is common, field is not).
	* dwarf2out.c (decl_ultimate_origin):  Only DECL's with
	TS_DECL_COMMON could have an origin.
	(add_location_or_const_value_attribute): Don't check section name
	on non-var/function decls.
	(dwarf2out_var_location): Reverse order of tests.
	* emit-rtl.c (set_reg_attrs_for_parm): DECL_CHECK is dead, replace
	with DECL_WRTL_CHECK.
	* expmed.c (make_tree): rtl is now in decl_with_rtl.
	* fold-const.c (fold_binary): Don't check weakness on
	non-var/function decls.
	(tree_expr_nonzero_p): Ditto.
	(fold_checksum_tree): Use tree_decl_extra as sizeof
	buffer.
	* ggc-page.c (extra_order_size_table): Add sizes for
	tree_decl_non_common, tree_parm_decl,  tree_var_decl, and
	tree_field_decl.
	* gimplify.c (gimplify_bind_expr): Only set
	DECL_SEEN_IN_BIND_EXPR_P on VAR_DECL.
	* integrate.c (copy_decl_for_inlining): Don't set RTL on decl's
	without RTL.
	* langhooks-def.h (LANG_HOOK_INIT_TS): New.
	* langhooks.h (init_ts). New langhook.
	* passes.c (rest_of_decl_compilation): Reverse order of tests.
	* print-tree.c (print_node): Update to only print fields that
	exist in the structures the passed decl has.
	* toplev.c (wrapup_global_declarations): Don't reset
	DECL_DEFER_OUTPUT on DECL's that don't contain it.
	* tree-browser.c (browse_tree): DECL_ARG_TYPE_AS_WRITTEN removed.
	* tree-inline.c (remap_decl): Ditto.
	* tree-outof-ssa.c (create_temp): Reverse order of tests.
	* tree-pretty-print.c (print_declaration): Don't print
	DECL_REGISTER on things that don't contain it.
	* tree-vrp.c (expr_computes_nonzero): Don't check weakness on
	non-var/function decls.
	* tree.c (tree_contains_struct): New structure.
	(init_priority_for_decl): New hashtable.
	(tree_int_map): New structure.
	(tree_int_map_eq): New function.
	(tree_int_map_marked_p): Ditto.
	(tree_int_map_hash): Ditto.
	(tree_map): Move to tree.h.
	(tree_map_eq): Externalize.
	(tree_map_hash): Ditto.
	(tree_map_marked_p): Ditto.
	(init_ttree): Set up tree_contains_struct and call langhook.
	(decl_assembler_name): Use DECL_NON_COMMON_CHECK..
	(tree_code_size): Update for new structures.
	(tree_node_structure): Update for new structures.
	(make_node_stat): Don't try to set DECL_IN_SYSTEM_HEADER on decls
	without the field.
	(copy_node_stat):  Copy init priority.
	(build_decl_stat): Ditto for visibility.
	(ts_enum_names): New.
	(tree_contains_struct_check_failed): New function.
	(decl_init_priority_lookup): Ditto.
	(decl_init_priority_insert): Ditto.
	* treestruct.def: New file.
	* tree.h (CODE_CONTAINS_STRUCT): New macro.
	(CONTAINS_STRUCT_CHECK): Ditto.
	(tree_contains_struct_check_failed): New prototype.
	(DECL_CHECK): Removed.
	(DECL_MINIMAL_CHECK): New.
	(DECL_COMMON_CHECK): Ditto.
	(DECL_WRTL_CHECK): Ditto.
	(DECL_NON_COMMON_CHECK): Ditto.
	(DECL_WITH_VIS_CHECK): Ditto.
	(VAR_OR_FUNCTION_DECL_P): Ditto
	(struct tree_decl_minimal): New structure.
	(struct tree_decl_common): Ditto.
	(struct tree_decl_with_rtl): Ditto.
	(struct tree_decl_with_vis): Ditto.
	(struct tree_decl_non_common): Ditto.
	(struct tree_field_decl): Ditto.
	(struct tree_parm_decl): Ditto.
	(struct tree_var_decl): Ditto.
	(struct tree_function_decl): Ditto.
	(struct tree_const_decl): Ditto.
	(struct tree_result_decl): Ditto.
	(union tree_node): Add new structures.
	* var-tracking.c (track_expr_p): Reverse order of tests.

	* doc/c-tree.texi: Add documentation on DECL node internal structure.


2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* utils.c (create_param_decl): DECL_ARG_TYPE_AS_WRITTEN is
	removed.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* Make-lang.in: Add gt-cp-lang.h.
	(cp-lang.o): Ditto.
	* class.c (create_vtable_ptr): Stop setting DECL_ASSEMBLER_NAME on
	the field.
	* config-lang.in: Add cp-lang.c to gtfiles.
	* cp-lang.c: Include hashtab.h.
	(cp_init_ts): New function.
	(LANG_HOOK_INIT_TS): Use macro.
	(decl_shadowed_for_var_lookup): New function.
	(decl_shadowed_for_var_insert): Ditto.
	* cp-tree.h (THUNK_FUNCTION_CHECK): Use decl_common.
	(NON_THUNK_FUNCTION_CHECK): Ditto.
	(DECL_NAMESPACE_ASSOCIATIONS): Use decl_non_common.
	(DECL_INIT_PRIORITY): Ditto.
	(DECL_HAS_SHADOWED_FOR_VAR_P): Ditto.
	(DECL_SHADOWED_FOR_VAR): Use hashtable.
	(SET_DECL_SHADOWED_FOR_VAR): Ditto.
	* decl.c (duplicate_decls): Update for new/updated structures.
	(poplevel): Use SET_DECL_SHADOWED_FOR_VAR.
	* decl2.c (start_static_initialization_or_destruction): Deal with
	priority.
	* pt.c (tsubst_decl): Check TS_DECL_WRTL before doing
	SET_DECL_RTL.
	* tree.c (handle_init_priority_attribute): Handle priority.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* objc-act.c (objc_push_parm): DECL_ARG_TYPE_AS_WRITTEN is
	removed.
	* objc-act.h (KEYWORD_ARG_NAME): Use decl_non_common.
	(KEYWORD_KEY_NAME): Use decl_minimal.
	(METHOD_SEL_NAME): Ditto..
	(METHOD_SEL_ARGS): Use decl_non_common.
	(METHOD_ADD_ARGS): Ditto.
	(METHOD_ADD_ARGS_ELLIPSIS_P): Use decl_common.
	(METHOD_DEFINITION): Ditto.
	(METHOD_ENCODING): Ditto.
	* objc-lang.c: (objc_init_ts): New function.

2005-07-08  Daniel Berlin  <dberlin@dberlin.org>

	* trans-decl.c (create_function_arglist): DECL_ARG_TYPE_AS_WRITTEN
	is removed.

From-SVN: r101799
2005-07-08 23:37:11 +00:00
Paolo Bonzini ef3303124e Makefile.in: Adjust dependencies.
2005-07-05  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in: Adjust dependencies.
	* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
	* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
	* alias.c (rest_of_handle_cfg, pass_cfg): New.
	* bb-reorder.c (duplicate_computed_gotos): Make it static.
	* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
	rest_of_compilation.

	* bb-reorder.c (gate_duplicate_computed_gotos,
	pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
	rest_of_handle_reorder_blocks, pass_reorder_blocks,
	gate_handle_partition_blocks, rest_of_handle_partition_blocks,
	pass_partition_blocks): New.
	* bt-load.c (gate_handle_branch_target_load_optimize,
	rest_of_handle_branch_target_load_optimize,
	pass_branch_target_load_optimize): New.
	* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
	pass_jump2): New.
	* cfglayout.c (pass_insn_locators_initialize): New.
	* cfgrtl.c (pass_free_cfg): New.
	* combine.c (gate_handle_combine, rest_of_handle_combine,
	pass_combine): New.
	* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
	gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
	* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
	* except.c (pass_set_nothrow_function_flags,
	pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
	pass_rtl_eh): New.
	* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
	rest_of_handle_shorten_branches, pass_shorten_branches,
	rest_of_clean_state, pass_clean_state): New.
	* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
	rest_of_handle_remove_death_notes, pass_remove_death_notes,
	rest_of_handle_life, pass_life, rest_of_handle_flow2,
	pass_flow2): New.
	* function.c (pass_instantiate_virtual_regs, pass_init_function,
	rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
	* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
	pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
	pass_gcse): New.
	* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
	* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
	pass_rtl_ifcvt, gate_handle_if_after_combine,
	rest_of_handle_if_after_combine, pass_if_after_combine,
	gate_handle_if_after_reload, rest_of_handle_if_after_reload,
	pass_if_after_reload): New.
	* integrate.c (pass_initial_value_sets): New.
	* jump.c (pass_cleanup_barriers, purge_line_number_notes,
	pass_purge_lineno_notes): New.
	* mode-switching.c (rest_of_handle_mode_switching,
	pass_mode_switching): New.
	* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
	* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
	pass_loop2): New.
	* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
	pass_loop_optimize): New.
	* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
	pass_sms): New.
	* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
	pass_gcse2): New.
	* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
	pass_postreload_cse): New.
	* profile.c (gate_handle_profiling, pass_profiling,
	rest_of_handle_branch_prob, pass_branch_prob): New.
	* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
	pass_split_before_regstack, gate_handle_split_before_regstack,
	gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
	rest_of_handle_split_all_insns, pass_split_all_insns): New.
	* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
	pass_stack_regs): New.
	* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
	gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
	pass_stack_adjustments): New.
	* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
	pass_regrename): New.
	* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
	pass_delay_slots, gate_handle_machine_reorg,
	rest_of_handle_machine_reorg, pass_machine_reorg): New.
	* rtl.h (extern void purge_line_number_notes): New.
	* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
	gate_handle_sched2, rest_of_handle_sched2, pass_sched,
	pass_sched2): New.
	* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
	pass_tracer): New.
	* value-prof.c (gate_handle_value_profile_transformations,
	rest_of_handle_value_profile_transformations,
	pass_value_profile_transformations): New.
	* var-tracking.c (gate_handle_var_tracking,
	pass_variable_tracking): New.
	* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.

	* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
	rest_of_handle_delay_slots, rest_of_handle_stack_regs,
	rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
	rest_of_handle_old_regalloc, rest_of_handle_regrename,
	rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
	rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
	rest_of_handle_gcse2, rest_of_handle_regmove,
	rest_of_handle_tracer, rest_of_handle_if_conversion,
	rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
	rest_of_handle_web, rest_of_handle_branch_prob,
	rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
	rest_of_handle_jump_bypass, rest_of_handle_combine,
	rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
	rest_of_handle_gcse, rest_of_handle_loop_optimize,
	rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
	rest_of_handle_mode_switching, rest_of_handle_jump,
	rest_of_handle_eh, rest_of_handle_stack_adjustments,
	rest_of_handle_flow2, rest_of_handle_jump2,
	rest_of_handle_peephole2, rest_of_handle_postreload,
	rest_of_handle_shorten_branches, rest_of_clean_state,
	rest_of_compilation): Remove.

	* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
	* passes.c (dump_flags, in_gimple_form, all_passes,
	all_ipa_passes, all_lowering_passes, register_one_dump_file,
	register_dump_files, next_pass_1, last_verified, execute_todo,
	execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
	from tree-optimize.c.
	(init_optimization_passes): Moved from tree-optimize.c,
	adding the RTL optimizations.
	* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
	* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
	all_ipa_passes, all_lowering_passes, register_one_dump_file,
	register_dump_files, next_pass_1, last_verified, execute_todo,
	execute_one_pass, execute_pass_list, execute_ipa_pass_list,
	init_tree_optimization_passes, ipa_passes): Delete.
	* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
	the RTL dumps.
	(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
	dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
	from tree.h.
	(ipa_passes): Remove.
	(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
	* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
	dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
	dump_switch_p, dump_flag_name): Moved to tree-pass.h.
	(dump_info_p, dump_flag): Moved to tree-dump.h.

	* Makefile.in: Adjust dependencies for tree-pretty-print.c,
	cgraph.c, opts.c.
	* passes.c (finish_optimization_passes): Use dump_begin
	and dump_end, TDI_end.
	(gate_rest_of_compilation): New.
	(pass_rest_of_compilation): Use it.
	(gate_postreload, pass_postreload): New.
	* toplev.c (general_init): Rename init_tree_optimization_passes.
	* toplev.h (init_tree_optimization_passes): Rename to
	init_optimizations_passes.
	* tree-dump.c (dump_flag): Make static.
	(dump_files): Remove RTL dumps.
	* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
	pass_cleanup_cfg, pass_free_cfg_annotations,
	pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
	pass_init_datastructures, pass_fixup_cfg): Make non-static.
	* tree-pretty-print.c: Include tree-pass.h.
	* cgraph.c: Include tree-dump.h.

cp:
2005-07-05  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in (class.o, decl2.o): Adjust dependencies.
	* class.c: Include tree-dump.h.
	* decl2.c: Include tree-dump.h.

java:
2005-07-05  Paolo Bonzini  <bonzini@gnu.org>

	* Makefile.in (parse.o): Adjust dependencies.
	* parse.y: Include tree-dump.h.

From-SVN: r101627
2005-07-05 16:20:53 +00:00
Steven Bosscher c2f7fa15c0 coretypes.h (tls_model): Add TLS_MODEL_NONE as 0.
* coretypes.h (tls_model): Add TLS_MODEL_NONE as 0.
	* tree.h (struct tree_decl): New field `tls_model'.
	(DECL_TLS_MODEL): New.
	(DECL_THREAD_LOCAL_P): Rename from DECL_THREAD_LOCAL, make it
	a predicate.
	* rtl.h (decl_default_tls_model): Add prototype for it.
	* varasm.c (decl_tls_model): Rewritten and renamed to ...
	(decl_default_tls_model): ... this.
	(default_encode_section_info): Use DECL_TLS_MODEL instead of
	decl_tls_model.
	(assemble_variable): Replace DECL_THREAD_LOCAL with
	DECL_THREAD_LOCAL_P.
	(default_section_type_flags_1): Likewise.
	(categorize_decl_for_section): Likewise.
	* tree.c (staticp): Likewise.
	(recompute_tree_invarant_for_addr_expr): Likewise.
	* drawf2out (loc_descriptor_from_tree_1): Likewise.
	* c-decl.c (diagnose_mismatched_decls): Likewise.
	with DECL_THREAD_LOCAL_P.
	(start_decl): Likewise.
	* print-tree.c (print_node): Likewise.  Print the TLS model.
	(grokdeclarator): Set the default DECL_TLS_MODEL here.
	* c-common.c (handle_tls_model_attribute): Rewrite to set the
	TLS model up based on the attribute.  Never add the attribute
	to the decl's attributes list.
	* config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Replace
	DECL_THREAD_LOCAL with DECL_THREAD_LOCAL_P.

cp/
	* decl.c (start_decl): Replace DECL_THREAD_LOCAL with
	DECL_THREAD_LOCAL_P.
	(cp_finish_decl): Likewise.
	(grokvardecl): Set the default DECL_TLS_MODEL here.

From-SVN: r101465
2005-06-30 12:17:52 +00:00
Jan Hubicka 370369e1a7 basic-block.h (basic_block_def): Kill rbi.
* basic-block.h (basic_block_def): Kill rbi.
	(reorder_block_def): Kill; Remove next field (replaced by aux);
	move other fields to ...
	(rtl_bb_info): ... here.
	* bb-reorder.c (find_traces, rotate_loop, find_traces_1_round,
	copy_bb, connect_traces, add_labels_and_missing_jumps
	fix_up_fall_thru_edges, fix_crossing_conditional_branches,
	duplicate_computed_gotos, partition_hot_cold_basic-blocks):
	Update to new fields.
	* cfg.c (initialize_bb_rbi): Kill.
	* cfglayout.c (record_effective_endpoints, fixup_reorder_chain,
	fixup_fallthru_exit_predecessor, cfg_layout_duplicate_bb): Update.
	* cfgrtl.c (cfg_layout_create_basic_block): Do not initialize rbi.
	(try_redirect_by_replacing_jump): Update rbi references.
	(cfg_layout_split_block): Likewise.
	(cfg_layout_delete_block): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* function.c (thread_prologue_and_epilogue_insns): Likewise.
	* passes.c (rest_of_handle_sms): Likewise.
	* tracer.c (seen, tail_duplicate, layout_superblocks): Likewise.

From-SVN: r101359
2005-06-27 23:06:33 +00:00
Jan Hubicka 5d9f607b1b passes.c (rest_of_handle_branch_prob): Do not rebuild profiling info when not neecesary
* passes.c (rest_of_handle_branch_prob): Do not rebuild profiling info
	when not neecesary
	(rest_of_compilation): Fix conditional on branch prob pass.
	* predict.c (tree_estimate_probability): Enable strip_builtin_expect
	when not loop optimizing.

From-SVN: r101321
2005-06-25 11:57:53 +00:00
Kelley Cook 366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Jan Hubicka 30be951ac7 cgraphunit.c (cgraph_create_edges): Do not walk BLOCK; finalize local statics when doing unit-at-a-time.
* cgraphunit.c (cgraph_create_edges): Do not walk BLOCK; finalize
	local statics when doing unit-at-a-time.
	(cgraph_varpool_assemble_pending_decls): Output debug info.
	* dwarf2out.c (decls_for_scope): Skip local statics.
	(dwarf2out_decl): Handle local statics.
	* passes.c (rest_of_decl_compilation): Do not differentiate
	local and global statics in unit-at-a-time.
	* tree-inline.c (remap_decls): Put local static into
	unexpanded_vars_list rather than introducing duplicated VAR_DECL
	node.

From-SVN: r100802
2005-06-09 16:21:36 +00:00
Jan Hubicka 670cd5c514 Makefile.in (ipa-inline.o): Add COEVERAGE_H dependency.
* Makefile.in (ipa-inline.o): Add COEVERAGE_H dependency.
	* cgraph.c (cgraph_create_node): Reset estimated_growth.
	* cgraph.h (cgraph_global_info): Add estimated_growth.
	* ipa-inline.c: Include coverage.h
	(max_insns, max_count): New static variables.
	(cgraph_estimate_size_after_inlining): Cache the result.
	(cgraph_estimate_growth):
	* passes.c (rest_of_clean_state): Kill coverage_end_function.
	* timevar.def (TV_INLINE_HEURISTICS): New timevar.
	* tree-optimize.c (init_tree_optimization_passes): Move profiling before
	inlining.
	(ipa_passes): Initialize bitmaps.

	* gcc.dg/tree-prof/inliner-1.c: New.

2005-05-25  Janis Johnson  <janis187@us.ibm.com>

	* gcc.dg/tree-prof: New directory.
	* gcc.dg/tree-prof/tree-prof.exp: New.

From-SVN: r100144
2005-05-25 12:34:01 +00:00
Caroline Tice c7466deed4 Correct fixes for various hot/cold partitioning concerns.
2005-04-27  Caroline Tice  <ctice@apple.com>

        * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
        Remove targetm.have_named_sections test.
        (fix_edges_for_rarely_executed_code): Likewise.
        (insert_section_boundary_note): Likewise.
        (reorder_basic_blocks): Check partitioning flag before calling
        verify_hot_cold_block_grouping.
        * dbxout.c (dbxout_function_end): Get hot/cold section labels from
        the function struct rather than global variables.
        * dwarf2out.c (COLD_TEXT_SECTION_LABEL): New macro.
        (COLD_END_LABEL): Likewise
        (cold_text_section_label): New static global variable.
        (cold_end_label): Likewise.
        (dwarf2out_switch_text_section): Get hot/cold section labels from
        the function struct rather than global variables; test to make sure
        cfun is defined.
        (output_aranges): Use cold_text_section_label and cold_end_label;
        check partitioning flag before putting out delta.
        (output_ranges): Remove incorrect code attempting to use
        hot/cold labels.
        (output_line_info): Get cold section label from function struct; test
        to make sure cfun is defined.
        (add_location_or_const_value_attribute): Likewise.
        (dwarf2out_var_location): Likewise.
        (dwarf2out_init): Generate cold_text_section_label and cold_end_label;
        write out cold_text_section_label if partition flag is set.
        (dwarf2out_finish): Write out cold_end_label if partition flag is set;
        * function.h (struct function): Add new fields to point to hot/cold
        section labels: hot_section_label, cold_section_label,
        hot_section_end_label and cold_section_end_label; also add new field
        for cold text section name, unlikely_text_section_name.
        * opts.c (decode_options): Turn off partitioning flag if
        !targetm.have_named_sections.
        * output.h (hot_section_label): Remove.
        (hot_section_end_label): Remove.
        (cold_section_end_label): Remove.
        (unlikely_section_label): Remove.
        (unlikely_text_section_name): Remove.
        * passes.c (rest_of_handle_final):  Remove extra blank line.
        * varasm.c (unlikely_section_label): Remove.
        (hot_section_label): Remove.
        (hot_section_end_label): Remove.
        (cold_section_end_label): Remove.
        (unlikely_text_section_name):  Remove.
        (initialize_cold_section_name): Modify to call
        targetm.strip_name_encoding; to store cold section name in current
        function struct, if it exists; and to only use the decl_section_name
        if flag_named_sections is true.
        (unlikely_text_section): Modify to get section name out of current
        function struct, if there is one; otherwise build it from
        UNLIKELY_EXECUTED_TEXT_SECTION_NAME.
        (in_unlikely_text_section): Likewise.
        (named_section): Modify to get/put cold section name in current function
        struct, if there is one.
        (function_section):  Change 'bool unlikely' to 'int reloc'; check
        targetm.have_named_sections before calling named_section.
        (current_function_section): Likewise.
        (assemble_start_function): Modify to get/put unlikely_text_section_name
        in current function struct; modify to get hot/cold section labels
        from function struct; initialize labels using
        ASM_GENERATE_INTERNAL_LABEL;
        test partitioning flag before writing out hot section label.
        (assemble_end_function): Test partitioning flag before writing out
        hot/cold section labels.
        (default_section_type_flags_1):  Get cold text section name from
        function struct if there is one; Set flags correctly for
        cold text section if there is not a current function struct.

From-SVN: r98885
2005-04-27 14:35:20 -07:00
David S. Miller d0828b3113 explow.c (allocate_dynamic_stack_space SETJMP_VIA_SAVE_AREA): Kill setjmpless_size.
* explow.c (allocate_dynamic_stack_space SETJMP_VIA_SAVE_AREA):
	Kill setjmpless_size.  current_function_calls_setjmp is completely
	computed when we are called, so just use the optimized size value
	instead of using REG_SAVE_AREA notes.
	(optimize_save_area_alloca): Delete....
	* rtl.h (optimize_save_area_alloca): Likewise...
	* passes.c (rest_of_compilation): and don't call it any more.
	* reg-notes.def (SAVE_AREA): Delete.

From-SVN: r98861
2005-04-27 10:38:17 -07:00
DJ Delorie d4ee4d2525 diagnostic.c (warning): Accept parameter to classify warning option.
* diagnostic.c (warning): Accept parameter to classify warning option.
(warning0): New, for when a pointer to an error() like function is needed.
* errors.c (warning): Likewise.
* errors.h (warning, warning0): Adjust prototypes.
* toplev.h (warning, warning0): Likewise.

* attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c,
c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c,
c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c,
fold-const.c, fortran/trans-decl.c, function.c, gcse.c,
genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c,
reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c,
tree-ssa.c, tree.c, varasm.c: Adjust warning() callers.

* config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c,
config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c,
config/darwin.c, config/darwin.h, config/h8300/h8300.c,
config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c,
config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c,
config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c,
config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c,
config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h,
config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h,
config/rs6000/aix52.h, config/rs6000/darwin.h,
config/rs6000/rs6000-c.c, config/rs6000/rs6000.c,
config/s390/s390.c, config/sh/sh.c, config/sh/sh.h,
config/sh/symbian.c, config/sol2-c.c, config/sol2.c,
config/stormy16/stormy16.c, config/v850/v850-c.c,
config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning()
callers.

* ada/misc.c: Adjust warning() callers.

* cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c,
cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c,
cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c,
cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers.

* fortran/trans-decl.c: Adjust warning() callers.

* java/class.c, java/decl.c, java/expr.c, java/jcf-io.c,
java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning()
callers.

* objc/objc-act.c: Adjust warning() callers.

* treelang/parse.y: Adjust warning() callers.

From-SVN: r98633
2005-04-23 17:29:07 -04:00
Kazu Hirata 25cd19de2f cfgrtl.c (purge_all_dead_edge): Remove an unused argument.
* cfgrtl.c (purge_all_dead_edge): Remove an unused argument.
	* basic-block.h: Update the prototype for
	purge_all_dead_edges.
	* cfgexpand.c (tree_expand_cfg): Update a call to
	purge_all_dead_edges.
	* combine.c (combine_instructions): Likewise.
	* passes.c (rest_of_handle_old_regalloc, rest_of_handle_cse,
	rest_of_handle_cse2, rest_of_handle_gcse,
	rest_of_handle_postreload): likewise.

From-SVN: r98168
2005-04-15 03:16:20 +00:00
Caroline Tice b3b51ded80 Temporary fix for partitioning problems; real fix coming soon.
From-SVN: r98051
2005-04-12 15:38:06 -07:00
Steven Bosscher 997de8ed6b Makefile.in: Add function.h to BASIC_BLOCK_H.
* Makefile.in: Add function.h to BASIC_BLOCK_H.  Remove all
	references to gt-tree-cfg.h.
	* basic-block.h (struct basic_block_def): Don't skip rbi
	for garbage collection.
	(struct reorder_block_def): Make GTY-able.
	(struct control_flow_graph): New structure.
	(n_edges, n_basic_blocks, last_basic_block, basic_block_info,
	BASIC_BLOCK, EXIT_BLOCK_PTR, ENTRY_BLOCK_PTR): No longer vars,
	but instead defines to the control_flow_graph for cfun.
	(label_to_block_map): New define, points to the label map of
	the control_flow_graph for cfun.
	(n_edges_for_function, n_basic_blocks_for_function,
	last_basic_block_for_function, basic_block_info_for_function,
	EXIT_BLOCK_PTR_FOR_FUNCTION, ENTRY_BLOCK_PTR_FOR_FUNCTION,
	basic_block_info_for_function, label_to_block_map_for_function):
	Counterparts for the above, taking a struct function as an extra
	argument.
	(alloc_rbi_pool, free_rbi_pool): Remove prototypes.
	* cfg.c: (n_edges, n_basic_blocks, last_basic_block,
	basic_block_info, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Remove.
	(alloc_rbi_pool, free_rbi_pool): Remove.
	(initialize_bb_rbi): Use ggc_alloc_cleared instead of pool_alloc.
	* cfglayout.c: (cfg_layout_initialize): Don't allocate the rbi pool
	here...
	(cfg_layout_finalize) ... and don't free it here.
	* cfgrtl.c (cfg_layout_delete_block): Zero out rbi so it gets
	garbage collected.
	* flow.c (free_basic_block_vars): Set label_to_block_map and
	n_edges to zero too.
	* function.h (struct function): Add cfg field.
	* function.c (allocate_struct_function): Allocate the cfg.
	* tree-cfg.c (label_to_block_map): Remove.
	(build_tree_cfg): Don't allocate the rbi pool here...
	(delete_tree_cfg_annotations): ...and don't free it here.
	Also don't nullify label_to_block_map for cfun.

Co-Authored-By: Jan Hubicka <jh@suse.cz>
Co-Authored-By: Stuart Hastings <stuart@apple.com>

From-SVN: r98048
2005-04-12 21:33:53 +00:00
Caroline Tice c3c822d506 Revert patch from April 9.
From-SVN: r98039
2005-04-12 13:39:09 -07:00
Caroline Tice e5e625da47 Fix problems with labels with hot/cold partitioning.
From-SVN: r97928
2005-04-09 13:41:49 -07:00
Alan Modra 8785e81a28 passes.c (rest_of_handle_final): NULL unlikely_text_section_name after freeing.
* passes.c (rest_of_handle_final): NULL unlikely_text_section_name
	after freeing.

From-SVN: r97536
2005-04-04 21:23:15 +09:30
Nathan Sidwell e16acfcd14 params.c (set_param_value): Use gcc_assert & gcc_unreachable.
* params.c (set_param_value): Use gcc_assert & gcc_unreachable.
	* passes.c (open_dump_file, rest_of_handle_final): Likewise.
	* postreload-gcse.c (expr_equiv_p, oprs_unchanged_p,
	hash_scan_set, reg_set_between_after_reload_p,
	reg_used_between_after_reload_p, get_avail_load_store_reg,
	eliminate_partially_redundant_load): Likewise.
	* postreload.c (reload_cse_simplify_set,
	reload_combine_note_use): Likewise.
	* predict.c (predict_insn, expected_value_to_br_prob,
	propagate_freq, expensive_function_p): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* profile.c (instrument_edges, instrument_values,
	compute_branch_probabilities, branch_prob, union_groups,
	tree_register_profile_hooks, rtl_register_profile_hooks): Likewise.
	* protoize.c (in_system_include_dir, file_could_be_converted,
	file_normally_convertible, gen_aux_info_file, seek_to_line,
	do_cleaning): Likewise.
	* tree-ssa-alias.c (collect_points_to_info_r): Likewise.
	* tree-ssa-ccp.c (execute_fold_all_builtins): Likewise.
	* tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise.

From-SVN: r97485
2005-04-03 10:27:51 +00:00
Mostafa Hagog f73d56667d cfg.c (clear_bb_flags): Don't clear BB_DISABLE_SCHEDULE.
2005-03-31 Mostafa Hagog <mustafa@il.ibm.com>

        * cfg.c (clear_bb_flags): Don't clear BB_DISABLE_SCHEDULE.
        * modulo-sched.c (undo_replace_buff_elem): New structure.
        (kernel_number_of_cycles, ps_unschedule_node,
        undo_generate_reg_moves,free_undo_replace_buff,
        undo_permute_partial_schedule,  loop_single_full_bb_p,
        SIMPLE_SMS_LOOP_P, loop_canon_p, canon_loop,
        build_loops_structure, get_sched_window): New.
        (generate_reg_moves): Return undo_replace_buff_elem and other
        fixes.
        (generate_prolog_epilog): Remove old loop versioning.
        (sms_schedule): Use loop information and loop_version.
        (sms_schedule_by_order): Split part of it to get_sched_window.
        * passes.c (rest_of_handle_sms): call cfg_layout_initialize
        cfg_layout_finalize and free_dominance_info before/after SMS.

From-SVN: r97484
2005-04-03 09:27:07 +00:00
Kazu Hirata aabcd30904 cgraphunit.c, [...]: Fix comment typos.
* cgraphunit.c, dbxout.c, flow.c, gcse.c, gimplify.c,
	lambda-code.c, loop.c, machmode.def, mips-tfile.c,
	modulo-sched.c, passes.c, postreload-gcse.c, tree-eh.c,
	tree-ssa-ccp.c, varasm.c, config/frv/frv.c, config/frv/frv.h,
	config/frv/frv.md, config/i386/i386.c, config/i386/i386.h,
	config/i386/i386.md, config/rs6000/predicates.md,
	config/rs6000/rs6000.c, config/s390/fixdfdi.h,
	config/s390/s390.c, config/stormy16/stormy16.c,
	config/stormy16/stormy16.md, config/vax/vax.md: Fix comment
	typos.

From-SVN: r97362
2005-04-01 03:42:55 +00:00
Caroline Tice 87c8b4bed3 Fix problems with hot/cold partitioning optimization.
From-SVN: r97322
2005-03-31 06:59:59 -08:00
Jan Hubicka cd9c7bd28b [multiple changes]
2005-03-31  Jan Hubicka  <jh@suse.cz>

	2004-11-02  Jan Hubicka  <jh@suse.cz>

	* cgraph.c (cgraph_varpool_node_name): New function.
	(dump_cgraph_varpool_node): New function.
	(dump_varpool): New function.
	* cgraphunit.c (cgraph_optimize): Dump varpool.

	2004-10-16  Jan Hubicka  <jh@suse.cz>

	* cgraph.c (decide_is_variable_needed): New function.
	(cgraph_varpool_finalize_decl): Use it.
	* cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing
	unit-at-a-time.
	* final.c (output_addr_const): Do not call mark_referenced.
	* passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack;
	always go via cgraph.
	* toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code.
	(check_global_declarations): Ifdef out code clearing DECL_RTL.
	* tree-optimize.c (execute_inline): Mark functions called.
	* i386.c (output_pic_addr_const): Do not call mark_decl_referenced.

	2004-10-11  Jan Hubicka  <jh@suse.cz>

	* cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable
	(cgraph_varpool_last_needed_node): New static variable.
	(enqueue_needed_varpool_node): Break out from ...; add items to the
	end of queue; update first pointers.
	(cgraph_varpool_mark_needed_node): ... here.
	(cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node.
	(cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c
	* cgraph.h (cgraph_varpool_node): Add analyzed field.
	(cgraph_varpool_first_unanalyzed_node): Declare.
	* cgraphunit.c: Include output.h.
	(cgraph_varpool_analyze_pending_decls): New function.
	(cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out
	for errors, analyze pending decls.
	(cgraph_finalize_compilation_unit): Only analyze decls.
	(cgraph_optimize): Assemble the decls after expanding.

From-SVN: r97287
2005-03-30 22:28:02 +00:00
Ian Lance Taylor c9d691e977 final.c (final): Remove prescan parameter.
* final.c (final): Remove prescan parameter.  Change all callers.
	(final_scan_insn): Remove prescan parameter.  Change all callers.

From-SVN: r97267
2005-03-30 18:53:35 +00:00