Commit Graph

189 Commits

Author SHA1 Message Date
Steven Bosscher 532aafaddb basic-block.h: Re-group most prototypes per file.
gcc/
	* basic-block.h: Re-group most prototypes per file.
	(struct edge_list): Remove num_blocks field.
	(dump_bb_info): Adjust prototypes.
	(dump_reg_info): Move prototype to regs.h.
	* function.h: Do not include tree.h.
	Include vec.h, vecir.h, input.h and machmode.h to compensate.
	(function_name): New prototype.
	* gimple.h: Include tree.h to compensate for basic-block.h change.
	* langhooks.h: Note that tree.h is only necessary for enum tree_code.
	* regs.h (dump_reg_info): Prototype here.
	* regset.h: Adjust file reference in comment.
	(debug_regset): Remove prototype.
	* rtl.h: Include flags.h for flag_var_tracking_assignments.
	(MAY_HAVE_DEBUG_INSNS): Define as flag_var_tracking_assignments
	instead of no-longer-available tree.h's MAY_HAVE_DEBUG_STMTS.
	(dump_reg_info, dump_flow_info): Remove prototypes.
	* bb-reorder.c (set_edge_can_fallthru_flag): Move from cfganal.c
	to here, the only user.  Make static.
	(reorder_basic_blocks): Call dump_reg_info before dump_flow_info.
	* cfg.c: Do not include tm.h, tree.h, rtl.h, hard-reg-set.h, regs.h,
	flags.h, function.h, except.h, diagnostic-core.h, tm_p.h, timevar.h,
	tree-pass.h, cfgloop.h, and tree-flow.h.
	Include basic-block.h, the first header I'd expect to be included.
	(reg_obstack): Move to df-core.c.
	(free_edge): Remove bogus ATTRIBUTE_UNUSED.
	(remove_edge_raw): Do not call tree-ssa's redirect_edge_var_map_clear.
	(redirect_edge_succ_nodup): Move to cfghooks.c.
	(dump_regset, debug_regset): Move to df-core.c.
	(dump_bb_info): Move to cfgrtl.c.
	(dump_reg_info): Move to regstat.c.
	(dump_flow_info): Move to cfgrtl.c.
	(debug_flow_info): Likewise.
	(dump_edge_info): Do not look at cfun, a CFG without cfun is nonsense.
	* cfganal.c: Do not include tm.h, rtl.h, obstack.h, hard-reg-set.h,
	insn-config.h, recog.h, diagnostic-core.h, tm_p.h, and cfgloop.h.
	(flow_active_insn_p, forwarder_block_p, can_fallthru,
	could_fall_through): Move to cfgrtl.c.
	(set_edge_can_fallthru_flag): Moved to bb-reorder.c.
	(create_edge_list): Do not set edge_list's removed num_blocks.
	(print_edge_list): Look at n_basic_blocks instead of num_blocks.
	(flow_nodes_print): Remove.
	(flow_edge_list_print): Remove.
	(inverted_post_order_compute): Use FOR_ALL_BB.
	*cfgrtl.c (dump_flow_info): Moved from cfg.c.
	Do not call dump_reg_info.
	(debug_flow_info): Moved from cfg.c
	(dump_bb_info): Moved from cfg.c.  Take 'verbose' argument
	to avoid looking at TDF_* flags from tree-pass.h.
	(flow_active_insn_p, forwarder_block_p, can_fallthru,
	could_fall_through): Moved from cfganal.c.
	(print_rtl_with_bb): Adjust dump_bb_info calls.
	* cfghooks.c (redirect_edge_succ_nodup): Moved from cfg.c.
	(remove_edge): Call redirect_edge_var_map_clear if IR_GIMPLE.
	(cfgcleanup.c): Look at MAY_HAVE_DEBUG_INSNS, not MAY_HAVE_DEBUG_STMTS.
	* cselib.c: Include tree.h with a FIXME.
	* df-core.c (reg_obstack): Moved from cfg.c.
	(dump_regset): Likewise.
	(debug_regset): Likewise.  Make a DEBUG_FUNCTION.
	* final.c (compute_alignments): Call dump_reg_info before
	dump_flow_info.
	* function.c (function_name): New function.
	(current_function_name): Use it.
	* ifcvt.c (rest_of_handle_if_conversion): Call dump_reg_info before
	dump_flow_info.
	* ira-conflicts.c: Include tree.h with a note.
	* regstat.c (dump_reg_info): Moved here from cfg.c.
	* loop-init.c: Include regs.h instead of hard-reg-set.h.
	(rtl_loop_init): Call dump_reg_info before dump_flow_info.
	(rtl_loop_done): Likewise.
	* mcf.c: Include tree.h before langhooks.h.
	* predict.c (maybe_hot_count_p): Assert we have cfun.
	(probably_never_executed_bb_p): Likewise.
	* profile.c (compute_branch_probabilities): Use gimple_dump_cfg
	instead of dump_flow_info.
	* sched-deps.c: Include tree.h with a FIXME.
	(call_may_noreturn_p): Add FIXME note why this function has to
	look at function decls instead of function decl flags.
	* sched-vis.c: Include tree.h with a FIXME.
	(print_rtl_slim): Adjust dump_bb_info uses.
	* statistics.c (statistics_fini_pass_2): Use current_function_name
	to avoid including tree.h.
	(statistics_counter_event): Use function_name for the same reason.
	(statistics_histogram_event): Likewise.
	* tracer.c (tracer): Remove bogus gcc_assert.  Use brief_dump_cfg
	instead of dump_flow_info.
	* var-tracking.c (variable_tracking_main_1): Call dump_reg_info
	before dump_flow_info.
	* doc/cfg.texi: Update CFG documentation.
	* Makefile.in (RTL_H): Depend on FLAGS_H.
	(GIMPLE_H): Depend on TREE_H.
	(FUNCTION_H): Depend on VEC_H, vecir.h, INPUT_H and MACHMODE_H,
	but no longer on TREE_H.
	(C_COMMON_H): Depend on TREE_H.
	(cselib.o, cse.o, cfganal.o, loop-init.o, ira-conflicts.o,
	sched-deps.o, sched-vis.o): Fixup dependencies.

c-family/
	* c-common.h: Include tree.h.

cp/
	* decl.c (cp_finish_decl): Add FIXME at add_local_decl call site.

From-SVN: r189359
2012-07-08 10:06:14 +00:00
Jan Hubicka 9c8305f8fc cgraphunit.c: Update toplevel comment.
* cgraphunit.c: Update toplevel comment.
	(tree_rest_of_compilation): Merge into cgraph_expand_function.
	(cgraph_analyze_function): Make static.
	(cgraph_decide_is_function_needed): Make static.
	(cgraph_add_new_function): Use expand_function instead of
	rest_of_compilation.
	(clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt,
	verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph):
	Move to cgraph.c
	(cgraph_inline_p): Remove.
	(cgraph_preserve_function_body_p): Move to ipa-inline-transform.
	(init_cgraph): Add comment.
	* cgraphbuild.c (record_reference, mark_address, mark_load,
	mark_store): Do not call analyze_expr hook.
	* cgraph.c: Update toplevel comment.
	(clone_of_p, verify_edge_count_and_frequency, cgraph_debug_gimple_stmt,
	verify_edge_corresponds_to_fndecl, verify_cgraph_node, verify_cgraph):
	Move fere from cgraphunit.c
	(cgraph_mark_force_output_node): Move to cgraph.h
	* cgraph.h: Reorder so the comments match the function placement.
	(cgraph_analyze_function, cgraph_decide_is_function_needed): Remove.
	(cgraph_mark_force_output_node): Move here from cgraph.c
	* tree.c (free_lang_data): Do not clear analyze_expr hook.
	* ipa-inline-transform.c (preserve_function_body_p): New function.
	(inline_transform): Update.
	* langhooks.c (lhd_callgraph_analyze_expr): Remove.
	* langhooks.h (lang_hooks_for_callgraph): Remove.
	(lang_hooks): Remove callgraph.
	* tree-inline.c (expand_call_inline): Do not use cgraph_inline_p.
	* varpool.c: Remove out of date comment.
	* langhooks-def.h (lhd_callgraph_analyze_expr): Remove.
	(LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): Remove.

From-SVN: r186832
2012-04-25 16:31:42 +00:00
Steven Bosscher c081413602 langhooks.c (add_builtin_type): New function.
* langhooks.c (add_builtin_type): New function.
	* langhooks.h (add_builtin_type): Export it.
	* config/mep/mep.c (mep_init_builtins): Use it.
	* config/rs6000/rs6000.c (rs6000_init_builtins): Use it.

From-SVN: r184960
2012-03-05 21:57:13 +00:00
Eric Botcazou c99c002630 langhooks.h (lang_hooks_for_types): Change global_bindings_p's return type to bool and adjust comment.
2011-05-07  Eric Botcazou  <ebotcazou@adacore.com>

	* langhooks.h (lang_hooks_for_types): Change global_bindings_p's return
	type to bool and adjust comment.
	* fold-const.c (fold_range_test): Adjust call to global_bindings_p.
	(fold_mathfn_compare): Remove calls to global_bindings_p.
	(fold_inf_compare): Likewise.
	* stor-layout.c (variable_size): Adjust call to global_bindings_p.
	* c-tree.h (global_bindings_p): Adjust prototype.
	* c-decl.c (global_bindings_p): Return bool and simplify.
ada/
	* gcc-interface/gigi.h (global_bindings_p): Adjust prototype.
	* gcc-interface/utils.c (global_bindings_p): Return bool and simplify.
cp/
	* name-lookup.h (global_bindings_p): Adjust prototype.
	* name-lookup.c (global_bindings_p): Return bool.
fortran/
	* f95-lang.c (global_bindings_p): Return bool and simplify.
go/
	* go-lang.c (global_bindings_p): Return bool and simplify.
java/
	* java-tree.h (global_bindings_p): Adjust prototype.
	* decl.c (global_bindings_p): Return bool.
lto/
	* lto-lang.c (global_bindings_p): Return bool.

From-SVN: r173535
2011-05-07 19:58:29 +00:00
Olivier Hainque 2a9d769a7f dwarf2out.c (dwarf_attr_name): Map DW_AT_GNAT_descriptive_type.
* dwarf2out.c (dwarf_attr_name): Map DW_AT_GNAT_descriptive_type.
	(add_gnat_descriptive_type_attribute): New function.
	(gen_array_type_die): Call it.
	(gen_enumeration_type_die): Likewise.
	(gen_struct_or_union_type_die): Likewise.
	(modified_type_die): Likewise.
	* langhooks.h (lang_hooks_for_types): New descriptive_type hook.
	* langhooks-def.h (LANG_HOOKS_DESCRIPTIVE_TYPE): Default to NULL.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_DESCRIPTIVE_TYPE.
ada/
	* gcc-interface/misc.c (gnat_descriptive_type): New function.
	(LANG_HOOKS_DESCRIPTIVE_TYPE): Redefine to gnat_descriptive_type.

Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>
Co-Authored-By: Nicolas Setton <setton@adacore.com>

From-SVN: r171862
2011-04-01 23:38:57 +00:00
Joseph Myers b37421c62a invoke.texi (-dy): Remove.
* doc/invoke.texi (-dy): Remove.
	* langhooks-def.h (lhd_do_nothing_i): Don't declare.
	(LANG_HOOKS_PARSE_FILE): Define to lhd_do_nothing.
	* langhooks.c (lhd_do_nothing_i): Remove.
	* langhooks.h (lang_hooks.parse_file): Take no arguments.
	* toplev.c (set_yydebug): Remove.
	(compile_file): Update call to lang_hooks.parse_file.
	(decode_d_option): Don't handle -dy.

ada:
	* gcc-interface/misc.c (gnat_parse_file): Take no arguments.

c-family:
	* c-opts.c (c_common_parse_file): Take no arguments.
	* c-common.h (c_common_parse_file): Update prototype.

fortran:
	* f95-lang.c (gfc_be_parse_file): Take no arguments.

java:
	* jcf-parse.c (java_parse_file): Take no arguments.
	* java-tree.h (java_parse_file): Update prototype.

lto:
	* lto.c (lto_main): Take no arguments.
	* lto.h (lto_main): Update prototype.

From-SVN: r166868
2010-11-17 14:31:07 +00:00
Joseph Myers a4d8c67600 Makefile.in (OPTS_H): Define.
* Makefile.in (OPTS_H): Define.
	(c-decl.o, c-family/c-common.o, c-family/c-opts.o,
	c-family/c-pch.o, c-family/c-pragma.o, gcc.o, gccspec.o,
	cppspec.o, options.o, gcc-options.o, lto-opts.o, opts.o,
	opts-common.o, toplev.o, passes.o, matrix-reorg.o,
	ipa-struct-reorg.o, PLUGIN_HEADERS): Use $(OPTS_H).
	* gcc.c (driver_handle_option): Take location_t parameter.
	(process_command, do_self_spec): Update calls to
	read_cmdline_option.
	* langhooks-def.h (lhd_handle_option): Take location_t parameter.
	* langhooks.c (lhd_handle_option): Take location_t parameter.
	* langhooks.h (handle_option): Take location_t parameter.
	* lto-opts.c (lto_reissue_options): Update call to set_option.
	* opts-common.c (handle_option): Make static.  Take location_t
	parameter and pass it to other functions.
	(handle_generated_option): Take location_t parameter and pass it
	to other functions.
	(read_cmdline_option): Take location_t parameter and pass it to
	other functions.  Use warning_at and error_at.
	(set_option): Take location_t parameter and pass it to other
	functions.
	* opts.c (common_handle_option): Take location_t parameter and
	pass it to other functions.
	(enable_warning_as_error): Make static.  Take location_t parameter
	and pass it to other functions.
	(lang_handle_option): Take location_t parameter and pass it to
	other functions.
	(target_handle_option): Take location_t parameter.
	(read_cmdline_options, maybe_default_option,
	maybe_default_options, default_options_optimization,
	decode_options): Take location_t parameter and pass it to other
	functions.
	* opts.h: Include input.h.
	(struct cl_option_handler_func, decode_options, set_option,
	handle_generated_option, read_cmdline_option): Take location_t
	parameters.
	(handle_option, enable_warning_as_error): Remove.
	* toplev.c (toplev_main): Update call to decode_options.

ada:
	* gcc-interface/Make-lang.in (ada/misc.o): Use $(OPTS_H).
	* gcc-interface/misc.c (gnat_handle_option): Take location_t
	parameter.

c-family:
	* c-common.c (parse_optimize_options): Update call to
	decode_options.
	* c-common.h (c_common_handle_option): Update prototype.
	* c-opts.c (c_common_handle_option): Take location_t parameter and
	pass it to other functions.

cp:
	* Make-lang.in (g++spec.o): Use $(OPTS_H).

fortran:
	* Make-lang.in (gfortranspec.o): Use $(OPTS_H).
	* gfortran.h (gfc_handle_option): Take location_t parameter.
	* options.c (gfc_handle_option): Take location_t parameter.

java:
	* Make-lang.in (jvspec.o, java/lang.o): Use $(OPTS_H).
	* lang.c (java_handle_option): Take location_t parameter.

lto:
	* Make-lang.in (lto/lto.o): Use $(OPTS_H).
	* lto-lang.c (lto_handle_option): Take location_t parameter.

