Skip to content
Snippets Groups Projects
  1. Jan 18, 2006
    • Diego Novillo's avatar
      [multiple changes] · 953ff289
      Diego Novillo authored
      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
      953ff289
  2. Nov 21, 2005
    • Richard Henderson's avatar
      c-common.c, [...]: Revert 2005-11-18 lookup_name patch. · 10e6657a
      Richard Henderson authored
      gcc/
              * c-common.c, config/darwin-c.c, c-decl.c, c-tree.h, c-objc-common.h,
              langhooks-def.h, langhooks.h: Revert 2005-11-18 lookup_name patch.
              * c-tree.h (lookup_name): Move declaration ...
              * c-common.h (lookup_name): ... here.
              * config/darwin-c.c: Include c-common.h.
              * config/t-darwin: Update dependencies.
      gcc/cp/
              * cp-objcp-common.h, name-lookup.c, name-lookup.h: Revert 11-18 patch.
              * name-lookup.c (lookup_name): Remove prefer_type argument.
              (lookup_name_prefer_type): New.
              * decl.c (lookup_and_check_tag): Use them.
              * pt.c (tsubst_friend_class): Likewise.
              (lookup_template_class): Likewise.
              (tsubst_copy_and_build): Likewise.
              * name-lookup.h (lookup_name_prefer_type): New.
              (lookup_name): Remove declaration.
      
      From-SVN: r107325
      10e6657a
  3. Nov 18, 2005
    • Mike Stump's avatar
      c-common.c (handle_cleanup_attribute): Use a lang hook for lookup_name. · 7bbd0aab
      Mike Stump authored
      	* c-common.c (handle_cleanup_attribute): Use a lang hook for lookup_name.
      	* config/darwin-c.c (darwin_pragma_unused): Likewise.
      	* c-decl.c (lookup_name_two) Remove.
      	* c-tree.h (lookup_name_two): Remove.
      	* c-objc-common.h (LANG_HOOKS_LOOKUP_NAME): Add.
      	* langhooks-def.h (LANG_HOOKS_LOOKUP_NAME): Add.
      	(LANG_HOOKS_DECLS): Add initializer for LANG_HOOKS_LOOKUP_NAME.
      	* langhooks.h (lang_hooks_for_decls): Add lookup_name.
      
      cp:
      	* cp-objcp-common.h (LANG_HOOKS_LOOKUP_NAME): Add.
      	* name-lookup.c (lookup_name_two): Remove.
      	(lookup_name_one): Add.
      	* name-lookup.h (lookup_name_two): Remove.
      	(lookup_name_one): Add.
      
      From-SVN: r107196
      7bbd0aab
  4. Jul 05, 2005
    • Joseph Myers's avatar
      re PR c/22013 (ICE in gimple_add_tmp_var, at gimplify.c:535) · 73f397d4
      Joseph Myers authored
      	PR c/22013
      	PR c/22098
      	* langhooks.h (struct lang_hooks): Add expr_to_decl.
      	* langhooks.c (lhd_expr_to_decl): New.
      	* langhooks-def.h (lhd_expr_to_decl, LANG_HOOKS_EXPR_TO_DECL):
      	New.
      	(LANG_HOOKS_INITIALIZER): Update.
      	* tree.c (recompute_tree_invarant_for_addr_expr): Call
      	expr_to_decl langhook.
      	* c-tree.h (c_expr_to_decl): Declare.
      	* c-typeck.c (c_expr_to_decl): New.
      	(build_unary_op): Do not handle ADDR_EXPR of COMPOUND_LITERAL_EXPR
      	specially.
      	* c-objc-common.h (LANG_HOOKS_EXPR_TO_DECL): Define.
      
      testsuite:
      	* gcc.c-torture/compile/pr22013-1.c,
      	gcc.c-torture/execute/pr22098-1.c,
      	gcc.c-torture/execute/pr22098-2.c,
      	gcc.c-torture/execute/pr22098-3.c: New tests.
      
      From-SVN: r101630
      73f397d4
  5. Jun 25, 2005
  6. Mar 23, 2005
    • Joseph Myers's avatar
      langhooks.h (truthvalue_conversion): Remove. · d101034c
      Joseph Myers authored
      	* langhooks.h (truthvalue_conversion): Remove.
      	* langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove
      	LANG_HOOKS_TRUTHVALUE_CONVERSION.
      	* system.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Poison.
      	* gimplify.c (gimple_boolify): Don't use truthvalue_conversion.
      	* c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
      
      ada:
      	* misc.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
      
      cp:
      	* cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
      
      fortran:
      	* f95-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
      
      java:
      	* lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
      
      treelang:
      	* treetree.c (LANG_HOOKS_TRUTHVALUE_CONVERSION,
      	tree_lang_truthvalue_conversion): Remove.
      	* tree-convert.c: Don't call truthvalue_conversion.
      
      From-SVN: r96947
      d101034c
    • Joseph Myers's avatar
      c-common.c (c_common_truthvalue_conversion): Adjust comment. · 85498824
      Joseph Myers authored
      	* c-common.c (c_common_truthvalue_conversion): Adjust comment.
      	Call c_common_truthvalue_conversion rather than
      	lang_hooks.truthvalue_conversion.
      	* c-convert.c (convert): Call c_objc_common_truthvalue_conversion.
      	* c-objc-common.c (c_objc_common_truthvalue_conversion): Move to
      	c-typeck.c.
      	* c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Change to
      	c_common_truthvalue_conversion.
      	* c-parser.c (c_parser_paren_condition, c_parser_for_statement,
      	c_parser_conditional_expression, c_parser_binary_expression): Call
      	c_objc_common_truthvalue_conversion.
      	* c-typeck.c (build_unary_op): Call
      	c_objc_common_truthvalue_conversion.
      	(build_conditional_expr): Do not call
      	lang_hooks.truthvalue_conversion.
      	(build_binary_op): Call c_common_truthvalue_conversion.
      	(c_objc_common_truthvalue_conversion): Moved from
      	c-objc-common.c.  Call default_function_array_conversion instead
      	of default_conversion.
      
      objc:
      	* objc-act.c (next_sjlj_build_enter_and_setjmp,
      	next_sjlj_build_catch_list, next_sjlj_build_try_catch_finally):
      	Call c_common_truthvalue_conversion.
      
      From-SVN: r96917
      85498824
  7. Feb 21, 2005
    • Kazu Hirata's avatar
      c-objc-common.h, [...]: Update copyright. · a4de48bc
      Kazu Hirata authored
      	* c-objc-common.h, c-pretty-print.c, cgraphunit.c, except.c,
      	genautomata.c, langhooks.c, langhooks.h, system.h,
      	config/arm/lib1funcs.asm: Update copyright.
      
      From-SVN: r95331
      a4de48bc
  8. Feb 20, 2005
    • Zack Weinberg's avatar
      re PR middle-end/18785 (isdigit builtin function fails with EBCDIC character sets) · c5ff069d
      Zack Weinberg authored
      	PR 18785
      libcpp:
      	* charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
      	(cpp_host_to_exec_charset): New function.
      	* include/cpplib.h: Declare cpp_host_to_exec_charset.
      
      gcc:
      	* langhooks.h (struct lang_hooks): Add to_target_charset.
      	* langhooks.c (lhd_to_target_charset): New function.
      	* langhooks-def.h: Declare lhd_to_target_charset.
      	(LANG_HOOKS_TO_TARGET_CHARSET): New macro.
      	(LANG_HOOKS_INITIALIZER): Update.
      	* c-common.c (c_common_to_target_charset): New function.
      	* c-common.h: Declare it.
      	* c-objc-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
      	c_common_to_target_charset.
      
      	* defaults.c (TARGET_BELL, TARGET_BS, TARGET_CR, TARGET_DIGIT0)
      	(TARGET_ESC, TARGET_FF, TARGET_NEWLINE, TARGET_TAB, TARGET_VT):
      	Delete definitions.
      	* system.h: Poison them.
      	* doc/tm.texi: Don't discuss them.
      	* builtins.c (fold_builtin_isdigit): Use lang_hooks.to_target_charset.
      	* c-pretty-print.c (pp_c_integer_constant): Don't use pp_c_char.
      	(pp_c_char): Do not attempt to generate letter escapes for
      	newline, tab, etc.
      	* config/arm/arm.c (output_ascii_pseudo_op): Likewise.
      	* config/mips/mips.c (mips_output_ascii): Likewise.
      gcc/cp:
      	* cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
      	c_common_to_target_charset.  Delete bogus comment.
      gcc/testsuite:
      	* gcc.dg/charset/builtin1.c: New test.
      
      From-SVN: r95304
      c5ff069d
  9. Nov 02, 2004
    • Ziemowit Laski's avatar
      c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove. · 65958285
      Ziemowit Laski authored
      [gcc/ChangeLog]
      2004-11-02  Ziemowit Laski  <zlaski@apple.com>
      
      	* c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove.
      	(c_types_compatible_p): Move function definition...
      	* c-objc-common.c (c_types_compatible_p): ...here.
      	* c-objc-common.h (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from
      	c-lang.c.
      
      [gcc/cp/ChangeLog]
      2004-11-02  Ziemowit Laski  <zlaski@apple.com>
      
      	* cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
      	(LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
      	* cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
      	from cp-lang.c.
      	* cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
      	from cp-lang.c.
      	(LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
      
      From-SVN: r89997
      65958285
  10. Aug 15, 2004
    • Ziemowit Laski's avatar
      Makefile.in (C_PRETTY_PRINT_H): Add c-pretty-print.h. · 9a4d6480
      Ziemowit Laski authored
      [gcc/ChangeLog]
      2004-08-15  Ziemowit Laski  <zlaski@apple.com>
      
             * Makefile.in (C_PRETTY_PRINT_H): Add c-pretty-print.h.
             (c-lang.o): Depend on c-objc-common.h.
             (c-objc-common.o): Depend on $(C_PRETTY_PRINT_H) and
             c-objc-common.h; remove duplicate $(C_TREE_H) dependency.
             * c-lang.c: Include c-objc-common.h.
             (LANG_HOOKS_FINISH, LANG_HOOKS_INIT_OPTIONS,
             LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
             LANG_HOOKS_MISSING_ARGUMENT, LANG_HOOKS_POST_OPTIONS,
             LANG_HOOKS_GET_ALIAS_SET, LANG_HOOKS_SAFE_FROM_P,
             LANG_HOOKS_EXPAND_EXPR, LANG_HOOKS_MARK_ADDRESSABLE,
             LANG_HOOKS_PARSE_FILE, LANG_HOOKS_TRUTHVALUE_CONVERSION,
             LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL,
             LANG_HOOKS_STATICP, LANG_HOOKS_SET_DECL_ASSEMBLER_NAME,
             LANG_HOOKS_NO_BODY_BLOCKS, LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL,
             LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_FUNCTION_ENTER_NESTED,
             LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_DUP_LANG_SPECIFIC_DECL,
             LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT,
             LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
             LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
             LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS,
             LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
             LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING,
             LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
             LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
             LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_TYPE_FOR_MODE,
             LANG_HOOKS_TYPE_FOR_SIZE, LANG_HOOKS_SIGNED_TYPE,
             LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE,
             LANG_HOOKS_INCOMPLETE_TYPE_ERROR, LANG_HOOKS_TYPE_PROMOTES_TO,
             LANG_HOOKS_REGISTER_BUILTIN_TYPE, LANG_HOOKS_WRITE_GLOBALS):
             Move to c-objc-common.h.
             * c-objc-common.c: Include c-objc-common.h.
             * c-objc-common.h: New file.
      
      [gcc/objc/ChangeLog]
      2004-08-15  Ziemowit Laski  <zlaski@apple.com>
      
             * Make-lang.in (objc/objc-lang.o): Depend on $(C_PRETTY_PRINT_H),
             $(DIAGNOSTIC_H), c-objc-common.h and gtype-objc.h, but not on toplev.h.
             (objc/objc-parse.o): Do not depend on gtype-objc.h.
             * objc-act.c: Do not include gtype-objc.h.
             (finish_file): Rename to objc_finish_file().
             * objc-act.h (finish_file): Update copyright notice; remove prototype.
             * objc-lang.c: Update copyright notice; include diagnostic.h,
             c-objc-common.h, c-pretty-print.h and gtype-objc.h; do not include
             toplev.h.
             (finish_file): New hook routine.
             (LANG_HOOKS_FINISH, LANG_HOOKS_INIT_OPTIONS,
             LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION,
             LANG_HOOKS_MISSING_ARGUMENT, LANG_HOOKS_POST_OPTIONS,
             LANG_HOOKS_GET_ALIAS_SET, LANG_HOOKS_SAFE_FROM_P,
             LANG_HOOKS_EXPAND_EXPR, LANG_HOOKS_MARK_ADDRESSABLE,
             LANG_HOOKS_PARSE_FILE, LANG_HOOKS_TRUTHVALUE_CONVERSION,
             LANG_HOOKS_FINISH_INCOMPLETE_DECL, LANG_HOOKS_UNSAFE_FOR_REEVAL,
             LANG_HOOKS_STATICP, LANG_HOOKS_SET_DECL_ASSEMBLER_NAME,
             LANG_HOOKS_NO_BODY_BLOCKS, LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL,
             LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_FUNCTION_ENTER_NESTED,
             LANG_HOOKS_FUNCTION_LEAVE_NESTED, LANG_HOOKS_DUP_LANG_SPECIFIC_DECL,
             LANG_HOOKS_DECL_UNINIT, LANG_HOOKS_RTL_EXPAND_STMT,
             LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE,
             LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN,
             LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS,
             LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P,
             LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING,
             LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
             LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN,
             LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_TYPE_FOR_MODE,
             LANG_HOOKS_TYPE_FOR_SIZE, LANG_HOOKS_SIGNED_TYPE,
             LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE,
             LANG_HOOKS_INCOMPLETE_TYPE_ERROR, LANG_HOOKS_TYPE_PROMOTES_TO,
             LANG_HOOKS_REGISTER_BUILTIN_TYPE, LANG_HOOKS_WRITE_GLOBALS):
             Move to c-objc-common.h.
      
      From-SVN: r86037
      9a4d6480
  11. Jul 28, 2004
    • Eric Christopher's avatar
      c-common.c (c_common_unsafe_for_reeval): Delete. · 9f63daea
      Eric Christopher authored
      2004-07-28  Eric Christopher  <echristo@redhat.com>
      
      	* c-common.c (c_common_unsafe_for_reeval): Delete.
      	* c-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete use.
      	* c-pretty-print.c (pp_c_expression): Delete UNSAVE_EXPR case.
      	* calls.c (fix_unsafe_tree): Delete.
      	(expand_call): Delete code which used above.
      	* dojump.c (do_jump): Delete UNSAVE_EXPR case.
      	* expr.c (expand_expr_real_1): Ditto.
      	* fold-const.c (non_lvalue): Ditto.
      	* langhooks-def.h (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
      	(lhd_unsafe_for_reeval): Ditto.
      	* langhooks.c (lhd_unsafe_for_reeval): Ditto.
      	* langhooks.h (unsafe_for_reeval): Ditto.
      	(unsave_expr_now): Adjust comment.
      	* tree-inline.c (copy_body_r): Delete UNSAVE_EXPR bits.
      	(estimate_num_insns_1): Ditto.
      	* tree-pretty-print.c (dump_generic_node): Ditto.
      	* tree.c (expr_align): Ditto.
      	(unsave_expr): Delete.
      	(unsafe_for_reeval): Ditto.
      	* tree.h (unsafe_for_reeval, unsave_expr): Ditto.
      	* tree.def (UNSAVE_EXPR): Delete.
      	* objc/objc-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
      
      2004-07-28  Eric Christopher  <echristo@redhat.com>
      
      	* cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
      
      2004-07-28  Eric Christopher  <echristo@redhat.com>
      
      	* lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
      	(java_unsafe_for_reeval): Ditto.
      
      From-SVN: r85276
      9f63daea
  12. Jul 11, 2004
    • Joseph Myers's avatar
      langhooks.h (estimate_num_insns, [...]): Remove hooks. · 9dcf6e73
      Joseph Myers authored
      	* langhooks.h (estimate_num_insns, pushlevel, poplevel, set_block,
      	maybe_build_cleanup, update_decl_after_saving): Remove hooks.
      	* langhooks.c (lhd_clear_binding_stack): Remove.
      	* langhooks-def.h (lhd_clear_binding_stack,
      	LANG_HOOKS_MAYBE_BUILD_CLEANUP,
      	LANG_HOOKS_UPDATE_DECL_AFTER_SAVING,
      	LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS, LANG_HOOKS_PUSHLEVEL,
      	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
      	(LANG_HOOKS_CLEAR_BINDING_STACK): Define to lhd_do_nothing.
      	* system.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS,
      	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_SET_BLOCK,
      	LANG_HOOKS_MAYBE_BUILD_CLEANUP,
      	LANG_HOOKS_UPDATE_DECL_AFTER_SAVING, LANG_HOOKS_POPLEVEL): Poison.
      	* tree.h (poplevel): Don't declare.
      	* c-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL,
      	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
      	* objc/objc-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK,
      	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK):
      	Remove.
      
      ada:
      	* misc.c (LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_PUSHLEVEL,
      	LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK): Remove.
      
      cp:
      	* cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL,
      	LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove.
      	* cp-tree.h (poplevel): Declare.
      	(set_block): Remove.
      	* decl.c (set_block): Remove.
      
      fortran:
      	* f95-lang.c (set_block): Remove.
      	(gfc_clear_binding_stack): New.
      	(LANG_HOOKS_CLEAR_BINDING_STACK): Define.
      	(struct binding_level): Remove block_created_by_back_end.
      	(clear_binding_level): Likewise.
      	(poplevel): Don't handle block_created_by_back_end.
      
      java:
      	* java-tree.h (set_block): Remove.
      	* lang.c (java_clear_binding_stack): New.
      	(LANG_HOOKS_CLEAR_BINDING_STACK): Define.
      	* decl.c (struct binding_level): Remove this_block.
      	(clear_binding_level): Likewise.
      	(poplevel): Don't handle this_block.
      	(set_block): Remove.
      
      treelang:
      	* treetree.c (set_block): Remove.
      	(struct binding_level): Remove block_created_by_back_end.
      	(clear_binding_level): Likewise.
      	(tree_code_create_function_initial,
      	tree_code_create_function_wrapup): Call pushlevel and poplevel
      	directly rather than through hooks.
      	(poplevel): Don't handle block_created_by_back_end.
      
      From-SVN: r84499
      9dcf6e73
  13. Jul 08, 2004
    • Zack Weinberg's avatar
      c-decl.c (static_ctors, [...]): Make static. · 36c1b0de
      Zack Weinberg authored
      	* c-decl.c (static_ctors, static_dtors): Make static.
      	(pop_file_scope): Call c_common_write_pch and
      	cgraph_finalize_compilation_unit here.
      	(build_cdtor): Moved here from c-objc-common.c; simplify.
      	(c_write_global_declarations_1): Clarify comment.
      	(c_write_global_declarations): Close the external scope before
      	doing anything else.  Call build_cdtor, cgraph_optimize, and
      	mudflap_finish_file here.
      	* c-lang.c (finish_file): Don't call c_objc_common_finish_file.
      	Clarify comment.
      	* c-objc-common.c: No need to include cgraph.h.
      	(build_cdtor): Moved to c-decl.c.
      	(c_objc_common_finish_file): Delete.
      	* c-tree.h: Update to match.
      	* objc/objc-act.c (finish_file): Don't call c_objc_common_finish_file.
      	(generate_static_references): Set TREE_USED before calling finish_decl.
      	Eliminate unnecessary dummy declaration.  Call rest_of_decl_compilation
      	on the static_instances_decl.
      
      From-SVN: r84307
      36c1b0de
    • Joseph Myers's avatar
      re PR c/2511 (-pedantic not warning about bitfield overflow) · bc15d0ef
      Joseph Myers authored
      
      2004-07-08  Joseph S. Myers  <jsm@polyomino.org.uk>
                  Neil Booth  <neil@daikokuya.co.uk>
      
      	PR c/2511
      	PR c/3325
      	* c-decl.c (finish_struct): Ensure bit-fields are given the
      	correct type.
      	* c-common.c (c_common_signed_or_unsigned_type): For C, require
      	the precision to match as well as the mode.
      	* expr.c (reduce_to_bit_field_precision): New function.
      	(expand_expr_real_1): Reduce expressions of bit-field type to
      	proper precision.
      	* langhooks.h (reduce_bit_field_operations): New hook.
      	* langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS):
      	Define.
      	* c-lang.c, objc/objc-lang.c
      	(LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
      	* objc/objc-act.c (check_ivars): Convert types to bit-field types
      	before checking.
      	* tree.c (build_nonstandard_integer_type): New function.
      	* tree.h (build_nonstandard_integer_type): New prototype.
      	* tree-ssa.c (tree_ssa_useless_type_conversion_1): Don't treat
      	conversions between integer and boolean types as useless.
      
      testsuite:
      	* gcc.c-torture/execute/bitfld-1.x: Remove.
      	* gcc.c-torture/execute/bitfld-3.c: New test.
      	* gcc.dg/bitfld-2.c: Remove XFAILs.
      
      Co-Authored-By: default avatarNeil Booth <neil@daikokuya.co.uk>
      
      From-SVN: r84279
      bc15d0ef
  14. Jul 05, 2004
    • Zack Weinberg's avatar
      langhooks.c: Don't include gt-langhooks.h. · 6de66680
      Zack Weinberg authored
      	* langhooks.c: Don't include gt-langhooks.h.
      	(var_labelno): Delete.
      	(lhd_set_decl_assembler_name): Do not append a distinguishing
      	number to file-scope internal-linkage declarations for the first
      	input file, even if they have DECL_CONTEXT set.  Use DECL_UID of
      	the declaration itself (if at block scope), or its containing
      	TRANSLATION_UNIT_DECL (if at file scope) for the distinguishing
      	number.
      
      	* opts.c (cur_in_fname): New global.
      	* opts.h: Declare it.
      	* tree.c: Include opts.h.
      	(make_node_stat): If creating a TRANSLATION_UNIT_DECL, give it
      	DECL_UID equal to cur_in_fname.
      	(copy_node_stat): Do not change DECL_UID when copying a
      	TRANSLATION_UNIT_DECL.
      	(build_common_tree_nodes): Adjust next_decl_uid to reserve the
      	range 0 .. num_in_fnames-1 for TRANSLATION_UNIT_DECLs.
      
      	* c-decl.c (c_static_assembler_name): Delete.
      	* c-tree.h (c_static_assembler_name): Delete prototype.
      	* c-lang.c, objc/objc-lang.c: Don't override
      	LANG_HOOKS_SET_DECL_ASSEMBLER_NAME.
      
      	* Makefile.in (tree.o): Update dependencies.
      	(GTFILES): Remove langhooks.c.
      
      cp:
      	* decl.c (cxx_init_decl_processing): Call
      	build_common_tree_nodes before creating the global NAMESPACE_DECL.
      
      From-SVN: r84123
      6de66680
  15. Jul 01, 2004
    • Joseph Myers's avatar
      re PR c/1027 (slightly misleading printf format warning) · ede1a387
      Joseph Myers authored
      	PR c/1027
      	* c-lang.c (c_initialize_diagnostics): Move from here ...
      	* c-objc-common.c: ... to here.  Include "c-pretty-print.h".
      	(c_tree_printer): Use pretty-printer to format %T.
      	* c-pretty-print.c (pp_c_specifier_qualifier_list): Include space
      	before '*' if not C++.
      	(pp_c_direct_abstract_declarator): Don't try to print array upper
      	bound for flexible array members.
      	* c-tree.h: Include "diagnostic.h".
      	(c_initialize_diagnostics): Declare.
      	* objc/objc-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Define.
      	* c-format.c (format_type_warning): New function.  Improve
      	diagnostics for incorrect format argument types.
      	(check_format_types): Use it.  Add two parameters.  Use the
      	TYPE_MAIN_VARIANT of wanted_type.
      	(check_format_info_main): Pass new parameters to
      	check_format_types.
      	(struct format_wanted_type): Update comment.
      
      testsuite:
      	* gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c,
      	gcc.dg/format/branch-1.c, gcc.dg/format/diag-1.c,
      	gcc.dg/format/multattr-3.c, gcc.dg/format/xopen-1.c: Update
      	expected warning text.
      	* gcc.dg/format/diag-2.c: New test.
      
      From-SVN: r83965
      ede1a387
  16. Jun 26, 2004
    • Richard Kenner's avatar
      c-common.c (c_safe_from_p, [...]): Deleted. · 350fae66
      Richard Kenner authored
      2004-06-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
      
              * c-common.c (c_safe_from_p, c_walk_subtrees): Deleted.
              * c-common.def (DECL_STMT): Remove.
              * c-common.h (DECL_STMT_DECL): Deleted.
              (COMPOUNT_LITERAL_EXPR_DECL): Use DECL_EXPR_DECL.
              (c_safe_from_p, c_walk_subtrees): Deleted.
              * c-decl.c, c-parse.in, c-pretty-print.c: DECL_STMT now DECL_EXPR.
              * c-dump.c (c_dump_tree, case DECL_STMT): Deleted.
              * c-gimplify.c (gimplify_decl_stmt): Deleted.
              (gimplify_compound_literal_expr): Use DECL_EXPR_DECL
              and gimplify_and_add.
              (c_gimplify_expr, case DECL_EXPR): New case.
              (c_gimplify_expr, case DECL_STMT): Deleted.
              * c-lang.c (LANG_HOOKS_SAFE_FROM_P): Likewise.
              (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise.
              * expr.c (safe_from_p, case 's'): New case.
              * gimplify.c (gimplify_decl_expr): New function.
              (gimplify_expr, case DECL_EXPR): New case.
              * tree-inline.c (walk_tree): Walk into all fields of a type and
              decl only if they are in a DECL_EXPR.
              (mark_local_for_remap_r): Minor code cleanup.
              * tree-outof-ssa.c (discover_nonconstant_array_refs_r): Add else.
              * tree.c (has_cleanups, case DECL_EXPR): New case.
              * tree.def (DECL_EXPR): New code.
              * tree.h (DECL_EXPR_DECL): New macro.
      
              * objc/objc-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted.
      
      From-SVN: r83721
      350fae66
  17. Jun 16, 2004
    • Richard Henderson's avatar
      c-common.c (lang_gimplify_stmt): Remove next_p argument. · 325c3691
      Richard Henderson authored
      	* c-common.c (lang_gimplify_stmt): Remove next_p argument.
      	(if_elt, if_stack, if_stack_space, c_expand_start_cond, c_finish_then,
      	c_expand_end_cond, c_expand_start_else, c_finish_else, c_begin_if_stmt,
      	c_begin_while_stmt, c_finish_while_stmt_cond): Move to c-typeck.c.
      	(finish_fname_decls, fname_decl): Use statement_lists.
      	(c_expand_expr_stmt): Don't set last_expr_type.
      	(c_type_hash): Fix indentation.
      	(c_safe_from_p): Don't follow TREE_CHAIN.
      	(c_tree_chain_matters_p): Remove.
      	* c-common.def (SCOPE_STMT): Remove.
      	(CLEANUP_STMT): Redefine to contain its own body.
      	* c-common.h (struct stmt_tree_s): Remove x_last_stmt,
      	x_last_expr_type, x_last_expr_filename, x_scope_stmt_stack.
      	Add x_cur_stmt_list.
      	(last_tree, last_expr_type, last_expr_filename, RECHAIN_STMTS): Remove.
      	(cur_stmt_list): New.
      	(STATEMENT_LIST_STMT_EXPR): New.
      	(SCOPE_BEGIN_P, SCOPE_END_P, SCOPE_STMT_BLOCK, SCOPE_NULLIFIED_P,
      	SCOPE_NO_CLEANUPS_P, SCOPE_PARTIAL_P, NEW_FOR_SCOPE_P): Remove.
      	(CLEANUP_BODY): New.
      	(CLEANUP_DECL): Move to operand 2.
      	(c_common_stmt_codes): Remove SCOPE_STMT.
      	(COMPOUND_STMT_NO_SCOPE, COMPOUND_STMT_BODY_BLOCK): Remove.
      	* c-decl.c (c_scope_stmt_stack, current_scope_stmt_stack): Remove.
      	(c_push_function_context, c_pop_function_context): Don't save it.
      	(finish_decl): Set TREE_USED on the decl for a cleanup.
      	Use push_cleanup.
      	(store_parm_decls): Use statement lists.
      	(finish_function): Remove compstmt rule workaround.  Use statement
      	lists.  Call finish_fname_decls after finalizing the body.
      	(c_begin_compound_stmt): Move to c-typeck.c.
      	* c-dump.c (c_dump_tree): Remove SCOPE_STMT.
      	* c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts): New.
      	(c_genericize): Invoke them.
      	(c_gimplify_stmt): Don't look through TREE_CHAIN.  Kill SCOPE_STMT.
      	(c_build_bind_expr): Export.
      	(gimplify_block, gimplify_cleanup): Remove.
      	(gimplify_condition): Use gimplify_stmt.
      	(gimplify_for_stmt): Remove FOR_INIT_STMT chaining hack.
      	(gimplify_if_stmt): Remove recursion hack.
      	(c_gimplify_expr): Remove STMT_EXPR handling.
      	(stmt_expr_last_stmt, gimplify_stmt_expr): Remove.
      	(is_last_stmt_of_scope): Remove.
      	* c-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
      	* c-mudflap.c (mflang_flush_calls): Use c_begin_compound_stmt,
      	c_end_compound_stmt.
      	* c-objc-common.c (build_cdtor): Likewise.
      	* c-parse.in (primary): Use c_finish_stmt_expr.
      	(push_scope, pop_scope): Remove.
      	(c99_block_start, compstmt_start): Use c_begin_compound_stmt.
      	(c99_block_end, compstmt): Use c_end_compound_stmt.
      	(c99_block_lineno_labeled_stmt): Likewise.
      	(compstmt_primary_start): Use c_begin_stmt_expr.
      	(simple_if, select_or_iter_stmt): Update calls to stmt builders.
      	(do_stmt_start): Fill in body directly.
      	(lineno_stmt): Avoid setting lineno on constants.
      	* c-pretty-print.c (pp_c_statement): Handle STATEMENT_LIST.
      	Remove SCOPE_STMT.
      	* c-semantics.c (begin_stmt_tree): Remove.
      	(push_stmt_list, re_push_stmt_list, pop_stmt_list): New.
      	(add_stmt): Use statement lists.
      	(add_scope_stmt, finish_stmt_tree): Remove.
      	(push_cleanup): New.
      	* c-tree.h: Move some decls from c-common.h.
      	* c-typeck.c (c_tree_expr_nonnegative_p): Simplify for statement lists.
      	(do_case, c_finish_case): Likewise.
      	(c_finish_then): Take body for then as argument.
      	(c_finish_else): Similarly.
      	(c_begin_for_stmt, c_finish_for_stmt_init, c_finish_for_stmt_cond,
      	c_finish_for_stmt_incr, c_finish_for_stmt): New.
      	(c_begin_stmt_expr, c_finish_stmt_expr): New.
      	(c_begin_compound_stmt): Do scope management.
      	(c_end_compound_stmt): New.
      	* fold-const.c (tree_expr_nonnegative_p): Fix BIND_EXPR.
      	* gimplify.c (voidify_wrapper_expr): Accept temporary argument.
      	Look through exception handling constructs.
      	(gimplify_bind_expr): Accept temporary argument.
      	(gimplify_target_expr): Special case BIND_EXPR bodies.
      	(gimplify_expr): Handle fallback == fb_none like a statement.
      	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Kill.
      	* langhooks.c (lhd_tree_inlining_tree_chain_matters_p): Remove.
      	* langhooks.h (tree_chain_matters_p): Remove.
      	* stub-objc.c (objc_clear_super_receiver): New.
      	* tree-gimple.h (voidify_wrapper_expr): Update decl.
      	(append_to_statement_list, append_to_statement_list_force): Move
      	to tree-iterator.h.
      	* tree-inline.c (expand_call_inline): Update call.
      	(clone_body): Use statement lists.
      	(walk_tree): Don't check tree_chain_matters_p.
      	(copy_tree_r): Likewise.
      	* tree-iterator.c (alloc_stmt_list): Clear lang bits.
      	(tsi_link_before, tsi_link_after): Set TREE_SIDE_EFFECTS properly.
      	* tree-iterator.h (append_to_statement_list,
      	append_to_statement_list_force): Moved from tree-gimple.h.
      	* tree-pretty-print.c (dump_generic_node): Clean up TARGET_EXPR dump.
      	* objc/objc-act.c (build_module_descriptor): Use c_begin_compound_stmt.
      	(objc_enter_block): Likewise.
      	(objc_exit_block): Use c_end_compound_stmt.
      	(objc_build_try_enter_fragment): Add #error and comment for
      	rewriting for OBJCPLUS.
      	(objc_build_extract_fragment, objc_build_try_epilogue,
      	objc_build_catch_stmt, objc_build_finally_prologue,
      	objc_build_finally_epilogue): Update for C statement builders.
      	* objc/objc-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P):
      	Remove.
      cp/
      	* call.c (initialize_reference): Don't build CLEANUP_STMT here.
      	* cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument.
      	(genericize_try_block): Use gimplify_stmt.
      	(genericize_catch_block, genericize_eh_spec_block): Likewise.
      	(cp_gimplify_init_expr): Remove STMT_EXPR special case.
      	(gimplify_must_not_throw_expr): Update voidify_wrapper_expr call.
      	* cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove.
      	(cp_tree_chain_matters_p): Remove.
      	* cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New.
      	(COMPOUND_STMT_BODY_BLOCK): New.
      	(STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New.
      	(EXPR_STMT_STMT_EXPR_RESULT): New.
      	(building_stmt_tree): Check cur_stmt_list.
      	(tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove.
      	(BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New.
      	* decl.c (poplevel): Use pop_stmt_list for minding cleanups.
      	(cp_finish_decl): Use push_cleanup.
      	(start_function, finish_function): Use statement lists.
      	(finish_stmt): Do nothing.
      	* except.c (begin_eh_spec_block): Use statement lists.
      	(check_handlers_1, check_handlers): Likewise.
      	* init.c (construct_virtual_base): Don't add extra compound stmts.
      	(build_vec_init): Likewise.
      	* name-lookup.c (maybe_push_cleanup_level): Use statement lists.
      	* name-lookup.h (struct cp_binding_level): Add statement_list.
      	* parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool.
      	(cp_parser_labeled_statement, cp_parser_expression_statement,
      	cp_parser_statement_seq_opt): Likewise.
      	(cp_parser_compound_statement): Likewise.  Take bool for try block.
      	(cp_parser_selection_statement): Tidy if processing.
      	(cp_parser_already_scoped_statement): Rewrite to do what it says.
      	* pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr.
      	(tsubst_expr): Rewrite STMT_EXPR processing.  Handle STATEMENT_LIST.
      	Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT.
      	* semantics.c (do_poplevel, do_pushlevel): Use statement lists.
      	(finish_cond): New, rewritten from FINISH_COND.
      	(simplify_loop_decl_cond): New.
      	(finish_expr_stmt): Avoid nested EXPR_STMTs.
      	(begin_if_stmt, finish_if_stmt_cond, finish_then_clause,
      	begin_else_clause, finish_else_clause, finish_if_stmt,
      	begin_while_stmt, finish_while_stmt_cond, finish_while_stmt,
      	begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt,
      	finish_for_cond, finish_for_stmt, begin_switch_stmt,
      	finish_switch_cond, finish_switch_stmt, begin_try_block,
      	finish_try_block, finish_cleanup_try_block, finish_function_try_block,
      	finish_handler_sequence, finish_function_handler_sequence,
      	begin_handler, finish_handler_parms, finish_handler,
      	begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite
      	using statement lists.
      	(begin_compound_stmt): Replace has_no_scope argument with flags.
      	Update all callers.  Use statement lists.
      	(finish_compound_stmt): Likewise.
      	(finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup.
      	(current_scope_stmt_stack): Remove.
      	(simplify_aggr_init_expr): Don't muck with TREE_CHAIN.
      	* typeck2.c (split_nonconstant_init_1, split_nonconstant_init):
      	Rewrite with statement lists.
      testsuite/
      	* g++.dg/ext/stmtexpr1.C: XFAIL.
      	* gcc.dg/20030612-1.c: XFAIL.
      
      From-SVN: r83221
      325c3691
  18. Jun 13, 2004
    • Joseph Myers's avatar
      c-typeck.c (comptypes, [...]): Remove flags parameter. · 132da1a5
      Joseph Myers authored
      	* c-typeck.c (comptypes, tagged_types_tu_compatible_p,
      	function_types_compatible_p, type_lists_compatible_p): Remove
      	flags parameter.
      	* c-tree.h (comptypes): Likewise.
      	(COMPARE_STRICT): Remove.
      	* c-decl.c, c-lang.c, c-parse.in, c-typeck.c, objc/objc-act.c: All
      	callers changed.
      
      From-SVN: r83061
      132da1a5
  19. May 13, 2004
  20. Mar 28, 2004
    • Zack Weinberg's avatar
      re PR c/14734 (Error recovery problem with undeclared array bounds) · 18d5f982
      Zack Weinberg authored
      	* c-decl.c: Verify that C_SIZEOF_STRUCT_LANG_IDENTIFIER is correct.
      	(struct c_binding, struct c_scope): Add chain_next
      	attributes to GTY markers.
      	(struct lang_identifier, struct lang_tree_node): Define
      	here...
      	* c-tree.h: ... not here.  No longer need to declare struct
      	c_binding either.  Do define C_SIZEOF_STRUCT_LANG_IDENTIFIER.
      	* c-lang.c, objc/objc-lang.c: Set LANG_HOOKS_IDENTIFIER_SIZE
      	to C_SIZEOF_STRUCT_LANG_IDENTIFIER.
      
      	PR 14734, 11944
      	* c-decl.c (get_parm_info): If error_mark_node is encountered
      	in the bindings chain, unbind and discard it; don't abort.
      	* testsuite/gcc.dg/noncompile/undeclared-2.c: New test.
      
      From-SVN: r80042
      18d5f982
  21. Mar 23, 2004
    • Zack Weinberg's avatar
      PR 12267, 12391, 12560, 13129, 14114, 14113 · f75fbaf7
      Zack Weinberg authored
      	* c-tree.h: Forward declare struct c_binding.  Declare
      	c_override_bindings_to_false.  Update prototypes.
      	(struct lang_identifier): Update comments.  Change fields to be
      	struct c_binding *.
      	(IDENTIFIER_SYMBOL_VALUE, IDENTIFIER_TAG_VALUE)
      	(IDENTIFIER_LABEL_VALUE, C_DECL_INVISIBLE)
      	(KEEP_NO, KEEP_YES, KEEP_MAYBE): Delete.
      	(C_DECL_IN_EXTERNAL_SCOPE, C_DECL_DECLARED_BUILTIN): New.
      	* c-common.h: Update prototypes.
      	* c-decl.c (struct c_scope): Update commentary.  Remove names,
      	names_last, parms, parms_last, tags, and shadowed fields.  Add
      	bindings and depth fields.
      	(scope_freelist): Move to more appropriate location.
      	(c_print_identifier): Update for changes to struct lang_identifier.
      	(objc_mark_locals_volatile): Update for new bindings structures.
      	(global_bindings_p): Honor c_override_global_bindings_to_false.
      	(pushlevel): Rename to push_scope; take no arguments; use the
      	scope_freelist; initialize scope->depth and check for overflow.
      	(poplevel): Rename to pop_scope; totally rewritten for new bindings
      	structures.
      	(diagnose_mismatched_decls): Use C_DECL_DECLARED_BUILTIN, not
      	C_DECL_INVISIBLE, for certain decisions.  Adjust some diagnostics.
      	Improve some commentary.  Adjust handling of forward parm decls.
      	(merge_decls): Set C_DECL_DECLARED_BUILTIN when appropriate.
      	Preserve C_DECL_IN_EXTERNAL_SCOPE.
      	(warn_if_shadowing): Correct indentation.  Improve diagnostics.
      	(pushdecl): Remove unnecessary assertion.  Short-circuit anonymous
      	decls.  Rewrite for new bindings structures.  Improve commentary.
      	Eliminate the copy_node call.
      	(implicit_decl_warning): Use the "diag" idiom (as seen in
      	locate_old_decl) to reduce code duplication; call locate_old_decl
      	if appropriate.  Relocate to remove need for forward declaration.
      	(implicitly_declare): Adjust for new bindings structures.  Kludge
      	around Objective-C not-really-builtin functions.
      	(undeclared_variable): Improve diagnostics.  If current_function_decl
      	is nonnull but current_function_scope is null, use current_scope.
      	Use bind.
      	(lookup_tag): Adjust for new bindings structures.  Kludge around
      	Objective-C's tag declarations that wind up in the external scope.
      	(lookup_name): Adjust for new bindings structures.  Kludge around
      	c-common.c's pseudo-typedefs that wind up in the external scope.
      	(lookup_name_current_level): Rename lookup_name_in_scope; take a
      	second argument indicating the scope to examine; rewrite for
      	new bindings structures.
      	(c_init_decl_processing): Adjust for renamed functions.  Do not
      	initialize current_file_decl, first_builtin_decl, last_builtin_decl.
      	First scope pushed is the external scope, not the global scope.
      	(builtin_function): Use bind, not pushdecl.  Adjust other bits
      	for new data structures.  Keep track of builtins that should be
      	made visible automatically.
      	(start_decl): Adjust diagnostics.  Remove unnecessary call to
      	expand_decl.
      	(grokparms): Return 0 if arg_types is error_mark_node.
      	(get_parm_info): Rename "void_at_end" argument to "ellipsis", with
      	reversed sense.  Rewrite for new bindings structures.  Do not
      	leave any decls in the scope, to prevent pop_scope from doing
      	contradictory things with them.
      	(finish_struct, finish_enum): Remove redundant diagnostics.
      	(build_enumerator): Don't cascade diagnostics for error_mark_node.
      	Mark location where -pedantic changes the meaning of the program.
      	(store_parm_decls_newstyle, store_parm_decls_oldstyle): Load the
      	parameter decls into the function's scope structure using bind.
      	Warn here about function definitions in the wrong style.
      	Adjust diagnostics.
      	(store_parm_decls): Correct the determination of whether a
      	function was defined with a prototype.
      	(c_write_global_declarations): Operate on all file decls and on
      	the external scope.  Split body of the loop to...
      	(c_write_global_declarations_1): ... this new function, to avoid
      	code duplication.
      	(truly_local_externals, first_builtin_decl, last_builtin_decl)
      	(make_scope, pop_scope, in_parm_level_p, set_block)
      	(any_external_decl, record_external_decl, bind_label, getdecls)
      	(link_hash_hash, link_hash_eq, merge_translation_unit_decls)
      	(c_reset_state): Delete.
      	(visible_builtins, c_override_global_bindings_to_false)
      	(c_binding, I_SYMBOL_BINDING, I_SYMBOL_DECL, I_TAG_BINDING)
      	(I_TAG_DECL, I_LABEL_BINDING, I_LABEL_DECL, file_scope)
      	(external_scope, binding_freelist, bind, free_binding_and_advance)
      	(push_file_scope, pop_file_scope): New.
      	(pushtag, pushdecl_top_level, lookup_label, declare_label)
      	(define_label, c_make_fname_decl, finish_decl)
      	(mark_forward_parm_decls, build_compound_literal)
      	(grokdeclarator, start_function, check_for_loop_decls)
      	(identifier_global_value, record_builtin_type): Minor adjustments
      	for new bindings structures.  Improve diagnostics and commentary.
      	* c-objc-common.c (start_cdtor, finish_cdtor): Adjust calls to
      	pushlevel/poplevel respectively.
      	(c_objc_common_finish_file): Don't call merge_translation_unit_decls.
      	* c-opts.c (c_common_parse_file): Remove spurious ATTRIBUTE_UNUSED.
      	Warn about YYDEBUG not being defined only if -dy.  Remove no-longer-
      	correct loop over multiple translation units; call fatal_error if
      	requested to compile more than one file at once.  (This disables
      	IMA temporarily - an up-front error being preferable to a crash.)
      	* c-parse.in (pushlevel, poplevel rules): Rename push_scope, pop_scope.
      	(all actions): Adjust calls to pushlevel/poplevel.
      	(parsing_iso_function_signature): Delete.
      	(extdef_1): Fold into extdef.
      	(old_style_parm_decls_1): Fold into old_style_parm_decls.  Don't
      	warn here about function definitions in the wrong style.
      	(after_tyle_declarator, parm_declarator_starttypename)
      	(parm_declarator_nostarttypename, notype_declarator): Remove
      	commented-out productions.
      	(parmlist_1, parmlist_2): Use make_node, not tree_cons, to create
      	an empty TREE_LIST node.  Adjust calls to get_parm_info.
      	(parmlist_2 : ELLIPSIS): Tag the arg-info block with error_mark_node
      	to suppress -Wold-style-definition after this error.
      	(c_parse_file): Don't clear the binding stack or call
      	finish_fname_decls here.  Correct comment.
      	* c-typeck.c (same_translation_unit_p): Export.
      	(common_type): Use c_override_global_bindings_to_false, not
      	pushlevel/poplevel/declare_parm_level.
      	* c-lang.c: Override LANG_HOOKS_CLEAR_BINDING_STACK,
      	LANG_HOOKS_PUSHLEVEL, LANG_HOOKS_POPLEVEL, LANG_HOOKS_SET_BLOCK,
      	and LANG_HOOKS_GETDECLS with do-nothing stubs.
      	* objc/objc-lang.c: Likewise.
      	* objc/objc-act.c: Adjust all calls to pushlevel, poplevel,
      	get_parm_info.
      	(OBJC_VOID_AT_END): Delete; replace all uses
      	with void_list_node.
      	(generate_forward_declaration_to_string_table): Delete.
      	* objc/objc-act.h (OCTI_STRG_DECL, UOBJC_STRINGS_decl): Delete.
      
      	* coverage.c (create_coverage): Don't pushdecl anything.
      	* langhooks.c (lhd_clear_binding_stack): Call
      	lang_hooks.decls.poplevel, not poplevel.
      	* tree.c (list_length): If ENABLE_TREE_CHECKING, abort on a
      	circular list rather than going into an infinite loop.
      
      cp:
      	* cp-lang.c (c_reset_state): Delete.
      	(push_file_scope, pop_file_scope): New stubs.
      	* parser.c (c_parse_file): Call sorry() here if called more than once.
      
      testsuite:
      	* gcc.dg/Wold-style-definition-1.c, gcc.dg/builtins-30.c
      	* gcc.dg/unused-4.c, gcc.dg/noncompile/label-1.c
      	* gcc.dg/noncompile/label-lineno-1.c, objc.dg/naming-1.m:
      	Adjust error regexps.
      	* gcc.dg/Wshadow-2.c, gcc.dg/noncompile/incomplete-3.c
      	* gcc.dg/noncompile/undeclared-1.c: New test cases.
      	* gcc.dg/decl-5.c, gcc.dg/redecl-1.c: Remove XFAIL.
      	* gcc.dg/local1.c: Add explanatory comment.
      
      From-SVN: r79883
      f75fbaf7
  22. Feb 04, 2004
    • Kazu Hirata's avatar
      alloc-pool.h, [...]: Update copyright. · e146f815
      Kazu Hirata authored
      	gcc/
      	* alloc-pool.h, c-convert.c, c-lang.c, c-tree.h,
      	caller-save.c, df.h, genconfig.c, global.c, lcm.c,
      	ra-rewrite.c, ra.c, regclass.c, regs.h, resource.c,
      	sched-rgn.c, config/arm/aof.h, config/arm/cirrus.md,
      	config/arm/fpa.md, config/arm/iwmmxt.md,
      	config/arm/netbsd-elf.h, config/arm/netbsd.h,
      	config/m68hc11/m68hc11.md, config/mips/iris5.h,
      	config/mn10300/mn10300.md, config/rs6000/altivec.md,
      	config/sparc/netbsd-elf.h: Update copyright.
      
      	cp/
      	* error.c, search.c: Update copyright.
      
      	java/
      	* typeck.c: Update copyright.
      
      From-SVN: r77265
      e146f815
  23. Feb 03, 2004
    • Paolo Bonzini's avatar
      re PR c/11658 (Wrong error message) · e57e265b
      Paolo Bonzini authored
      2004-02-03  Paolo Bonzini  <bonzini@gnu.org>
      
      	PR c/11658
      	PR c/13994
      	* Makefile.in (c-parse.o, c-convert.o, c-typeck.o): Depend
      	on langhooks.h.
      	* objc/Make-lang.in (objc-parse.o): Depend on langhooks.h.
      	* c-parse.in, c-convert.c, c-typeck.c, objc/objc-act.c:
      	Include langhooks.h.  Replace c_common_truthvalue_conversion
      	with the truthvalue_conversion language hook throughout.
      	(expr_no_commas): Call default_conversion before save_expr
      	for the first term of the production 'x ? : y'.
      	* c-common.c (c_common_truthvalue_conversion): Remove
      	obsolete block.  Invoke recursively the hook instead
      	of this function.
      	* c-convert.c (convert): handle ERROR_MARK_NODE.
      	* c-typeck.c (build_binary_op): handle ERROR_MARK_NODE
      	returned by the truthvalue_conversion language hook.
      	* c-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Use
      	c_objc_common_truthvalue_conversion.
      	* c-objc-common.c (c_objc_common_truthvalue_conversion):
      	New function.
      	* c-tree.h (c_objc_common_truthvalue_conversion): Declare it.
      	* objc/objc-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Use
      	c_objc_common_truthvalue_conversion.
      
      From-SVN: r77168
      e57e265b
  24. Sep 25, 2003
  25. Sep 09, 2003
    • Mark Mitchell's avatar
      langhooks-def.h (lhd_register_builtin_type): New function. · 9649812a
      Mark Mitchell authored
      	* langhooks-def.h (lhd_register_builtin_type): New function.
      	(LANG_HOOKS_REGISTER_BUILTIN_TYPE): New macro.
      	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
      	* langhooks.h (lang_hooks_for_types): Add register_builtin_type.
      	* langhooks.c (lhd_register_builtin_type): New function.
      	* c-common.h (c_register_builtin_type): Declare.
      	* c-common.c (c_register_builtin_type): New function.
      	* c-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
      	c_register_builtin_type.
      	* config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Remove __fpreg,
      	__float80, and __float128 macros.
      	* config/ia64/ia64.c (ia64_init_builtins): Create __fpreg,
      	__float80, and __float128 types.
      
      	* cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to
      	c_register_builtin_type.
      
      	* gcc.dg/ia64-types1.c: New test.
      	* gcc.dg/ia64-types2.c: Likewise.
      
      From-SVN: r71227
      9649812a
  26. Aug 29, 2003
    • Richard Henderson's avatar
      tree-optimize.c: New file. · 4985cde3
      Richard Henderson authored
      
      gcc/
              * tree-optimize.c: New file.
              * Makefile.in (OBJS-archive): Add tree-optimize.o.
              (tree-optimize.o): New.
              * c-decl.c (store_parm_decls): Use allocate_struct_function.
              (finish_function): Don't free_after_parsing or free_after_compilation.
              (set_save_expr_context): Move to tree-optimize.c.
              (c_expand_body_1): Use tree_rest_of_compilation.
              * c-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
              * objc/objc-lang.c (LANG_HOOKS_RTL_EXPAND_STMT): New.
              * c-objc-common.c (expand_deferred_fns): Don't emit unused inlines;
              iterate until closure.
              * langhooks-def.h (LANG_HOOKS_RTL_EXPAND_START,
              LANG_HOOKS_RTL_EXPAND_STMT, LANG_HOOKS_RTL_EXPAND_END): New.
              (LANG_HOOKS_RTL_EXPAND_INITIALIZER): New.
              * langhooks.h (struct lang_hooks_for_rtl_expansion): New.
              * toplev.h (tree_rest_of_compilation): Declare it.
      
      gcc/cp/
              * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New.
              (LANG_HOOKS_RTL_EXPAND_STMT): New.
              * cp-tree.h (cxx_expand_function_start): Declare.
              * decl.c (start_function): Use allocate_struct_function.
              Move stmts_are_full_exprs_p assertion from expand_body.
              Do not free_after_parsing or free_after_compilation.
              (cxx_push_function_context): Move code to set struct function
              data from genrtl_start_function.
              * optimize.c (optimize_function): Don't inc/dec function_depth.
              * semantics.c (expand_body): Use tree_rest_of_compilation.
              (cxx_expand_function_start): Rename from genrtl_start_function,
              omit bits done by tree_rest_of_compilation.
              (genrtl_finish_function): Remove.
              (clear_decl_rtl): Move to ../tree-optimize.c.
      
      Co-Authored-By: default avatarJason Merrill <jason@redhat.com>
      
      From-SVN: r70933
      4985cde3
  27. Aug 25, 2003
    • Gabriel Dos Reis's avatar
      pretty-print.h (pp_maybe_newline_and_indent): New macro. · 12ea3302
      Gabriel Dos Reis authored
      	* pretty-print.h (pp_maybe_newline_and_indent): New macro.
      	* c-pretty-print.h (c_pretty_printer): Now typedef to the
      	structure.  Be consistent with pretty-print.h abd cxx-pretty-print.h
      	(struct c_pretty_print_info): Document.  Add new fields.
      	(pp_type_specifier_seq): Rename from pp_c_type_specifier.
      	(pp_direct_abstract_declarator): New macro.
      	(pp_ptr_operator): Likewise.
      	(pp_simple_type_specifier): Likewise.
      	(pp_expression): Likewise.
      	(pp_parameter_list): Rename from pp_parameter_declaration.
      	* c-pretty-print.c (pp_c_whitespace): Now a function.
      	(pp_c_left_paren): Likewise.
      	(pp_c_right_paren): Likewise.
      	(pp_c_dot): Likewise.
      	(pp_c_ampersand): Likewise.
      	(pp_c_arrow): Likewise.
      	(pp_c_semicolon): Likewise.
      	(pp_c_type_cast): New function.
      	(pp_c_space_for_pointer_operator): Likewise.
      	(pp_c_call_argument_list): Likewise.
      	(pp_c_cv_qualifier): Adjust prototype.
      	(pp_c_type_qualifier_list): Likewise.
      	(pp_c_pointer): Likewise.  Handle REFERENCE_TYPE here.
      	(pp_c_type_specifier): Rename from pp_c_simple_type_specifier.
      	Adjust to follow standard grammar.
      	(pp_c_specifier_qualifier_list): Adjusr prototype.  Handle
      	REFERENCE_TYPE.  Tidy.
      	(pp_c_parameter_type_list): Adjust prototype.  Tidy.
      	(pp_c_parameter_declaration): Remove.
      	(pp_c_abstract_declarator): Adjust prototype.
      	(pp_c_direct_abstract_declarator): Likewise.
      	(pp_c_type_id): Likewise.
      	(pp_c_storage_class_specifier): Likewise.
      	(pp_c_function_specifier): Likewise.
      	(pp_c_declaration_specifiers): Likewise.
      	(pp_c_direct_declarator): Likewise.
      	(pp_c_declarator): Likewise.
      	(pp_c_declarator): Likewise.
      	(pp_c_declaration): Likewise.
      	(pp_c_attributes): Likewise.  Tidy.
      	(pp_c_function_definition): Adjust prototype.
      	(pp_c_char): Likewise.
      	(pp_c_string_literal): Likewise.
      	(pp_c_integer_constant): Likewise.
      	(pp_c_character_constant): Likewise.
      	(pp_c_bool_constant): Likewise.
      	(pp_c_enumeration_constant): Likewise.
      	(pp_c_floating_constant): Likewise.
      	(pp_c_constant): Likewise.
      	(pp_c_identifier): Likewise.
      	(pp_c_primary_expression): Likewise.  Remove TARGET_EXPR case.  Tidy.
      	(pp_c_initializer): Adjust prototype.
      	(pp_c_init_declarator): Likewise.
      	(pp_c_initializer_list): Likewise.
      	(pp_c_id_expression): Likewise.
      	(pp_c_postfix_expression): Likewise.
      	(pp_c_expression_list): Likewise.
      	(pp_c_unary_expression): Likewise.
      	(pp_c_cast_expression): Likewise.
      	(pp_c_multiplicative_expression): Likewise.
      	(pp_c_additive_expression): Likewise.
      	(pp_c_shift_expression): Likewise.
      	(pp_c_relational_expression): Likewise.
      	(pp_c_equality_expression): Likewise.
      	(pp_c_and_expression): Likewise.
      	(pp_c_exclusive_or_expression): Likewise.
      	(pp_c_inclusive_or_expression): Likewise.
      	(pp_c_logical_and_expression): Likewise.
      	(pp_c_logical_or_expression): Likewise.
      	(pp_c_conditional_expression): Likewise.
      	(pp_c_assignment_expression): Likewise.
      	(pp_c_expression): Likewise.  Tidy.
      	(pp_c_statement): Likewise.  Document.
      	(pp_c_pretty_printer_init): Adjust prototype. Tidy.
      
      	* c-lang.c (c_initialize_diagnostics): Update.
      	* c-common.h (strip_pointer_operator): Declare.
      	* c-common.c (strip_pointer_operator): Define.
      
      cp/
      	* cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag.
      	(cxx_pretty_printer): Adjust base type.
      	(pp_cxx_function_specifier): Declare.
      	* cxx-pretty-print.c (pp_cxx_whitespace): New macro.
      	(pp_cxx_left_paren): Likewise.
      	(pp_cxx_right_paren): Likewise.
      	(pp_cxx_dot): Likewise.
      	(pp_cxx_arrow): Likewise.
      	(pp_cxx_semicolon): Likewise.
      	(pp_cxx_identifier): Likewise.
      	(pp_cxx_cv_qualifier_seq): Likewise.
      	(pp_cxx_storage_class_specifier): Likewise.
      	(pp_cxx_expression_list): Likewise.
      	(pp_cxx_space_for_pointer_operator): Likewise.
      	(pp_cxx_init_declarator): Likewise.
      	(pp_cxx_call_argument_list): Likewise.
      	(pp_cxx_nonconsecutive_character): Tidy.
      	(pp_cxx_conversion_function_id): New function.
      	(pp_cxx_template_id): Likewise.
      	(pp_cxx_class_name): Likewise.
      	(pp_cxx_template_keyword_if_needed): Likewise.
      	(pp_cxx_nested_name_specifier): Likewise.
      	(pp_cxx_unqualified_id): Tidy
      	(pp_cxx_qualified_id): Handle more nodes.
      	(pp_cxx_primary_expression): Tidy.
      	(pp_cxx_postfix_expression): Likewise.
      	(pp_cxx_new_expression): Tidy.
      	(pp_cxx_delete_expression): Likewise.
      	(pp_cxx_cast_expression): New function.
      	(pp_cxx_pm_expression): Tidy.
      	(pp_cxx_conditional_expression): Likewise.
      	(pp_cxx_assignment_operator): New function.
      	(pp_cxx_assignment_expression): Tidy.
      	(pp_cxx_expression): New function.
      	(pp_cxx_function_specifier): Likewise.
      	(pp_cxx_decl_specifier_seq): Likewise.
      	(pp_cxx_simple_type_specifier): Tidy.
      	(pp_cxx_type_specifier_seq): Likewise.
      	(pp_cxx_ptr_operator): New function.
      	(pp_cxx_implicit_parameter_type): Likewise.
      	(pp_cxx_parameter_declaration): Tidy.
      	(pp_cxx_parameter_declaration_clause): New function.
      	(pp_cxx_exception_specification): Likewise.
      	(pp_cxx_direct_declarator): Tidy.
      	(pp_cxx_declarator): Likewise.
      	(pp_cxx_ctor_initializer): New function.
      	(pp_cxx_function_definition): Likewise.
      	(pp_cxx_abstract_declarator): Tidy.
      	(pp_cxx_direct_abstract_declarator): Likewise.
      	(pp_cxx_type_id): Likewise.
      	(pp_cxx_exception_declaration): New function.
      	(pp_cxx_statement): Likewise.
      	(pp_cxx_simple_declaration): Likewise.
      	(pp_cxx_template_parameter_list): Likewise.
      	(pp_cxx_template_parameter): Likewise.
      	(pp_cxx_template_declaration): Likewise.
      	(pp_cxx_explicit_specialization): Likewise.
      	(pp_cxx_explicit_instantiation): Likewise.
      	(pp_cxx_declaration): Tidy.
      	(pp_cxx_pretty_printer_init): Initialize more fields.
      
      From-SVN: r70777
      12ea3302
  28. Aug 19, 2003
    • Andrew Pinski's avatar
      PR c++/10538, PR c/5582 · 3390f9c9
      Andrew Pinski authored
      ChangeLog:
              * langhooks-def.h (lhd_decl_uninit): Declare.
              (LANG_HOOKS_DECL_UNINIT): New macro.
              (LANG_HOOKS_INITIALIZER): Adjust.
              * langhooks.h (struct lang_hooks): Add new field
              decl_uninit.
              * langhooks.c (lhd_decl_uninit): Define.
              * c-common.c (c_decl_uninit_1): New function.
              (c_decl_uninit): New function.
              (warn_init_self): Define.
              * c-common.h (c_decl_uninit): Declare.
              (warn_init_self): Declare.
              * c.opt: Introduce -Winit-self.
              * c-opts.c (c_common_handle_options): Set warn_init_self.
              * c-lang.c (LANG_HOOKS_DECL_UNINIT): Define.
              * objc/objc-lang.c  (LANG_HOOKS_DECL_UNINIT): Define.
              * function.c (uninitialized_vars_warning): Call the language hook.
              * doc/invoke.texi: Document -Winit-self.
      
      
      cp/ChangeLog:
              * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define.
      
      
      testsuite:
              * gcc.dg/uninit-D.c: New Test.
              * gcc.dg/uninit-E.c: New Test.
              * gcc.dg/uninit-F.c: New Test.
              * gcc.dg/uninit-G.c: New Test.
      
      From-SVN: r70574
      3390f9c9
    • Gabriel Dos Reis's avatar
      langhooks-def.h (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling. · fc95cf70
      Gabriel Dos Reis authored
              * langhooks-def.h (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling.
              (LANG_HOOKS_INITIALIZER): Correct.
              * c-lang.c: Likewise.
      cp/
              * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling.
      
      From-SVN: r70561
      fc95cf70
  29. Aug 10, 2003
    • Gabriel Dos Reis's avatar
      pretty-print.c (pp_base_indent): Rename from pp_indent. · 4b780675
      Gabriel Dos Reis authored
      	* pretty-print.c (pp_base_indent): Rename from pp_indent.
      	* c-pretty-print.h (pp_c_pretty_print_flag)s: New datatype.
      	(struct c_pretty_print_info): Add more fields.
      	(pp_c_left_paren): Move to c-pretty-print.c.
      	(pp_c_right_paren): Likewise.
      	(pp_c_left_brace): Likewise.
      	(pp_c_right_brace): Likewise.
      	(pp_c_left_bracket): Likewise.
      	(pp_c_right_bracket): Likewise.
      	(pp_c_declarator): Declare.
      	(pp_c_direct_declarator): Likewise.
      	(pp_c_specifier_qualifier_list): Likewise.
      	(pp_c_type_id): Likewise.
      	* c-pretty-print.c (pp_c_cv_qualifier): Change prootype. Rework..
      	(pp_c_type_qualifier_list): New.
      	(pp_c_pointer): Likewise.
      	(pp_c_parameter_type_list): Likewise.
      	(pp_c_function_definition): Likewise.
      	(pp_c_id_expression): Likewise.
      	(pp_c_simple_type_specifier): Tidy.
      	(pp_c_unary_expression): Likewise.
      	(pp_c_expression): Likewise.
      	(pp_c_pretty_printer_init): Likewise.
      	(pp_c_specifier_qualifier_list): Rework..
      	(pp_c_abstract_declarator): Likewise.
      	(pp_c_postfix_expression): Likewise.
      	(pp_c_primary_expression): Likewise.
      	(pp_c_cast_expression): Likewise.
      	(pp_c_direct_abstract_declarator): Likewise.
      	(pp_c_storage_class_specifier): Likewise.
      	(pp_c_function_specifier): Likewise.
      	(pp_c_declaration_specifiers): Likewise.
      	(pp_c_direct_declarator): Likewise.
      	(pp_c_declarator): Likewise.
      	(pp_c_declaration): Likewise.
      	(pp_c_statement): Likewise.
      	(pp_c_integer_constant): Rename from pp_c_integer_literal.
      	(pp_c_character_constant): Rename from pp_c_character_literal.
      	(pp_c_bool_constant): Rename from pp_c_bool_literal.
      	(pp_c_enumeration_constant): Rename from pp_c_enumerator.
      	(pp_c_floating_constant): Rename from pp_c_real_literal.
      	(pp_c_constant): Rename from pp_c_literal.
      	* c-lang.c: Include diagnostic.h and c-pretty-print.h
      	(LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define.
      	(c_initialize_diagnostics): New.
      	* Makefile.in (c-lang.o): Update dependency.
      
      cp/
      
      	* error.c (dump_expr): Tidy.
      	* cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New.
      	(pp_cxx_begin_template_argument_list): Likewise.
      	(pp_cxx_end_template_argument_list): Likewise.
      	(is_destructor_name): Likewise.
      	(pp_cxx_unqualified_id): Likewise.
      	(pp_cxx_qualified_id): Likewise.
      	(pp_cxx_id_expression): Likewise.
      	(pp_cxx_new_expression): Likewise.
      	(pp_cxx_delete_expression): Likewise.
      	(pp_cxx_pm_expression): Likewise.
      	(pp_cxx_type_specifier): Rework.
      	(pp_cxx_type_id): Likewise.
      	(pp_cxx_primary_expression): Likewise.
      	(pp_cxx_postfix_expression): Likewise.
      	(pp_cxx_unary_expression): Likewise.
      	(pp_cxx_multiplicative_expression): Likewise.
      	(pp_cxx_conditional_expression): Likewise.
      	(pp_cxx_assignment_expression): Likewise.
      	(pp_cxx_pretty_printer_init): Tidy.
      
      From-SVN: r70299
      4b780675
  30. Aug 04, 2003
    • Roger Sayle's avatar
      c-common.c (flag_noniso_default_format_attributes): Delete. · 03aa99d4
      Roger Sayle authored
      	* c-common.c (flag_noniso_default_format_attributes): Delete.
      	(built_in_attribute): Don't define/undefine DEF_FN_ATTR.
      	(c_attrs_initialized): Delete.
      	(c_common_nodes_and_builtins): Don't test c_attrs_initialized,
      	always call c_init_attributes.
      	(c_init_attributes): Don't define/undefine DEF_FN_ATTR.  Don't
      	set c_attrs_initialized when done.
      	(c_common_insert_default_attributes): Delete.
      	* c-common.h (flag_noniso_default_format_attributes): Delete.
      	(c_coomon_insert_default_attributes): Delete prototype.
      	* c-opts.c (set_std_c89, set_std_c99, set_std_cxx98): Dont set
      	flag_noniso_default_format_attributes.
      
      	* c-decl.c (c_insert_default_attributes): Delete.
      	* c-tree.h (c_insert_default_attributes): Delete prototype.
      
      	* attribs.c (decl_attributes): Don't call insert_default_attributes
      	langhook.  Update function description comment.
      	* langhooks.h (lang_hooks): Remove insert_default_attributes field.
      	* langhooks-def.h (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Delete.
      	* c-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
      	* system.h: Poison LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES macro.
      
      cp/
      	* decl.c (cxx_insert_default_attributes): Delete.
      	* cp-tree.h (cxx_insert_default_attributes): Don't prototype.
      	* cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
      
      objc/
      	* objc-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define.
      
      From-SVN: r70155
      03aa99d4
  31. Jul 31, 2003
    • Per Bothner's avatar
      opts.c (in_fnames, [...]): Moved here from c-opts. · 40e941af
      Per Bothner authored
      	* opts.c (in_fnames, num_in_fnames):  Moved here from c-opts.
      	(add_input_filename):  New function.
      	(handle_options):  Call add_input_filename directly instead of
      	with a lang hook.
      	* opts.h (in_fnames, num_in_fnames):  Moved here.
      	(add_input_filename):  Declare.
      	* c-decl.c:  Need to #include opts.h.
      	* Makefile.in (c-decl.o):  Also depends on opts.h.
      	* c-opts.c (in_fnames, num_in_fnames):  Moved to opts.c.
      	(c_common_handle_filename):  Replaced by add_input_filename.
      	* c-common.h (in_fnames, num_in_fnames, c_common_handle_filename):
      	Remove.
      	* langhooks.h (struct lang_hooks):  Remove handle_filename hook.
      	* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME):  Remove macro.
      	(LANG_HOOKS_INITIALIZER):  Remove use of LANG_HOOKS_HANDLE_FILENAME.
      	* c-lang.c (LANG_HOOKS_HANDLE_FILENAME):  Remove macro.
      
      From-SVN: r70012
      40e941af
  32. Jul 17, 2003
    • Geoffrey Keating's avatar
      re PR middle-end/11498 (asm can't be used to give a variable its own name) · 26e0dcb3
      Geoffrey Keating authored
      	PR 11498
      	* Makefile.in (c-opts.o): Add $(LANGHOOKS_DEF_H).
      	(langhooks.o): Add $(GGC_H), gt-langhooks.h.
      	(GTFILES): Add langhooks.c.
      	(gt-langhooks.h): New.
      	* c-common.h (c_static_assembler_name): Prototype.
      	* c-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define.
      	* objc/objc-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Define.
      	* c-opts.c: Include langhooks-def.h.
      	(c_static_assembler_name): New.
      	* langhooks.c: Include ggc.h.  Include gt-langhooks.h.
      	(var_labelno): New.
      	(lhd_set_decl_assembler_name): Give static objects with context
      	unique names.
      	* varasm.c (var_labelno): Delete.
      	(make_decl_rtl): Don't change the assembler name once it's set.
      
      From-SVN: r69527
      26e0dcb3
  33. Jul 11, 2003
    • Geoffrey Keating's avatar
      Index: ChangeLog · d1bd0ded
      Geoffrey Keating authored
      2003-07-10  Geoffrey Keating  <geoffk@apple.com>
      
      	* c-decl.c (finish_decl): Handle 'used' here...
      	* cgraphunit.c (cgraph_finalize_function): ... and here ...
      	* c-common.c: (handle_used_attribute): ... not here.
      
      	* configure.in (onstep): Support --enable-intermodule.
      	* Makefile.in (OBJS-common): New.
      	(OBJS-md): New.
      	(OBJS-archive): New.
      	(OBJS): Build from OBJS-common, OBJS-md, OBJS-archive.
      	(OBJS-onestep): New.
      	(libbackend.a): Support @onestep@.
      	(libbackend.o): New.
      	* configure: Regenerate.
      
      	* c-common.h (c_reset_state): New prototype.
      	(c_parse_file): New prototype.
      	(finish_file): Move prototype from c-tree.h.
      	* c-decl.c: Include <hashtab.h>.
      	(builtin_decls): New.
      	(current_file_decl): New.
      	(duplicate_decls): Add extra parameter. Change all callers.  Don't
      	output duplicate common symbols.
      	(link_hash_hash): New.
      	(link_hash_eq): New.
      	(poplevel): Handle popping of the top level.
      	(warn_if_shadowing): Handle TRANSLATION_UNIT_DECL.
      	(pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate.
      	(pushdecl_top_level): Likewise.
      	(redeclaration_error_message): Handle TRANSLATION_UNIT_DECL.
      	(c_init_decl_processing): Create TRANSLATION_UNIT_DECL.
      	(finish_decl): Handle TRANSLATION_UNIT_DECL.
      	(merge_translation_unit_decls): New.
      	(c_write_global_declarations): New.
      	(c_reset_state): New.
      	(implicitly_declare): Handle TRANSLATION_UNIT_DECL.
      	* c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New.
      	* c-objc-common.c (c_cannot_inline_tree_fn): Handle
      	TRANSLATION_UNIT_DECL.
      	(c_objc_common_finish_file): Call merge_translation_unit_decls.
      	* c-opts.c (in_fnames): Rename from in_fname.
      	(c_common_decode_option): Handle multiple input filenames.
      	(c_common_post_options): Likewise.
      	(c_common_parse_file): Likewise; also, call c_parse_file rather than
      	yyparse.
      	* c-parse.in: Move cleanup code to c_parse_file.
      	(free_parser_stacks): Move contents to c_parse_file.
      	(c_parse_file): New.
      	* c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT
      	for integer types.
      	(C_DECL_FILE_SCOPE): New.
      	(finish_file): Move prototype to c-common.h.
      	(merge_translation_unit_decls): New prototype.
      	(comptypes): Add extra parameter to prototype.
      	(c_write_global_declarations): New prototype.
      	* c-typeck.c (tagged_types_tu_compatible_p): New.
      	(function_types_compatible_p): Add extra parameter, change all callers.
      	(type_lists_compatible_p): Likewise.
      	(comptypes): Likewise.
      	(struct tagged_tu_seen): New.
      	(tagged_tu_seen_base): New.
      	(build_unary_op): Handle TRANSLATION_UNIT_DECL.
      	(c_mark_addressable): Remove #if 0 code.
      	* calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add
      	comment explaining why it shouldn't have to.
      	* cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY
      	options.
      	* cppinit.c (cpp_read_next_file): New.
      	(cpp_read_main_file): Use it.
      	* cpplib.c (undefine_macros): New.
      	(cpp_undef_all): New.
      	* cpplib.h (cpp_read_next_file): Prototype.
      	(cpp_undef_all): Prototype.
      	* langhooks-def.h (write_global_declarations): Remove prototype.
      	* toplev.h (write_global_declarations): Add prototype.
      	* tree.c (decl_type_context): Use switch statement, handle
      	TRANSLATION_UNIT_DECL.
      	* tree.def: Update documentation for TRANSLATION_UNIT_DECL.
      	(TRANSLATION_UNIT_DECL): New kind of tree.
      	* tree.h: Update documentation for TRANSLATION_UNIT_DECL.
      	* Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies.
      	* doc/invoke.texi: Make attempt to document new functionality.
      
      	2003-05-19  Per Bothner <bothner@apple.com>
      
      	* gcc.c (combine_inputs): New.
      	(process_command): Set combine_inputs.
      	(do_spec_1): Handle combine_inputs.
      	(main): Likewise.
      
      Index: cp/ChangeLog
      2003-07-10  Geoffrey Keating  <geoffk@apple.com>
      
      	* decl.c (cp_finish_decl): Handle 'used' attribute.
      
      	* cp-lang.c (c_reset_state): New dummy routine.
      	* cp-tree.h (finish_file): Move prototype to c-common.h.
      	* parser.c (c_parse_file): Rename from yyparse; don't call finish_file.
      
      From-SVN: r69224
      d1bd0ded
  34. Jul 09, 2003
    • Jan Hubicka's avatar
      java-tree.h (DECL_NUM_STMTS): Rename to... · 084c1779
      Jan Hubicka authored
      	* java-tree.h (DECL_NUM_STMTS): Rename to...
      	(DECL_ESTIMATED_INSNS): ... this.
      	* lang.c (java_estimate_num_insns, java_estimate_num_insns_1):
      	New static functions.
      	(LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): Define.
      	* parser.y (add_stmt_to_compound): Do not account statements.
      
      	* cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
      	* decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
      	(start_function): Use DECL_ESTIMATED_INSNS.
      	* optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS.
      
      	* decl2.c (maybe_emit_vtables): Fix marking vtables as needed in
      	unit-at-a-time
      
      	* c-common.c (c_estimate_num_insns_1): New static function.
      	(c_estimate_num_insns): New global function.
      	* c-common.h (DECL_NUM_STMTS): Rename to...
      	(DECL_ESTIMATED_INSNS): ... this.
      	(c_estimate_num_insns): Declare.
      	* c-decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS.
      	* c-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New.
      	* c-semantics.c (add_stmt): Do not account statements.
      	* langhooks-def.h (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS):
      	New.
      	* langhooks.h (lang_hooks_for_tree_inlining): Add
      	estimate_num_insns
      	* params.def (max-inline-insns-auto, max-inline-insns-auto): set
      	to 100.
      	(max-inline-insns): set to 300.
      	(min-inline-insns): set to 10.
      	* tree-inline.c (struct inline_data): Rename inlined_stmts to
      	inlined-insns.
      	(INSNS_PER_STMT): Kill.
      	(inlinable_function_p): Compute and store body size.
      	(expand_call_inline): Likewise.
      	(optimize_inline_calls): Likewise.
      
      From-SVN: r69113
      084c1779
  35. Jul 06, 2003
    • Neil Booth's avatar
      c-common.h (c_comon_handle_filename, [...]): New. · cb66e385
      Neil Booth authored
      	* c-common.h (c_comon_handle_filename,
      	c_common_missing_arguement): New.
      	* c-lang.c (LANG_HOOKS_HANDLE_FILENAME,
      	LANG_HOOKS_MISSING_ARGUMENT): New.
      	* c-opts.c (missing_arg): Rename c_common_missing_argument,
      	update to be an appropriate langhook.
      	(c_common_handle_option): Don't handle filenames.
      	(c_common_handle_filename): New.
      	* hooks.c (hook_void_constcharptr,
      	hook_bool_constcharptr_size_t_false): New.
      	* hooks.h (hook_void_constcharptr,
      	hook_bool_constcharptr_size_t_false): New.
      	* langhooks-def.h (LANG_HOOKS_HANDLE_FILENAME,
      	LANG_HOOKS_MISSING_ARGUMENT): New.
      	(LANG_HOOKS_INITIALIZER): Update.
      	* langhooks.h (struct lang_hooks): Add handle_filename and
      	missing_argument.
      	* opts.c (handle_option): Don't handle filenames here, but ...
      	(handle_options): ... here.
      	(common_handle_option): Don't handle missing arguments here.
      	* objc/objc-lang.c (LANG_HOOKS_HANDLE_FILENAME,
      	LANG_HOOKS_MISSING_ARGUMENT): New.
      ada:
      	* misc.c (gnat_handle_option): Don't handle filenames.
      cp:
      	* cp-lang.c (LANG_HOOKS_HANDLE_FILENAME,
      	LANG_HOOKS_MISSING_ARGUMENT): Override.
      f:
      	* top.c (ffe_handle_option): Don't handle filenames.
      java:
      	* lang.c (java_handle_option): Don't handle filenames.
      
      From-SVN: r69011
      cb66e385
  36. Jun 30, 2003
    • Neil Booth's avatar
      c-common.c (enum c_language_kind, flag_objc): Remove. · 37fa72e9
      Neil Booth authored
      	* c-common.c (enum c_language_kind, flag_objc): Remove.
      	(fix_string_type, check_case_value, c_common_nodes_and_builtins,
      	c_add_case_label, finish_label_addr_expr, boolean_increment):
      	Use c_dialect_ macros.
      	* c-common.h (enum c_language_kind): Extend.
      	(c_dialect_cxx, c_dialect_objc): New.
      	(flag_objc): Remove.
      	(c_common_init_options): Update prototype.
      	* c-cppbuiltin.c (define__GNUC__, c_cpp_builtins): Use c_dialect_
      	macros.
      	* c-decl.c (finsih_decl, grokfield, finish_struct): Use c_dialect_
      	macros.
      	* c-format.c (C_STD_VER, C_STD_NAME): Similarly.
      	* c-lang.c (c_init_options): Remove.
      	(c_language): Define.
      	(LANG_HOOKS_INIT_OPTIONS): Use common hook.
      	* c-lex.c (lex_charconst): Use c_dialect_cxx().
      	* c-opts.c (lang_flags): Make function-local.
      	(c_common_init_options): Use c_dialect_ macros.  Handle
      	C++ diagnostic requirements.
      	(c_common_handle_option, c_common_post_options): Use flag_cxx.
      	* c-parse.in (init_reswords): Use c_dialect_objc ().
      	* c-pch.c (get_ident): Use c_language.
      	* c-pretty-print.c (pp_c_bool_literal): Use c_dialect_ macros.
      	* c-typeck.c (comptypes, build_c_cast): Similarly.
      	* objc/objc-lang.c (c_language): Define.
      	(LANG_HOOKS_INIT_OPTIONS): Use common hook.
      	(objc_init_options): Remove.
      cp:
      	* Make-lang.in: Update.
      	* cp-lang.c (c_language): Define.
      	(LANG_HOOKS_INIT_OPTIONS): Use common hook.
      	* cp-tree.h (cxx_init_options): Remove.
      	* lex.c: Don't include diagnostic.h.
      	(cxx_init_options): Remove.
      
      From-SVN: r68734
      37fa72e9
  37. Jun 25, 2003
    • Zack Weinberg's avatar
      re PR c/10178 (ICE in tree_low_cst) · 2896d056
      Zack Weinberg authored
      	PR 10178
      	* langhooks.h (struct lang_hooks): Add no_body_blocks bool.
      	* langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): New; default false.
      	* c-lang.c, objc/objc-lang.c: Override LANG_HOOKS_NO_BODY_BLOCKS
      	to true.
      	* stmt.c (is_body_block): If lang_hooks.no_body_blocks, always
      	return 0.
      
      From-SVN: r68483
      2896d056
Loading