From-SVN: r166688
2010-11-12 23:26:56 +00:00
Joseph Myers a75bfaa6cd Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h.
* Makefile.in (TM_H): Include $(FLAGS_H) instead of options.h.
	(TREE_H): Include $(FLAGS_H) instead of options.h.
	(opts-common.o): Depend on $(FLAGS_H) instead of options.h.
	* c-objc-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
	* common.opt (flag_complex_method, flag_evaluation_order,
	flag_ira_algorithm, flag_ira_region, flag_warn_unused_result): New
	Variable declarations.
	* configure.ac (tm_include_list): Include flags.h instead of
	options.h.
	* configure: Regenerate.
	* flags.h: Condition out contents for target libraries.  Include
	options.h at end of file.
	(flag_complex_method, flag_ira_algorithm, flag_ira_region,
	flag_evaluation_order, flag_warn_unused_result): Remove.
	* gcc.c (main): Intialize global_options with global_options_init.
	* langhooks-def.h (lhd_init_options_struct): Declare.
	(LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
	(LANG_HOOKS_INITIALIZER): Include LANG_HOOKS_INIT_OPTIONS_STRUCT.
	* langhooks.c (lhd_init_options_struct): New.
	* langhooks.h (struct lang_hooks): Add init_options_struct.
	Update comment on init_options.
	* optc-gen.awk: Generate initializer for global_options_init, not
	global_options.
	* opth-gen.awk: Condition out structure declarations for target
	libraries.  Declare global_options_init.
	* opts-common.c: Include flags.h instead of options.h.
	* opts.c (flag_warn_unused_result): Remove.
	(read_cmdline_options): Take gcc_options parameters.  Pass them to
	read_cmdline_option.
	(initial_lang_mask, initial_min_crossjump_insns,
	initial_max_fields_for_field_sensitive,
	initial_loop_invariant_max_bbs_in_loop): Define at file scope.
	(init_options_once): New.  Split out of decode_options.
	(init_options_struct): New.  Split out of decode_options.
	(decode_cmdline_options_to_array_default_mask): New.
	(default_options_optimization): New.  Split out of decode_options.
	(decode_options): Move most code to other functions.  Update call
	to read_cmdline_options.
	(finish_options): New.  Split out of decode_options.
	* opts.h (decode_options): Add gcc_options parameters.
	(init_options_once, init_options_struct,
	decode_cmdline_options_to_array_default_mask): New.
	* toplev.c (flag_complex_method, flag_ira_algorithm,
	flag_ira_region, flag_evaluation_order): Remove.
	(general_init): Use global_options_init for initial flag values
	for global_dc.
	(toplev_main): Call init_options_once, init_options_struct,
	lang_hooks.init_options_struct,
	decode_cmdline_options_to_array_default_mask and
	lang_hooks.init_option before decode_options.  Update arguments to
	decode_options.
	* tree.h: Include flags.h instead of options.h.

ada:
	* gcc-interface/misc.c (gnat_init_options_struct): New.  Split out
	from gnat_init_options.
	(LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.

c-family:
	* c-common.c (parse_optimize_options): Call
	decode_cmdline_options_to_array_default_mask before
	decode_options.  Update arguments to decode_options.
	* c-common.h (c_common_init_options_struct): Declare.
	* c-opts.c (c_common_init_options_struct): New.  Split out from
	c_common_init_options.

cp:
	* cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.

fortran:
	* f95-lang.c (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
	* gfortran.h (gfc_init_options_struct): Declare.
	* options.c (gfc_init_options_struct): New.  Split out from
	gfc_init_options.

java:
	* lang.c (java_init_options_struct): New.  Split out from
	java_init_options.
	(LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.

lto:
	* lto-lang.c (lto_init_options): Change to
	lto_init_options_struct.  Update parameters.
	(LANG_HOOKS_INIT_OPTIONS): Don't define.
	(LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.

From-SVN: r165189
2010-10-08 16:17:32 +01:00
Joseph Myers 1ebe4b4fa0 opts-common.c (handle_option, [...]): Add diagnostic_context parameter.
* opts-common.c (handle_option, handle_generated_option,
	read_cmdline_option, set_option): Add diagnostic_context
	parameter.  Update calls among these functions.
	(set_option): Don't use global_dc.
	* opts.c (read_cmdline_options): Pass global_dc to
	read_cmdline_option.
	(decode_options): Pass global_dc to enable_warning_as_error.
	(common_handle_option): Pass global_dc to enable_warning_as_error.
	(enable_warning_as_error): Add diagnostic_context parameter.
	Document parameters.  Don't use global_dc.  Pass
	diagnostic_context parameter to handle_generated_option.
	* opts.h (set_option, handle_option, handle_generated_option,
	read_cmdline_option, enable_warning_as_error): Add
	diagnostic_context parameter.
	* Makefile.in (lto-opts.o): Update dependencies.
	* coretypes.h (struct diagnostic_context, diagnostic_context):
	Declare here.
	* diagnostic.h (diagnostic_context): Don't declare typedef here.
	* gcc.c (process_command): Pass global_dc to read_cmdline_option.
	* langhooks-def.h (struct diagnostic_context): Don't declare here.
	(lhd_print_error_function, lhd_initialize_diagnostics): Declare
	using diagnostic_context typedef.
	* langhooks.c (lhd_initialize_diagnostics): Declare using
	diagnostic_context typedef.
	* langhooks.h (struct diagnostic_context): Don't declare here.
	(initialize_diagnostics, print_error_function): Declare using
	diagnostic_context typedef.
	* lto-opts.c: Include diagnostic.h.
	(lto_reissue_options): Pass global_dc to set_option.  Pass
	DK_UNSPECIFIED not 0.
	* plugin.c (plugins_internal_error_function): Declare using
	diagnostic_context typedef.
	* plugin.h (struct diagnostic_context): Don't declare here.
	(plugins_internal_error_function): Declare using
	diagnostic_context typedef.

c-family:
	* c-common.h (struct diagnostic_context): Don't declare here.
	(c_common_initialize_diagnostics): Declare using
	diagnostic_context typedef.
	* c-opts.c (c_common_handle_option): Pass global_dc to
	handle_generated_option.

cp:
	* cp-tree.h (cxx_print_error_function,
	cxx_initialize_diagnostics): Declare using diagnostic_context
	typedef.

From-SVN: r164991
2010-10-05 15:28:39 +01:00
Eric Botcazou 523e82a7a3 langhooks.h (struct lang_hooks_for_types): Remove hash_types field.
* langhooks.h (struct lang_hooks_for_types): Remove hash_types field.
	* langhooks-def.h (LANG_HOOKS_HASH_TYPES): Delete.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Remove LANG_HOOKS_HASH_TYPES.
	* system.h (LANG_HOOKS_HASH_TYPES): Poison.
	* tree.c (type_hash_canon): Do not test lang_hooks.types.hash_types.
	(build_nonstandard_integer_type): Likewise.
	(build_range_type_1): New function, built from...
	(build_range_type): ...this.  Call build_range_type_1.
	(build_nonshared_range_type): New function.
	(build_array_type_1): New function, built from...
	(build_array_type: ...this.  Call build_array_type_1.
	(build_nonshared_array_type): New function.
	* tree.h (build_nonshared_range_type): Declare.
	(build_nonshared_array_type): Likewise.
ada/
	* gcc-interface/decl.c (gnat_to_gnu_entity): Replace calls to
	build_array_type with calls to build_nonshared_array_type.
	(substitute_in_type): Likewise.
	* gcc-interface/misc.c (LANG_HOOKS_HASH_TYPES): Delete.
	(LANG_HOOKS_TYPE_HASH_EQ): Define.
	(gnat_post_options): Add 'static' keyword.
	(gnat_type_hash_eq): New static function.
	* gcc-interface/utils.c (fntype_same_flags_p): New function.
	(create_subprog_type): Call it.
	(create_index_type): Call build_nonshared_range_type and tidy up.
	(create_range_type): Likewise.
	* gcc-interface/gigi.h (fntype_same_flags_p): Declare.

From-SVN: r164452
2010-09-20 20:11:35 +00:00
Joseph Myers 5f20c6574d coretypes.h (struct cl_option_handlers): Declare.
* coretypes.h (struct cl_option_handlers): Declare.
	* hooks.c (hook_int_size_t_constcharptr_int_0): Remove.
	* hooks.h (hook_int_size_t_constcharptr_int_0): Remove.
	* langhooks-def.h (lhd_handle_option): Declare.
	(LANG_HOOKS_HANDLE_OPTION): Use lhd_handle_option.
	* langhooks.c (lhd_handle_option): New.
	* langhooks.h (struct lang_hooks): Update prototype and return
	value type of handle_option hook.
	* optc-gen.awk: Generate target_flags_explicit definition for the
	driver.
	* opts-common.c: Include diagnostic.h.
	(handle_option): Move from opts.c.  Update prototype and return
	value type.  Use handlers structure.
	(read_cmdline_option): Move from opts.c.  Update prototype.  Use
	handlers structure.
	(set_option): Move from opts.c.
	* opts.c (common_handle_option): Update prototype and return value
	type.  Update calls to handle_option and enable_warning_as_error.
	(unknown_option_callback, post_handling_callback,
	lang_handle_option, target_handle_option): New.
	(handle_option, read_cmdline_option): Move to opts-common.c.
	(read_cmdline_options): Update prototype.  Update call to
	read_cmdline_option.
	(decode_options): Initialize and use handlers structure.
	(set_option): Move to opts-common.c.
	(enable_warning_as_error): Update prototype.  Update call to
	handle_option.
	* opts.h (struct cl_option_handler_func, struct
	cl_option_handlers): New.
	(handle_option, enable_warning_as_error): Update prototypes.
	(read_cmdline_option): Declare.
	* Makefile.in (opts-common.o): Update dependencies.

ada:
	* gcc-interface/misc.c (gnat_handle_option): Update prototype and
	return value type.  Don't check for missing arguments here.

c-family:
	* c-common.h (c_common_handle_option): Update prototype and return
	value type.
	* c-opts.c (c_common_handle_option): Update prototype and return
	value type.  Update calls to handle_option and
	enable_warning_as_error.

fortran:
	* gfortran.h (gfc_handle_option): Update prototype and return
	value type.
	* options.c (gfc_handle_option): Update prototype and return value
	type.

java:
	* lang.c (java_handle_option): Update prototype and return value
	type.

lto:
	* lto-lang.c (lto_handle_option): Update prototype and return
	value type.  Remove duplicate assignment to result.

From-SVN: r162601
2010-07-27 22:23:53 +01:00
Joseph Myers 61ff2bdc6c common.opt (o): Add MissingArgError.
* common.opt (o): Add MissingArgError.
	* doc/options.texi (MissingArgError): Document.
	* hooks.c (hook_bool_constcharptr_size_t_false): Remove.
	* hooks.h (hook_bool_constcharptr_size_t_false): Remove.
	* langhooks-def.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
	(LANG_HOOKS_INITIALIZER): Remove missing_argument hook
	initializer.
	* langhooks.h (struct lang_hooks): Remove missing_argument.
	* optc-gen.awk: Handle MissingArgError and output new structure
	field initializers.
	* opts.c (read_cmdline_option): Use missing_argument_error field
	instead of missing_argument langhook.
	* opts.h (struct cl_option): Add missing_argument_error field.
	* system.h (LANG_HOOKS_MISSING_ARGUMENT): Poison.

c-family:
	* c-common.h (c_common_missing_argument): Remove.
	* c-opts.c (c_common_missing_argument): Remove.
	* c.opt (A, D, F, I, MD, MMD, MQ, MT, U, fconstant-string-class=,
	idirafter, imacros, include, isysroot, isystem, iquote): Add
	MissingArgError.
	* c-objc-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.

cp:
	* cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.

po:
	* exgettext: Also extract MissingArgError texts from .opt files.

From-SVN: r162571
2010-07-27 15:43:31 +01:00
Joseph Myers 7a9bf9a4e0 langhooks-def.h (lhd_init_options, [...]): New.
* langhooks-def.h (lhd_init_options, LANG_HOOKS_OPTION_LANG_MASK,
	LANG_HOOKS_COMPLAIN_WRONG_LANG_P): New.
	(LANG_HOOKS_INIT_OPTIONS): Update default definition.
	(LANG_HOOKS_INITIALIZER): Add new hooks.
	* langhooks.c (lhd_init_options, lhd_complain_wrong_lang_p): New.
	* langhooks.h (struct lang_hooks): Add new hooks option_lang_mask
	and complain_wrong_lang_p.  Update init_options prototype.
	* c-objc-common.c (c_initialize_diagnostics): First call
	c_common_initialize_diagnostics.
	* c-objc-common.h (LANG_HOOKS_OPTION_LANG_MASK,
	LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
	* coretypes.h (struct cl_option, struct cl_decoded_option):
	Declare.
	* hooks.c (hook_uint_uint_constcharptrptr_0): Remove.
	(hook_uint_void_0): New.
	* hooks.h (hook_uint_uint_constcharptrptr_0): Remove.
	(hook_uint_void_0): New.
	* opts-common.c (decode_cmdline_option,
	decode_cmdline_options_to_array): Also fill in canonical_option
	field.
	* opts.c (complain_wrong_lang): Use langhook to determine whether
	to complain instead of special-casing LTO.
	(decode_options): Separate lang_mask determination with
	option_lang_mask hook from call of init_options hook.
	* opts.h (struct cl_decoded_option): Add canonical_option.

ada:
	* gcc-interface/misc.c (gnat_option_lang_mask): New.
	(gnat_init_options): Update prototype.  Reconstruct argv array
	from decoded options.

c-family:
	* c-common.h (c_common_option_lang_mask,
	c_common_initialize_diagnostics, c_common_complain_wrong_lang_p):
	New.
	(c_common_init_options): Update prototype.
	* c-opts.c (c_common_option_lang_mask): New.
	(c_common_initialize_diagnostics): Split out of
	c_common_init_options.
	(accept_all_c_family_options, c_common_complain_wrong_lang_p):
	New.
	(c_common_init_options): Update prototype.  Use decoded options in
	search for -lang-asm.

cp:
	* cp-objcp-common.c (cxx_initialize_diagnostics): First call
	c_common_initialize_diagnostics.
	* cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
	LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.

fortran:
	* cpp.c (gfc_cpp_init_options): Update prototype.  Use number of
	decoded options in allocating deferred_opt.
	* cpp.h (gfc_cpp_init_options): Update prototype.
	* f95-lang.c (LANG_HOOKS_OPTION_LANG_MASK): Define.
	* gfortran.h (gfc_option_lang_mask): New.
	(gfc_init_options): Update prototype.
	* options.c (gfc_option_lang_mask): New.
	(gfc_init_options): Update prototype.  Pass new arguments to
	gfc_cpp_init_options.

java:
	* lang.c (java_option_lang_mask): New.
	(java_init_options): Update prototype.
	(LANG_HOOKS_OPTION_LANG_MASK): Define.

lto:
	* lto-lang.c (lto_option_lang_mask, lto_complain_wrong_lang_p):
	New.
	(lto_init_options): Update prototype.
	(LANG_HOOKS_OPTION_LANG_MASK, LANG_HOOKS_COMPLAIN_WRONG_LANG_P):
	Define.

From-SVN: r162560
2010-07-27 10:59:51 +01:00
Steven Bosscher 3b06d37902 system.h: Poison GCC_EXCEPT_H for front-end files.
gcc/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* system.h: Poison GCC_EXCEPT_H for front-end files.

	* langhooks.h (struct lang_hooks): Add eh_protect_cleanup_actions
	langhook.
	* langhooks-def.h (LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS) New.
	Define to NULL by default.
	* except.h: Define GCC_EXCEPT_H.
	(doing_eh): Remove prototype.
	(init_eh, init_eh_for_function): Move prototypes to toplev.h.
	(lang_protect_cleanup_actions): Remove.
	* except.c (lang_protect_cleanup_actions): Remove.
	(doing_eh): Remove.
	(gen_eh_region): Don't check doing_eh here.
	* toplev.h (init_eh, init_eh_for_function_): Moved from except.h.
	* tree-eh.c (honor_protect_cleanup_actions): Use new langhook
	instead of lang_protect_cleanup_actions.
	* omp-low.c (maybe_catch_exception): Likewise.
	* Makefile.in: Update dependencies.

gcc/c-family/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* c-cppbuiltin.c: Do not include except.h.

gcc/objc/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* objc-act.c: Do not include except.h.

gcc/cp/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* init.c: Do not include except.h.
	* decl.c: Likewise.
	* expr.c: Likewise.
	* cp-lang.c: Likewise.
	* pt.c: Likewise.
	* semantics.c: Likewise.
	* decl2.c: Likewise.
	* except.c: Likewise.
	(init_exception_processing): Do not set the removed
	lang_protect_cleanup_actions here.
	(cp_protect_cleanup_actions): Make non-static and remove prototype.
	(doing_eh): New, moved from except.c but removed the do_warning flag.
	(expand_start_catch_block): Update doing_eh call.
	(expand_end_catch_block): Likewise.
	(build_throw): Likewise.
	* cp-tree.h: Prototype cp_protect_cleanup_actions.
	* cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
	cp_protect_cleanup_actions.
	* Make-lang.in: Update dependencies.

gcc/objcp/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* objcp-lang.c: Do not include except.h.
	* Make-lang.in: Update dependencies.

gcc/java/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* lang.c: Do not include except.h
	* except.c: Likewise.
	(doing_eh): New, moved from except.c (in gcc/) but removed the
	do_warning flag.
	(maybe_start_try): Update doing_eh call.
	* Make-lang.in: Update dependencies.

gcc/ada/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* gcc-interface/misc.c: Do not include except.h.
	* gcc-interface/Make-lang.in: Update dependencies.

gcc/fortran/ChangeLog:
2010-06-28  Steven Bosscher  <steven@gcc.gnu.org>

	* Make-lang.in: Update dependencies.

From-SVN: r161484
2010-06-28 10:52:46 +00:00
Jakub Jelinek 79943d19dc re PR fortran/44536 (OMP: missing error with default(none))
PR fortran/44536
	* langhooks.h (struct lang_hooks_for_decls): Add omp_report_decl.
	* langhooks-def.h (LANG_HOOKS_OMP_REPORT_DECL): Define.
	(LANG_HOOKS_DECLS): Add it.
	* gimplify.c (omp_notice_variable): Call
	lang_hooks.decls.omp_report_decl.

	* trans-openmp.c (gfc_omp_predetermined_sharing): Don't return
	OMP_CLAUSE_DEFAULT_SHARED for artificial vars with
	GFC_DECL_SAVED_DESCRIPTOR set.
	(gfc_omp_report_decl): New function.
	* trans.h (gfc_omp_report_decl): New prototype.
	* f95-lang.c (LANG_HOOKS_OMP_REPORT_DECL): Redefine.

	* gfortran.dg/gomp/pr44536.f90: New test.
	* gfortran.dg/gomp/sharing-3.f90: Remove xfail.

From-SVN: r160779
2010-06-15 14:15:26 +02:00
Eric Botcazou 616f1431bf langhooks.h (struct lang_hooks): Add new field deep_unsharing.
* langhooks.h (struct lang_hooks): Add new field deep_unsharing.
	* langhooks-def.h (LANG_HOOKS_DEEP_UNSHARING): New macro.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_DEEP_UNSHARING.
	* gimplify.c: (mostly_copy_tree_r): Copy trees under SAVE_EXPR and
	TARGET_EXPR nodes, but only once, if instructed to do so.  Do not
	propagate the 'data' argument to copy_tree_r.
	(copy_if_shared_r): Remove bogus ATTRIBUTE_UNUSED marker.
	Propagate 'data' argument to walk_tree.
	(copy_if_shared): New function.
	(unmark_visited_r): Remove bogus ATTRIBUTE_UNUSED marker.
	(unmark_visited): New function.
	(unshare_body): Call copy_if_shared instead of doing it manually.
	(unvisit_body): Call unmark_visited instead of doing it manually.
ada/
	* gcc-interface/misc.c (LANG_HOOKS_DEEP_UNSHARING): Redefine.
	* gcc-interface/trans.c (unshare_save_expr): Delete.
	(gigi): Do not unshare trees under SAVE_EXPRs here.

From-SVN: r159592
2010-05-19 17:53:58 +00:00
Martin Jambor b5023f3c40 cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef and define.
2010-05-14  Martin Jambor  <mjambor@suse.cz>

	* cp/cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
	and define.

	* langhooks-def.h (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove.
	(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_FOLD_OBJ_TYPE_REF.
	* langhooks.h (struct lang_hooks_for_decls): Removed field
	fold_obj_type_ref.
	* tree.c (free_lang_data): Remove assignment to
	lang_hooks.fold_obj_type_ref.
	* tree.def (OBJ_TYPE_REF): Update comment.

From-SVN: r159393
2010-05-14 15:08:45 +02:00
Manuel López-Ibáñez 3734d9607e re PR c/40989 (-Werror= and #pragma diagnostics do not work with group flags)
2010-05-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 40989
	* doc/invoke.texi (Wimplicit): Document as C only.
	* opts.c (common_handle_option): Add argument kind.
	(handle_option): Rename as read_cmdline_option. Factor out code to...
	(handle_option): ... here. New.
	(handle_options): Rename as read_cmdline_options.
	(decode_options): Update call.
	(set_option): Use option index instead of option pointer. Classify
	diagnostics correctly.
	(enable_warning_as_error): Call handle_option.
	* opts.h (set_option): Update declaration.
	(handle_option): Declare.
	* langhooks.h (struct lang_hooks): Add argument kind to
	handle_option.
	* c.opt (Wimplicit,Wimplicit-int): Initialize to -1.
	* c-opts.c (set_Wimplicit): Delete.
	(c_family_lang_mask): New static constant.
	(c_common_handle_option): Add argument kind. Use handle_option
	instead of set_Wimplicit.
	(c_common_post_options): warn_implicit and warn_implicit_int
	are disabled by default.
	* c-common.c (warn_implicit): Do not define here.
	* c-common.h (warn_implicit): Do not declare here.
	(c_common_handle_option): Update declaration.
	* lto-opts.c (lto_reissue_options): Update call to set_option.
java/
	* lang.c (java_handle_option): Add argument kind.
fortran/	
	* options.c (gfc_handle_option): Add argument kind.
	* gfortran.h (gfc_handle_option): Update declaration.
ada/
	* gcc-interface/misc.c (gnat_handle_option): Add argument kind.
testsuite/
	* gcc.dg/pr40989.c: New.

From-SVN: r159102
2010-05-06 10:12:36 +00:00
Jan Hubicka 6744a6abc3 cgraph.c (same_body_alias_1): Break out of
* cgraph.c (same_body_alias_1): Break out of
	(same_body_alias): ... here; remove comdat check; it is handled
	in cp already.
	(cgraph_add_thunk): New.
	(dump_cgraph_node): Dump aliases and thunks.
	* cgraph.h (cgraph_thunk_info): New structure.
	(struct cgraph_node): Add thunk info.
	(cgraph_add_thunk): New.
	* cgraphunit.c (cgraph_emit_thunks): Remove.
	(cgraph_finalize_compilation_unit): Do not call cgraph_emit_thunks.
	(assemble_thunk): New function.
	(cgraph_expand_function): Handle thunks.
	(thunk_adjust): New.
	(init_lowered_empty_function): New.
	* optimize.c (maybe_clone_body): Emit thunks associated to alias.
	* Make-lang.in (method.o): Add dependency on gimple.h.
	* method.c: Include gimple.h
	(make_alias_for_thunk): Use same body alias instead of assemble_alias.
	(use_thunk): Drop codegen; use cgraph_add_thunk; gimplify
	generic thunks.
	* semantics.c (expand_or_defer_fn): Emit associated thunks.
	* cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove.
	* lto-cgraph.c (lto_output_node): Stream thunk info.
	(input_node): Likewise.
	* langhooks.h (lang_hooks_for_callgraph): Remove emit_associated_thunks.
	* langhooks-def.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove.
	(LANG_HOOKS_CALLGRAPH_INITIALIZER): Update.
	* i386.c (x86_output_mi_thunk): Make output prettier.

From-SVN: r154736
2009-11-29 10:32:08 +00:00
Diego Novillo d7f09764d7 Merge lto branch into trunk.
From-SVN: r152434
2009-10-03 17:10:11 -04:00
Richard Henderson 384c400a82 except.h (struct eh_region_d): Add use_cxa_end_cleanup.
* except.h (struct eh_region_d): Add use_cxa_end_cleanup.
	* except.c (gen_eh_region): Set it.
	(duplicate_eh_regions_1): Copy it.
	* tree-eh.c (lower_resx): Use it to determine which function
	to call to resume.

	* langhooks.h (struct lang_hooks): Add eh_use_cxa_end_cleanup.
	* langhooks-def.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.

	* builtins.def (BUILT_IN_CXA_END_CLEANUP): New.
	* tree.c (build_common_builtin_nodes): Remove parameter.  Build
	BUILT_IN_CXA_END_CLEANUP if necessary.
	* tree.h (build_common_builtin_nodes): Update decl.

	* c-common.c (c_define_builtins): Update call to
	build_common_builtin_nodes.

gcc/ada/
	* gcc-interface/utils.c (gnat_install_builtins): Update call to
	build_common_builtin_nodes.

gcc/cp/
	* cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.

gcc/fortran/
	* f95-lang.c (gfc_init_builtin_functions): Update call to
	build_common_builtin_nodes.

gcc/java/
	* builtins.c (initialize_builtins): Update call to
	build_common_builtin_nodes.
	* lang.c (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.

From-SVN: r152241
2009-09-28 09:44:32 -07:00
Dodji Seketeli d40a19da13 re PR debug/41266 (Emit DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack)
Fix for PR debug/41266

ChangeLog:

	* include/dwarf2.h (enum dwarf_tag): Add
	DW_TAG_template_parameter_pack and DW_TAG_formal_parameter_pack.

gcc/ChangeLog:

	* dwarf2out.c (template_parameter_pack_die,
	gen_formal_parameter_pack_die ): New functions.
	(make_ith_pack_parameter_name): Remove this function.
	(dwarf_tag_name): Support printing DW_TAG_template_parameter_pack and
	DW_TAG_formal_parameter_pack.
	(gen_generic_params_dies): Represent each template parameter pack
	by a DW_TAG_template_parameter_pack DIE. Argument pack elements are
	represented by usual DW_TAG_template_*_parameter DIEs that are
	children of the DW_TAG_template_parameter_pack element DIE.
	(generic_parameter_die): This doesn't deal with parameter pack
	names anymore. Don't generate DW_AT_name for some DIEs, e.g. children of
	parameter pack DIEs.
	(gen_formal_parameter_die): Add a flag to not emit DW_AT_name
	in certain cases, e.g. for pack elements.
	(gen_formal_types_die, gen_decl_die): Adjust usage of
	gen_formal_parameter_die.
	(gen_subprogram_die): Represent each function parameter pack by a
	DW_TAG_formal_parameter_pack DIE. Arguments of of the pack are
	represented by usual DW_TAG_formal_parameter DIEs that are children
	of the DW_TAG_formal_parameter_pack DIE. Remove references to
	____builtin_va_alist decls as no part of the compiler uses those
	anymore.
	* langhooks.h (struct lang_hooks_for_decls): Add
	function_parm_expanded_from_pack_p, get_generic_function_decl
	and function_parameter_pack_p hooks.  Fix comment for
	get_innermost_generic_parms hook.
	* langhooks-def.h (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
	LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P ): Declare new hook
	macros and use them to initialize lang_hook.

gcc/cp/ChangeLog:

	* cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
	LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
	LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
	hooks for the c++ FE.
	* cp-tree.h (function_parameter_pack_p, get_function_template_decl,
	function_parameter_expanded_from_pack_p): Declare ...
	* pt.c (function_parameter_pack_p, get_function_template_decl,
	function_parameter_expanded_from_pack_p): ... new hooks.
	(get_template_info): Make this more robust.
	(template_args_variadic_p, make_ith_pack_parameter_name): Add a new
	line between comment and function.
	(get_template_argument_pack_elems): Fix comment.
	(tsubst_decl): Arguments of function parameter packs are not
	parameter packs themselves.

gcc/testsuite/ChangeLog:
	* g++.dg/debug/dwarf2/template-func-params-4.C: Adjust.
	* g++.dg/debug/dwarf2/template-func-params-7.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-4.C: Likewise.

From-SVN: r152043
2009-09-22 22:20:03 +02:00
Richard Guenther f9417da1a2 langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
2009-09-13  Richard Guenther  <rguenther@suse.de>
	Rafael Avila de Espindola  <espindola@google.com>

	* langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
	(LANG_HOOKS_EH_PERSONALITY): Likewise.
	(LANG_HOOKS_INITIALIZER): Adjust.
	(lhd_pass_through_t): Declare.
	* langhooks.h (struct lang_hooks): Add eh_runtime_type and
	eh_personality.
	* langhooks.c (lhd_pass_through_t): New function.

        * dwarf2out.c (output_call_frame_info, dwarf2out_do_cfi_startproc,
	dwarf2out_begin_prologue): Use personality from current_function_decl.
        * expr.h (get_personality_function): Declare.
	* expr.c (get_personality_function): New function.
	(build_personality_function): Likewise.
        * libfuncs.h (libfunc_index): Remove LTI_eh_personality.
        (eh_personality_libfunc): Remove.
        * optabs.c (build_libfunc_function): New function split out from ...
	(init_one_libfunc): ... here.
        * tree.h (DECL_FUNCTION_PERSONALITY): New.
        (tree_function_decl): Add personality.
	(lhd_gcc_personality): Declare.
	(build_personality_function): Likewise.
	* tree.c (gcc_eh_personality_decl): New.
	(lhd_gcc_personality): New function.
	* except.h (lang_eh_runtime_type): Remove.
	(enum eh_personality_kind): New.
	(build_personality_function): Declare.
	(function_needs_eh_personality): Declare.
        * except.c (lang_eh_runtime_type): Remove.
	(function_needs_eh_personality): New function.
	(add_type_for_runtime): Call lang_hooks.type_for_runtime instead.
        (sjlj_emit_function_enter, output_function_exception_table):
        Use personality from current_function_decl.
	* tree-eh.c (lower_eh_constructs): Set DECL_FUNCTION_PERSONALITY.
	* tree-inline.c (tree_can_inline_p): Do not inline across different
	EH personalities.
	(expand_call_inline): Likewise.  Adjust the callers EH personality.
	(tree_function_versioning): Copy DECL_FUNCTION_PERSONALITY.
	* cgraph.c (cgraph_add_new_function): Set DECL_FUNCTION_PERSONALITY.
	* Makefile.in (cgraph.o): Add $(EXCEPT_H) dependency.
	(c-parser.o): Likewise

	* c-tree.h (c_eh_initialized_p): Remove.
	(c_maybe_initialize_eh): Likewise.
	* c-decl.c (finish_decl): Don't call c_maybe_initialize_eh.
	(finish_decl): Don't call c_maybe_initialize_eh.
	(c_eh_initialized_p): Remove.
	(c_maybe_initialize_eh): Likewise.
        * c-parser.c (c_parser_omp_construct): Likewise.
	(c_parse_file): Initialize exception handling.

	objc/
	* objc-act.c (objc_eh_runtime_type): Export.
	(objc_init_exceptions): Remove.  Move warning code ...
	(objc_begin_try_stmt): ... here
	(objc_build_throw_stmt): ... and here.
	(objc_eh_personality_decl): New.
	(objc_eh_personality): New function.
	* objc-act.h (objc_eh_runtime_type): Declare.
	(objc_eh_personality): Likewise.
	* objc-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
	(LANG_HOOKS_EH_PERSONALITY): Likewise.

	cp/
	* except.c (init_exception_processing): Do not set
	lang_eh_runtime_type.
	(choose_personality_routine): Do not set eh_personality_decl,
	set pragma_java_exceptions.
	* cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
	(LANG_HOOKS_EH_PERSONALITY): Likewise.
	(cp_eh_personality_decl): New.
	(cp_eh_personality): Likewise.
	* Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
	dependencies.

	java/
	* decl.c (do_nothing): Remove.
	(java_init_decl_processing): Do not set lang_eh_runtime_type.
	* Make-lang.in (lang.o): Add $(EXCEPT_H) dependency.
	* lang.c (java_eh_personality): New.
	(java_eh_personality_decl): Likewise.
	(LANG_HOOKS_EH_PERSONALITY): Define.

	ada/
	* gcc-interface/misc.c (gnat_init_gcc_eh): Do not set
	lang_eh_runtime_type.
	(LANG_HOOKS_EH_PERSONALITY): Define.
	(gnat_eh_personality_decl): New.
	(gnat_eh_personality): Likewise.
	* Make-lang.in (misc.o): Add gt-ada-misc.h dependency.
	* config-lang.in (gtfiles): Add misc.c.

	fortran/
	* f95-lang.c (gfc_maybe_initialize_eh): Do not init
	eh_personality_libfunc.

Co-Authored-By: Rafael Avila de Espindola <espindola@google.com>

From-SVN: r151676
2009-09-13 19:40:33 +00:00
Diego Novillo 4537ec0c86 [multiple changes]
2009-09-01  Diego Novillo  <dnovillo@google.com>

	* c-lang.c (lang_hooks): Remove const qualifier.

java/ChangeLog

	* lang.c (lang_hooks): Remove const qualifier.

objc/ChangeLog

	* objc-lang.c (lang_hooks): Remove const qualifier.

objcp/ChangeLog

	* objcp-lang.c (lang_hooks): Remove const qualifier.

ada/ChangeLog

	* gcc-interface/misc.c (lang_hooks): Remove const qualifier.

fortran/ChangeLog

	* f95-lang.c (lang_hooks): Remove const qualifier.

cp/ChangeLog

	* cp-lang.c (lang_hooks): Remove const qualifier.

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* cgraph.c (cgraph_node_for_decl): New.
	* cgraph.h (cgraph_node_for_decl): Declare.
	* tree.c (host_integerp): Return 0 if T is NULL.


2009-09-01  Diego Novillo  <dnovillo@google.com>

	* tree.h (struct alias_pair): Move from varasm.c.
	(alias_pairs): Likewise.
	(TYPE_MAXVAL): Define.
	(TYPE_MINVAL): Define.
	(iterative_hash_host_wide_int): Declare.
	(remove_unreachable_alias_pairs): Declare.
	* tree-pass.h (pass_ipa_free_lang_data): Declare.
	* diagnostic.c (default_diagnostic_starter): Make extern.
	(default_diagnostic_finalizer): Make extern.
	* diagnostic.h (default_diagnostic_starter): Declare.
	(default_diagnostic_finalizer): Declare.
	(default_tree_printer): Declare.
	* toplev.c (default_tree_printer): Make extern.


2009-09-01  Richard Guenther  <rguenther@suse.de>
	    Diego Novillo  <dnovillo@google.com>

	* cgraph.c (cgraph_add_new_function): Remove gimplification.
	* cgraphunit.c (cgraph_expand_function): Do not emit
	associated thunks from here.
	(cgraph_emit_thunks): New.
	(cgraph_optimize): Call it.
	Return if any IPA pass finds an error.
	* varasm.c (finish_aliases_1): Ignore errorneous aliases used
	by thunks.


2009-09-01  Simon Baldwin  <simonb@google.com>
	    Rafael Espindola  <espindola@google.com>
	    Richard Guenther  <rguenther@suse.de>
	    Doug Kwan  <dougkwan@google.com>
	    Diego Novillo  <dnovillo@google.com>

	* tree.c: Include tree-pass.h, langhooks-def.h,
	diagnostic.h, cgraph.h, timevar.h, except.h and debug.h.
	(free_lang_data_in_type): New.
	(need_assembler_name_p): New.
	(free_lang_data_in_block): New.
	(free_lang_data_in_decl): New.
	(struct free_lang_data_d): New.
	(add_tree_to_fld_list): New.
	(find_decls_types_r): New.
	(get_eh_types_for_runtime): New.
	(find_decls_types_in_eh_region): New.
	(find_decls_types_in_node): New.
	(find_decls_types_in_var): New.
	(free_lang_data_in_cgraph): New.
	(free_lang_data): New.
	(gate_free_lang_data): New.
	(pass_ipa_free_lang_data): New.

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* timevar.def (TV_IPA_FREE_LANG_DATA): Define.
	* langhooks.h (struct lang_hooks): Add field free_lang_data.
	(lang_hooks): Remove const qualifier.
	* ipa.c (cgraph_remove_unreachable_nodes): Call
	remove_unreachable_alias_pairs.
	* except.c (add_type_for_runtime): Check if TYPE has
	already been converted.
	(lookup_type_for_runtime): Likewise.
	(check_handled): Handle converted types.
	* varasm.c (remove_unreachable_alias_pairs): New.
	* gimple.c: Include demangle.h.
	(gimple_decl_printable_name): New.
	(gimple_fold_obj_type_ref): New.
	* gimple.h (gimple_decl_printable_name): Declare.
	(gimple_fold_obj_type_ref): Declare.
	* passes.c (init_optimization_passes): Add pass
	pass_ipa_free_lang_data.
	* langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA.

testsuite/ChangeLog

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* gcc.dg/gomp/combined-1.c: Adjust expected pattern.
	* g++.dg/tree-prof/inline_mismatch_args.C: Likewise.
	* g++.dg/warn/unit-1.C: Likewise.
	* g++.dg/ipa/iinline-1.C: Likewise.
	* g++.dg/template/cond2.C: Adjust expected line location for the
	error.
	* g++.dg/template/pr35240.C: Likewise.


cp/ChangeLog

2009-09-01  Doug Kwan  <dougkwan@google.com>

	* tree.c (cp_fix_function_decl_p): New.
	(cp_free_lang_data): New.

2009-09-01  Diego Novillo  <dnovillo@google.com>

	* Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
	* decl2.c: Include pointer-set.h.
	(collect_candidates_for_java_method_aliases): New.
	(cp_write_global_declarations): Call it.
	Add local variable CANDIDATES.  If set, call
	build_java_method_aliases.
	(build_java_method_aliases): Add argument CANDIDATES.
	Use it to determine if FNDECL should get a hidden alias.
	* cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
	* cp-tree.h (cp_free_lang_data): Declare.

2009-09-03  Richard Guenther  <rguenther@suse.de>

	* method.c (use_thunk): Use cgraph_finalize_function to hand
	off thunks to the cgraph.
	* semantics.c (emit_associated_thunks): Do not emit thunks
	for really extern functions.

From-SVN: r151360
2009-09-03 00:07:12 -04:00
Richard Guenther 71c00b5c99 tree.c (tree_expr_size): New function.
2009-09-01  Richard Guenther  <rguenther@suse.de>

	* tree.c (tree_expr_size): New function.
	* tree.h (tree_expr_size): Declare.
	* rtlanal.c (rtx_addr_can_trap_p_1): Adjust comment.
	* builtins.c (fold_builtin_memory_op): Use tree_expr_size.
	* langhooks.c (lhd_expr_size): Remove.
	* langhooks.h (struct lang_hooks): Remove expr_size.
	* explow.c (expr_size): Use tree_expr_size.
	(int_expr_size): Likewise.
	* langhooks-def.h (lhd_expr_size): Remove.
	(LANG_HOOKS_EXPR_SIZE): Likewise.
	(LANG_HOOKS_INITIALIZER): Adjust.

	cp/
	* cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
	* cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.

From-SVN: r151261
2009-09-01 08:41:53 +00:00
Richard Guenther 58f986ca91 tree-flow.h (mark_addressable): Move declaration ...
2009-09-01  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (mark_addressable): Move declaration ...
	* tree.h (mark_addressable): ... here.
	* stmt.c (expand_asm_operands): Use mark_addressable, not
	lang_hooks.mark_addressable.
	* langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove
	LANG_HOOKS_MARK_ADDRESSABLE.
	* langhooks.h (struct lang_hooks): Remove mark_addressable langhook.

	* c-objc-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.

	ada/
	* gcc-interface/misc.c (LANG_HOOKS_MARK_ADDRESSABLE): Remove.

	cp/
	* cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.

	fortran/
	* f95-lang.c (gfc_mark_addressable): Remove.
	(LANG_HOOKS_MARK_ADDRESSABLE): Likewise.

	java/
	* lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
	* java-tree.h (java_mark_addressable): Likewise.
	* typeck.c (java_mark_addressable): Likewise.

From-SVN: r151260
2009-09-01 08:38:10 +00:00
Dodji Seketeli f9329c35d7 Emit DWARF for template parameters (PR debug/30161)
ChangeLog:
	PR debug/30161
	* include/dwarf2.h (enum dwarf_tag): Added
	DW_TAG_GNU_template_template_param
	(enum dwarf_attribute): Added DW_AT_GNU_template_name.

gcc/ChangeLog:
	PR debug/30161
	* cgraph.h (cgraph_get_node): Declare ...
	* cgraph.c (cgraph_get_node): ... new function.
	* dwarf2out.c (gen_generic_params_dies,
	generic_parameter_die, tree_add_const_value_attribute_for_decl,
	make_ith_pack_parameter_name,
	append_entry_to_tmpl_value_parm_die_table,
	gen_remaining_tmpl_value_param_die_attribute): New functions.
	(gen_subprogram_die): Generate debug info for template parameters
	if debug info level is higher than DINFO_LEVEL_TERSE.
	Use tree_add_const_value_attribute_for_decl instead of
	tree_add_const_value_attribute.
	(gen_const_die): Use tree_add_const_value_attribute_for_decl
	instead of tree_add_const_value_attribute.
	(gen_struct_or_union_type_die): Generate debug
	info for template parameters if debug info level is higher than
	DINFO_LEVEL_TERSE.
	(tree_add_const_value_attribute): Handle integral and pointer
	constants. Update comment.
	(dwarf_tag_name): Support DW_TAG_GNU_template_template_param.
	(dwarf_attr_name): Support DW_AT_GNU_template_name.
	(reference_to_unused): Fix thinko. Remove redundant predicates from
	tests.
	(tree_add_const_value_attribute): Make this work for constant
	expressions only.
	tree_add_const_value_attribute_for_decl is to be used for variable
	DECLs now.
	(add_location_or_const_value_attribute): Use
	tree_add_const_value_attribute_for_decl now.
	(dwarf2out_finish): Emit the DW_AT_const_value attribute of
	DW_TAG_template_value_param DIEs after function DIEs have been
	emitted.
	* langhooks.h (lang_hooks_for_types): Add
	get_argument_pack_elems.
	(lang_hooks_for_decls): Add generic_generic_parameter_decl_p.
	(lang_hooks): Added get_innermost_generic_parms,
	get_innermost_generic_args.
	* langhooks-def.h (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
	LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
	LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
	LANG_HOOKS_GENERIC_GENERIC_PARAMETER_DECL_P): New language hooks.

gcc/cp/ChangeLog:
	PR debug/30161
	* cp-tree.h (get_template_info): Parameter should be const.
	(CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
	(get_template_argument_pack_elems,
	get_primary_template_innermost_parameters,
	get_template_innermost_arguments, template_template_parameter_p):
	Declare ...
	* pt.c (get_template_argument_pack_elems,
	get_template_innermost_parameters, get_template_innermost_arguments,
	template_template_parameter_p):
	... New C++ front end implementation of new language hooks.
	(primary_template_instantiation_p): New private helper.
	(make_ith_pack_parameter_name): Use snprintf and strnlen instead of
	printf and strlen.
	(get_template_info): Const-ify parameter.
	* cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
	LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
	LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
	LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
	interfaces for the C++ front-end.

gcc/testsuite/ChangeLog:
	PR debug/30161
	* g++.dg/debug/dwarf2/template-params-1.C: New test.
	* g++.dg/debug/dwarf2/template-params-2.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-3.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-4.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-5.C: Likewise.
	* g++.dg/debug/dwarf2/template-params-6.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-1.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-2.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-3.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-4.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-5.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-6.C: Likewise.
	* g++.dg/debug/dwarf2/template-func-params-7.C: Likewise.

From-SVN: r151249
2009-08-31 23:48:04 +02:00
Rafael Avila de Espindola fc26fae3db cgraphunit.c (cgraph_function_versioning,save_inline_function_body): Use DECL_COMDAT_GROUP instead of DECL_ONE_ONLY.
2009-06-15  Rafael Avila de Espindola  <espindola@google.com>

	* cgraphunit.c (cgraph_function_versioning,save_inline_function_body):
	Use DECL_COMDAT_GROUP instead of DECL_ONE_ONLY.
	* cgraph.c (cgraph_create_virtual_clone): Use DECL_COMDAT_GROUP.
	* config/i386/i386.c (ix86_file_end): Compute DECL_COMDAT_GROUP.
	* dwarf2asm.c(dw2_force_const_mem): Update call to make_decl_one_only.
	* langhooks-def.h (lhd_comdat_group, LANG_HOOKS_COMDAT_GROUP): Remove.
	(LANG_HOOKS_DECLS): Remove LANG_HOOKS_COMDAT_GROUP.
	* langhooks.c (lhd_comdat_group): Remove.
	* langhooks.h (lang_hooks_for_decls): Remove comdat_group.
	* tree.h (DECL_COMDAT_GROUP): New.
	(DECL_ONE_ONLY): Use DECL_COMDAT_GROUP.
	(tree_decl_with_vis): Add comdat_group. Remove one_only.
	(make_decl_one_only): Change signature.
	* varasm.c (get_emutls_init_templ_addr, emutls_decl): Update call to
	make_decl_one_only.
	(make_decl_one_only): Change signature.
	(default_elf_asm_named_section): Use DECL_COMDAT_GROUP.

2009-06-15  Rafael Avila de Espindola  <espindola@google.com>

	* cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
	* cp-tree.h (cxx_comdat_group): Change signature.
	* decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
	(cxx_comdat_group): Change signature.
	* decl2.c (comdat_linkage, maybe_make_one_only): Update call to
	make_decl_one_only.
	(constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
	* method.c (use_thunk): Update call to make_decl_one_only.
	* optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP

2009-06-15  Rafael Avila de Espindola  <espindola@google.com>

	* g++.dg/abi/mangle11.C: Update warning line.
	* g++.dg/abi/mangle12.C: Update warning line.
	* g++.dg/abi/mangle17.C: Update warning line.
	* g++.dg/abi/mangle20-2.C: Update warning line.

From-SVN: r148492
2009-06-15 14:25:50 +00:00
Eric Botcazou 84fb43a1a4 dbxout.c (dbxout_range_type): Add LOW and HIGH parameters.
* dbxout.c (dbxout_range_type): Add LOW and HIGH parameters.  Use them
	for bounds.
	(print_int_cst_bounds_in_octal_p): Likewise.
	(dbxout_type): Adjust calls to above functions.  Be prepared to deal
	with subtypes.
	* dwarf2out.c (base_type_die): Likewise.
	(is_subrange_type): Delete.
	(subrange_type_die): Add LOW and HIGH parameters.  Use them for bounds.
	(modified_type_die): Call subrange_type_for_debug_p on subtypes.
	* fold-const.c (fold_truth_not_expr) <CONVERT_EXPR>: Do not strip it if
	the destination type is boolean.
	(build_range_check): Do not special-case subtypes.
	(fold_sign_changed_comparison): Likewise.
	(fold_unary): Likewise.
	* langhooks-def.h (LANG_HOOKS_GET_SUBRANGE_BOUNDS): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add LANG_HOOKS_GET_SUBRANGE_BOUNDS.
	* langhooks.h (lang_hooks_for_types): Add get_subrange_bounds.
	* tree.c (subrange_type_for_debug_p): New predicate based on the former
	is_subrange_type.
	* tree.h (subrange_type_for_debug_p): Declare.
	* tree-chrec.c (avoid_arithmetics_in_type_p): Delete.
	(convert_affine_scev): Remove call to above function.
	(chrec_convert_aggressive): Likewise.
	* tree-ssa.c (useless_type_conversion_p_1): Do not specifically return
	false for conversions involving subtypes.
	* tree-vrp.c (vrp_val_max): Do not special-case subtypes.
	(vrp_val_min): Likewise.
	(needs_overflow_infinity): Likewise.
	(extract_range_from_unary_expr): Likewise.
ada/
	* gcc-interface/ada-tree.h (TYPE_GCC_MIN_VALUE, TYPE_GCC_MAX_VALUE):
	New macros.
	(TYPE_RM_VALUES): Likewise.
	(TYPE_RM_SIZE): Rewrite in terms of TYPE_RM_VALUES.
	(SET_TYPE_RM_SIZE): New macro.
	(TYPE_RM_MIN_VALUE, TYPE_RM_MAX_VALUE): Likewise.
	(SET_TYPE_RM_SIZE, SET_TYPE_RM_MAX_VALUE): Likewise.
	(TYPE_MIN_VALUE, TYPE_MAX_VALUE): Redefine.
	* gcc-interface/gigi.h (create_range_type): Declare.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>
	Use SET_TYPE_RM_MAX_VALUE to set the upper bound on the UMT type.
	<E_Signed_Integer_Subtype>: Build a regular integer type first and
	then set the RM bounds.  Use SET_TYPE_RM_SIZE to set the RM size.
	<E_Floating_Point_Subtype>: Build a regular floating-point type first
	and then set the RM bounds.
	<E_Array_Type>: Use create_range_type instead of build_range_type.
	<E_Array_Subtype>: Build a regular integer type first and then set
	the RM bounds for the extra subtype.
	<E_String_Literal_Subtype>: Use create_range_type instead of
	build_range_type.
	<all>: Set the RM bounds for enumeration types and the GCC bounds for
	floating-point types.
	(set_rm_size): Use SET_TYPE_RM_SIZE to set the RM size.
	(make_type_from_size) <INTEGER_TYPE>: Use SET_TYPE_RM_{MIN,MAX}_VALUE
	to set the bounds.  Use SET_TYPE_RM_SIZE to set the RM size.
	(substitute_in_type) <INTEGER_TYPE>: Deal with GCC bounds for domain
	types and with RM bounds for subtypes.
	* gcc-interface/misc.c (LANG_HOOKS_GET_SUBRANGE_BOUNDS): Define.
	(gnat_print_type) <REAL_TYPE>: New case.
	<ENUMERAL_TYPE>: Fall through to above case.
	(gnat_get_subrange_bounds): New function.
	* gcc-interface/trans.c (add_decl_expr): Mark the trees rooted as
	TYPE_RM_MIN_VALUE and TYPE_RM_MAX_VALUE, if any.
	* gcc-interface/utils.c (gnat_init_decl_processing): Use precision 8
	for booleans.  Adjust and use SET_TYPE_RM_SIZE to set the RM size.
	(create_range_type): New function.
	(create_param_decl): Build a regular integer type first and then set
	the RM bounds for the extra subtype.
	(unchecked_convert): Remove kludge for 'Valid.
	* gcc-interface/utils2.c (build_binary_op) <ARRAY_RANGE_REF>: Convert
	the index to sizetype instead of TYPE_DOMAIN.

From-SVN: r147563
2009-05-15 09:11:40 +00:00
Joseph Myers 4f1e4960a6 attribs.c (decl_attributes): Use %qE for identifiers in diagnostics.
* attribs.c (decl_attributes): Use %qE for identifiers in
	diagnostics.
	* cgraphunit.c (verify_cgraph_node): Translate function names to
	locale character set in diagnostics.
	* coverage.c (get_coverage_counts): Use %qE for identifiers in
	diagnostics.
	* doc/invoke.texi (-finstrument-functions-exclude-function-list):
	Document that functions are named in UTF-8.
	* expr.c (expand_expr_real_1): Translate function names to locale
	character set in diagnostics.
	* gimplify.c (omp_notice_variable, omp_is_private,
	gimplify_scan_omp_clauses): Use %qE for identifiers in
	diagnostics.
	* langhooks.c (lhd_print_error_function): Translate function names
	to locale character set.
	* langhooks.h (decl_printable_name): Document that return value is
	in internal character set.
	* stmt.c: Include pretty-print.h
	(tree_conflicts_with_clobbers_p): Use %qE for identifiers in
	diagnostics.
	(resolve_operand_name_1): Translate named operand name to locale
	character set.
	* stor-layout.c (finalize_record_size): Use %qE for identifiers in
	diagnostics.
	* toplev.c (announce_function): Translate function names to locale
	character set.
	(warn_deprecated_use): Use %qE for identifiers in diagnostics.
	(default_tree_printer): Use pp_identifier or translate identifiers
	to locale character set.  Mark "<anonymous>" for translation.
	* tree-mudflap.c (mx_register_decls, mudflap_finish_file): Use %qE
	for identifiers in diagnostics.
	* tree.c (handle_dll_attribute): Use %qE for identifiers in
	diagnostics.
	* varasm.c (output_constructor): Use %qE for identifiers in
	diagnostics.

testsuite:
	* gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c, gcc.dg/ucnid-13.c: New
	tests.

From-SVN: r147111
2009-05-05 00:44:36 +01:00
Paolo Bonzini 2ec5deb5c3 c-common.c (c_expand_expr, c_staticp): Remove.
2009-03-28  Paolo Bonzini  <bonzini@gnu.org>

        * c-common.c (c_expand_expr, c_staticp): Remove.
        * c-common.def (COMPOUND_LITERAL_EXPR): Delete.
        * c-common.h (emit_local_var, c_staticp, COMPOUND_LITERAL_EXPR_DECL,
        COMPOUND_LITERAL_EXPR_DECL_EXPR): Remove.
        * c-gimplify.c (gimplify_compound_literal_expr,
        optimize_compound_literals_in_ctor): Remove.
        (c_gimplify_expr): Remove COMPOUND_LITERAL_EXPR handling.
        * c-objc-common.h (LANG_HOOKS_STATICP): Remove.
        * c-semantics.c (emit_local_var): Remove.

        * langhooks-def.h (lhd_expand_expr): Remove.
        * langhooks.c (lhd_expand_expr): Remove.
        * langhooks.h (LANG_HOOKS_DEF): Remove LANG_HOOKS_EXPAND_EXPR.

        * expr.c (expand_expr_real_1): Move COMPOUND_LITERAL_EXPR
        handling from c-semantics.c; don't call into langhook.
        (expand_expr_addr_expr_1): Check that we don't get non-GENERIC trees.
        * gimplify.c (gimplify_compound_literal_expr,
        optimize_compound_literals_in_ctor): Move from c-gimplify.c.
        (gimplify_init_constructor): Call optimize_compound_literals_in_ctor.
        (gimplify_modify_expr_rhs, gimplify_expr): Handle COMPOUND_LITERAL_EXPR
        as was done in c-gimplify.c.
        * tree.c (staticp): Move COMPOUND_LITERAL_EXPR handling from c_staticp.
        * tree.h (COMPOUND_LITERAL_EXPR_DECL, COMPOUND_LITERAL_EXPR_DECL_EXPR):
        Move from c-common.h.
        * tree.def (COMPOUND_LITERAL_EXPR): Move from c-common.def.

	* tree.c (staticp): Do not call langhook.
	* langhooks.c (lhd_staticp): Delete.
	* langhooks-def.h (lhd_staticp): Delete prototype.
	(LANG_HOOKS_STATICP): Delete.
	(LANG_HOOKS_INITIALIZER): Delete LANG_HOOKS_STATICP.

        * doc/c-tree.texi (Expression nodes): Refer to DECL_EXPRs
        instead of DECL_STMTs.

cp:
2009-03-28  Paolo Bonzini  <bonzini@gnu.org>

	* cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
	* cp/cp-objcp-common.c (cxx_staticp): Remove.
	* cp/cp-tree.h (cxx_staticp): Remove.

From-SVN: r145256
2009-03-29 18:26:43 +00:00
Dodji Seketeli 68599f330b re PR debug/37959 (g++ does not emit DW_AT_explicit)
PR debug/37959
	* dwarf2out.c (dwarf_attr_name): Handle DW_AT_explicit attribute.
	(gen_subprogram_die): When a function is explicit, generate the
	DW_AT_explicit attribute.
	* langhooks.h (struct lang_hooks_for_decls): Add
	function_decl_explicit_p langhook.
	* langhooks-def.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
	(LANG_HOOKS_DECLS): Add LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P.

	* cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
	(cp_function_decl_explicit_p): New prototype.
	* cp-objcp-common.c (cp_function_decl_explicit_p): New function.

	* g++.dg/debug/dwarf2/explicit-constructor.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>

From-SVN: r145128
2009-03-27 22:44:21 +01:00
Jan Hubicka cff7525fb0 re PR debug/39267 (gdb testsuite regressions)
PR debug/39267
	* tree.h (TREE_PROTECTED): Fix comment.
	(BLOCK_HANDLER_BLOCK): Remove.
	(struct tree_block): Remove handler_block add body_block.
	(inlined_function_outer_scope_p): New.
	(is_body_block): Remove.
	* dbxout.c (dbxout_block): Remove BLOCK_HANDLER_BLOCK.
	* dwarf2out.c (is_inlined_entry_point): Remove.
	(add_high_low_attributes): Use inlined_function_outer_scope_p.
	(gen_block_die): Use is_inlined_entry_point check; remove body block code.
	* langhooks.h (struct lang_hooks): Remove no_bodu_blocks.
	* gimplify.c (gimplify_expr): Gimplify body blocks.
	* tree-ssa-live.c (remove_unused_scope_block_p): Allow removing wrapper block
	with multiple subblocks.
	(dump_scope_block): Prettier output; dump more flags and info.
	(dump_scope_blocks): New.
	(remove_unused_locals): Use dump_scope_blocks.
	* tree-flow.h (dump_scope_blocks): Declare.
	* tree-cfg.c (execute_build_cfg): Dump scope blocks.
	* stmt.c (is_body_block): Remove.
	* tree-inline.c (remap_block): Copy BODY_BLOCK info.
	* langhooks-def.h (LANG_HOOKS_NO_BODY_BLOCKS): Remove.

From-SVN: r144474
2009-02-27 19:49:42 +00:00
Andrew Pinski 2700cb8675 re PR objc/37460 (NeXT runtime ICEs)
2008-09-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        * tree.c (get_callee_fndecl): Don't call the language hook.
        * langhooks.h (lang_hooks): Remove lang_get_callee_fndecl.
        * langhooks-def.h (LANG_HOOKS_GET_CALLEE_FNDECL): Kill.
        (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_GET_CALLEE_FNDECL.


2008-09-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR objc/37460
        * objc-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
        * objc-act.h (objc_get_callee_fndecl): Remove prototype.
        * objc-act.c (objc_get_callee_fndecl): Kill.

2008-09-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        * lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.
        (java_get_callee_fndecl): Kill.

2008-09-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR objc/37460
        * objcp-lang.c (LANG_HOOKS_GET_CALLEE_FNDECL): Don't define.

From-SVN: r140430
2008-09-17 14:39:13 -07:00
Paolo Bonzini 0c03f46fcb c-common.c (c_expand_decl): Remove.
2008-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* c-common.c (c_expand_decl): Remove.
	* c-common.h (anon_aggr_type_p): Remove prototype.
	(DECL_ANON_UNION_ELEMS): Remove.
	* c-objc-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
	* c-decl.c (anon_aggr_type_p): Remove.
	* langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Remove.
	(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_EXPAND_DECL.
	* langhooks.h (struct lang_hooks): Remove expand_decl.
	* langhooks.c (lhd_expand_decl): Remove.
	* stmt.c (expand_anon_union_decl): Remove.
	* tree.h (expand_anon_union_decl): Remove prototype.

cp:
2008-09-09  Paolo Bonzini  <bonzini@gnu.org>

	* cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
	* cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
	* semantics.c (anon_aggr_type_p): Remove.

From-SVN: r140138
2008-09-09 08:56:58 +00:00
Michael Meissner 5779e7133d Change attribute((option(...))) to attribute((target(...))); Do not allocate tree nodes on x86 for builtins until we generate code for the ISA; Delete hot/cold functions changing optimization; Make C++ support target specific functions; Add #pragma GCC {push_options,pop_options,reset_options} instead of #pragma GCC {target,optimize} {push,reset,pop}
From-SVN: r139812
2008-08-30 23:50:40 +00:00
Richard Biener 726a989a8b backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
2008-07-28  Richard Guenther  <rguenther@suse.de>

	Merge from gimple-tuples-branch.

	* ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
	* gimple.def: New file.
	* gsstruct.def: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* tree-gimple.c: Removed.  Merged into ...
	* gimple.c: ... here.  New file.
	* tree-gimple.h: Removed.  Merged into ...
	* gimple.h: ... here.  New file.

	* Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h.
	* configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the
	--enable-checking=gimple flag.
	* config.in: Likewise.
	* configure: Regenerated.

	* tree-ssa-operands.h: Tuplified.
	* tree-vrp.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-complex.c: Likewise.
	* cgraphbuild.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tracer.c: Likewise.
	* gengtype.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* value-prof.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-tailcall.c: Likewise.
	* value-prof.h: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* tree-pass.h: Likewise.
	* ipa-cp.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-scalar-evolution.h: Likewise.
	* target.h: Likewise.
	* lambda-mat.c: Likewise.
	* tree-phinodes.c: Likewise.
	* diagnostic.h: Likewise.
	* builtins.c: Likewise.
	* tree-ssa-alias-warnings.c: Likewise.
	* cfghooks.c: Likewise.
	* fold-const.c: Likewise.
	* cfghooks.h: Likewise.
	* omp-low.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* ipa-reference.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* toplev.c: Likewise.
	* tree-gimple.c: Likewise.
	* tree-gimple.h: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* cgraphunit.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* c-format.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* ipa-utils.c: Likewise.
	* tree-ssa-propagate.h: Likewise.
	* tree-ssa-alias.c: Likewise.
	* gimple-low.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* ipa-inline.c: Likewise.
	* c-semantics.c: Likewise.
	* dwarf2out.c: Likewise.
	* expr.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* predict.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* matrix-reorg.c: Likewise.
	* c-decl.c: Likewise.
	* tree-eh.c: Likewise.
	* c-pretty-print.c: Likewise.
	* lambda-trans.c: Likewise.
	* function.c: Likewise.
	* langhooks.c: Likewise.
	* ebitmap.h: Likewise.
	* tree-vectorizer.c: Likewise.
	* function.h: Likewise.
	* langhooks.h: Likewise.
	* tree-vectorizer.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* domwalk.c: Likewise.
	* tree-if-conv.c: Likewise.
	* profile.c: Likewise.
	* domwalk.h: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-affine.c: Likewise.
	* tree-vect-analyze.c: Likewise.
	* c-typeck.c: Likewise.
	* gimplify.c: Likewise.
	* coretypes.h: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* calls.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree.def: Likewise.
	* tree-dfa.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* cfgexpand.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-predcom.c: Likewise.
	* lambda.h: Likewise.
	* tree-mudflap.c: Likewise.
	* ipa-prop.c: Likewise.
	* print-tree.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* ipa-prop.h: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* ggc-page.c: Likewise.
	* c-omp.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-ssa.c: Likewise.
	* lambda-code.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-iterator.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-vect-transform.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* cfgloop.c: Likewise.
	* system.h: Likewise.
	* tree-profile.c: Likewise.
	* cfgloop.h: Likewise.
	* c-gimplify.c: Likewise.
	* c-common.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-flow.h: Likewise.
	* c-common.h: Likewise.
	* basic-block.h: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-ssa-structalias.h: Likewise.
	* tree-cfg.c: Likewise.
	* passes.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* cfgrtl.c: Likewise.
	* varpool.c: Likewise.
	* stmt.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* langhooks-def.h: Likewise.
	* tree-ssa-operands.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32c/m32c-protos.h: Likewise.
	* config/spu/spu.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/mips/mips.c: Likewise.

From-SVN: r138207
2008-07-28 14:33:56 +00:00
Jakub Jelinek a68ab35173 c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to 200805.
* c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to
	200805.
	* langhooks.h (struct lang_hooks_for_decls): Add omp_finish_clause.
	Add omp_private_outer_ref hook, add another argument to
	omp_clause_default_ctor hook.
	* langhooks-def.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
	(LANG_HOOKS_OMP_PRIVATE_OUTER_REF): Define.
	(LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): Change to
	hook_tree_tree_tree_tree_null.
	(LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_FINISH_CLAUSE and
	LANG_HOOKS_OMP_PRIVATE_OUTER_REF.
	* hooks.c (hook_tree_tree_tree_tree_null): New function.
	* hooks.h (hook_tree_tree_tree_tree_null): New prototype.
	* tree.def (OMP_TASK): New tree code.
	* tree.h (OMP_TASK_COPYFN, OMP_TASK_ARG_SIZE, OMP_TASK_ARG_ALIGN,
	OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_LASTPRIVATE_STMT,
	OMP_CLAUSE_COLLAPSE_ITERVAR, OMP_CLAUSE_COLLAPSE_COUNT,
	OMP_TASKREG_CHECK, OMP_TASKREG_BODY, OMP_TASKREG_CLAUSES,
	OMP_TASKREG_FN, OMP_TASKREG_DATA_ARG, OMP_TASK_BODY,
	OMP_TASK_CLAUSES, OMP_TASK_FN, OMP_TASK_DATA_ARG,
	OMP_CLAUSE_COLLAPSE_EXPR): Define.
	(enum omp_clause_default_kind): Add OMP_CLAUSE_DEFAULT_FIRSTPRIVATE.
	(OMP_DIRECTIVE_P): Add OMP_TASK.
	(OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED): New clause codes.
	(OMP_CLAUSE_SCHEDULE_AUTO): New schedule kind.
	* tree.c (omp_clause_code_name): Add OMP_CLAUSE_COLLAPSE
	and OMP_CLAUSE_UNTIED entries.
	(omp_clause_num_ops): Likewise.  Increase OMP_CLAUSE_LASTPRIVATE
	num_ops to 2.
	(walk_tree_1): Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED.
	Walk OMP_CLAUSE_LASTPRIVATE_STMT.
	* tree-pretty-print.c (dump_omp_clause): Handle
	OMP_CLAUSE_SCHEDULE_AUTO, OMP_CLAUSE_UNTIED, OMP_CLAUSE_COLLAPSE,
	OMP_CLAUSE_DEFAULT_FIRSTPRIVATE.
	(dump_generic_node): Handle OMP_TASK and collapsed OMP_FOR loops.
	* c-omp.c (c_finish_omp_for): Allow pointer iterators.  Remove
	warning about unsigned iterators.  Change decl/init/cond/incr
	arguments to TREE_VECs, check arguments for all collapsed loops.
	(c_finish_omp_taskwait): New function.
	(c_split_parallel_clauses): Put OMP_CLAUSE_COLLAPSE clause to
	ws_clauses.
	* c-parser.c (c_parser_omp_for_loop): Parse collapsed loops.  Call
	default_function_array_conversion on init.  Add par_clauses argument.
	If decl is present in parallel's lastprivate clause, change it to
	shared and add lastprivate clause for decl to OMP_FOR_CLAUSES.
	Add clauses argument, on success set OMP_FOR_CLAUSES to it.  Look up
	collapse count in clauses.
	(c_parser_omp_for, c_parser_omp_parallel): Adjust
	c_parser_omp_for_loop callers.
	(OMP_FOR_CLAUSE_MASK): Add 1 << PRAGMA_OMP_CLAUSE_COLLAPSE.
	(c_parser_pragma): Handle PRAGMA_OMP_TASKWAIT.
	(c_parser_omp_clause_name): Handle collapse and untied clauses.
	(c_parser_omp_clause_collapse, c_parser_omp_clause_untied): New
	functions.
	(c_parser_omp_clause_schedule): Handle schedule(auto).
	Include correct location in the error message.
	(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
	and PRAGMA_OMP_CLAUSE_UNTIED.
	(OMP_TASK_CLAUSE_MASK): Define.
	(c_parser_omp_task, c_parser_omp_taskwait): New functions.
	(c_parser_omp_construct): Handle PRAGMA_OMP_TASK.
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_LASTPRIVATE_STMT,
	OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE,
	OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED.
	Don't handle TREE_STATIC or DECL_EXTERNAL VAR_DECLs in
	OMP_CLAUSE_DECL.
	(conver_nonlocal_reference, convert_local_reference,
	convert_call_expr): Handle OMP_TASK the same as OMP_PARALLEL.  Use
	OMP_TASKREG_* macros rather than OMP_PARALLEL_*.
	(walk_omp_for): Adjust for OMP_FOR_{INIT,COND,INCR} changes.
	* tree-gimple.c (is_gimple_stmt): Handle OMP_TASK.
	* c-tree.h (c_begin_omp_task, c_finish_omp_task): New prototypes.
	* c-pragma.h (PRAGMA_OMP_TASK, PRAGMA_OMP_TASKWAIT): New.
	(PRAGMA_OMP_CLAUSE_COLLAPSE, PRAGMA_OMP_CLAUSE_UNTIED): New.
	* c-typeck.c (c_begin_omp_task, c_finish_omp_task): New functions.
	(c_finish_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
	OMP_CLAUSE_UNTIED.
	* c-pragma.c (init_pragma): Init omp task and omp taskwait pragmas.
	* c-common.h (c_finish_omp_taskwait): New prototype.
	* gimple-low.c (lower_stmt): Handle OMP_TASK.
	* tree-parloops.c (create_parallel_loop): Create 1 entry
	vectors for OMP_FOR_{INIT,COND,INCR}.
	* tree-cfg.c (remove_useless_stmts_1): Handle OMP_* containers.
	(make_edges): Handle OMP_TASK.
	* tree-ssa-operands.c (get_expr_operands): Handle collapsed OMP_FOR
	loops, adjust for OMP_FOR_{INIT,COND,INCR} changes.
	* tree-inline.c (estimate_num_insns_1): Handle OMP_TASK.
	* builtin-types.def (BT_PTR_ULONGLONG, BT_PTR_FN_VOID_PTR_PTR,
	BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
	BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
	BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): New.
	* omp-builtins.def (BUILT_IN_GOMP_TASK, BUILT_IN_GOMP_TASKWAIT,
	BUILT_IN_GOMP_LOOP_ULL_STATIC_START,
	BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ULL_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ULL_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_START,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_START,
	BUILT_IN_GOMP_LOOP_ULL_STATIC_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_RUNTIME_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT): New builtins.
	* gimplify.c (gimplify_omp_for): Allow pointer type for decl,
	handle POINTER_PLUS_EXPR.  If loop counter has been replaced and
	original iterator is present in lastprivate clause or if
	collapse > 1, set OMP_CLAUSE_LASTPRIVATE_STMT.  Handle collapsed
	OMP_FOR loops, adjust for OMP_FOR_{INIT,COND,INCR} changes.
	(gimplify_expr): Handle OMP_SECTIONS_SWITCH and OMP_TASK.
	(enum gimplify_omp_var_data): Add GOVD_PRIVATE_OUTER_REF.
	(omp_notice_variable): Set GOVD_PRIVATE_OUTER_REF if needed,
	if it is set, lookup var in outer contexts too.  Handle
	OMP_CLAUSE_DEFAULT_FIRSTPRIVATE.  Handle vars that are supposed
	to be implicitly determined firstprivate for task regions.
	(gimplify_scan_omp_clauses): Set GOVD_PRIVATE_OUTER_REF if needed,
	if it is set, lookup var in outer contexts too.  Set
	OMP_CLAUSE_PRIVATE_OUTER_REF if GOVD_PRIVATE_OUTER_REF is set.
	Handle OMP_CLAUSE_LASTPRIVATE_STMT, OMP_CLAUSE_COLLAPSE and
	OMP_CLAUSE_UNTIED.  Take region_type as last argument
	instead of in_parallel and in_combined_parallel.
	(gimplify_omp_parallel, gimplify_omp_for, gimplify_omp_workshare):
	Adjust callers.
	(gimplify_adjust_omp_clauses_1): Set OMP_CLAUSE_PRIVATE_OUTER_REF if
	GOVD_PRIVATE_OUTER_REF is set.  Call omp_finish_clause
	langhook.
	(new_omp_context): Set default_kind to
	OMP_CLAUSE_DEFAULT_UNSPECIFIED for OMP_TASK regions.
	(omp_region_type): New enum.
	(struct gimplify_omp_ctx): Remove is_parallel and is_combined_parallel
	fields, add region_type.
	(new_omp_context): Take region_type as argument instead of is_parallel
	and is_combined_parallel.
	(gimple_add_tmp_var, omp_firstprivatize_variable, omp_notice_variable,
	omp_is_private, omp_check_private): Adjust ctx->is_parallel and
	ctx->is_combined_parallel checks.
	(gimplify_omp_task): New function.
	(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
	OMP_CLAUSE_UNTIED.
	* omp-low.c (extract_omp_for_data): Use schedule(static)
	for schedule(auto).  Handle pointer and unsigned iterators.
	Compute fd->iter_type.  Handle POINTER_PLUS_EXPR increments.
	Add loops argument.  Extract data for collapsed OMP_FOR loops.
	(expand_parallel_call): Assert sched_kind isn't auto,
	map runtime schedule to index 3.
	(struct omp_for_data_loop): New type.
	(struct omp_for_data): Remove v, n1, n2, step, cond_code fields.
	Add loop, loops, collapse and iter_type fields.
	(workshare_safe_to_combine_p): Disallow combined for if
	iter_type is unsigned long long.  Don't combine collapse > 1 loops
	unless all bounds and steps are constant.  Adjust extract_omp_for_data
	caller.
	(expand_omp_for_generic): Handle pointer, unsigned and long long
	iterators.  Handle collapsed OMP_FOR loops.  Adjust
	for struct omp_for_data changes.  If libgomp function doesn't return
	boolean_type_node, add comparison of the return value with 0.
	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk): Handle
	pointer, unsigned and long long iterators.  Adjust for struct
	omp_for_data changes.
	(expand_omp_for): Assert sched_kind isn't auto, map runtime schedule
	to index 3.  Use GOMP_loop_ull*{start,next} if iter_type is
	unsigned long long.  Allocate loops array, pass it to
	extract_omp_for_data.  For collapse > 1 loops use always
	expand_omp_for_generic.
	(omp_context): Add sfield_map and srecord_type fields.
	(is_task_ctx, lookup_sfield): New functions.
	(use_pointer_for_field): Use is_task_ctx helper.  Change first
	argument's type from const_tree to tree.  Clarify comment.
	In OMP_TASK disallow copy-in/out sharing.
	(build_sender_ref): Call lookup_sfield instead of lookup_field.
	(install_var_field): Add mask argument.  Populate both record_type
	and srecord_type if needed.
	(delete_omp_context): Destroy sfield_map, clear DECL_ABSTRACT_ORIGIN
	in srecord_type.
	(fixup_child_record_type): Also remap FIELD_DECL's DECL_SIZE{,_UNIT}
	and DECL_FIELD_OFFSET.
	(scan_sharing_clauses): Adjust install_var_field callers.  For
	firstprivate clauses on explicit tasks allocate the var by value in
	record_type unconditionally, rather than by reference.
	Handle OMP_CLAUSE_PRIVATE_OUTER_REF.  Scan OMP_CLAUSE_LASTPRIVATE_STMT.
	Use is_taskreg_ctx instead of is_parallel_ctx.
	Handle OMP_CLAUSE_COLLAPSE and OMP_CLAUSE_UNTIED.
	(create_omp_child_function_name): Add task_copy argument, use
	*_omp_cpyfn* names if it is true.
	(create_omp_child_function): Add task_copy argument, if true create
	*_omp_cpyfn* helper function.
	(scan_omp_parallel): Adjust create_omp_child_function callers.
	Rename parallel_nesting_level to taskreg_nesting_level.
	(scan_omp_task): New function.
	(lower_rec_input_clauses): Don't run constructors for firstprivate
	explicit task vars which are initialized by *_omp_cpyfn*.  
	Pass outer var ref to omp_clause_default_ctor hook if
	OMP_CLAUSE_PRIVATE_OUTER_REF or OMP_CLAUSE_LASTPRIVATE.
	Replace OMP_CLAUSE_REDUCTION_PLACEHOLDER decls in
	OMP_CLAUSE_REDUCTION_INIT.
	(lower_send_clauses): Clear DECL_ABSTRACT_ORIGIN if in task to
	avoid duplicate setting of fields.  Handle
	OMP_CLAUSE_PRIVATE_OUTER_REF.
	(lower_send_shared_vars): Use srecord_type if non-NULL.  Don't
	copy-out if TREE_READONLY, only copy-in.
	(expand_task_copyfn): New function.
	(expand_task_call): New function.
	(struct omp_taskcopy_context): New type.
	(task_copyfn_copy_decl, task_copyfn_remap_type, create_task_copyfn):
	New functions.
	(lower_omp_parallel): Rename to...
	(lower_omp_taskreg): ... this.  Use OMP_TASKREG_* macros where needed.
	Call create_task_copyfn if srecord_type is needed.  Adjust
	sender_decl type.
	(task_shared_vars): New variable.
	(check_omp_nesting_restrictions): Warn if work-sharing,
	barrier, master or ordered region is closely nested inside OMP_TASK.
	Add warnings for barrier if closely nested inside of work-sharing,
	ordered, or master region.
	(scan_omp_1): Call check_omp_nesting_restrictions even for
	GOMP_barrier calls.  Rename parallel_nesting_level to
	taskreg_nesting_level.  Handle OMP_TASK.
	(lower_lastprivate_clauses): Even if some lastprivate is found on a
	work-sharing construct, continue looking for them on parent parallel
	construct.
	(lower_omp_for_lastprivate): Add lastprivate clauses
	to the beginning of dlist rather than end.  Adjust for struct
	omp_for_data changes.
	(lower_omp_for): Add rec input clauses before OMP_FOR_PRE_BODY,
	not after it.  Handle collapsed OMP_FOR loops, adjust for
	OMP_FOR_{INIT,COND,INCR} changes, adjust extract_omp_for_data
	caller.
	(get_ws_args_for): Adjust extract_omp_for_data caller.
	(scan_omp_for): Handle collapsed OMP_FOR
	loops, adjust for OMP_FOR_{INIT,COND,INCR} changes.
	(lower_omp_single_simple): If libgomp function doesn't return
	boolean_type_node, add comparison of the return value with 0.
	(diagnose_sb_1, diagnose_sb_2): Handle collapsed OMP_FOR
	loops, adjust for OMP_FOR_{INIT,COND,INCR} changes.  Handle OMP_TASK.
	(parallel_nesting_level): Rename to...
	(taskreg_nesting_level): ... this.
	(is_taskreg_ctx): New function.
	(build_outer_var_ref, omp_copy_decl): Use is_taskreg_ctx instead
	of is_parallel_ctx.
	(execute_lower_omp): Rename parallel_nesting_level to
	taskreg_nesting_level.
	(expand_omp_parallel): Rename to...
	(expand_omp_taskreg): ... this.  Use OMP_TASKREG_* macros where needed.
	Call omp_task_call for OMP_TASK regions.
	(expand_omp): Adjust caller, handle OMP_TASK.
	(lower_omp_1): Adjust lower_omp_taskreg caller, handle OMP_TASK.

	* bitmap.c (bitmap_default_obstack_depth): New variable.
	(bitmap_obstack_initialize, bitmap_obstack_release): Do nothing
	if argument is NULL and bitmap_default_obstack is already initialized.
	* ipa-struct-reorg.c (do_reorg_1): Call bitmap_obstack_release
	at the end.
	* matrix-reorg.c (matrix_reorg): Likewise.
cp/
	* cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
	dependent_omp_for_p, begin_omp_task, finish_omp_task,
	finish_omp_taskwait): New prototypes.
	(cxx_omp_clause_default_ctor): Add outer argument.
	(finish_omp_for): Add new clauses argument.
	* cp-gimplify.c (cxx_omp_finish_clause): New function.
	(cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
	(cxx_omp_clause_default_ctor): Add outer argument.
	(cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
	* cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
	* parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
	Add par_clauses argument.  If decl is present in parallel's
	lastprivate clause, change that clause to shared and add
	a lastprivate clause for decl to OMP_FOR_CLAUSES.
	Fix wording of error messages.  Adjust finish_omp_for caller.
	Add clauses argument.  Parse loops with random access iterators.
	(cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
	functions.
	(cp_parser_omp_for, cp_parser_omp_parallel): Adjust
	cp_parser_omp_for_loop callers.
	(cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
	functions.
	(cp_parser_omp_clause_name): Handle collapse and untied
	clauses.
	(cp_parser_omp_clause_schedule): Handle auto schedule.
	(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
	and PRAGMA_OMP_CLAUSE_UNTIED.
	(OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
	(OMP_TASK_CLAUSE_MASK): Define.
	(cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
	(cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
	(cp_parser_pragma): Handle PRAGMA_OMP_TASK and
	PRAGMA_OMP_TASKWAIT.
	* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
	OMP_CLAUSE_UNTIED.  Handle OMP_CLAUSE_LASTPRIVATE_STMT.
	(tsubst_omp_for_iterator): New function.
	(dependent_omp_for_p): New function.
	(tsubst_expr) <case OMP_FOR>: Use it.  Handle collapsed OMP_FOR
	loops.  Adjust finish_omp_for caller.  Handle loops with random
	access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR} changes.
	(tsubst_expr): Handle OMP_TASK.
	* semantics.c (cxx_omp_create_clause_info): New function.
	(finish_omp_clauses): Call it.  Handle OMP_CLAUSE_UNTIED and
	OMP_CLAUSE_COLLAPSE.
	(cxx_omp_predetermined_sharing): Removed.
	* semantics.c (finish_omp_for): Allow pointer iterators.  Use
	handle_omp_for_class_iterator and dependent_omp_for_p.  Handle
	collapsed for loops.  Adjust c_finish_omp_for caller.  Add new
	clauses argument.  Fix check for type dependent cond or incr.
	Set OMP_FOR_CLAUSES to clauses.  Use cp_convert instead of
	fold_convert to convert incr amount to difference_type.  Only
	fold if not in template.  If decl is mentioned in lastprivate
	clause, set OMP_CLAUSE_LASTPRIVATE_STMT.  Handle loops with random
	access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR}
	changes.
	(finish_omp_threadprivate): Allow static class members of the
	current class.
	(handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
	finish_omp_taskwait): New functions.

	* parser.c (cp_parser_binary_expression): Add prec argument.
	(cp_parser_assignment_expression): Adjust caller.
	* cp-tree.h (outer_curly_brace_block): New prototype.
	* decl.c (outer_curly_brace_block): No longer static.
fortran/
	* scanner.c (skip_free_comments, skip_fixed_comments): Handle tabs.
	* parse.c (next_free): Allow tab after !$omp.
	(decode_omp_directive): Handle !$omp task, !$omp taskwait
	and !$omp end task.
	(case_executable): Add ST_OMP_TASKWAIT.
	(case_exec_markers): Add ST_OMP_TASK.
	(gfc_ascii_statement): Handle ST_OMP_TASK, ST_OMP_END_TASK and
	ST_OMP_TASKWAIT.
	(parse_omp_structured_block, parse_executable): Handle ST_OMP_TASK.
	* gfortran.h (gfc_find_sym_in_expr): New prototype.
	(gfc_statement): Add ST_OMP_TASK, ST_OMP_END_TASK and ST_OMP_TASKWAIT.
	(gfc_omp_clauses): Add OMP_SCHED_AUTO to sched_kind,
	OMP_DEFAULT_FIRSTPRIVATE to default_sharing.  Add collapse and
	untied fields.
	(gfc_exec_op): Add EXEC_OMP_TASK and EXEC_OMP_TASKWAIT.
	* f95-lang.c (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
	LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR,
	LANG_HOOKS_OMP_PRIVATE_OUTER_REF): Define.
	* trans.h (gfc_omp_clause_default_ctor): Add another argument.
	(gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
	gfc_omp_clause_dtor, gfc_omp_private_outer_ref): New prototypes.
	* types.def (BT_ULONGLONG, BT_PTR_ULONGLONG,
	BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR,
	BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
	BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
	BT_FN_VOID_PTR_PTR, BT_PTR_FN_VOID_PTR_PTR,
	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): New.
	(BT_BOOL): Use integer type with BOOL_TYPE_SIZE rather
	than boolean_type_node.
	* dump-parse-tree.c (gfc_show_omp_node): Handle EXEC_OMP_TASK,
	EXEC_OMP_TASKWAIT, OMP_SCHED_AUTO, OMP_DEFAULT_FIRSTPRIVATE,
	untied and collapse clauses.
	(gfc_show_code_node): Handle EXEC_OMP_TASK and EXEC_OMP_TASKWAIT.
	* trans.c (gfc_trans_code): Handle EXEC_OMP_TASK and
	EXEC_OMP_TASKWAIT.
	* st.c (gfc_free_statement): Likewise.
	* resolve.c (gfc_resolve_blocks, resolve_code): Likewise.
	(find_sym_in_expr): Rename to...
	(gfc_find_sym_in_expr): ... this.  No longer static.
	(resolve_allocate_expr, resolve_ordinary_assign): Adjust caller.
	* match.h (gfc_match_omp_task, gfc_match_omp_taskwait): New
	prototypes.
	* openmp.c (resolve_omp_clauses): Allow allocatable arrays in
	firstprivate, lastprivate, reduction, copyprivate and copyin
	clauses.
	(omp_current_do_code): Made static.
	(omp_current_do_collapse): New variable.
	(gfc_resolve_omp_do_blocks): Compute omp_current_do_collapse,
	clear omp_current_do_code and omp_current_do_collapse on return.
	(gfc_resolve_do_iterator): Handle collapsed do loops.
	(resolve_omp_do): Likewise, diagnose errorneous collapsed do loops.
	(OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_UNTIED): Define.
	(gfc_match_omp_clauses): Handle default (firstprivate),
	schedule (auto), untied and collapse (n) clauses.
	(OMP_DO_CLAUSES): Add OMP_CLAUSE_COLLAPSE.
	(OMP_TASK_CLAUSES): Define.
	(gfc_match_omp_task, gfc_match_omp_taskwait): New functions.
	* trans-openmp.c (gfc_omp_private_outer_ref): New function.
	(gfc_omp_clause_default_ctor): Add outer argument.  For allocatable
	arrays allocate them with the bounds of the outer var if outer
	var is allocated.
	(gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
	gfc_omp_clause_dtor): New functions.
	(gfc_trans_omp_array_reduction): If decl is allocatable array,
	allocate it with outer var's bounds in OMP_CLAUSE_REDUCTION_INIT
	and deallocate it in OMP_CLAUSE_REDUCTION_MERGE.
	(gfc_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
	for assumed-size arrays.
	(gfc_trans_omp_do): Add par_clauses argument.  If dovar is
	present in lastprivate clause and do loop isn't simple,
	set OMP_CLAUSE_LASTPRIVATE_STMT.  If dovar is present in
	parallel's lastprivate clause, change it to shared and add
	lastprivate clause to OMP_FOR_CLAUSES.  Handle collapsed do loops.
	(gfc_trans_omp_directive): Adjust gfc_trans_omp_do callers.
	(gfc_trans_omp_parallel_do): Likewise.  Move collapse clause to
	OMP_FOR from OMP_PARALLEL.
	(gfc_trans_omp_clauses): Handle OMP_SCHED_AUTO,
	OMP_DEFAULT_FIRSTPRIVATE, untied and collapse clauses.
	(gfc_trans_omp_task, gfc_trans_omp_taskwait): New functions.
	(gfc_trans_omp_directive): Handle EXEC_OMP_TASK and
	EXEC_OMP_TASKWAIT.
gcc/testsuite/
	* gcc.dg/gomp/collapse-1.c: New test.
	* gcc.dg/gomp/nesting-1.c: New test.
	* g++.dg/gomp/task-1.C: New test.
	* g++.dg/gomp/predetermined-1.C: New test.
	* g++.dg/gomp/tls-4.C: New test.
	* gfortran.dg/gomp/collapse1.f90: New test.
	* gfortran.dg/gomp/sharing-3.f90: New test.
	* gcc.dg/gomp/pr27499.c (foo): Remove is unsigned dg-warning.
	* g++.dg/gomp/pr27499.C (foo): Likewise.
	* g++.dg/gomp/for-16.C (foo): Likewise.
	* g++.dg/gomp/tls-3.C: Remove dg-error, add S::s definition.
	* g++.dg/gomp/pr34607.C: Adjust dg-error location.
	* g++.dg/gomp/for-16.C (foo): Add a new dg-error.
	* gcc.dg/gomp/appendix-a/a.35.4.c: Add dg-warning.
	* gcc.dg/gomp/appendix-a/a.35.6.c: Likewise.
	* gfortran.dg/gomp/appendix-a/a.35.4.f90: Likewise.
	* gfortran.dg/gomp/appendix-a/a.35.6.f90: Likewise.
	* gfortran.dg/gomp/omp_parse1.f90: Remove !$omp tab test.
	* gfortran.dg/gomp/appendix-a/a.33.4.f90: Remove dg-error
	about allocatable array.
	* gfortran.dg/gomp/reduction1.f90: Likewise.
libgomp/
	* configure.ac (LIBGOMP_GNU_SYMBOL_VERSIONING): New AC_DEFINE.
	Substitute also OMP_*LOCK_25*.
	* configure: Regenerated.
	* config.h.in: Regenerated.
	* Makefile.am (libgomp_la_SOURCES): Add loop_ull.c, iter_ull.c,
	ptrlock.c and task.c.
	* Makefile.in: Regenerated.
	* testsuite/Makefile.in: Regenerated.
	* task.c: New file.
	* loop_ull.c: New file.
	* iter_ull.c: New file.
	* libgomp.h: Include ptrlock.h.
	(enum gomp_task_kind): New type.
	(struct gomp_team): Add task_lock, task_queue, task_count,
	task_running_count, single_count fields.  Add
	work_share_list_free_lock ifndef HAVE_SYNC_BUILTINS.
	Remove work_share_lock, generation_mask,
	oldest_live_gen, num_live_gen and init_work_shares fields, add
	work work_share_list_alloc, work_share_list_free and work_share_chunk
	fields.  Change work_shares from pointer to pointers into an array.
	Change ordered_release field into gomp_sem_t ** from flexible array
	member.  Add implicit_task and initial_work_shares fields.
	Move close to the end of the struct.
	(struct gomp_team_state): Add single_count, last_work_share,
	active_level and level fields, remove work_share_generation.
	(gomp_barrier_handle_tasks): New prototype.
	(gomp_finish_task): New inline function.
	(struct gomp_work_share): Move chunk_size, end, incr into
	transparent union/struct, add chunk_size_ull, end_ll, incr_ll and
	next_ll fields.  Reshuffle fields.  Add next_alloc,
	next_ws, next_free and inline_ordered_team_ids fields, change
	ordered_team_ids into pointer from flexible array member.
	Add mode field.  Put lock and next into a different cache line
	from most of the write-once fields.
	(gomp_iter_ull_static_next, gomp_iter_ull_dynamic_next_locked,
	gomp_iter_ull_guided_next_locked, gomp_iter_ull_dynamic_next,
	gomp_iter_ull_guided_next): New prototypes.
	(gomp_new_icv): New prototype.
	(struct gomp_thread): Add thread_pool and task fields.
	(struct gomp_thread_pool): New type.
	(gomp_new_team): New prototype.
	(gomp_team_start): Change type of last argument.
	(gomp_new_work_share): Removed.
	(gomp_init_work_share, gomp_fini_work_share): New prototypes.
	(gomp_work_share_init_done): New static inline.
	(gomp_throttled_spin_count_var, gomp_available_cpus,
	gomp_managed_threads): New extern decls.
	(gomp_init_task): New prototype.
	(gomp_spin_count_var): New extern var decl.
	(LIBGOMP_GNU_SYMBOL_VERSIONING): Undef if no visibility
	or no alias support, or if not PIC.
	(gomp_init_lock_30, gomp_destroy_lock_30, gomp_set_lock_30,
	gomp_unset_lock_30, gomp_test_lock_30, gomp_init_nest_lock_30,
	gomp_destroy_nest_lock_30, gomp_set_nest_lock_30,
	gomp_unset_nest_lock_30, gomp_test_nest_lock_30, gomp_init_lock_25,
	gomp_destroy_lock_25, gomp_set_lock_25, gomp_unset_lock_25,
	gomp_test_lock_25, gomp_init_nest_lock_25, gomp_destroy_nest_lock_25,
	gomp_set_nest_lock_25, gomp_unset_nest_lock_25,
	gomp_test_nest_lock_25): New prototypes.
	(omp_lock_symver, strong_alias): Define.
	(gomp_remaining_threads_count, gomp_remaining_threads_lock): New
	decls.
	(gomp_end_task): New.
	(struct gomp_task_icv, gomp_global_icv): New.
	(gomp_thread_limit_var, gomp_max_active_levels_var): New.
	(struct gomp_task): New.
	(gomp_nthreads_var, gomp_dyn_var, gomp_nest_var,
	gomp_run_sched_var, gomp_run_sched_chunk): Remove.
	(gomp_icv): New.
	(gomp_schedule_type): Reorder enum to match
	omp_sched_t.
	* team.c (struct gomp_thread_start_data): Add thread_pool and task
	fields.
	(gomp_thread_start): Add gomp_team_barrier_wait call.
	For non-nested case remove clearing of docked thread thr fields.
	Use pool fields instead of global gomp_* variables.  Use
	gomp_barrier_wait_last when needed.  Initialize ts.active_level.
	Create tasks for each member thread.
	(free_team): Only destroy team barrier, task_lock here and free it.
	(gomp_free_thread): Free last_team if non-NULL.
	(gomp_team_end): Call gomp_team_barrier_wait instead of
	gomp_barrier_wait.  For nested case call one extra
	gomp_barrier_wait.  Move here some destruction from free_team.
	Call free_team on pool->last_team if any, rather than freeing
	current team.  Destroy work_share_list_free_lock ifndef
	HAVE_SYNC_BUILTINS.
	(gomp_new_icv): New function.
	(gomp_threads, gomp_threads_size, gomp_threads_used,
	gomp_threads_dock): Removed.
	(gomp_thread_destructor): New variable.
	(gomp_new_thread_pool, gomp_free_pool_helper, gomp_free_thread): New
	functions.
	(gomp_team_start): Create new pool if current thread doesn't have
	one.  Use pool fields instead of global gomp_* variables. 
	Initialize thread_pool field for new threads.  Clear single_count.
	Change last argument from ws to team, don't create
	new team, set ts.work_share to &team->work_shares[0] and clear
	ts.last_work_share.  Don't clear ts.work_share_generation.
	If number of threads changed, adjust atomically gomp_managed_threads.
	Use gomp_init_task instead of gomp_new_task,
	set thr->task to the corresponding implicit_task array entry.
	Create tasks for each member thread.  Initialize ts.level.
	(initialize_team): Call pthread_key_create on
	gomp_thread_destructor.
	(team_destructor): New function.
	(new_team): Removed.
	(gomp_new_team): New function.
	(free_team): Free gomp_work_share blocks chained through next_alloc,
	instead of freeing work_shares and destroying work_share_lock.
	(gomp_team_end): Call gomp_fini_work_share.  If number of threads
	changed, adjust atomically gomp_managed_threads.  Use gomp_end_task.
	* barrier.c (GOMP_barrier): Call gomp_team_barrier_wait instead
	of gomp_barrier_wait.
	* single.c (GOMP_single_copy_start): Call gomp_team_barrier_wait
	instead of gomp_barrier_wait.  Call gomp_work_share_init_done
	if gomp_work_share_start returned true.  Don't unlock ws->lock.
	(GOMP_single_copy_end): Call gomp_team_barrier_wait instead
	of gomp_barrier_wait.
	(GOMP_single_start): Rewritten if HAVE_SYNC_BUILTINS.  Call
	gomp_work_share_init_done if gomp_work_share_start returned true.
	Don't unlock ws->lock.
	* work.c: Include stddef.h.
	(free_work_share): Use work_share_list_free_lock instead
	of atomic chaining ifndef HAVE_SYNC_BUILTINS.  Add team argument.
	Call gomp_fini_work_share and then either free ws if orphaned, or
	put it into work_share_list_free list of the current team.
	(alloc_work_share, gomp_init_work_share, gomp_fini_work_share): New
	functions.
	(gomp_work_share_start, gomp_work_share_end,
	gomp_work_share_end_nowait): Rewritten.
	* omp_lib.f90.in Change some tabs to spaces to prevent warnings.
	(openmp_version): Set to 200805.
	(omp_sched_kind, omp_sched_static, omp_sched_dynamic,
	omp_sched_guided, omp_sched_auto): New parameters.
	(omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
	omp_set_max_active_levels, omp_get_max_active_levels,
	omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size,
	omp_get_active_level): New interfaces.
	* omp_lib.h.in (openmp_version): Set to 200805.
	(omp_sched_kind, omp_sched_static, omp_sched_dynamic,
	omp_sched_guided, omp_sched_auto): New parameters.
	(omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
	omp_set_max_active_levels, omp_get_max_active_levels,
	omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size,
	omp_get_active_level): New externals.
	* loop.c: Include limits.h.
	(GOMP_loop_runtime_next, GOMP_loop_ordered_runtime_next): Handle
	GFS_AUTO.
	(GOMP_loop_runtime_start, GOMP_loop_ordered_runtime_start):
	Likewise.  Use gomp_icv.
	(gomp_loop_static_start, gomp_loop_dynamic_start): Clear
	ts.static_trip here.
	(gomp_loop_static_start, gomp_loop_ordered_static_start): Call
	gomp_work_share_init_done after gomp_loop_init.  Don't unlock ws->lock.
	(gomp_loop_dynamic_start, gomp_loop_guided_start): Call
	gomp_work_share_init_done after gomp_loop_init.  If HAVE_SYNC_BUILTINS,
	don't unlock ws->lock, otherwise lock it.
	(gomp_loop_ordered_dynamic_start, gomp_loop_ordered_guided_start): Call
	gomp_work_share_init_done after gomp_loop_init.  Lock ws->lock.
	(gomp_parallel_loop_start): Call gomp_new_team instead of
	gomp_new_work_share.  Call gomp_loop_init on &team->work_shares[0].
	Adjust gomp_team_start caller.  Pass 0 as second argument to
	gomp_resolve_num_threads.
	(gomp_loop_init): For GFS_DYNAMIC, multiply ws->chunk_size by incr.
	If adding ws->chunk_size nthreads + 1 times after end won't
	overflow, set ws->mode to 1.
	* libgomp_g.h (GOMP_loop_ull_static_start, GOMP_loop_ull_dynamic_start,
	GOMP_loop_ull_guided_start, GOMP_loop_ull_runtime_start,
	GOMP_loop_ull_ordered_static_start,
	GOMP_loop_ull_ordered_dynamic_start,
	GOMP_loop_ull_ordered_guided_start,
	GOMP_loop_ull_ordered_runtime_start, GOMP_loop_ull_static_next,
	GOMP_loop_ull_dynamic_next, GOMP_loop_ull_guided_next,
	GOMP_loop_ull_runtime_next, GOMP_loop_ull_ordered_static_next,
	GOMP_loop_ull_ordered_dynamic_next, GOMP_loop_ull_ordered_guided_next,
	GOMP_loop_ull_ordered_runtime_next, GOMP_task, GOMP_taskwait): New
	prototypes.
	* libgomp.map: Export lock routines also @@OMP_2.0.
	(GOMP_loop_ordered_dynamic_first,
	GOMP_loop_ordered_guided_first, GOMP_loop_ordered_runtime_first,
	GOMP_loop_ordered_static_first): Remove.
	(GOMP_loop_ull_dynamic_next, GOMP_loop_ull_dynamic_start,
	GOMP_loop_ull_guided_next, GOMP_loop_ull_guided_start,
	GOMP_loop_ull_ordered_dynamic_next,
	GOMP_loop_ull_ordered_dynamic_start,
	GOMP_loop_ull_ordered_guided_next,
	GOMP_loop_ull_ordered_guided_start,
	GOMP_loop_ull_ordered_runtime_next,
	GOMP_loop_ull_ordered_runtime_start,
	GOMP_loop_ull_ordered_static_next,
	GOMP_loop_ull_ordered_static_start,
	GOMP_loop_ull_runtime_next, GOMP_loop_ull_runtime_start,
	GOMP_loop_ull_static_next, GOMP_loop_ull_static_start,
	GOMP_task, GOMP_taskwait): Export @@GOMP_2.0.
	(omp_set_schedule, omp_get_schedule,
	omp_get_thread_limit, omp_set_max_active_levels,
	omp_get_max_active_levels, omp_get_level,
	omp_get_ancestor_thread_num, omp_get_team_size, omp_get_active_level,
	omp_set_schedule_, omp_set_schedule_8_,
	omp_get_schedule_, omp_get_schedule_8_, omp_get_thread_limit_,
	omp_set_max_active_levels_, omp_set_max_active_levels_8_,
	omp_get_max_active_levels_, omp_get_level_,
	omp_get_ancestor_thread_num_, omp_get_ancestor_thread_num_8_,
	omp_get_team_size_, omp_get_team_size_8_, omp_get_active_level_):
	New exports @@OMP_3.0.
	* omp.h.in (omp_sched_t): New type.
	(omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
	omp_set_max_active_levels, omp_get_max_active_levels,
	omp_get_level, omp_get_ancestor_thread_num, omp_get_team_size,
	omp_get_active_level): New prototypes.
	* env.c (gomp_spin_count_var, gomp_throttled_spin_count_var,
	gomp_available_cpus, gomp_managed_threads, gomp_max_active_levels_var,
	gomp_thread_limit_var, gomp_remaining_threads_count,
	gomp_remaining_threads_lock): New variables.
	(parse_spincount): New function.
	(initialize_env): Call gomp_init_num_threads unconditionally.
	Initialize gomp_available_cpus.  Call parse_spincount,
	initialize gomp_{,throttled_}spin_count_var
	depending on presence and value of OMP_WAIT_POLICY and
	GOMP_SPINCOUNT env vars.  Handle GOMP_BLOCKTIME env var.
	Handle OMP_WAIT_POLICY, OMP_MAX_ACTIVE_LEVELS,
	OMP_THREAD_LIMIT, OMP_STACKSIZE env vars.  Handle unit specification
	for GOMP_STACKSIZE.  Initialize gomp_remaining_threads_count and
	gomp_remaining_threads_lock if needed.  Use gomp_global_icv.
	(gomp_nthreads_var, gomp_dyn_var, gomp_nest_var,
	gomp_run_sched_var, gomp_run_sched_chunk): Remove.
	(gomp_global_icv): New.
	(parse_schedule): Use it.  Parse "auto".
	(omp_set_num_threads): Use gomp_icv.
	(omp_set_dynamic, omp_get_dynamic, omp_set_nested, omp_get_nested):
	Likewise.
	(omp_get_max_threads): Move from parallel.c.
	(omp_set_schedule, omp_get_schedule, omp_get_thread_limit,
	omp_set_max_active_levels, omp_get_max_active_levels): New functions,
	add ialias.
	(parse_stacksize, parse_wait_policy): New functions.
	* fortran.c: Rewrite lock wrappers, if symbol versioning provide
	both wrappers for compatibility and new locks.
	(omp_set_schedule, omp_get_schedule,
	omp_get_thread_limit, omp_set_max_active_levels,
	omp_get_max_active_levels, omp_get_level,
	omp_get_ancestor_thread_num, omp_get_team_size,
	omp_get_active_level): New ialias_redirect.
	(omp_set_schedule_, omp_set_schedule_8_,
	omp_get_schedule_, omp_get_schedule_8_, omp_get_thread_limit_,
	omp_set_max_active_levels_, omp_set_max_active_levels_8_,
	omp_get_max_active_levels_, omp_get_level_,
	omp_get_ancestor_thread_num_, omp_get_ancestor_thread_num_8_,
	omp_get_team_size_, omp_get_team_size_8_, omp_get_active_level_):
	New functions.
	* parallel.c: Include limits.h.
	(gomp_resolve_num_threads): Add count argument.  Rewritten.
	(GOMP_parallel_start): Call gomp_new_team and pass that as last
	argument to gomp_team_start.  Pass 0 as second argument to
	gomp_resolve_num_threads.
	(GOMP_parallel_end): Decrease gomp_remaining_threads_count
	if gomp_thread_limit_var != ULONG_MAX.
	(omp_in_parallel): Implement using ts.active_level.
	(omp_get_max_threads): Move to env.c.
	(omp_get_level, omp_get_ancestor_thread_num,
	omp_get_team_size, omp_get_active_level): New functions,
	add ialias.
	* sections.c (GOMP_sections_start): Call gomp_work_share_init_done
	after gomp_sections_init.  If HAVE_SYNC_BUILTINS, call
	gomp_iter_dynamic_next instead of the _locked variant and don't take
	lock around it, otherwise acquire it before calling
	gomp_iter_dynamic_next_locked.
	(GOMP_sections_next): If HAVE_SYNC_BUILTINS, call
	gomp_iter_dynamic_next instead of the _locked variant and don't take
	lock around it.
	(GOMP_parallel_sections_start): Call gomp_new_team instead of
	gomp_new_work_share.  Call gomp_sections_init on &team->work_shares[0].
	Adjust gomp_team_start caller.  Pass count as second argument to
	gomp_resolve_num_threads, don't adjust num_threads after the call.
	Use gomp_icv.
	* iter.c (gomp_iter_dynamic_next_locked): Don't multiply
	ws->chunk_size by incr.
	(gomp_iter_dynamic_next): Likewise.  If ws->mode, use more efficient
	code.
	* libgomp_f.h.in (omp_lock_25_arg_t, omp_nest_lock_25_arg_t): New
	types.
	(omp_lock_25_arg, omp_nest_lock_25_arg): New macros.
	(omp_check_defines): Check even the compat defines.
	* config/linux/ptrlock.c: New file.
	* config/linux/ptrlock.h: New file.
	* config/linux/wait.h: New file.
	* config/posix/ptrlock.c: New file.
	* config/posix/ptrlock.h: New file.
	* config/linux/bar.h (gomp_team_barrier_wait,
	gomp_team_barrier_wait_end, gomp_team_barrier_wake): New prototypes.
	(gomp_team_barrier_set_task_pending,
	gomp_team_barrier_clear_task_pending,
	gomp_team_barrier_set_waiting_for_tasks,
	gomp_team_barrier_waiting_for_tasks,
	gomp_team_barrier_done): New inlines.
	(gomp_barrier_t): Rewritten.
	(gomp_barrier_state_t): New typedef.
	(gomp_barrier_init, gomp_barrier_reinit, gomp_barrier_destroy,
	gomp_barrier_wait_start): Rewritten.
	(gomp_barrier_wait_end): Change second argument to
	gomp_barrier_state_t.
	(gomp_barrier_last_thread, gomp_barrier_wait_last): New static
	inlines.
	* config/linux/bar.c: Include wait.h instead of libgomp.h and
	futex.h.
	(gomp_barrier_wait_end): Rewritten.
	(gomp_team_barrier_wait, gomp_team_barrier_wait_end,
	gomp_team_barrier_wake, gomp_barrier_wait_last): New functions.
	* config/posix/bar.h (gomp_barrier_t): Add generation field.
	(gomp_barrier_state_t): New typedef.
	(gomp_team_barrier_wait,
	gomp_team_barrier_wait_end, gomp_team_barrier_wake): New prototypes.
	(gomp_barrier_wait_start): Or all but low 2 bits from generation
	into the return value.  Return gomp_barrier_state_t.
	(gomp_team_barrier_set_task_pending,
	gomp_team_barrier_clear_task_pending,
	gomp_team_barrier_set_waiting_for_tasks,
	gomp_team_barrier_waiting_for_tasks,
	gomp_team_barrier_done): New inlines.
	(gomp_barrier_wait_end): Change second argument to
	gomp_barrier_state_t.
	(gomp_barrier_last_thread, gomp_barrier_wait_last): New static
	inlines.
	* config/posix/bar.c (gomp_barrier_init): Clear generation field.
	(gomp_barrier_wait_end): Change second argument to
	gomp_barrier_state_t. 
	(gomp_team_barrier_wait, gomp_team_barrier_wait_end,
	gomp_team_barrier_wake): New functions.
	* config/linux/mutex.c: Include wait.h instead of libgomp.h and
	futex.h.
	(gomp_futex_wake, gomp_futex_wait): New variables.
	(gomp_mutex_lock_slow): Call do_wait instead of futex_wait.
	* config/linux/lock.c: Rewrite to make locks task owned,
	for backwards compatibility provide the old entrypoints
	if symbol versioning.  Include wait.h instead of libgomp.h and
	futex.h.
	(gomp_set_nest_lock_25): Call do_wait instead of futex_wait.
	* config/posix95/lock.c: Rewrite to make locks task owned,
	for backwards compatibility provide the old entrypoints
	if symbol versioning.
	* config/posix/lock.c: Rewrite to make locks task owned,
	for backwards compatibility provide the old entrypoints
	if symbol versioning.
	* config/linux/proc.c (gomp_init_num_threads): Use gomp_global_icv.
	(get_num_procs, gomp_dynamic_max_threads): Use gomp_icv.
	* config/posix/proc.c, config/mingw32/proc.c: Similarly.
	* config/linux/powerpc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
	(sys_futex0): Return error code.
	(futex_wake, futex_wait): If ENOSYS was returned, clear
	FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
	(cpu_relax, atomic_write_barrier): New static inlines.
	* config/linux/alpha/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
	(futex_wake, futex_wait): If ENOSYS was returned, clear
	FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
	(cpu_relax, atomic_write_barrier): New static inlines.
	* config/linux/x86/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
	(sys_futex0): Return error code.
	(futex_wake, futex_wait): If ENOSYS was returned, clear
	FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
	(cpu_relax, atomic_write_barrier): New static inlines.
	* config/linux/s390/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
	(sys_futex0): Return error code.
	(futex_wake, futex_wait): If ENOSYS was returned, clear
	FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
	(cpu_relax, atomic_write_barrier): New static inlines.
	* config/linux/ia64/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
	(sys_futex0): Return error code.
	(futex_wake, futex_wait): If ENOSYS was returned, clear
	FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
	(cpu_relax, atomic_write_barrier): New static inlines.
	* config/linux/sparc/futex.h (FUTEX_WAIT, FUTEX_WAKE): Remove.
	(sys_futex0): Return error code.
	(futex_wake, futex_wait): If ENOSYS was returned, clear
	FUTEX_PRIVATE_FLAG in gomp_futex_wa{ke,it} and retry.
	(cpu_relax, atomic_write_barrier): New static inlines.
	* config/linux/sem.c: Include wait.h instead of libgomp.h and
	futex.h.
	(gomp_sem_wait_slow): Call do_wait instead of futex_wait.
	* config/linux/affinity.c: Assume HAVE_SYNC_BUILTINS.
	* config/linux/omp-lock.h (omp_lock_25_t, omp_nest_lock_25_t): New
	types.
	(omp_nest_lock_t): Change owner into void *, add lock field.
	* config/posix95/omp-lock.h: Include semaphore.h.
	(omp_lock_25_t, omp_nest_lock_25_t): New types.
	(omp_lock_t): Use sem_t instead of mutex if semaphores
	aren't broken.
	(omp_nest_lock_t): Likewise.  Change owner to void *.
	* config/posix/omp-lock.h: Include semaphore.h.
	(omp_lock_25_t, omp_nest_lock_25_t): New types.
	(omp_lock_t): Use sem_t instead of mutex if semaphores
	aren't broken.
	(omp_nest_lock_t): Likewise.  Add owner field.

	* testsuite/libgomp.c/collapse-1.c: New test.
	* testsuite/libgomp.c/collapse-2.c: New test.
	* testsuite/libgomp.c/collapse-3.c: New test.
	* testsuite/libgomp.c/icv-1.c: New test.
	* testsuite/libgomp.c/icv-2.c: New test.
	* testsuite/libgomp.c/lib-2.c: New test.
	* testsuite/libgomp.c/lock-1.c: New test.
	* testsuite/libgomp.c/lock-2.c: New test.
	* testsuite/libgomp.c/lock-3.c: New test.
	* testsuite/libgomp.c/loop-4.c: New test.
	* testsuite/libgomp.c/loop-5.c: New test.
	* testsuite/libgomp.c/loop-6.c: New test.
	* testsuite/libgomp.c/loop-7.c: New test.
	* testsuite/libgomp.c/loop-8.c: New test.
	* testsuite/libgomp.c/loop-9.c: New test.
	* testsuite/libgomp.c/nested-3.c: New test.
	* testsuite/libgomp.c/nestedfn-6.c: New test.
	* testsuite/libgomp.c/sort-1.c: New test.
	* testsuite/libgomp.c/task-1.c: New test.
	* testsuite/libgomp.c/task-2.c: New test.
	* testsuite/libgomp.c/task-3.c: New test.
	* testsuite/libgomp.c/task-4.c: New test.
	* testsuite/libgomp.c++/c++.exp: Add libstdc++-v3 build includes
	to C++ testsuite default compiler options.
	* testsuite/libgomp.c++/collapse-1.C: New test.
	* testsuite/libgomp.c++/collapse-2.C: New test.
	* testsuite/libgomp.c++/ctor-10.C: New test.
	* testsuite/libgomp.c++/for-1.C: New test.
	* testsuite/libgomp.c++/for-2.C: New test.
	* testsuite/libgomp.c++/for-3.C: New test.
	* testsuite/libgomp.c++/for-4.C: New test.
	* testsuite/libgomp.c++/for-5.C: New test.
	* testsuite/libgomp.c++/loop-8.C: New test.
	* testsuite/libgomp.c++/loop-9.C: New test.
	* testsuite/libgomp.c++/loop-10.C: New test.
	* testsuite/libgomp.c++/task-1.C: New test.
	* testsuite/libgomp.c++/task-2.C: New test.
	* testsuite/libgomp.c++/task-3.C: New test.
	* testsuite/libgomp.c++/task-4.C: New test.
	* testsuite/libgomp.c++/task-5.C: New test.
	* testsuite/libgomp.c++/task-6.C: New test.
	* testsuite/libgomp.fortran/allocatable1.f90: New test.
	* testsuite/libgomp.fortran/allocatable2.f90: New test.
	* testsuite/libgomp.fortran/allocatable3.f90: New test.
	* testsuite/libgomp.fortran/allocatable4.f90: New test.
	* testsuite/libgomp.fortran/collapse1.f90: New test.
	* testsuite/libgomp.fortran/collapse2.f90: New test.
	* testsuite/libgomp.fortran/collapse3.f90: New test.
	* testsuite/libgomp.fortran/collapse4.f90: New test.
	* testsuite/libgomp.fortran/lastprivate1.f90: New test.
	* testsuite/libgomp.fortran/lastprivate2.f90: New test.
	* testsuite/libgomp.fortran/lib4.f90: New test.
	* testsuite/libgomp.fortran/lock-1.f90: New test.
	* testsuite/libgomp.fortran/lock-2.f90: New test.
	* testsuite/libgomp.fortran/nested1.f90: New test.
	* testsuite/libgomp.fortran/nestedfn4.f90: New test.
	* testsuite/libgomp.fortran/strassen.f90: New test.
	* testsuite/libgomp.fortran/tabs1.f90: New test.
	* testsuite/libgomp.fortran/tabs2.f: New test.
	* testsuite/libgomp.fortran/task1.f90: New test.
	* testsuite/libgomp.fortran/task2.f90: New test.
	* testsuite/libgomp.fortran/vla4.f90: Add dg-warning.
	* testsuite/libgomp.fortran/vla5.f90: Likewise.
	* testsuite/libgomp.c/pr26943-2.c: Likewise.
	* testsuite/libgomp.c/pr26943-3.c: Likewise.
	* testsuite/libgomp.c/pr26943-4.c: Likewise.

Co-Authored-By: Jakob Blomer <jakob.blomer@ira.uka.de>
Co-Authored-By: Richard Henderson <rth@redhat.com>
Co-Authored-By: Ulrich Drepper <drepper@redhat.com>

From-SVN: r136433
2008-06-06 15:01:54 +02:00
Jakub Jelinek 5dc1195440 re PR c++/35758 (vector_size attribute lost in function arguments for templates)
PR c++/35758
	* c-common.c (handle_vector_size_attribute): Call
	lang_hooks.types.reconstruct_complex_type instead of
	reconstruct_complex_type.
	* config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): Likewise.
	* config/spu/spu.c (spu_handle_vector_attribute): Likewise.
	* langhooks.h (struct lang_hooks_for_types): Add
	reconstruct_complex_type hook.
	* langhooks-def.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.

	* cp-tree.h (cp_reconstruct_complex_type): New prototype.
	* cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
	* decl2.c (is_late_template_attribute): Only make vector_size
	late tmpl attribute if argument is type or value dependent.
	(cp_reconstruct_complex_type): New function.

	* g++.dg/ext/vector14.C: New test.

From-SVN: r134639
2008-04-24 18:29:40 +02:00
Paolo Bonzini 51eed2800d tree-cfg.c (verify_expr): Check with is_gimple_address.
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* tree-cfg.c (verify_expr): Check with is_gimple_address.  Don't
	check TREE_INVARIANT.
	* tree-gimple.c (is_gimple_address): New.
	(is_gimple_invariant_address): Simplify using decl_address_invariant_p.
	* tree-gimple.h (is_gimple_address): New.
	* tree.h (decl_address_invariant_p): New.
	* tree.c (make_node_stat): Don't set TREE_INVARIANT.
	(build_string): Likewise.
	(decl_address_invariant_p): New, from is_gimple_invariant_address.
	(tree_invariant_p_1): Likewise.
	(save_expr): Use it.
	(tree_invariant_p): New.
	(skip_simple_arithmetic): Use it.
	(stabilize_reference_1): Use it.
	(recompute_tree_invariant_for_addr_expr): Don't update TREE_INVARIANT,
	simplify.
	(build1_stat): Drop code to compute TREE_INVARIANT.
	(build2_stat): Drop code to compute TREE_INVARIANT.
	(build3_stat): Drop code to compute TREE_INVARIANT.
	(build4_stat): Drop code to compute TREE_INVARIANT.
	(build5_stat): Drop code to compute TREE_INVARIANT.
	(build7_stat): Drop code to compute TREE_INVARIANT.
	(merge_dllimport_decl_attributes): Don't mention TREE_INVARIANT.
	* tree.h (struct tree_base): Remove invariant_flag.
	(TREE_INVARIANT): Remove.
	* builtins.c (build_string_literal): Don't set TREE_INVARIANT.
	(fold_builtin_expect): Check TREE_CONSTANT.
	* tree-ssa-ccp.c (fold_stmt_r): Adjust comment.
	* c-tree.h (c_expr_to_decl): Drop third parameter.
	* c-typeck.c (build_external_ref): Don't set TREE_INVARIANT.
	(build_c_cast): Don't set TREE_INVARIANT.
	(pop_init_level): Don't set TREE_INVARIANT.
	(c_objc_common_truthvalue_conversion): Don't set TREE_INVARIANT.
	* gimplify.c (gimplify_init_ctor_preeval): Add assertion, test
	TREE_CONSTANT.
	(gimplify_init_constructor): Don't set TREE_INVARIANT.
	(gimplify_addr_expr): Adjust comment.
	* tree-mudflap.c (mf_build_string):
	* print-tree.c (print_node): Don't print TREE_INVARIANT.
	* tree-nested.c (convert_nonlocal_reference): Adjust comment.
	* c-common.c (fix_string_type): Don't set TREE_INVARIANT.
	* langhooks-def.h (lhd_expr_to_decl): Drop third parameter.
	* langhooks.c (lhd_expr_to_decl): Drop third parameter.
	* langhooks.h (struct lang_hooks): Drop third parameter from
	expr_to_decl.

java:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* class.c (build_utf8_ref): Don't set TREE_INVARIANT.
	(build_classdollar_field): Don't set TREE_INVARIANT.
	(get_dispatch_table): Don't set TREE_INVARIANT.
	(make_class_data): Don't set TREE_INVARIANT.
	(build_symbol_entry): Don't set TREE_INVARIANT.
	(emit_symbol_table): Don't set TREE_INVARIANT.
	* constants.c (build_constant_data_ref): Don't set TREE_INVARIANT.
	(build_ref_from_constant_pool): Don't set TREE_INVARIANT.
	* resource.c (compile_resource_data): Don't set TREE_INVARIANT.
	* expr.c (cache_cpool_data_ref): Don't set TREE_INVARIANT.

objc:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* objc-act.c (objc_build_string_object): Don't set TREE_INVARIANT.

cp:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
	(build_ptrmemfunc1): Don't set TREE_INVARIANT.
	* init.c (build_zero_init): Don't set TREE_INVARIANT.
	* class.c (build_base_path): Don't set TREE_INVARIANT.
	(build_vtbl_ref_1): Don't set TREE_INVARIANT.
	(build_vtbl_initializer): Don't set TREE_INVARIANT.
	* decl.c (build_enumerator): Don't set TREE_INVARIANT.
	* rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
	(generic_initializer): Don't set TREE_INVARIANT.
	(ptr_initializer): Don't set TREE_INVARIANT.
	(ptm_initializer): Don't set TREE_INVARIANT.
	(class_initializer): Don't set TREE_INVARIANT.
	* typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
	* pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
	(build_template_parm_index): Don't set TREE_INVARIANT.
	(reduce_template_parm_level): Don't set TREE_INVARIANT.
	(process_template_parm): Don't set TREE_INVARIANT.

ada:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* trans.c (Attribute_to_gnu): Don't set TREE_INVARIANT.
	(call_to_gnu): Don't set TREE_INVARIANT.
	* utils2.c (gnat_build_constructor): Don't set TREE_INVARIANT.

fortran:
2008-04-23  Paolo Bonzini  <bonzini@gnu.org>

	* trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT.
	* trans-array.c (gfc_build_null_descriptor): Don't set TREE_INVARIANT.
	(gfc_trans_array_constructor_value): Don't set TREE_INVARIANT.
	(gfc_build_constant_array_constructor): Don't set TREE_INVARIANT.
	(gfc_conv_array_initializer): Don't set TREE_INVARIANT.
	* trans-common.c (get_init_field): Don't set TREE_INVARIANT.
	(create_common): Don't set TREE_INVARIANT.
	* trans-stmt.c (gfc_trans_character_select): Don't set TREE_INVARIANT.
	* trans-decl.c (gfc_generate_function_code): Don't set TREE_INVARIANT.

From-SVN: r134599
2008-04-23 15:00:52 +00:00
Paolo Bonzini e892493899 function.c (free_after_parsing): Replace with cxx_push_function_context from C++ front-end.
2008-04-03  Paolo Bonzini  <bonzini@gnu.org>

	* function.c (free_after_parsing): Replace with
	cxx_push_function_context from C++ front-end.
	(allocate_struct_function): Don't call langhook.
	* langhooks.h (struct lang_hooks_for_functions): Delete.
	(struct lang_hooks): Add back missing_noreturn_ok_p here, delete
	member "function".
	* langhooks-def.h (LANG_HOOKS_MISSING_NORETURN_OK_P): Add.
	(LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL,
	LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P,
	LANG_HOOKS_FUNCTION_INITIALIZER): Delete.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_MISSING_NORETURN_OK_P,
	remove LANG_HOOKS_FUNCTION_INITIALIZER.
	* tree-cfg.c: Adjust call to missing_noreturn_ok_p langhook.

	* c-objc-common.h (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P):
	Rename to LANG_HOOKS_MISSING_NORETURN_OK_P.
	
cp:
2008-04-03  Paolo Bonzini  <bonzini@gnu.org>

	* decl.c (cxx_push_function_context): Delete.
	(cxx_pop_function_context): Delete.
	(start_preparsed_function): Merge cxx_push_function_context (!f->decl
	code only).
	* cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
	LANG_HOOKS_FUNCTION_FINAL): Delete.
	(LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
	LANG_HOOKS_MISSING_NORETURN_OK_P.
	* cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
	Delete prototype.
	* semantics.c (current_stmt_tree): Fix comment.

From-SVN: r133900
2008-04-04 14:57:18 +00:00
Paolo Bonzini 9ff420f135 tree-inline.c (copy_generic_body, [...]): Export.
2007-03-09  Paolo Bonzini  <bonzini@gnu.org>

	* tree-inline.c (copy_generic_body, copy_decl_no_change): Export.
	(remap_block): Call id->transform_lang_insert_block instead
	of langhook.
	(optimize_inline_calls, unsave_expr_now, tree_function_versioning):
	Set id.transform_lang_insert_block to NULL.
	(clone_body): Move to cp/optimize.c
	* tree-inline.h (struct copy_body_data): Change
	transform_lang_insert_block to function pointer.
	(copy_generic_body, copy_decl_no_change): Export.
	* langhooks.h (struct lang_hooks_for_decls): Kill insert_block.
	* langhooks-def.h (LANG_HOOKS_INSERT_BLOCK): Kill.
	(LANG_HOOKS_DECLS): Remove LANG_HOOKS_INSERT_BLOCK.

	* c-tree.h (insert_block): Kill.
	* c-decl.c (insert_block): Kill.

cp:
2007-03-09  Paolo Bonzini  <bonzini@gnu.org>

	* optimize.c (clone_body): New, from tree-inline.c.

ada:
2007-03-09  Paolo Bonzini  <bonzini@gnu.org>

	* gigi.h (insert_block): Kill.
	* utils.c (insert_block): Kill.

java:
2007-03-09  Paolo Bonzini  <bonzini@gnu.org>

	* java-tree.h (insert_block): Kill.
	* decl.c (insert_block): Kill.

fortran:
2007-03-09  Paolo Bonzini  <bonzini@gnu.org>

	* f95-lang.c (insert_block): Kill.

From-SVN: r133861
2008-04-03 05:41:57 +00:00
Paolo Bonzini d2784db4e5 c-objc-common.h (LANG_HOOKS_FUNCTION_ENTER_NESTED, [...]): Delete.
2008-04-03  Paolo Bonzini  <bonzini@gnu.org>

	* c-objc-common.h (LANG_HOOKS_FUNCTION_ENTER_NESTED,
	LANG_HOOKS_FUNCTION_LEAVE_NESTED): Delete.
	* c-tree.h (c_push_function_context, c_pop_function_context): Remove
	argument.
	* c-decl.c (c_push_function_context, c_pop_function_context): Remove
	argument, call {push,pop}_function_context from here.
	* c-parser.c: Use c_{push,pop}_function_context.

	* function.c (push_function_context_to): Move meat ...
	(push_function_context): ... here.  Simplify.
	* function.c (pop_function_context_from): Move meat ...
	(pop_function_context): ... here.  Simplify.
	* langhooks.h (struct lang_hooks_for_functions): Remove enter_nested,
	leave_nested).
	* langhooks-def.h (LANG_HOOKS_FUNCTION_ENTER_NESTED,
        LANG_HOOKS_FUNCTION_LEAVE_NESTED): Delete.
	(LANG_HOOKS_FUNCTION_INITIALIZER): Delete them from here.
	* tree.h (push_function_context_to, pop_function_context_from): Remove.

cp:
2008-04-03  Paolo Bonzini  <bonzini@gnu.org>

	* method.c (synthesize_method): Use {push,pop}_function_context.
	* name-lookup.c (push_to_top_level): Likewise.
	* parser.c (cp_parser_late_parsing_for_member): Likewise.

From-SVN: r133860
2008-04-03 05:38:32 +00:00
Paolo Bonzini ac5dc795ad expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations is true.
2008-03-18  Paolo Bonzini  <bonzini@gnu.org>

        * expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations
        is true.
        (expand_expr_real_1) <REDUCE_BIT_FIELD>: Don't look at ignore.
        (expand_expr_real_1): Assume lang_hooks.reduce_bit_field_operations
        is true.  Add "&& !ignore" condition to reduce_bit_field.  Modify
        target after ignore has been set, and move there also the commputation
        of subtarget and original_target.
        * langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
        (LANG_HOOKS_INITIALIZER): Remove it.
        * langhooks.h (struct lang_hooks): Remove reduce_bit_field_operations.

ada:
2008-03-18  Paolo Bonzini  <bonzini@gnu.org>

        * misc.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.

cp:
2008-03-18  Paolo Bonzini  <bonzini@gnu.org>

        * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.

From-SVN: r133316
2008-03-18 17:11:30 +00:00
Paolo Bonzini 30e257e544 langhooks-def.h (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
2008-03-11  Paolo Bonzini  <bonzini@gnu.org>

        * langhooks-def.h (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
        * langhooks.h (struct lang_hooks): Delete clear_binding_stack member.
        * toplev.c (compile_file): Don't call it.

fortran:
2008-03-11  Paolo Bonzini  <bonzini@gnu.org>

        * f95-lang.c (LANG_HOOKS_CLEAR_BINDING_STACK): Delete.
        (gfc_be_parse_file): Call clear_binding_stack from here.
	(gfc_clear_binding_stack): Rename to clear_binding_stack.

java:
2008-03-11  Paolo Bonzini  <bonzini@gnu.org>

        * jcf-parse.c (java_parse_file): Assert binding levels are
        left in order.
        * lang.c (LANG_HOOKS_CLEAR_BINDING_STACK, java_clear_binding_stack):
        Delete.

From-SVN: r133115
2008-03-11 16:44:25 +00:00
Alexandre Oliva 394d9fe79e re PR debug/7081 (DWARF enhancements for C++)
gcc/ChangeLog:
PR debug/7081
* dwarf2out.c (dwarf_tag_name): Synchronize with dwarf2.h.
(is_type_die): Cover interface types.
(class_or_namespace_scope_p): Cover interface and class types.
(record_type_tag): New.
(gen_inlined_structure_type_die): Use it.
(gen_struct_or_union_type_die): Likewise.
(prune_unused_types_walk): Cover interface types.
* langhooks.h (classify_record): New enum.
(classify_record): New member in struct langhooks_for_types.
* langhooks-def.h (LANG_HOOKS_CLASSIFY_RECORD): New.
(LANGHOOKS_FOR_TYPES_INITIALIZER): Adjust.
gcc/cp/ChangeLog:
PR debug/7081
* cp-lang.c (cp_classify_record): New.
(LANG_HOOKS_CLASSIFY_RECORD): Override.
gcc/java/ChangeLog:
PR debug/7081
* lang.c (java_classify_record): New.
(LANG_HOOKS_CLASSIFY_RECORD): Override.

From-SVN: r130960
2007-12-15 20:19:23 +00:00
Jakub Jelinek fad0afd7d7 re PR fortran/22244 (dimension information is lost for multi-dimension array)
PR fortran/22244
	* langhooks-def.h (LANG_HOOKS_GET_ARRAY_DESCR_INFO): Define.
	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.
	* langhooks.h (struct array_descr_info): Forward declaration.
	(struct lang_hooks_for_types): Add get_array_descr_info field.
	* dwarf2.h (DW_AT_bit_stride, DW_AT_byte_stride): New.
	(DW_AT_stride_size, DW_AT_stride): Keep around for Dwarf2
	compatibility.
	* dwarf2out.h (struct array_descr_info): New type.
	* dwarf2out.c (dwarf_attr_name): Rename DW_AT_stride to
	DW_AT_byte_stride and DW_AT_stride_size to DW_AT_bit_size.
	(descr_info_loc, add_descr_info_field, gen_descr_array_type_die):
	New functions.
	(gen_type_die_with_usage): Call lang_hooks.types.get_array_descr_info
	and gen_descr_array_type_die.

	* trans.h (struct array_descr_info): Forward declaration.
	(gfc_get_array_descr_info): New prototype.
	(enum gfc_array_kind): New type.
	(struct lang_type): Add akind field.
	(GFC_TYPE_ARRAY_AKIND): Define.
	* trans-types.c: Include dwarf2out.h.
	(gfc_build_array_type): Add akind argument.  Adjust
	gfc_get_array_type_bounds call.
	(gfc_get_nodesc_array_type): Include proper debug info even for
	assumed-size arrays.
	(gfc_get_array_type_bounds): Add akind argument, set
	GFC_TYPE_ARRAY_AKIND to it.
	(gfc_sym_type, gfc_get_derived_type): Adjust gfc_build_array_type
	callers.
	(gfc_get_array_descr_info): New function.
	* trans-array.c (gfc_trans_create_temp_array,
	gfc_conv_expr_descriptor): Adjust gfc_get_array_type_bounds
	callers.
	* trans-stmt.c (gfc_trans_pointer_assign_need_temp): Likewise.
	* trans-types.h (gfc_get_array_type_bounds): Adjust prototype.
	* Make-lang.in (fortran/trans-types.o): Depend on dwarf2out.h.
	* f95-lang.c (LANG_HOOKS_GET_ARRAY_DESCR_INFO): Define.

From-SVN: r130724
2007-12-09 18:08:06 +01:00
Diego Novillo c4e622b658 langhooks.h (struct lang_hooks_for_callgraph): Remove third argument from function pointer ANALYZE_EXPR.
* langhooks.h (struct lang_hooks_for_callgraph): Remove third
	argument from function pointer ANALYZE_EXPR.  Update all
	users.
	* cgraph.c (debug_cgraph_node): New.
	(debug_cgraph): New.

From-SVN: r129845
2007-11-02 07:12:30 -04:00
Ollie Wild 6524147cd2 varasm.c (compare_constant): Removed call to lang_hooks.expand_constant.
gcc/
	* varasm.c (compare_constant): Removed call to
	lang_hooks.expand_constant.
	(copy_constants): Removed call to lang_hooks.expand_constant.
	(compute_reloc_for_constant): Removed call to
	lang_hooks.expand_constant.
	(output_addressed_constants): Removed call to
	lang_hooks.expand_constant.
	(constructor_static_from_elts_p): Removed call to
	lang_hooks.expand_constant.
	(output_constant): Removed calls to lang_hooks.expand_constant.
	* langhooks.h (struct lang_hooks): Removed field expand_constant.
	* langhooks-def.h (lhd_return_tree): Removed.
	(LANG_HOOKS_EXPAND_CONSTANT): Removed.
	(LANG_HOOKS_INITIALIZER): Removed LANG_HOOKS_EXPAND_CONSTANT.
	* langhooks.c (lhd_return_tree): Removed.

	gcc/cp/
	* typeck2.c (digest_init): Call cplus_expand_constant after
	convert_for_initialization.
	* cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
	* expr.c (cplus_expand_constant): Updated function description.

	gcc/ada/
	* misc.c (LANG_HOOKS_PUSHDECL): Replaced lhd_return_tree with
	gnat_return_tree.
	(gnat_init_gcc_eh): Replaced gnat_eh_runtime_type with
	gnat_return_tree.
	(gnat_eh_runtime_type): Removed.
	(gnat_return_tree): New function.

From-SVN: r129133
2007-10-08 16:52:27 +00:00
Ollie Wild 6dcee2d6ca Revert
2007-09-27  Ollie Wild  <aaw@google.com>

	gcc/
	* varasm.c (compare_constant): Removed call to
	lang_hooks.expand_constant.
	(copy_constants): Removed call to lang_hooks.expand_constant.
	(compute_reloc_for_constant): Removed call to
	lang_hooks.expand_constant.
	(output_addressed_constants): Removed call to
	lang_hooks.expand_constant.
	(constructor_static_from_elts_p): Removed call to
	lang_hooks.expand_constant.
	(output_constant): Removed calls to lang_hooks.expand_constant.
	* langhooks.h (struct lang_hooks): Removed field expand_constant.
	* langhooks-def.h (lhd_return_tree): Removed.
	(LANG_HOOKS_EXPAND_CONSTANT): Removed.
	(LANG_HOOKS_INITIALIZER): Removed LANG_HOOKS_EXPAND_CONSTANT.
	* langhooks.c (lhd_return_tree): Removed.

	gcc/cp/
	* typeck2.c (digest_init): Call cplus_expand_constant after
	convert_for_initialization.
	* cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
	* expr.c (cplus_expand_constant): Updated function description.

From-SVN: r128881
2007-09-29 03:47:05 +00:00