1. 05 Jan, 2015 1 commit
  2. 12 Nov, 2014 1 commit
    • re PR c/59708 (clang-compatible checked arithmetic builtins) · 1304953e
      	PR c/59708
      	* builtin-attrs.def (ATTR_NOTHROW_TYPEGENERIC_LEAF): New attribute.
      	* builtins.c (fold_builtin_arith_overflow): New function.
      	(fold_builtin_3): Use it.
      	* builtins.def (BUILT_IN_ADD_OVERFLOW, BUILT_IN_SUB_OVERFLOW,
      	BUILT_IN_MUL_OVERFLOW, BUILT_IN_SADD_OVERFLOW, BUILT_IN_SADDL_OVERFLOW,
      	BUILT_IN_SADDLL_OVERFLOW, BUILT_IN_SSUB_OVERFLOW,
      	BUILT_IN_SSUBL_OVERFLOW, BUILT_IN_SSUBLL_OVERFLOW,
      	BUILT_IN_SMUL_OVERFLOW, BUILT_IN_SMULL_OVERFLOW,
      	BUILT_IN_SMULLL_OVERFLOW, BUILT_IN_UADDL_OVERFLOW,
      	BUILT_IN_UADDLL_OVERFLOW, BUILT_IN_USUB_OVERFLOW,
      	BUILT_IN_USUBL_OVERFLOW, BUILT_IN_USUBLL_OVERFLOW,
      	BUILT_IN_UMUL_OVERFLOW, BUILT_IN_UMULL_OVERFLOW,
      	BUILT_IN_UMULLL_OVERFLOW): New built-in functions.
      	* builtin-types.def (BT_PTR_UINT, BT_PTR_ULONG, BT_PTR_LONGLONG,
      	BT_FN_BOOL_INT_INT_INTPTR, BT_FN_BOOL_LONG_LONG_LONGPTR,
      	BT_FN_BOOL_LONGLONG_LONGLONG_LONGLONGPTR, BT_FN_BOOL_UINT_UINT_UINTPTR,
      	BT_FN_BOOL_ULONG_ULONG_ULONGPTR,
      	BT_FN_BOOL_ULONGLONG_ULONGLONG_ULONGLONGPTR, BT_FN_BOOL_VAR): New.
      	* expr.c (write_complex_part): Remove prototype, no longer static.
      	* expr.h (write_complex_part): New prototype.
      	* function.c (aggregate_value_p): For internal functions return 0.
      	* gimple-fold.c (arith_overflowed_p): New functions.
      	(gimple_fold_call): Fold {ADD,SUB,MUL}_OVERFLOW internal calls.
      	* gimple-fold.h (arith_overflowed_p): New prototype.
      	* tree-ssa-dce.c: Include tree-ssa-propagate.h and gimple-fold.h.
      	(find_non_realpart_uses, maybe_optimize_arith_overflow): New
      	functions.
      	(eliminate_unnecessary_stmts): Transform {ADD,SUB,MUL}_OVERFLOW
      	into COMPLEX_CST/COMPLEX_EXPR if IMAGPART_EXPR of the result is
      	never used.
      	* gimplify.c (gimplify_call_expr): Handle gimplification of
      	internal calls with lhs.
      	* internal-fn.c (get_range_pos_neg, get_min_precision,
      	expand_arith_overflow_result_store): New functions.
      	(ubsan_expand_si_overflow_addsub_check): Renamed to ...
      	(expand_addsub_overflow): ... this.  Add LOC, LHS, ARG0, ARG1,
      	UNSR_P, UNS0_P, UNS1_P, IS_UBSAN arguments, remove STMT argument.
      	Handle ADD_OVERFLOW and SUB_OVERFLOW expansion.
      	(ubsan_expand_si_overflow_neg_check): Renamed to ...
      	(expand_neg_overflow): ... this.  Add LOC, LHS, ARG1, IS_UBSAN
      	arguments, remove STMT argument.  Handle SUB_OVERFLOW with
      	0 as first argument expansion.
      	(ubsan_expand_si_overflow_mul_check): Renamed to ...
      	(expand_mul_overflow): ... this.  Add LOC, LHS, ARG0, ARG1,
      	UNSR_P, UNS0_P, UNS1_P, IS_UBSAN arguments, remove STMT argument.
      	Handle MUL_OVERFLOW expansion.
      	(expand_UBSAN_CHECK_ADD): Use expand_addsub_overflow, prepare
      	arguments for it.
      	(expand_UBSAN_CHECK_SUB): Use expand_addsub_overflow or
      	expand_neg_overflow, prepare arguments for it.
      	(expand_UBSAN_CHECK_MUL): Use expand_mul_overflow, prepare arguments
      	for it.
      	(expand_arith_overflow, expand_ADD_OVERFLOW, expand_SUB_OVERFLOW,
      	expand_MUL_OVERFLOW): New functions.
      	* internal-fn.def (ADD_OVERFLOW, SUB_OVERFLOW, MUL_OVERFLOW): New
      	internal functions.
      	* tree-vrp.c (check_for_binary_op_overflow): New function.
      	(extract_range_basic): Handle {REAL,IMAG}PART_EXPR if the operand
      	is SSA_NAME set by {ADD,SUB,MUL}_OVERFLOW internal functions.
      	(simplify_internal_call_using_ranges): Handle {ADD,SUB,MUL}_OVERFLOW
      	internal functions.
      	* optabs.def (umulv4_optab): New optab.
      	* config/i386/i386.md (umulv<mode>4, <u>mulvqi4): New define_expands.
      	(*umulv<mode>4, *<u>mulvqi4): New define_insns.
      	* doc/extend.texi (Integer Overflow Builtins): Document
      	__builtin_*_overflow.
      c-family/
      	* c-common.c (check_builtin_function_arguments): Handle
      	BUILT_IN_{ADD,SUB,MUL}_OVERFLOW.
      testsuite/
      	* c-c++-common/builtin-arith-overflow-1.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-10.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-11.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-12.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-12.h: New file.
      	* c-c++-common/torture/builtin-arith-overflow-13.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-14.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-15.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-16.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-17.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-18.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-1.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-1.h: New file.
      	* c-c++-common/torture/builtin-arith-overflow-2.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-3.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-4.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-5.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-6.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-7.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-8.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow-9.c: New test.
      	* c-c++-common/torture/builtin-arith-overflow.h: New file.
      	* gcc.dg/builtin-arith-overflow-1.c: New test.
      	* gcc.dg/builtin-arith-overflow-2.c: New test.
      
      From-SVN: r217415
      Jakub Jelinek committed
  3. 05 Nov, 2014 1 commit
    • ipa-chkp.c: New. · d5e254e1
      gcc/
      
      2014-11-05  Ilya Enkovich  <ilya.enkovich@intel.com>
      
      	* ipa-chkp.c: New.
      	* ipa-chkp.h: New.
      	* tree-chkp.c: New.
      	* tree-chkp.h: New.
      	* tree-chkp-opt.c: New.
      	* rtl-chkp.c: New.
      	* rtl-chkp.h: New.
      	* Makefile.in (OBJS): Add ipa-chkp.o, rtl-chkp.o, tree-chkp.o
      	tree-chkp-opt.o.
      	(GTFILES): Add tree-chkp.c.
      	* mode-classes.def (MODE_POINTER_BOUNDS): New.
      	* tree.def (POINTER_BOUNDS_TYPE): New.
      	* genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS.
      	(POINTER_BOUNDS_MODE): New.
      	(make_pointer_bounds_mode): New.
      	* machmode.h (POINTER_BOUNDS_MODE_P): New.
      	* stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS.
      	(layout_type): Support POINTER_BOUNDS_TYPE.
      	* tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE.
      	* tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE.
      	* tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE.
      	(type_contains_placeholder_1): Likewise.
      	(build_common_tree_nodes): Initialize
      	pointer_bounds_type_node.
      	* tree.h (POINTER_BOUNDS_TYPE_P): New.
      	(pointer_bounds_type_node): New.
      	(POINTER_BOUNDS_P): New.
      	(BOUNDED_TYPE_P): New.
      	(BOUNDED_P): New.
      	(CALL_WITH_BOUNDS_P): New.
      	* gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
      	(gimple_call_with_bounds_p): New.
      	(gimple_call_set_with_bounds): New.
      	(gimple_return_retbnd): New.
      	(gimple_return_set_retbnd): New
      	* gimple.c (gimple_build_return): Increase number of ops
      	for return statement.
      	(gimple_build_call_from_tree): Propagate CALL_WITH_BOUNDS_P
      	flag.
      	* gimple-pretty-print.c (dump_gimple_return): Print second op.
      	* rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.
      	* gimplify.c (gimplify_init_constructor): Avoid infinite
      	loop during gimplification of bounds initializer.
      	* calls.c: Include tree-chkp.h, rtl-chkp.h, bitmap.h.
      	(special_function_p): Use original decl name when analyzing
      	instrumentation clone.
      	(arg_data): Add fields special_slot, pointer_arg and
      	pointer_offset.
      	(store_bounds): New.
      	(emit_call_1): Propagate instrumentation flag for CALL.
      	(initialize_argument_information): Compute pointer_arg,
      	pointer_offset and special_slot for pointer bounds arguments.
      	(finalize_must_preallocate): Preallocate when storing bounds
      	in bounds table.
      	(compute_argument_addresses): Skip pointer bounds.
      	(expand_call): Store bounds into tables separately.  Return
      	result joined with resulting bounds.
      	* cfgexpand.c: Include tree-chkp.h, rtl-chkp.h.
      	(expand_call_stmt): Propagate bounds flag for CALL_EXPR.
      	(expand_return): Add returned bounds arg.  Handle returned bounds.
      	(expand_gimple_stmt_1): Adjust to new expand_return signature.
      	(gimple_expand_cfg): Reset rtx bounds map.
      	* expr.c: Include tree-chkp.h, rtl-chkp.h.
      	(expand_assignment): Handle returned bounds.
      	(store_expr_with_bounds): New.  Replaces store_expr with new bounds
      	target argument.  Handle bounds returned by calls.
      	(store_expr): Now wraps store_expr_with_bounds.
      	* expr.h (store_expr_with_bounds): New.
      	* function.c: Include tree-chkp.h, rtl-chkp.h.
      	(bounds_parm_data): New.
      	(use_register_for_decl): Do not registerize decls used for bounds
      	stores and loads.
      	(assign_parms_augmented_arg_list): Add bounds of the result
      	structure pointer as the second argument.
      	(assign_parm_find_entry_rtl): Mark bounds are never passed on
      	the stack.
      	(assign_parm_is_stack_parm): Likewise.
      	(assign_parm_load_bounds): New.
      	(assign_bounds): New.
      	(assign_parms): Load bounds and determine a location for
      	returned bounds.
      	(diddle_return_value_1): New.
      	(diddle_return_value): Handle returned bounds.
      	* function.h (rtl_data): Add field for returned bounds.
      	* varasm.c: Include tree-chkp.h.
      	(output_constant): Support POINTER_BOUNDS_TYPE.
      	(output_constant_pool_2): Support MODE_POINTER_BOUNDS.
      	(ultimate_transparent_alias_target): Move up.
      	(make_decl_rtl): For instrumented function use
      	name of the original decl.
      	(assemble_start_function): Mark function as global
      	in case it is instrumentation clone of the global
      	function.
      	(do_assemble_alias): Follow transparent alias chain
      	for identifier.  Check if original alias is public.
      	(maybe_assemble_visibility): Use visibility of the
      	original function for instrumented version.
      	(default_unique_section): Likewise.
      	* emit-rtl.c (immed_double_const): Support MODE_POINTER_BOUNDS.
      	(init_emit_once): Build pointer bounds zero constants.
      	* explow.c (trunc_int_for_mode): Support MODE_POINTER_BOUNDS.
      	* target.def (builtin_chkp_function): New.
      	(chkp_bound_type): New.
      	(chkp_bound_mode): New.
      	(chkp_make_bounds_constant): New.
      	(chkp_initialize_bounds): New.
      	(load_bounds_for_arg): New.
      	(store_bounds_for_arg): New.
      	(load_returned_bounds): New.
      	(store_returned_bounds): New.
      	(chkp_function_value_bounds): New.
      	(setup_incoming_vararg_bounds): New.
      	(function_arg): Update hook description with new possible return
      	value CONST_INT.
      	* targhooks.h (default_load_bounds_for_arg): New.
      	(default_store_bounds_for_arg): New.
      	(default_load_returned_bounds): New.
      	(default_store_returned_bounds): New.
      	(default_chkp_bound_type): New.
      	(default_chkp_bound_mode): New.
      	(default_builtin_chkp_function): New.
      	(default_chkp_function_value_bounds): New.
      	(default_chkp_make_bounds_constant): New.
      	(default_chkp_initialize_bounds): New.
      	(default_setup_incoming_vararg_bounds): New.
      	* targhooks.c (default_load_bounds_for_arg): New.
      	(default_store_bounds_for_arg): New.
      	(default_load_returned_bounds): New.
      	(default_store_returned_bounds): New.
      	(default_chkp_bound_type): New.
      	(default_chkp_bound_mode); New.
      	(default_builtin_chkp_function): New.
      	(default_chkp_function_value_bounds): New.
      	(default_chkp_make_bounds_constant): New.
      	(default_chkp_initialize_bounds): New.
      	(default_setup_incoming_vararg_bounds): New.
      	* builtin-types.def (BT_BND): New.
      	(BT_FN_PTR_CONST_PTR): New.
      	(BT_FN_CONST_PTR_CONST_PTR): New.
      	(BT_FN_BND_CONST_PTR): New.
      	(BT_FN_CONST_PTR_BND): New.
      	(BT_FN_PTR_CONST_PTR_SIZE): New.
      	(BT_FN_PTR_CONST_PTR_CONST_PTR): New.
      	(BT_FN_VOID_PTRPTR_CONST_PTR): New.
      	(BT_FN_VOID_CONST_PTR_SIZE): New.
      	(BT_FN_VOID_PTR_BND): New.
      	(BT_FN_CONST_PTR_CONST_PTR_CONST_PTR): New.
      	(BT_FN_BND_CONST_PTR_SIZE): New.
      	(BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New.
      	(BT_FN_VOID_CONST_PTR_BND_CONST_PTR): New.
      	* chkp-builtins.def: New.
      	* builtins.def: include chkp-builtins.def.
      	(DEF_CHKP_BUILTIN): New.
      	* builtins.c: Include tree-chkp.h and rtl-chkp.h.
      	(expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS,
      	BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS,
      	BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS,
      	BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS,
      	BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS,
      	BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND,
      	BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL,
      	BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET,
      	BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_NARROW,
      	BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER.
      	(std_expand_builtin_va_start): Init bounds for va_list.
      	* cppbuiltin.c (define_builtin_macros_for_compilation_flags): Add
      	__CHKP__ macro when Pointer Bounds Checker is on.
      	* params.def (PARAM_CHKP_MAX_CTOR_SIZE): New.
      	* passes.def (pass_ipa_chkp_versioning): New.
      	(pass_early_local_passes): Renamed to pass_build_ssa_passes.
      	(pass_fixup_cfg): Moved to pass_chkp_instrumentation_passes.
      	(pass_chkp_instrumentation_passes): New.
      	(pass_ipa_chkp_produce_thunks): New.
      	(pass_local_optimization_passes): New.
      	(pass_chkp_opt): New.
      	* tree-pass.h (make_pass_ipa_chkp_versioning): New.
      	(make_pass_ipa_chkp_produce_thunks): New.
      	(make_pass_chkp): New.
      	(make_pass_chkp_opt): New.
      	(make_pass_early_local_passes): Renamed to ...
      	(make_pass_build_ssa_passes): This.
      	(make_pass_chkp_instrumentation_passes): New.
      	(make_pass_local_optimization_passes): New.
      	* passes.c (pass_manager::execute_early_local_passes): Execute
      	early passes in three steps.
      	(execute_all_early_local_passes): Renamed to ...
      	(execute_build_ssa_passes): This.
      	(pass_data_early_local_passes): Renamed to ...
      	(pass_data_build_ssa_passes): This.
      	(pass_early_local_passes): Renamed to ...
      	(pass_build_ssa_passes): This.
      	(pass_data_chkp_instrumentation_passes): New.
      	(pass_chkp_instrumentation_passes): New.
      	(pass_data_local_optimization_passes): New.
      	(pass_local_optimization_passes): New.
      	(make_pass_early_local_passes): Renamed to ...
      	(make_pass_build_ssa_passes): This.
      	(make_pass_chkp_instrumentation_passes): New.
      	(make_pass_local_optimization_passes): New.
      	* c-family/c.opt (fcheck-pointer-bounds): New.
      	(fchkp-check-incomplete-type): New.
      	(fchkp-zero-input-bounds-for-main): New.
      	(fchkp-first-field-has-own-bounds): New.
      	(fchkp-narrow-bounds): New.
      	(fchkp-narrow-to-innermost-array): New.
      	(fchkp-optimize): New.
      	(fchkp-use-fast-string-functions): New.
      	(fchkp-use-nochk-string-functions): New.
      	(fchkp-use-static-bounds): New.
      	(fchkp-use-static-const-bounds): New.
      	(fchkp-treat-zero-dynamic-size-as-infinite): New.
      	(fchkp-check-read): New.
      	(fchkp-check-write): New.
      	(fchkp-store-bounds): New.
      	(fchkp-instrument-calls): New.
      	(fchkp-instrument-marked-only): New.
      	(Wchkp): New.
      	* c-family/c-common.c (handle_bnd_variable_size_attribute): New.
      	(handle_bnd_legacy): New.
      	(handle_bnd_instrument): New.
      	(c_common_attribute_table): Add bnd_variable_size, bnd_legacy
      	and bnd_instrument.  Fix documentation.
      	(c_common_format_attribute_table): Likewsie.
      	* toplev.c: include tree-chkp.h.
      	(process_options): Check Pointer Bounds Checker is supported.
      	(compile_file): Add chkp_finish_file call.
      	* ipa-cp.c (initialize_node_lattices): Use cgraph_local_p
      	to handle instrumentation clones properly.
      	(propagate_constants_accross_call): Do not propagate
      	through instrumentation thunks.
      	* ipa-pure-const.c (propagate_pure_const): Support
      	IPA_REF_CHKP.
      	* ipa-inline.c (early_inliner): Check edge has summary allocated.
      	* ipa-split.c: Include tree-chkp.h.
      	(find_retbnd): New.
      	(split_part_set_ssa_name_p): New.
      	(consider_split): Do not split retbnd and retval
      	producers.
      	(insert_bndret_call_after): new.
      	(split_function): Propagate Pointer Bounds Checker
      	instrumentation marks and handle returned bounds.
      	* tree-ssa-sccvn.h (vn_reference_op_struct): Transform opcode
      	into bit field and add with_bounds field.
      	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Set
      	with_bounds field for instrumented calls.
      	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Restore
      	CALL_WITH_BOUNDS_P flag for calls.
      	* tree-ssa-ccp.c: Include tree-chkp.h.
      	(insert_clobber_before_stack_restore): Handle
      	BUILT_IN_CHKP_BNDRET calls.
      	* tree-ssa-dce.c: Include tree-chkp.h.
      	(propagate_necessity): For free call fed by alloc check
      	bounds are also provided by the same alloc.
      	(eliminate_unnecessary_stmts): Handle BUILT_IN_CHKP_BNDRET
      	used by free calls.
      	* tree-inline.c: Include tree-chkp.h.
      	(declare_return_variable): Add arg holding
      	returned bounds slot.  Create and initialize returned bounds var.
      	(remap_gimple_stmt): Handle returned bounds.
      	Return sequence of statements instead of a single statement.
      	(insert_init_stmt): Add declaration.
      	(remap_gimple_seq): Adjust to new remap_gimple_stmt signature.
      	(copy_bb): Adjust to changed return type of remap_gimple_stmt.
      	Properly handle bounds in va_arg_pack and va_arg_pack_len.
      	(expand_call_inline): Handle returned bounds.  Add bounds copy
      	for generated mem to mem assignments.
      	* tree-inline.h (copy_body_data): Add fields retbnd and
      	assign_stmts.
      	* value-prof.c: Include tree-chkp.h.
      	(gimple_ic): Support returned bounds.
      	* ipa.c (cgraph_build_static_cdtor_1): Support contructors
      	with "chkp ctor" and "bnd_legacy" attributes.
      	(symtab_remove_unreachable_nodes): Keep initial values for
      	pointer bounds to be used for checks eliminations.
      	(process_references): Handle IPA_REF_CHKP.
      	(walk_polymorphic_call_targets): Likewise.
      	* ipa-visibility.c (cgraph_externally_visible_p): Mark
      	instrumented 'main' as externally visible.
      	(function_and_variable_visibility): Filter instrumentation
      	thunks.
      	* cgraph.h (cgraph_thunk_info): Add add_pointer_bounds_args
      	field.
      	(cgraph_node): Add instrumented_version, orig_decl and
      	instrumentation_clone fields.
      	(symtab_node::get_alias_target): Allow IPA_REF_CHKP reference.
      	(varpool_node): Add need_bounds_init field.
      	(cgraph_local_p): New.
      	* cgraph.c: Include tree-chkp.h.
      	(cgraph_node::remove): Fix instrumented_version
      	of the referenced node if any.
      	(cgraph_node::dump): Dump instrumentation_clone and
      	instrumented_version fields.
      	(cgraph_node::verify_node): Check correctness of IPA_REF_CHKP
      	references and instrumentation thunks.
      	(cgraph_can_remove_if_no_direct_calls_and_refs_p): Keep
      	all not instrumented instrumentation clones alive.
      	(cgraph_redirect_edge_call_stmt_to_callee): Support
      	returned bounds.
      	* cgraphbuild.c (rebuild_cgraph_edges): Rebuild IPA_REF_CHKP
      	reference.
      	(cgraph_rebuild_references): Likewise.
      	* cgraphunit.c: Include tree-chkp.h.
      	(assemble_thunks_and_aliases): Skip thunks calling instrumneted
      	function version.
      	(varpool_finalize_decl): Register statically initialized decls
      	in Pointer Bounds Checker.
      	(walk_polymorphic_call_targets): Do not mark generated call to
      	__builtin_unreachable as with_bounds.
      	(output_weakrefs): If there are both instrumented and original
      	versions, output only one of them.
      	(cgraph_node::expand_thunk): Set with_bounds flag
      	for created call statement.
      	* ipa-ref.h (ipa_ref_use): Add IPA_REF_CHKP.
      	(ipa_ref): increase size of use field.
      	* symtab.c (ipa_ref_use_name): Add element for IPA_REF_CHKP.
      	* varpool.c (dump_varpool_node): Dump need_bounds_init field.
      	(ctor_for_folding): Do not fold constant bounds vars.
      	* lto-streamer.h (LTO_minor_version): Change minor version from
      	0 to 1.
      	* lto-cgraph.c (compute_ltrans_boundary): Keep initial values for
      	pointer bounds.
      	(lto_output_node): Output instrumentation_clone,
      	thunk.add_pointer_bounds_args and orig_decl field.
      	(lto_output_ref): Adjust to new ipa_ref::use field size.
      	(input_overwrite_node): Read instrumentation_clone field.
      	(input_node): Read thunk.add_pointer_bounds_args and orig_decl
      	fields.
      	(input_ref): Adjust to new ipa_ref::use field size.
      	(input_cgraph_1): Compute instrumented_version fields and restore
      	IDENTIFIER_TRANSPARENT_ALIAS chains.
      	(lto_output_varpool_node): Output
      	need_bounds_init value.
      	(input_varpool_node): Read need_bounds_init value.
      	* lto-partition.c (add_symbol_to_partition_1): Keep original
      	and instrumented versions together.
      	(privatize_symbol_name): Restore transparent alias chain if required.
      	(add_references_to_partition): Add references to pointer bounds vars.
      	* dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE.
      	* dwarf2out.c (gen_subprogram_die): Ignore bound args.
      	(gen_type_die_with_usage): Skip pointer bounds.
      	(dwarf2out_global_decl): Likewise.
      	(is_base_type): Support POINTER_BOUNDS_TYPE.
      	(gen_formal_types_die): Skip pointer bounds.
      	(gen_decl_die): Likewise.
      	* var-tracking.c (vt_add_function_parameters): Skip
      	bounds parameters.
      	* ipa-icf.c (sem_function::merge): Do not merge when instrumentation
      	thunk still exists.
      	(sem_variable::merge): Reset need_bounds_init flag.
      	* doc/extend.texi: Document Pointer Bounds Checker built-in functions
      	and attributes.
      	* doc/tm.texi.in (TARGET_LOAD_BOUNDS_FOR_ARG): New.
      	(TARGET_STORE_BOUNDS_FOR_ARG): New.
      	(TARGET_LOAD_RETURNED_BOUNDS): New.
      	(TARGET_STORE_RETURNED_BOUNDS): New.
      	(TARGET_CHKP_FUNCTION_VALUE_BOUNDS): New.
      	(TARGET_SETUP_INCOMING_VARARG_BOUNDS): New.
      	(TARGET_BUILTIN_CHKP_FUNCTION): New.
      	(TARGET_CHKP_BOUND_TYPE): New.
      	(TARGET_CHKP_BOUND_MODE): New.
      	(TARGET_CHKP_MAKE_BOUNDS_CONSTANT): New.
      	(TARGET_CHKP_INITIALIZE_BOUNDS): New.
      	* doc/tm.texi: Regenerated.
      	* doc/rtl.texi (MODE_POINTER_BOUNDS): New.
      	(BND32mode): New.
      	(BND64mode): New.
      	* doc/invoke.texi (-mmpx): New.
      	(-mno-mpx): New.
      	(chkp-max-ctor-size): New.
      	* config/i386/constraints.md (w): New.
      	(Ti): New.
      	(Tb): New.
      	* config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__.
      	* config/i386/i386-modes.def (BND32): New.
      	(BND64): New.
      	* config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New.
      	* config/i386/i386.c: Include tree-chkp.h, rtl-chkp.h, tree-iterator.h.
      	(regclass_map): Add bound registers.
      	(dbx_register_map): Likewise.
      	(dbx64_register_map): Likewise.
      	(svr4_dbx_register_map): Likewise.
      	(isa_opts): Add -mmpx.
      	(PTA_MPX): New.
      	(ix86_option_override_internal): Support MPX ISA.
      	(ix86_conditional_register_usage): Support bound registers.
      	(ix86_code_end): Add MPX bnd prefix.
      	(output_set_got): Likewise.
      	(print_reg): Avoid prefixes for bound registers.
      	(ix86_print_operand): Add '!' (MPX bnd) print prefix support.
      	(ix86_print_operand_punct_valid_p): Likewise.
      	(ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and
      	UNSPEC_BNDLDX_ADDR.
      	(ix86_output_call_insn): Add MPX bnd prefix to branch instructions.
      	(ix86_class_likely_spilled_p): Add bound regs support.
      	(ix86_hard_regno_mode_ok): Likewise.
      	(x86_order_regs_for_local_alloc): Likewise.
      	(ix86_bnd_prefixed_insn_p): New.
      	(ix86_builtins): Add
      	IX86_BUILTIN_BNDMK, IX86_BUILTIN_BNDSTX,
      	IX86_BUILTIN_BNDLDX, IX86_BUILTIN_BNDCL,
      	IX86_BUILTIN_BNDCU, IX86_BUILTIN_BNDRET,
      	IX86_BUILTIN_BNDNARROW, IX86_BUILTIN_BNDINT,
      	IX86_BUILTIN_SIZEOF, IX86_BUILTIN_BNDLOWER,
      	IX86_BUILTIN_BNDUPPER.
      	(builtin_isa): Add leaf_p and nothrow_p fields.
      	(def_builtin): Initialize leaf_p and nothrow_p.
      	(ix86_add_new_builtins): Handle leaf_p and nothrow_p
      	flags.
      	(bdesc_mpx): New.
      	(bdesc_mpx_const): New.
      	(ix86_init_mpx_builtins): New.
      	(ix86_init_builtins): Call ix86_init_mpx_builtins.
      	(ix86_emit_cmove): New.
      	(ix86_emit_move_max): New.
      	(ix86_expand_builtin): Expand IX86_BUILTIN_BNDMK,
      	IX86_BUILTIN_BNDSTX, IX86_BUILTIN_BNDLDX,
      	IX86_BUILTIN_BNDCL, IX86_BUILTIN_BNDCU,
      	IX86_BUILTIN_BNDRET, IX86_BUILTIN_BNDNARROW,
      	IX86_BUILTIN_BNDINT, IX86_BUILTIN_SIZEOF,
      	IX86_BUILTIN_BNDLOWER, IX86_BUILTIN_BNDUPPER.
      	(ix86_function_value_bounds): New.
      	(ix86_builtin_mpx_function): New.
      	(ix86_get_arg_address_for_bt): New.
      	(ix86_load_bounds): New.
      	(ix86_store_bounds): New.
      	(ix86_load_returned_bounds): New.
      	(ix86_store_returned_bounds): New.
      	(ix86_mpx_bound_mode): New.
      	(ix86_make_bounds_constant): New.
      	(ix86_initialize_bounds):
      	(TARGET_LOAD_BOUNDS_FOR_ARG): New.
      	(TARGET_STORE_BOUNDS_FOR_ARG): New.
      	(TARGET_LOAD_RETURNED_BOUNDS): New.
      	(TARGET_STORE_RETURNED_BOUNDS): New.
      	(TARGET_CHKP_BOUND_MODE): New.
      	(TARGET_BUILTIN_CHKP_FUNCTION): New.
      	(TARGET_CHKP_FUNCTION_VALUE_BOUNDS): New.
      	(TARGET_CHKP_MAKE_BOUNDS_CONSTANT): New.
      	(TARGET_CHKP_INITIALIZE_BOUNDS): New.
      	(ix86_option_override_internal): Do not
      	support x32 with MPX.
      	(init_cumulative_args): Init stdarg, bnd_regno, bnds_in_bt
      	and force_bnd_pass.
      	(function_arg_advance_32): Return number of used integer
      	registers.
      	(function_arg_advance_64): Likewise.
      	(function_arg_advance_ms_64): Likewise.
      	(ix86_function_arg_advance): Handle pointer bounds.
      	(ix86_function_arg): Likewise.
      	(ix86_function_value_regno_p): Mark fisrt bounds registers as
      	possible function value.
      	(ix86_function_value_1): Handle pointer bounds type/mode
      	(ix86_return_in_memory): Likewise.
      	(ix86_print_operand): Analyse insn to decide abounf "bnd" prefix.
      	(ix86_expand_call): Generate returned bounds.
      	(ix86_setup_incoming_vararg_bounds): New.
      	(ix86_va_start): Initialize bounds for pointers in va_list.
      	(TARGET_SETUP_INCOMING_VARARG_BOUNDS): New.
      	* config/i386/i386.h (TARGET_MPX): New.
      	(TARGET_MPX_P): New.
      	(FIRST_PSEUDO_REGISTER): Fix to new value.
      	(FIXED_REGISTERS): Add bound registers.
      	(CALL_USED_REGISTERS): Likewise.
      	(REG_ALLOC_ORDER): Likewise.
      	(HARD_REGNO_NREGS): Likewise.
      	(VALID_BND_REG_MODE): New.
      	(FIRST_BND_REG): New.
      	(LAST_BND_REG): New.
      	(reg_class): Add BND_REGS.
      	(REG_CLASS_NAMES): Likewise.
      	(REG_CLASS_CONTENTS): Likewise.
      	(BND_REGNO_P): New.
      	(ANY_BND_REG_P): New.
      	(BNDmode): New.
      	(HI_REGISTER_NAMES): Add bound registers.
      	(ix86_args): Add bnd_regno, bnds_in_bt,	force_bnd_pass and
      	stdarg fields.
      	* config/i386/i386.md (UNSPEC_BNDMK): New.
      	(UNSPEC_BNDMK_ADDR): New.
      	(UNSPEC_BNDSTX): New.
      	(UNSPEC_BNDLDX): New.
      	(UNSPEC_BNDLDX_ADDR): New.
      	(UNSPEC_BNDCL): New.
      	(UNSPEC_BNDCU): New.
      	(UNSPEC_BNDCN): New.
      	(UNSPEC_MPX_FENCE): New.
      	(UNSPEC_SIZEOF): New.
      	(BND0_REG): New.
      	(BND1_REG): New.
      	(type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst.
      	(length_immediate): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst.
      	(prefix_rep): Check for bnd prefix.
      	(prefix_0f): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst.
      	(length_nobnd): New.
      	(length): Use length_nobnd when specified.
      	(memory): Support mpxmov, mpxmk, mpxchk, mpxld, mpxst.
      	(BND): New.
      	(bnd_ptr): New.
      	(BNDCHECK): New.
      	(bndcheck): New.
      	(*jcc_1): Add MPX bnd prefix.
      	(*jcc_2): Likewise.
      	(jump): Likewise.
      	(*indirect_jump): Likewise.
      	(*tablejump_1): Likewise.
      	(simple_return_internal): Likewise.
      	(simple_return_internal_long): Likewise.
      	(simple_return_pop_internal): Likewise.
      	(simple_return_indirect_internal): Likewise.
      	(<mode>_mk): New.
      	(*<mode>_mk): New.
      	(mov<mode>): New.
      	(*mov<mode>_internal_mpx): New.
      	(<mode>_<bndcheck>): New.
      	(*<mode>_<bndcheck>): New.
      	(<mode>_ldx): New.
      	(*<mode>_ldx): New.
      	(<mode>_stx): New.
      	(*<mode>_stx): New.
      	move_size_reloc_<mode>): New.
      	* config/i386/predicates.md (address_mpx_no_base_operand): New.
      	(address_mpx_no_index_operand): New.
      	(bnd_mem_operator): New.
      	(symbol_operand): New.
      	(x86_64_immediate_size_operand): New.
      	* config/i386/i386.opt (mmpx): New.
      	* config/i386/i386-builtin-types.def (BND): New.
      	(ULONG): New.
      	(BND_FTYPE_PCVOID_ULONG): New.
      	(VOID_FTYPE_BND_PCVOID): New.
      	(VOID_FTYPE_PCVOID_PCVOID_BND): New.
      	(BND_FTYPE_PCVOID_PCVOID): New.
      	(BND_FTYPE_PCVOID): New.
      	(BND_FTYPE_BND_BND): New.
      	(PVOID_FTYPE_PVOID_PVOID_ULONG): New.
      	(PVOID_FTYPE_PCVOID_BND_ULONG): New.
      	(ULONG_FTYPE_VOID): New.
      	(PVOID_FTYPE_BND): New.
      
      gcc/testsuite/
      
      2014-11-05  Ilya Enkovich  <ilya.enkovich@intel.com>
      
      	* gcc.target/i386/chkp-builtins-1.c: New.
      	* gcc.target/i386/chkp-builtins-2.c: New.
      	* gcc.target/i386/chkp-builtins-3.c: New.
      	* gcc.target/i386/chkp-builtins-4.c: New.
      	* gcc.target/i386/chkp-remove-bndint-1.c: New.
      	* gcc.target/i386/chkp-remove-bndint-2.c: New.
      	* gcc.target/i386/chkp-const-check-1.c: New.
      	* gcc.target/i386/chkp-const-check-2.c: New.
      	* gcc.target/i386/chkp-lifetime-1.c: New.
      	* gcc.dg/pr37858.c: Replace early_local_cleanups pass name
      	with build_ssa_passes.
      
      From-SVN: r217125
      Ilya Enkovich committed
  4. 14 Oct, 2014 1 commit
    • machmode.h (int_n_data_t): New. · 78a7c317
      	* machmode.h (int_n_data_t): New.
      	(int_n_enabled_p): New.
      	(int_n_data): New.
      	* tree.c (int_n_enabled_p): New.
      	(int_n_trees): New.
      	(make_or_reuse_type): Check for all __intN types, not just
      	__int128.
      	(build_common_tree_nodes): Likewise.  Also fill in integer_typs[]
      	entries.
      	* tree.h (int128_integer_type_node): Remove.
      	(int128_unsigned_type_node): Remove.
      	(int_n_trees_t): New.
      	(int_n_enabled_p): New.
      	(int_n_trees): New.
      	* toplev.c (standard_type_bitsize): New.
      	(do_compile): Check which __intN types are enabled for the current
      	run.
      	* builtin-types.def (BT_INT128): Remove.
      	(BT_UINT128): Remove.
      	* machmode.def: Add macro to create __int128 for all targets.
      	* stor-layout.c (mode_for_size): Support __intN types.
      	(smallest_mode_for_size): Likewise.
      	(initialize_sizetypes): Support __intN types.
      	* genmodes.c (struct mode_data): Add int_n field.
      	(blank_mode): Likewise.
      	(INT_N): New.
      	(make_int_n): New.
      	(emit_insn_modes_h): Count __intN entries and define
      	NUM_INT_N_ENTS.
      	(emit_mode_int_n): New.
      	(emit_insn_modes_c): Call it.
      	* gimple.c (gimple_signed_or_unsigned_type): Check for all __intN
      	types, not just __int128.
      	* tree-core.h (integer_type_kind): Remove __int128-specific
      	entries, reserve spots for __intN entries.
      
      libstdc++-v3/
      	* src/c++11/limits.cc: Add support for __intN types.
      	* include/std/type_traits: Likewise.
      	* include/std/limits: Likewise.
      	* include/c_std/cstdlib: Likewise.
      	* include/bits/cpp_type_traits.h: Likewise.
      	* include/c_global/cstdlib: Likewise.
      
      c-family/
      	* c-pretty-print.c (pp_c_integer_constant): Check for all __intN
      	types, not just __int128.
      	* c-cppbuiltin.c (c_cpp_builtins): Add builtins for all __intN
      	types, not just __int128.
      	(cpp_atomic_builtins): Round pointer sizes up.
      	(type_suffix): Use type precision, not specific types.
      	* c-common.c (c_common_reswords): Remove __int128 special case.
      	(c_common_type_for_size): Check for all __intN types, not just
      	__int128.
      	(c_common_type_for_mode): Likewise.
      	(c_common_signed_or_unsigned_type): Likewise.
      	(c_build_bitfield_integer_type): Likewise.
      	(c_common_nodes_and_builtins): Likewise.
      	(keyword_begins_type_specifier): Likewise.
      	* c-common.h (rid): Remove RID_INT128 and add RID_INT_N_* for all
      	__intN variants.
      
      c/
      	* c-parser.c (c_parse_init): Add RID entries for each __intN.
      	(c_token_starts_typename): Check all __intN, not just __int128.
      	(c_token_starts_declspecs): Likewise.
      	(c_parser_declspecs): Likewise.
      	(c_parser_attribute_any_word): Likewise.
      	(c_parser_objc_selector): Likewise.
      	* c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
      	(struct c_declspecs): Add int_n_idx field to record *which* __intN
      	is specified.
      	* c-decl.c (declspecs_add_type): Check for all __intN, not just
      	__int128.
      	(finish_declspecs): Likewise.
      
      testsuite/
      	* g++.dg/abi/mangle64.C: New.
      
      cp/
      	* typeck.c (cp_common_type): Check for all __intN types, not just
      	__int128.
      	* decl.c (grokdeclarator): Likewise.
      	* rtti.c (emit_support_tinfos): Check for all __intN types, not just
      	__int128.
      	* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
      	for all __intN types, not just __int128.
      	(cp_parser_simple_type_specifier): Likewise.
      	* mangle.c (integer_type_codes): Remove int128-specific codes.
      	* cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
      	__intN was specified.
      	* lex.c (init_reswords): Reserve all __intN keywords.
      
      lto/
      	* lto-lang.c (lto_build_c_type_nodes): Check intN types for
      	size-type as well.
      	(lto_init): Initialize all intN types, not just int128.
      
      From-SVN: r216220
      DJ Delorie committed
  5. 22 May, 2014 1 commit
    • Cosmetic fixes for DEF_FUNCTION_TYPE_* macros. · f6a7cffc
      	gcc/ada/
      	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
      	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
      	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
      	gcc/
      	* builtin-types.def: Simplify examples for DEF_FUNCTION_TYPE_*.
      	gcc/c-family/
      	* c-common.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
      	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
      	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
      	gcc/fortran/
      	* f95-lang.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
      	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
      	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
      	* types.def: Simplify examples for DEF_FUNCTION_TYPE_*.
      	gcc/lto/
      	* lto-lang.c (DEF_FUNCTION_TYPE_0, DEF_FUNCTION_TYPE_6)
      	(DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_8)
      	(DEF_FUNCTION_TYPE_VAR_5): Cosmetic fixes.
      
      From-SVN: r210822
      Thomas Schwinge committed
  6. 07 Feb, 2014 1 commit
    • re PR middle-end/60092 (posix_memalign not recognized to derive alias and alignment info) · 32cab212
      2014-02-07  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/60092
      	* builtin-types.def (BT_FN_INT_PTRPTR_SIZE_SIZE): Add.
      	* builtins.def (BUILT_IN_POSIX_MEMALIGN): Likewise.
      	* tree-ssa-structalias.c (find_func_aliases_for_builtin_call):
      	Handle BUILT_IN_POSIX_MEMALIGN.
      	(find_func_clobbers): Likewise.
      	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise.
      	(call_may_clobber_ref_p_1): Likewise.
      
      	* gcc.dg/tree-ssa/alias-30.c: New testcase.
      	* gcc.dg/tree-ssa/alias-31.c: Likewise.
      
      From-SVN: r207595
      Richard Biener committed
  7. 02 Jan, 2014 1 commit
  8. 29 Nov, 2013 1 commit
    • revert: cgraph.h (varpool_node): Add need_bounds_init field. · 089d1227
      	Reverted:
      	2013-11-20  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* cgraph.h (varpool_node): Add need_bounds_init field.
      	* lto-cgraph.c (lto_output_varpool_node): Output
      	need_bounds_init value.
      	(input_varpool_node): Read need_bounds_init value.
      	* varpool.c (dump_varpool_node): Dump need_bounds_init field.
      
      	Reverted:
      	2013-11-20  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE.
      	* dwarf2out.c (gen_subprogram_die): Ignore bound args.
      	(gen_type_die_with_usage): Skip pointer bounds.
      	(dwarf2out_global_decl): Likewise.
      
      	Reverted:
      	2013-11-18  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New.
      	* chkp-builtins.def (BUILT_IN_CHKP_BIND_BOUNDS): New.
      	* cfgexpand.c (expand_call_stmt): Expand BUILT_IN_CHKP_BIND_BOUNDS.
      	* gimple.c (gimple_call_get_nobnd_arg_index): Remove.
      	* gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
      	(gimple_call_with_bounds_p): New.
      	(gimple_call_set_with_bounds): New.
      	(gimple_call_num_nobnd_args): Remove.
      	(gimple_call_nobnd_arg): Remove.
      	* tree.h (CALL_WITH_BOUNDS_P): New.
      	* rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.
      
      	Reverted:
      	2013-11-08  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* common.opt (fcheck-pointer-bounds): Move to ...
      	* c-family/c.opt: ... here.
      	* langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): Remove.
      	(LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_CHKP_SUPPORTED.
      	* langhooks.h (lang_hooks): Remove chkp_supported field.
      	* toplev.c (process_options): Remove chkp_supported check.
      
      	Reverted:
      	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE.
      	* tree.h (POINTER_BOUNDS_P): New.
      	(BOUNDED_TYPE_P): New.
      	(BOUNDED_P): New.
      	(pointer_bounds_type_node): New.
      	* tree.c (build_common_tree_nodes): Initialize
      	pointer_bounds_type_node.
      	* gimple.h (gimple_call_get_nobnd_arg_index): New.
      	(gimple_call_num_nobnd_args): New.
      	(gimple_call_nobnd_arg): New.
      	(gimple_return_retbnd): New.
      	(gimple_return_set_retbnd): New
      	* gimple.c (gimple_build_return): Increase number of ops
      	for return statement.
      	(gimple_call_get_nobnd_arg_index): New.
      	* gimple-pretty-print.c (dump_gimple_return): Print second op.
      
      	Reverted:
      	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* ipa.c (cgraph_build_static_cdtor_1): Support contructors
      	with "chkp ctor" and "bnd_legacy" attributes.
      	* gimplify.c (gimplify_init_constructor): Avoid infinite
      	loop during gimplification of bounds initializer.
      
      	Reverted:
      	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* c-family/c-common.c (handle_bnd_variable_size_attribute): New.
      	(handle_bnd_legacy): New.
      	(c_common_attribute_table): Add bnd_variable_size and bnd_legacy.
      	* doc/extend.texi: Document bnd_variable_size and bnd_legacy
      	attributes.
      
      	Reverted:
      	2013-10-29  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* builtin-types.def (BT_FN_VOID_CONST_PTR): New.
      	(BT_FN_PTR_CONST_PTR): New.
      	(BT_FN_CONST_PTR_CONST_PTR): New.
      	(BT_FN_PTR_CONST_PTR_SIZE): New.
      	(BT_FN_PTR_CONST_PTR_CONST_PTR): New.
      	(BT_FN_VOID_PTRPTR_CONST_PTR): New.
      	(BT_FN_VOID_CONST_PTR_SIZE): New.
      	(BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New.
      	* chkp-builtins.def: New.
      	* builtins.def: include chkp-builtins.def.
      	(DEF_CHKP_BUILTIN): New.
      	* builtins.c (expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS,
      	BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS,
      	BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS,
      	BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS,
      	BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS,
      	BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND,
      	BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL,
      	BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET,
      	BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_ARG_BND, BUILT_IN_CHKP_NARROW,
      	BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER.
      	* common.opt (fcheck-pointer-bounds): New.
      	* toplev.c (process_options): Check Pointer Bounds Checker is
      	supported.
      	* doc/extend.texi: Document Pointer Bounds Checker built-in functions.
      
      	Reverted:
      	2013-10-30  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* target.def (builtin_chkp_function): New.
      	(chkp_bound_type): New.
      	(chkp_bound_mode): New.
      	(fn_abi_va_list_bounds_size): New.
      	(load_bounds_for_arg): New.
      	(store_bounds_for_arg): New.
      	* targhooks.h (default_load_bounds_for_arg): New.
      	(default_store_bounds_for_arg): New.
      	(default_fn_abi_va_list_bounds_size): New.
      	(default_chkp_bound_type): New.
      	(default_chkp_bound_mode): New.
      	(default_builtin_chkp_function): New.
      	* targhooks.c (default_load_bounds_for_arg): New.
      	(default_store_bounds_for_arg): New.
      	(default_fn_abi_va_list_bounds_size): New.
      	(default_chkp_bound_type): New.
      	(default_chkp_bound_mode); New.
      	(default_builtin_chkp_function): New.
      	* doc/tm.texi.in (TARGET_FN_ABI_VA_LIST_BOUNDS_SIZE): New.
      	(TARGET_LOAD_BOUNDS_FOR_ARG): New.
      	(TARGET_STORE_BOUNDS_FOR_ARG): New.
      	(TARGET_BUILTIN_CHKP_FUNCTION): New.
      	(TARGET_CHKP_BOUND_TYPE): New.
      	(TARGET_CHKP_BOUND_MODE): New.
      	* doc/tm.texi: Regenerated.
      	* langhooks.h (lang_hooks): Add chkp_supported field.
      	* langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): New.
      	(LANG_HOOKS_INITIALIZER); Add LANG_HOOKS_CHKP_SUPPORTED.
      
      	Reverted:
      	2013-10-24  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* config/i386/constraints.md (B): New.
      	(Ti): New.
      	(Tb): New.
      	* config/i386/i386-c.c (ix86_target_macros_internal): Add __MPX__.
      	* config/i386/i386-modes.def (BND32): New.
      	(BND64): New.
      	* config/i386/i386-protos.h (ix86_bnd_prefixed_insn_p): New.
      	* config/i386/i386.c (isa_opts): Add mmpx.
      	(regclass_map): Add bound registers.
      	(dbx_register_map): Likewise.
      	(dbx64_register_map): Likewise.
      	(svr4_dbx_register_map): Likewise.
      	(PTA_MPX): New.
      	(ix86_option_override_internal): Support MPX ISA.
      	(ix86_conditional_register_usage): Support bound registers.
      	(print_reg): Likewise.
      	(ix86_code_end): Add MPX bnd prefix.
      	(output_set_got): Likewise.
      	(ix86_output_call_insn): Likewise.
      	(ix86_print_operand): Add '!' (MPX bnd) print prefix support.
      	(ix86_print_operand_punct_valid_p): Likewise.
      	(ix86_print_operand_address): Support UNSPEC_BNDMK_ADDR and
      	UNSPEC_BNDMK_ADDR.
      	(ix86_class_likely_spilled_p): Add bound regs support.
      	(ix86_hard_regno_mode_ok): Likewise.
      	(x86_order_regs_for_local_alloc): Likewise.
      	(ix86_bnd_prefixed_insn_p): New.
      	* config/i386/i386.h (FIRST_PSEUDO_REGISTER): Fix to new value.
      	(FIXED_REGISTERS): Add bound registers.
      	(CALL_USED_REGISTERS): Likewise.
      	(REG_ALLOC_ORDER): Likewise.
      	(HARD_REGNO_NREGS): Likewise.
      	(TARGET_MPX): New.
      	(VALID_BND_REG_MODE): New.
      	(FIRST_BND_REG): New.
      	(LAST_BND_REG): New.
      	(reg_class): Add BND_REGS.
      	(REG_CLASS_NAMES): Likewise.
      	(REG_CLASS_CONTENTS): Likewise.
      	(BND_REGNO_P): New.
      	(ANY_BND_REG_P): New.
      	(BNDmode): New.
      	(HI_REGISTER_NAMES): Add bound registers.
      	* config/i386/i386.md (UNSPEC_BNDMK): New.
      	(UNSPEC_BNDMK_ADDR): New.
      	(UNSPEC_BNDSTX): New.
      	(UNSPEC_BNDLDX): New.
      	(UNSPEC_BNDLDX_ADDR): New.
      	(UNSPEC_BNDCL): New.
      	(UNSPEC_BNDCU): New.
      	(UNSPEC_BNDCN): New.
      	(UNSPEC_MPX_FENCE): New.
      	(BND0_REG): New.
      	(BND1_REG): New.
      	(type): Add mpxmov, mpxmk, mpxchk, mpxld, mpxst.
      	(length_immediate): Likewise.
      	(prefix_0f): Likewise.
      	(memory): Likewise.
      	(prefix_rep): Check for bnd prefix.
      	(length_nobnd): New.
      	(length): Use length_nobnd if specified.
      	(BND): New.
      	(bnd_ptr): New.
      	(BNDCHECK): New.
      	(bndcheck): New.
      	(*jcc_1): Add bnd prefix and rename length attr to length_nobnd.
      	(*jcc_2): Likewise.
      	(jump): Likewise.
      	(simple_return_internal): Likewise.
      	(simple_return_pop_internal): Likewise.
      	(*indirect_jump): Add MPX bnd prefix.
      	(*tablejump_1): Likewise.
      	(simple_return_internal_long): Likewise.
      	(simple_return_indirect_internal): Likewise.
      	(<mode>_mk): New.
      	(*<mode>_mk): New.
      	(mov<mode>): New.
      	(*mov<mode>_internal_mpx): New.
      	(<mode>_<bndcheck>): New.
      	(*<mode>_<bndcheck>): New.
      	(<mode>_ldx): New.
      	(*<mode>_ldx): New.
      	(<mode>_stx): New.
      	(*<mode>_stx): New.
      	* config/i386/predicates.md (lea_address_operand): Rename to...
      	(address_no_seg_operand): ... this.
      	(address_mpx_no_base_operand): New.
      	(address_mpx_no_index_operand): New.
      	(bnd_mem_operator): New.
      	* config/i386/i386.opt (mmpx): New.
      	* doc/invoke.texi: Add documentation for the flags -mmpx, -mno-mpx.
      	* doc/rtl.texi Add documentation for BND32mode and BND64mode.
      
      	Reverted:
      	2013-10-24  Ilya Enkovich  <ilya.enkovich@intel.com>
      	* mode-classes.def (MODE_POINTER_BOUNDS): New.
      	* tree.def (POINTER_BOUNDS_TYPE): New.
      	* genmodes.c (complete_mode): Support MODE_POINTER_BOUNDS.
      	(POINTER_BOUNDS_MODE): New.
      	(make_pointer_bounds_mode): New.
      	* machmode.h (POINTER_BOUNDS_MODE_P): New.
      	* stor-layout.c (int_mode_for_mode): Support MODE_POINTER_BOUNDS.
      	(layout_type): Support POINTER_BOUNDS_TYPE.
      	* tree-pretty-print.c (dump_generic_node): Support POINTER_BOUNDS_TYPE.
      	* tree.c (build_int_cst_wide): Support POINTER_BOUNDS_TYPE.
      	(type_contains_placeholder_1): Likewise.
      	* tree.h (POINTER_BOUNDS_TYPE_P): New.
      	* varasm.c (output_constant): Support POINTER_BOUNDS_TYPE.
      	* doc/rtl.texi (MODE_POINTER_BOUNDS): New.
      
      From-SVN: r205522
      Ilya Enkovich committed
  9. 18 Nov, 2013 1 commit
    • builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New. · 01156003
              * builtin-types.def (BT_FN_PTR_CONST_PTR_VAR): New.
              * chkp-builtins.def (BUILT_IN_CHKP_BIND_BOUNDS): New.
              * cfgexpand.c (expand_call_stmt): Expand BUILT_IN_CHKP_BIND_BOUNDS.
              * gimple.c (gimple_call_get_nobnd_arg_index): Remove.
              * gimple.h (gf_mask): Add GF_CALL_WITH_BOUNDS.
              (gimple_call_with_bounds_p): New.
              (gimple_call_set_with_bounds): New.
              (gimple_call_num_nobnd_args): Remove.
              (gimple_call_nobnd_arg): Remove.
              * tree.h (CALL_WITH_BOUNDS_P): New.
              * rtl.h (CALL_EXPR_WITH_BOUNDS_P): New.
      
      From-SVN: r204947
      Ilya Enkovich committed
  10. 30 Oct, 2013 1 commit
    • builtin-types.def (BT_FN_VOID_CONST_PTR): New. · 109719eb
              * builtin-types.def (BT_FN_VOID_CONST_PTR): New.
              (BT_FN_PTR_CONST_PTR): New.
              (BT_FN_CONST_PTR_CONST_PTR): New.
              (BT_FN_PTR_CONST_PTR_SIZE): New.
              (BT_FN_PTR_CONST_PTR_CONST_PTR): New.
              (BT_FN_VOID_PTRPTR_CONST_PTR): New.
              (BT_FN_VOID_CONST_PTR_SIZE): New.
              (BT_FN_PTR_CONST_PTR_CONST_PTR_SIZE): New.
              * chkp-builtins.def: New.
              * builtins.def: include chkp-builtins.def.
              (DEF_CHKP_BUILTIN): New.
              * builtins.c (expand_builtin): Support BUILT_IN_CHKP_INIT_PTR_BOUNDS,
              BUILT_IN_CHKP_NULL_PTR_BOUNDS, BUILT_IN_CHKP_COPY_PTR_BOUNDS,
              BUILT_IN_CHKP_CHECK_PTR_LBOUNDS, BUILT_IN_CHKP_CHECK_PTR_UBOUNDS,
              BUILT_IN_CHKP_CHECK_PTR_BOUNDS, BUILT_IN_CHKP_SET_PTR_BOUNDS,
              BUILT_IN_CHKP_NARROW_PTR_BOUNDS, BUILT_IN_CHKP_STORE_PTR_BOUNDS,
              BUILT_IN_CHKP_GET_PTR_LBOUND, BUILT_IN_CHKP_GET_PTR_UBOUND,
              BUILT_IN_CHKP_BNDMK, BUILT_IN_CHKP_BNDSTX, BUILT_IN_CHKP_BNDCL,
              BUILT_IN_CHKP_BNDCU, BUILT_IN_CHKP_BNDLDX, BUILT_IN_CHKP_BNDRET,
              BUILT_IN_CHKP_INTERSECT, BUILT_IN_CHKP_ARG_BND, BUILT_IN_CHKP_NARROW,
              BUILT_IN_CHKP_EXTRACT_LOWER, BUILT_IN_CHKP_EXTRACT_UPPER.
              * common.opt (fcheck-pointer-bounds): New.
              * toplev.c (process_options): Check Pointer Bounds Checker is supported.
              * doc/extend.texi: Document Pointer Bounds Checker built-in functions.
      
      From-SVN: r204196
      Ilya Enkovich committed
  11. 11 Oct, 2013 1 commit
    • target.c: New file. · acf0174b
      libgomp/
      	* target.c: New file.
      	* Makefile.am (libgomp_la_SOURCES): Add target.c.
      	* Makefile.in: Regenerated.
      	* libgomp_g.h (GOMP_task): Add depend argument.
      	(GOMP_barrier_cancel, GOMP_loop_end_cancel,
      	GOMP_sections_end_cancel, GOMP_target, GOMP_target_data,
      	GOMP_target_end_data, GOMP_target_update, GOMP_teams,
      	GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
      	GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
      	GOMP_parallel, GOMP_cancel, GOMP_cancellation_point,
      	GOMP_taskgroup_start, GOMP_taskgroup_end,
      	GOMP_parallel_sections): New prototypes.
      	* fortran.c (omp_is_initial_device): Add ialias_redirect.
      	(omp_is_initial_device_): New function.
      	(ULP, STR1, STR2, ialias_redirect): Removed.
      	(omp_get_cancellation_, omp_get_proc_bind_, omp_set_default_device_,
      	omp_set_default_device_8_, omp_get_default_device_,
      	omp_get_num_devices_, omp_get_num_teams_, omp_get_team_num_): New
      	functions.
      	* libgomp.map (GOMP_barrier_cancel, GOMP_loop_end_cancel,
      	GOMP_sections_end_cancel, GOMP_target, GOMP_target_data,
      	GOMP_target_end_data, GOMP_target_update, GOMP_teams): Export
      	@@GOMP_4.0.
      	(omp_is_initial_device, omp_is_initial_device_, omp_get_cancellation,
      	omp_get_cancellation_, omp_get_proc_bind, omp_get_proc_bind_,
      	omp_set_default_device, omp_set_default_device_,
      	omp_set_default_device_8_, omp_get_default_device,
      	omp_get_default_device_, omp_get_num_devices, omp_get_num_devices_,
      	omp_get_num_teams, omp_get_num_teams_, omp_get_team_num,
      	omp_get_team_num_): Export @@OMP_4.0.
      	* team.c (struct gomp_thread_start_data): Add place field.
      	(gomp_thread_start): Clear thr->thread_pool and
      	thr->task before returning.  Use gomp_team_barrier_wait_final
      	instead of gomp_team_barrier_wait.  Initialize thr->place.
      	(gomp_new_team): Initialize work_shares_to_free, work_share_cancelled,
      	team_cancelled and task_queued_count fields.
      	(gomp_free_pool_helper): Clear thr->thread_pool and thr->task
      	before calling pthread_exit.
      	(gomp_free_thread): No longer static.  Use
      	gomp_managed_threads_lock instead of gomp_remaining_threads_lock.
      	(gomp_team_start): Add flags argument.  Set
      	thr->thread_pool->threads_busy to nthreads immediately after creating
      	new pool.  Use gomp_managed_threads_lock instead of
      	gomp_remaining_threads_lock.  Handle OpenMP 4.0 affinity.
      	(gomp_team_end): Use gomp_managed_threads_lock instead of
      	gomp_remaining_threads_lock.  Use gomp_team_barrier_wait_final instead
      	of gomp_team_barrier_wait.  If team->team_cancelled, call
      	gomp_fini_worshare on ws chain starting at team->work_shares_to_free
      	rather than thr->ts.work_share.
      	(initialize_team): Don't call gomp_sem_init here.
      	* sections.c (GOMP_parallel_sections_start): Adjust gomp_team_start
      	caller.
      	(GOMP_parallel_sections, GOMP_sections_end_cancel): New functions.
      	* env.c (gomp_global_icv): Add default_device_var, target_data and
      	bind_var initializers.
      	(gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
      	(gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
      	gomp_places_list_len): New variables.
      	(parse_bind_var, parse_one_place, parse_places_var): New functions.
      	(parse_affinity): Rewritten to construct OMP_PLACES list with unit
      	sized places.
      	(gomp_cancel_var): New global variable.
      	(parse_int): New function.
      	(handle_omp_display_env): New function.
      	(initialize_env): Use it.  Initialize default_device_var.
      	Parse OMP_CANCELLATION env var.  Use parse_bind_var to parse
      	OMP_PROC_BIND instead of parse_boolean.  Use parse_places_var for
      	OMP_PLACES parsing.  Don't call parse_affinity if OMP_PLACES has
      	been successfully parsed (and call gomp_init_affinity in that case).
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New functions.
      	* libgomp.h: Include stdlib.h.
      	(ialias_ulp, ialias_str1, ialias_str2, ialias_redirect, ialias_call):
      	Define.
      	(struct target_mem_desc): Forward declare.
      	(struct gomp_task_icv): Add default_device_var, target_data, bind_var
      	and thread_limit_var fields.
      	(gomp_get_num_devices): New prototype.
      	(gomp_cancel_var): New extern decl.
      	(struct gomp_team): Add work_shares_to_free, work_share_cancelled,
      	team_cancelled and task_queued_count fields.  Add comments about
      	task_{,queued_,running_}count.
      	(gomp_cancel_kind): New enum.
      	(gomp_work_share_end_cancel): New prototype.
      	(struct gomp_task): Add next_taskgroup, prev_taskgroup, taskgroup,
      	copy_ctors_done, dependers, depend_hash, depend_count, num_dependees
      	and depend fields.
      	(struct gomp_taskgroup): New type.
      	(struct gomp_task_depend_entry,
      	struct gomp_dependers_vec): New types.
      	(gomp_finish_task): Free depend_hash if non-NULL.
      	(struct gomp_team_state): Add place_partition_off
      	and place_partition_len fields.
      	(gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
      	gomp_places_list_len): New extern decls.
      	(struct gomp_thread): Add place field.
      	(gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
      	(gomp_init_thread_affinity): Add place argument.
      	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
      	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
      	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
      	gomp_affinity_init_level, gomp_affinity_print_place): New
      	prototypes.
      	(gomp_team_start): Add flags argument.
      	(gomp_thread_limit_var, gomp_remaining_threads_count,
      	gomp_remaining_threads_lock): Remove.
      	(gomp_managed_threads_lock): New variable.
      	(struct gomp_thread_pool): Add threads_busy field.
      	(gomp_free_thread): New prototype.
      	* task.c: Include hashtab.h.
      	(hash_entry_type): New typedef.
      	(htab_alloc, htab_free, htab_hash, htab_eq): New inlines.
      	(gomp_init_task): Clear dependers, depend_hash, depend_count,
      	copy_ctors_done and taskgroup fields.
      	(GOMP_task): Add depend argument, handle depend clauses.  If
      	gomp_team_barrier_cancelled or if it's taskgroup has been
      	cancelled, don't queue or start new tasks.  Set copy_ctors_done
      	field if needed.  Initialize taskgroup field.  If copy_ctors_done
      	and already cancelled, don't discard the task.  If taskgroup is
      	non-NULL, enqueue the task into taskgroup queue.  Increment
      	num_children field in taskgroup.  Increment task_queued_count.
      	(gomp_task_run_pre, gomp_task_run_post_remove_parent,
      	gomp_task_run_post_remove_taskgroup): New inline functions.
      	(gomp_task_run_post_handle_depend_hash,
      	gomp_task_run_post_handle_dependers,
      	gomp_task_run_post_handle_depend): New functions.
      	(GOMP_taskwait): Use them.  If more than one new tasks
      	have been queued, wake other threads if needed.
      	(gomp_barrier_handle_tasks): Likewise.  If
      	gomp_team_barrier_cancelled, don't start any new tasks, just free
      	all tasks.
      	(GOMP_taskgroup_start, GOMP_taskgroup_end): New functions.
      	* omp_lib.f90.in
      	(omp_proc_bind_kind, omp_proc_bind_false,
      	omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
      	omp_proc_bind_spread): New params.
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New interfaces.
      	(omp_get_dynamic, omp_get_nested, omp_in_parallel,
      	omp_get_max_threads, omp_get_num_procs, omp_get_num_threads,
      	omp_get_thread_num, 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_in_final): Remove
      	useless use omp_lib_kinds.
      	* omp.h.in (omp_proc_bind_t): New typedef.
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New prototypes.
      	* loop.c (gomp_parallel_loop_start): Add flags argument, pass it
      	through to gomp_team_start.
      	(GOMP_parallel_loop_static_start, GOMP_parallel_loop_dynamic_start,
      	GOMP_parallel_loop_guided_start, GOMP_parallel_loop_runtime_start):
      	Adjust gomp_parallel_loop_start callers.
      	(GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
      	GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
      	GOMP_loop_end_cancel): New functions.
      	(GOMP_parallel_end): Add ialias_redirect.
      	* hashtab.h: New file.
      	* libgomp.texi (Environment Variables): Minor cleanup,
      	update section refs to OpenMP 4.0rc2.
      	(OMP_DISPLAY_ENV, GOMP_SPINCOUNT): Document these
      	environment variables.
      	* work.c (gomp_work_share_end, gomp_work_share_end_nowait): Set
      	team->work_shares_to_free to thr->ts.work_share before calling
      	free_work_share.
      	(gomp_work_share_end_cancel): New function.
      	* config/linux/proc.c: Include errno.h.
      	(gomp_get_cpuset_size, gomp_cpuset_size, gomp_cpusetp): New variables.
      	(gomp_cpuset_popcount): Add cpusetsize argument, use it instead of
      	sizeof (cpu_set_t) to determine number of iterations.  Fix up check
      	extern decl.  Use CPU_COUNT_S if available, or CPU_COUNT if
      	gomp_cpuset_size is sizeof (cpu_set_t).
      	(gomp_init_num_threads): Initialize gomp_cpuset_size,
      	gomp_get_cpuset_size and gomp_cpusetp here, use gomp_cpusetp instead
      	of &cpuset and pass gomp_cpuset_size instead of sizeof (cpu_set_t)
      	to pthread_getaffinity_np.  Free and clear gomp_cpusetp if it didn't
      	contain any logical CPUs.
      	(get_num_procs): Don't call pthread_getaffinity_np if gomp_cpusetp
      	is NULL.  Use gomp_cpusetp instead of &cpuset and pass
      	gomp_get_cpuset_size instead of sizeof (cpu_set_t) to
      	pthread_getaffinity_np.  Check gomp_places_list instead of
      	gomp_cpu_affinity.  Adjust gomp_cpuset_popcount caller.
      	* config/linux/bar.c (gomp_barrier_wait_end,
      	gomp_barrier_wait_last): Use BAR_* defines.
      	(gomp_team_barrier_wait_end): Likewise.  Clear BAR_CANCELLED
      	from state where needed.  Set work_share_cancelled to 0 on last
      	thread.
      	(gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel_end,
      	gomp_team_barrier_wait_cancel, gomp_team_barrier_cancel): New
      	functions.
      	* config/linux/proc.h (gomp_cpuset_popcount): Add attribute_hidden.
      	Add cpusetsize argument.
      	(gomp_cpuset_size, gomp_cpusetp): Declare.
      	* config/linux/affinity.c: Include errno.h, stdio.h and string.h.
      	(affinity_counter): Remove.
      	(CPU_ISSET_S, CPU_ZERO_S, CPU_SET_S, CPU_CLR_S): Define
      	if CPU_ALLOC_SIZE isn't defined.
      	(gomp_init_affinity): Rewritten, if gomp_places_list is NULL, try
      	silently create OMP_PLACES=threads, if it is non-NULL afterwards,
      	bind current thread to the first place.
      	(gomp_init_thread_affinity): Rewritten.  Add place argument, just
      	pthread_setaffinity_np to gomp_places_list[place].
      	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
      	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
      	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
      	gomp_affinity_init_level, gomp_affinity_print_place): New functions.
      	* config/linux/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
      	BAR_WAITING_FOR_TASK, BAR_INCR, BAR_CANCELLED): Define.
      	(gomp_barrier_t): Add awaited_final field.
      	(gomp_barrier_init): Initialize awaited_final field.
      	(gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel,
      	gomp_team_barrier_wait_cancel_end, gomp_team_barrier_cancel): New
      	prototypes.
      	(gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.  Use BAR_*
      	defines.
      	(gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final_start,
      	gomp_team_barrier_cancelled): New inline functions.
      	(gomp_barrier_last_thread,
      	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): Use BAR_* defines.
      	* config/posix/bar.c (gomp_barrier_init): Clear cancellable field.
      	(gomp_barrier_wait_end): Use BAR_* defines.
      	(gomp_team_barrier_wait_end): Clear BAR_CANCELLED from state.
      	Set work_share_cancelled to 0 on last thread, use __atomic_load_n.
      	Use BAR_* defines.
      	(gomp_team_barrier_wait_cancel_end, gomp_team_barrier_wait_cancel,
      	gomp_team_barrier_cancel): New functions.
      	* config/posix/affinity.c (gomp_init_thread_affinity): Add place
      	argument.
      	(gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
      	gomp_affinity_remove_cpu, gomp_affinity_copy_place,
      	gomp_affinity_same_place, gomp_affinity_finalize_place_list,
      	gomp_affinity_init_level, gomp_affinity_print_place): New stubs.
      	* config/posix/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
      	BAR_WAITING_FOR_TASK, BAR_INCR, BAR_CANCELLED): Define.
      	(gomp_barrier_t): Add cancellable field.
      	(gomp_team_barrier_wait_cancel, gomp_team_barrier_wait_cancel_end,
      	gomp_team_barrier_cancel): New prototypes.
      	(gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.
      	(gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final,
      	gomp_team_barrier_cancelled): New inline functions.
      	(gomp_barrier_wait_start, gomp_barrier_last_thread,
      	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): Use BAR_* defines.
      	* barrier.c (GOMP_barrier_cancel): New function.
      	* omp_lib.h.in (omp_proc_bind_kind, omp_proc_bind_false,
      	omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
      	omp_proc_bind_spread): New params.
      	(omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
      	omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
      	omp_get_team_num, omp_is_initial_device): New externals.
      	* parallel.c (GOMP_parallel, GOMP_cancel, GOMP_cancellation_point):
      	New functions.
      	(gomp_resolve_num_threads): Adjust for thread_limit now being in
      	icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
      	infinity.  If not nested, just return minimum of max_num_threads
      	and icv->thread_limit_var and if thr->thread_pool, set threads_busy
      	to the returned value.  Otherwise, don't update atomically
      	gomp_remaining_threads_count, but instead thr->thread_pool->threads_busy.
      	(GOMP_parallel_end): Adjust for thread_limit now being in
      	icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
      	infinity.  Adjust threads_busy in the pool rather than
      	gomp_remaining_threads_count.  Remember team->nthreads and call
      	gomp_team_end before adjusting threads_busy, if not nested
      	afterwards, just set it to 1 non-atomically.  Add ialias.
      	(GOMP_parallel_start): Adjust gomp_team_start caller.
      	* testsuite/libgomp.c/atomic-14.c: Add parens to make it valid.
      	* testsuite/libgomp.c/affinity-1.c: New test.
      	* testsuite/libgomp.c/atomic-15.c: New test.
      	* testsuite/libgomp.c/atomic-16.c: New test.
      	* testsuite/libgomp.c/atomic-17.c: New test.
      	* testsuite/libgomp.c/cancel-for-1.c: New test.
      	* testsuite/libgomp.c/cancel-for-2.c: New test.
      	* testsuite/libgomp.c/cancel-parallel-1.c: New test.
      	* testsuite/libgomp.c/cancel-parallel-2.c: New test.
      	* testsuite/libgomp.c/cancel-parallel-3.c: New test.
      	* testsuite/libgomp.c/cancel-sections-1.c: New test.
      	* testsuite/libgomp.c/cancel-taskgroup-1.c: New test.
      	* testsuite/libgomp.c/cancel-taskgroup-2.c: New test.
      	* testsuite/libgomp.c/depend-1.c: New test.
      	* testsuite/libgomp.c/depend-2.c: New test.
      	* testsuite/libgomp.c/depend-3.c: New test.
      	* testsuite/libgomp.c/depend-4.c: New test.
      	* testsuite/libgomp.c/for-1.c: New test.
      	* testsuite/libgomp.c/for-1.h: New file.
      	* testsuite/libgomp.c/for-2.c: New test.
      	* testsuite/libgomp.c/for-2.h: New file.
      	* testsuite/libgomp.c/for-3.c: New test.
      	* testsuite/libgomp.c/pr58392.c: New test.
      	* testsuite/libgomp.c/simd-1.c: New test.
      	* testsuite/libgomp.c/simd-2.c: New test.
      	* testsuite/libgomp.c/simd-3.c: New test.
      	* testsuite/libgomp.c/simd-4.c: New test.
      	* testsuite/libgomp.c/simd-5.c: New test.
      	* testsuite/libgomp.c/simd-6.c: New test.
      	* testsuite/libgomp.c/target-1.c: New test.
      	* testsuite/libgomp.c/target-2.c: New test.
      	* testsuite/libgomp.c/target-3.c: New test.
      	* testsuite/libgomp.c/target-4.c: New test.
      	* testsuite/libgomp.c/target-5.c: New test.
      	* testsuite/libgomp.c/target-6.c: New test.
      	* testsuite/libgomp.c/target-7.c: New test.
      	* testsuite/libgomp.c/taskgroup-1.c: New test.
      	* testsuite/libgomp.c/thread-limit-1.c: New test.
      	* testsuite/libgomp.c/thread-limit-2.c: New test.
      	* testsuite/libgomp.c/thread-limit-3.c: New test.
      	* testsuite/libgomp.c/udr-1.c: New test.
      	* testsuite/libgomp.c/udr-2.c: New test.
      	* testsuite/libgomp.c/udr-3.c: New test.
      	* testsuite/libgomp.c++/affinity-1.C: New test.
      	* testsuite/libgomp.c++/atomic-10.C: New test.
      	* testsuite/libgomp.c++/atomic-11.C: New test.
      	* testsuite/libgomp.c++/atomic-12.C: New test.
      	* testsuite/libgomp.c++/atomic-13.C: New test.
      	* testsuite/libgomp.c++/atomic-14.C: New test.
      	* testsuite/libgomp.c++/atomic-15.C: New test.
      	* testsuite/libgomp.c++/cancel-for-1.C: New test.
      	* testsuite/libgomp.c++/cancel-for-2.C: New test.
      	* testsuite/libgomp.c++/cancel-parallel-1.C: New test.
      	* testsuite/libgomp.c++/cancel-parallel-2.C: New test.
      	* testsuite/libgomp.c++/cancel-parallel-3.C: New test.
      	* testsuite/libgomp.c++/cancel-sections-1.C: New test.
      	* testsuite/libgomp.c++/cancel-taskgroup-1.C: New test.
      	* testsuite/libgomp.c++/cancel-taskgroup-2.C: New test.
      	* testsuite/libgomp.c++/cancel-taskgroup-3.C: New test.
      	* testsuite/libgomp.c++/cancel-test.h: New file.
      	* testsuite/libgomp.c++/for-9.C: New test.
      	* testsuite/libgomp.c++/for-10.C: New test.
      	* testsuite/libgomp.c++/for-11.C: New test.
      	* testsuite/libgomp.c++/simd-1.C: New test.
      	* testsuite/libgomp.c++/simd-2.C: New test.
      	* testsuite/libgomp.c++/simd-3.C: New test.
      	* testsuite/libgomp.c++/simd-4.C: New test.
      	* testsuite/libgomp.c++/simd-5.C: New test.
      	* testsuite/libgomp.c++/simd-6.C: New test.
      	* testsuite/libgomp.c++/simd-7.C: New test.
      	* testsuite/libgomp.c++/simd-8.C: New test.
      	* testsuite/libgomp.c++/target-1.C: New test.
      	* testsuite/libgomp.c++/target-2.C: New test.
      	* testsuite/libgomp.c++/target-2-aux.cc: New file.
      	* testsuite/libgomp.c++/target-3.C: New test.
      	* testsuite/libgomp.c++/taskgroup-1.C: New test.
      	* testsuite/libgomp.c++/udr-1.C: New test.
      	* testsuite/libgomp.c++/udr-2.C: New test.
      	* testsuite/libgomp.c++/udr-3.C: New test.
      	* testsuite/libgomp.c++/udr-4.C: New test.
      	* testsuite/libgomp.c++/udr-5.C: New test.
      	* testsuite/libgomp.c++/udr-6.C: New test.
      	* testsuite/libgomp.c++/udr-7.C: New test.
      	* testsuite/libgomp.c++/udr-8.C: New test.
      	* testsuite/libgomp.c++/udr-9.C: New test.
      gcc/
      	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE__LOOPTEMP_
      	and new OpenMP 4.0 clauses, handle UDR OMP_CLAUSE_REDUCTION,
      	formatting fixes, use pp_colon instead of pp_character (..., ':'),
      	similarly pp_right_paren.
      	(dump_generic_node): Handle OMP_DISTRIBUTE, OMP_TEAMS,
      	OMP_TARGET_DATA, OMP_TARGET, OMP_TARGET_UPDATE, OMP_TASKGROUP,
      	allow OMP_FOR_INIT to be NULL, handle OMP_ATOMIC_SEQ_CST.
      	* tree.c (omp_clause_num_ops, omp_clause_code_name): Add OpenMP 4.0
      	clauses.
      	(omp_declare_simd_clauses_equal,
      	omp_remove_redundant_declare_simd_attrs): New functions.
      	(attribute_value_equal): Use omp_declare_simd_clauses_equal.
      	(walk_tree_1): Handle new OpenMP 4.0 clauses.
      	* tree.h (OMP_LOOP_CHECK): Define.
      	(OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND,
      	OMP_FOR_INCR, OMP_FOR_PRE_BODY): Use it.
      	(OMP_TASKGROUP_BODY, OMP_TEAMS_BODY, OMP_TEAMS_CLAUSES,
      	OMP_TARGET_DATA_BODY, OMP_TARGET_DATA_CLAUSES, OMP_TARGET_BODY,
      	OMP_TARGET_CLAUSES, OMP_TARGET_UPDATE_CLAUSES, OMP_CLAUSE_SIZE,
      	OMP_ATOMIC_SEQ_CST, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_MAP_KIND,
      	OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION, OMP_CLAUSE_PROC_BIND_KIND,
      	OMP_CLAUSE_REDUCTION_OMP_ORIG_REF, OMP_CLAUSE_ALIGNED_ALIGNMENT,
      	OMP_CLAUSE_NUM_TEAMS_EXPR, OMP_CLAUSE_THREAD_LIMIT_EXPR,
      	OMP_CLAUSE_DEVICE_ID, OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR,
      	OMP_CLAUSE_SIMDLEN_EXPR): Define.
      	(OMP_CLAUSE_DECL): Change range up to OMP_CLAUSE__LOOPTEMP_.
      	(omp_remove_redundant_declare_simd_attrs): New prototype.
      	* gimple.def (GIMPLE_OMP_TASKGROUP, GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS): New codes.
      	(GIMPLE_OMP_RETURN): Use GSS_OMP_ATOMIC_STORE instead of GSS_BASE.
      	* omp-low.c (struct omp_context): Add cancel_label and cancellable
      	fields.
      	(target_nesting_level): New variable.
      	(extract_omp_for_data): Handle GF_OMP_FOR_KIND_DISTRIBUTE and
      	OMP_CLAUSE_DIST_SCHEDULE.  Don't fallback to library implementation
      	for collapse > 1 static schedule unless ordered.
      	(get_ws_args_for): Add par_stmt argument.  Handle combined loops.
      	(determine_parallel_type): Adjust get_ws_args_for caller.
      	(install_var_field): Handle mask & 4 for double indirection.
      	(scan_sharing_clauses): Ignore shared clause on teams construct.
      	Handle OMP_CLAUSE__LOOPTEMP_ and new OpenMP 4.0 clauses.
      	(create_omp_child_function): If inside target or declare target
      	constructs, set "omp declare target" attribute on the child
      	function.
      	(find_combined_for): New function.
      	(scan_omp_parallel): Handle combined loops.
      	(scan_omp_target, scan_omp_teams): New functions.
      	(check_omp_nesting_restrictions): Check new OpenMP 4.0 nesting
      	restrictions and set ctx->cancellable for cancellable constructs.
      	(scan_omp_1_stmt): Call check_omp_nesting_restrictions also on
      	selected builtin calls.  Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS.
      	(build_omp_barrier): Add lhs argument, return gimple rather than
      	tree.
      	(omp_clause_aligned_alignment): New function.
      	(lower_rec_simd_input_clauses): Only call SET_DECL_VALUE_EXPR
      	on decls.
      	(lower_rec_input_clauses): Add FD argument.  Ignore shared clauses
      	on teams constructs.  Handle user defined reductions and new
      	OpenMP 4.0 clauses.
      	(lower_reduction_clauses): Don't set placeholder to address of ref
      	if it has already the right type.
      	(lower_send_clauses): Handle OMP_CLAUSE__LOOPTEMP_.
      	(expand_parallel_call): Use the new non-_start suffixed builtins,
      	handle OMP_CLAUSE_PROC_BIND, don't call the outlined function
      	and GOMP_parallel_end after the call.
      	(expand_task_call): Handle OMP_CLAUSE_DEPEND.
      	(expand_omp_for_init_counts): Handle combined loops.
      	(expand_omp_for_init_vars): Add inner_stmt argument, handle combined
      	loops.
      	(expand_omp_for_generic): Likewise.  Use GOMP_loop_end_cancel at the
      	end of cancellable loops.
      	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
      	Likewise.  Handle collapse > 1 loops.
      	(expand_omp_simd): Handle combined loops.
      	(expand_omp_for): Add inner_stmt argument, adjust callers of
      	expand_omp_for* functions, use expand_omp_for_static*chunk even
      	for collapse > 1 unless ordered.
      	(expand_omp_sections): Use GOMP_sections_end_cancel at the end
      	of cancellable sections.
      	(expand_omp_single): Remove need_barrier variable, just rely on
      	gimple_omp_return_nowait_p.  Adjust build_omp_barrier caller.
      	(expand_omp_synch): Allow GIMPLE_OMP_TASKGROUP and GIMPLE_OMP_TEAMS.
      	(expand_omp_atomic_load, expand_omp_atomic_store,
      	expand_omp_atomic_fetch_op): Handle gimple_omp_atomic_seq_cst_p.
      	(expand_omp_target): New function.
      	(expand_omp): Handle combined loops.  Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TEAMS, GIMPLE_OMP_TARGET.
      	(build_omp_regions_1): Immediately close region for
      	GF_OMP_TARGET_KIND_UPDATE.
      	(maybe_add_implicit_barrier_cancel): New function.
      	(lower_omp_sections): Adjust lower_rec_input_clauses caller.  Handle
      	cancellation.
      	(lower_omp_single): Likewise.  Add clobber after the barrier.
      	(lower_omp_taskgroup): New function.
      	(lower_omp_for): Handle combined loops.  Adjust
      	lower_rec_input_clauses caller.  Handle cancellation.
      	(lower_depend_clauses): New function.
      	(lower_omp_taskreg): Lower depend clauses.  Adjust
      	lower_rec_input_clauses caller.  Add clobber after the call.  Handle
      	cancellation.
      	(lower_omp_target, lower_omp_teams): New functions.
      	(lower_omp_1): Handle cancellation.  Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GOMP_barrier, GOMP_cancel
      	and GOMP_cancellation_point calls.
      	(lower_omp): Fold stmts inside of target region.
      	(diagnose_sb_1, diagnose_sb_2): Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
      	* builtin-types.def (DEF_FUNCTION_TYPE_8): Document.
      	(BT_FN_VOID_OMPFN_PTR_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
      	(BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
      	BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL, BT_FN_VOID_UINT_UINT,
      	BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
      	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
      	call_may_clobber_ref_p_1): Handle BUILT_IN_GOMP_BARRIER_CANCEL,
      	BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_LOOP_END_CANCEL,
      	BUILT_IN_GOMP_SECTIONS_END_CANCEL.  Don't handle
      	BUILT_IN_GOMP_PARALLEL_END.
      	* gimple-low.c (lower_stmt): Handle GIMPLE_OMP_TASKGROUP,
      	GIMPLE_OMP_TARGET and GIMPLE_OMP_TEAMS.
      	* gimple-pretty-print.c (dump_gimple_omp_for): Handle
      	GF_OMP_FOR_KIND_DISTRIBUTE.
      	(dump_gimple_omp_target, dump_gimple_omp_teams): New functions.
      	(dump_gimple_omp_block): Handle GIMPLE_OMP_TASKGROUP.
      	(dump_gimple_omp_return): Print lhs if it has any.
      	(dump_gimple_omp_atomic_load, dump_gimple_omp_atomic_store): Handle
      	gimple_omp_atomic_seq_cst_p.
      	(pp_gimple_stmt_1): Handle GIMPLE_OMP_TASKGROUP, GIMPLE_OMP_TARGET
      	and GIMPLE_OMP_TEAMS.
      	* langhooks.c (lhd_omp_mappable_type): New function.
      	* tree-vectorizer.c (struct simd_array_to_simduid): Fix up comment.
      	* langhooks.h (struct lang_hooks_for_types): Add omp_mappable_type
      	hook.
      	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP,
      	GOVD_ALIGNED and GOVD_MAP_TO_ONLY.
      	(enum omp_region_type): Add ORT_TEAMS, ORT_TARGET_DATA and
      	ORT_TARGET.
      	(struct gimplify_omp_ctx): Add combined_loop field.
      	(gimplify_call_expr, gimplify_modify_expr): Don't call fold_stmt
      	on stmts inside of target region.
      	(is_gimple_stmt): Return true for OMP_DISTRIBUTE and OMP_TASKGROUP.
      	(omp_firstprivatize_variable): Handle GOVD_MAP, GOVD_ALIGNED,
      	ORT_TARGET and ORT_TARGET_DATA.
      	(omp_add_variable): Avoid checks on readding var for GOVD_ALIGNED.
      	Handle GOVD_MAP.
      	(omp_notice_threadprivate_variable): Complain about threadprivate
      	variables in target region.
      	(omp_notice_variable): Complain about vars with non-mappable type
      	in target region.  Handle ORT_TEAMS, ORT_TARGET and ORT_TARGET_DATA.
      	(omp_check_private): Ignore ORT_TARGET* regions.
      	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1,
      	gimplify_adjust_omp_clauses): Handle new OpenMP 4.0 clauses.
      	(find_combined_omp_for): New function.
      	(gimplify_omp_for): Handle gimplification of combined loops.
      	(gimplify_omp_workshare): Gimplify also OMP_TARGET, OMP_TARGET_DATA,
      	OMP_TEAMS.
      	(gimplify_omp_target_update): New function.
      	(gimplify_omp_atomic): Handle OMP_ATOMIC_SEQ_CST.
      	(gimplify_expr): Handle OMP_DISTRIBUTE, OMP_TARGET, OMP_TARGET_DATA,
      	OMP_TARGET_UPDATE, OMP_TEAMS, OMP_TASKGROUP.
      	(gimplify_body): If fndecl has "omp declare target" attribute, add
      	implicit ORT_TARGET context around it.
      	* tree.def (OMP_DISTRIBUTE, OMP_TEAMS, OMP_TARGET_DATA, OMP_TARGET,
      	OMP_TASKGROUP, OMP_TARGET_UPDATE): New tree codes.
      	* tree-nested.c (convert_nonlocal_reference_stmt,
      	convert_local_reference_stmt, convert_gimple_call): Handle
      	GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* omp-builtins.def (BUILT_IN_GOMP_TASK): Use
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
      	instead of BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT.
      	(BUILT_IN_GOMP_TARGET, BUILT_IN_GOMP_TARGET_DATA,
      	BUILT_IN_GOMP_TARGET_END_DATA, BUILT_IN_GOMP_TARGET_UPDATE,
      	BUILT_IN_GOMP_TEAMS, BUILT_IN_BARRIER_CANCEL,
      	BUILT_IN_GOMP_LOOP_END_CANCEL,
      	BUILT_IN_GOMP_SECTIONS_END_CANCEL, BUILT_IN_OMP_GET_TEAM_NUM,
      	BUILT_IN_OMP_GET_NUM_TEAMS, BUILT_IN_GOMP_TASKGROUP_START,
      	BUILT_IN_GOMP_TASKGROUP_END, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
      	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
      	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
      	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME, BUILT_IN_GOMP_PARALLEL,
      	BUILT_IN_GOMP_PARALLEL_SECTIONS, BUILT_IN_GOMP_CANCEL,
      	BUILT_IN_GOMP_CANCELLATION_POINT): New built-ins.
      	(BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
      	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
      	BUILT_IN_GOMP_PARALLEL_SECTIONS_START): Remove.
      	* tree-inline.c (remap_gimple_stmt, estimate_num_insns):
      	Handle GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* gimple.c (gimple_build_omp_taskgroup, gimple_build_omp_target,
      	gimple_build_omp_teams): New functions.
      	(walk_gimple_op): Handle GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS and
      	GIMPLE_OMP_TASKGROUP.  Walk optional lhs on GIMPLE_OMP_RETURN.
      	(walk_gimple_stmt, gimple_copy): Handle GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* gimple.h (enum gf_mask): GF_OMP_FOR_KIND_DISTRIBUTE,
      	GF_OMP_FOR_COMBINED, GF_OMP_FOR_COMBINED_INTO,
      	GF_OMP_TARGET_KIND_MASK, GF_OMP_TARGET_KIND_REGION,
      	GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_UPDATE,
      	GF_OMP_ATOMIC_SEQ_CST): New.
      	(gimple_build_omp_taskgroup, gimple_build_omp_target,
      	gimple_build_omp_teams): New prototypes.
      	(gimple_has_substatements): Handle GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	(gimple_omp_subcode): Use GIMPLE_OMP_TEAMS instead of
      	GIMPLE_OMP_SINGLE as end of range.
      	(gimple_omp_return_set_lhs, gimple_omp_return_lhs,
      	gimple_omp_return_lhs_ptr, gimple_omp_atomic_seq_cst_p,
      	gimple_omp_atomic_set_seq_cst, gimple_omp_for_combined_p,
      	gimple_omp_for_set_combined_p, gimple_omp_for_combined_into_p,
      	gimple_omp_for_set_combined_into_p, gimple_omp_target_clauses,
      	gimple_omp_target_clauses_ptr, gimple_omp_target_set_clauses,
      	gimple_omp_target_kind, gimple_omp_target_set_kind,
      	gimple_omp_target_child_fn, gimple_omp_target_child_fn_ptr,
      	gimple_omp_target_set_child_fn, gimple_omp_target_data_arg,
      	gimple_omp_target_data_arg_ptr, gimple_omp_target_set_data_arg,
      	gimple_omp_teams_clauses, gimple_omp_teams_clauses_ptr,
      	gimple_omp_teams_set_clauses): New inlines.
      	(CASE_GIMPLE_OMP): Add GIMPLE_OMP_TARGET, GIMPLE_OMP_TEAMS
      	and GIMPLE_OMP_TASKGROUP.
      	* tree-core.h (enum omp_clause_code): Add new OpenMP 4.0 clause
      	codes.
      	(enum omp_clause_depend_kind, enum omp_clause_map_kind,
      	enum omp_clause_proc_bind_kind): New.
      	(union omp_clause_subcode): Add depend_kind, map_kind and
      	proc_bind_kind fields.
      	* tree-cfg.c (make_edges): Handle GIMPLE_OMP_TARGET,
      	GIMPLE_OMP_TEAMS and GIMPLE_OMP_TASKGROUP.
      	* langhooks-def.h (lhd_omp_mappable_type): New prototype.
      	(LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
      	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.
      gcc/c-family/
      	* c-cppbuiltin.c (c_cpp_builtins): Predefine _OPENMP to
      	201307 instead of 201107.
      	* c-common.c (DEF_FUNCTION_TYPE_8): Define.
      	(c_common_attribute_table): Add "omp declare target" and
      	"omp declare simd" attributes.
      	(handle_omp_declare_target_attribute,
      	handle_omp_declare_simd_attribute): New functions.
      	* c-omp.c: Include c-pragma.h.
      	(c_finish_omp_taskgroup): New function.
      	(c_finish_omp_atomic): Add swapped argument, if true,
      	build the operation first with rhs, lhs arguments and use NOP_EXPR
      	build_modify_expr.
      	(c_finish_omp_for): Add code argument, pass it down to make_code.
      	(c_omp_split_clauses): New function.
      	(c_split_parallel_clauses): Removed.
      	(c_omp_declare_simd_clause_cmp, c_omp_declare_simd_clauses_to_numbers,
      	c_omp_declare_simd_clauses_to_decls): New functions.
      	* c-common.h (omp_clause_mask): New type.
      	(OMP_CLAUSE_MASK_1): Define.
      	(omp_clause_mask::omp_clause_mask, omp_clause_mask::operator &=,
      	omp_clause_mask::operator |=, omp_clause_mask::operator ~,
      	omp_clause_mask::operator |, omp_clause_mask::operator &,
      	omp_clause_mask::operator <<, omp_clause_mask::operator >>,
      	omp_clause_mask::operator ==): New methods.
      	(enum c_omp_clause_split): New.
      	(c_finish_omp_taskgroup): New prototype.
      	(c_finish_omp_atomic): Add swapped argument.
      	(c_finish_omp_for): Add code argument.
      	(c_omp_split_clauses): New prototype.
      	(c_split_parallel_clauses): Removed.
      	(c_omp_declare_simd_clauses_to_numbers,
      	c_omp_declare_simd_clauses_to_decls): New prototypes.
      	* c-pragma.c (omp_pragmas): Add new OpenMP 4.0 constructs.
      	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_CANCEL,
      	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_SIMD,
      	PRAGMA_OMP_TARGET, PRAGMA_OMP_TASKGROUP and PRAGMA_OMP_TEAMS.
      	Remove PRAGMA_OMP_PARALLEL_FOR and PRAGMA_OMP_PARALLEL_SECTIONS.
      	(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_ALIGNED,
      	PRAGMA_OMP_CLAUSE_DEPEND, PRAGMA_OMP_CLAUSE_DEVICE,
      	PRAGMA_OMP_CLAUSE_DIST_SCHEDULE, PRAGMA_OMP_CLAUSE_FOR,
      	PRAGMA_OMP_CLAUSE_FROM, PRAGMA_OMP_CLAUSE_INBRANCH,
      	PRAGMA_OMP_CLAUSE_LINEAR, PRAGMA_OMP_CLAUSE_MAP,
      	PRAGMA_OMP_CLAUSE_NOTINBRANCH, PRAGMA_OMP_CLAUSE_NUM_TEAMS,
      	PRAGMA_OMP_CLAUSE_PARALLEL, PRAGMA_OMP_CLAUSE_PROC_BIND,
      	PRAGMA_OMP_CLAUSE_SAFELEN, PRAGMA_OMP_CLAUSE_SECTIONS,
      	PRAGMA_OMP_CLAUSE_SIMDLEN, PRAGMA_OMP_CLAUSE_TASKGROUP,
      	PRAGMA_OMP_CLAUSE_THREAD_LIMIT, PRAGMA_OMP_CLAUSE_TO and
      	PRAGMA_OMP_CLAUSE_UNIFORM.
      gcc/ada/
      	* gcc-interface/utils.c (DEF_FUNCTION_TYPE_8): Define.
      gcc/fortran/
      	* trans-openmp.c (gfc_omp_clause_default_ctor,
      	gfc_omp_clause_dtor): Return NULL for OMP_CLAUSE_REDUCTION.
      	* f95-lang.c (ATTR_NULL, DEF_FUNCTION_TYPE_8): Define.
      	* types.def (DEF_FUNCTION_TYPE_8): Document.
      	(BT_FN_VOID_OMPFN_PTR_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT): Remove.
      	(BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
      	BT_FN_BOOL_INT, BT_FN_BOOL_INT_BOOL, BT_FN_VOID_UINT_UINT,
      	BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
      	BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR): New.
      gcc/lto/
      	* lto-lang.c (DEF_FUNCTION_TYPE_8): Define.
      gcc/c/
      	* c-lang.h (current_omp_declare_target_attribute): New extern
      	decl.
      	* c-parser.c: Include c-lang.h.
      	(struct c_parser): Change tokens to c_token *.
      	Add tokens_buf field.  Change tokens_avail type to unsigned int.
      	(c_parser_consume_token): If parser->tokens isn't
      	&parser->tokens_buf[0], increment parser->tokens.
      	(c_parser_consume_pragma): Likewise.
      	(enum pragma_context): Add pragma_struct and pragma_param.
      	(c_parser_external_declaration): Adjust
      	c_parser_declaration_or_fndef caller.
      	(c_parser_declaration_or_fndef): Add omp_declare_simd_clauses
      	argument, if it is non-vNULL vector, call c_finish_omp_declare_simd.
      	Adjust recursive call.
      	(c_parser_struct_or_union_specifier): Use pragma_struct instead
      	of pragma_external.
      	(c_parser_parameter_declaration): Use pragma_param instead of
      	pragma_external.
      	(c_parser_compound_statement_nostart, c_parser_label,
      	c_parser_for_statement): Adjust
      	c_parser_declaration_or_fndef callers.
      	(c_parser_expr_no_commas): Add omp_atomic_lhs argument, pass
      	it through to c_parser_conditional_expression.
      	(c_parser_conditional_expression): Add omp_atomic_lhs argument,
      	pass it through to c_parser_binary_expression.  Adjust recursive
      	call.
      	(c_parser_binary_expression): Remove prec argument, add
      	omp_atomic_lhs argument instead.  Always start from PREC_NONE, if
      	omp_atomic_lhs is non-NULL and one of the arguments of toplevel
      	binop matches it, use build2 instead of parser_build_binary_op.
      	(c_parser_pragma): Handle PRAGMA_OMP_CANCEL,
      	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_TARGET,
      	PRAGMA_OMP_END_DECLARE_TARGET, PRAGMA_OMP_DECLARE_REDUCTION.
      	Handle pragma_struct and pragma_param the same as pragma_external.
      	(c_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
      	(c_parser_omp_variable_list): Parse array sections for
      	OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.
      	(c_parser_omp_clause_collapse): Fully fold collapse expression.
      	(c_parser_omp_clause_reduction): Handle user defined reductions.
      	(c_parser_omp_clause_branch, c_parser_omp_clause_cancelkind,
      	c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit,
      	c_parser_omp_clause_aligned, c_parser_omp_clause_linear,
      	c_parser_omp_clause_safelen, c_parser_omp_clause_simdlen,
      	c_parser_omp_clause_depend, c_parser_omp_clause_map,
      	c_parser_omp_clause_device, c_parser_omp_clause_dist_schedule,
      	c_parser_omp_clause_proc_bind, c_parser_omp_clause_to,
      	c_parser_omp_clause_from, c_parser_omp_clause_uniform): New functions.
      	(c_parser_omp_all_clauses): Add finish_p argument.  Don't call
      	c_finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
      	(c_parser_omp_atomic): Parse seq_cst clause, pass true if it is
      	present to c_finish_omp_atomic.  Handle OpenMP 4.0 atomic forms.
      	(c_parser_omp_for_loop): Add CODE argument, pass it through
      	to c_finish_omp_for.  Change last argument to cclauses,
      	and adjust uses to grab parallel clauses from the array of all
      	the split clauses.  Adjust c_parser_binary_expression,
      	c_parser_declaration_or_fndef and c_finish_omp_for callers.
      	(omp_split_clauses): New function.
      	(c_parser_omp_simd): New function.
      	(c_parser_omp_for): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs,
      	and call c_parser_omp_simd when parsing for simd.
      	(c_parser_omp_sections_scope): If section-sequence doesn't start with
      	#pragma omp section, require exactly one structured-block instead of
      	sequence of statements.
      	(c_parser_omp_sections): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs.
      	(c_parser_omp_parallel): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined
      	constructs.
      	(c_parser_omp_taskgroup, c_parser_omp_cancel,
      	c_parser_omp_cancellation_point, c_parser_omp_distribute,
      	c_parser_omp_teams, c_parser_omp_target_data,
      	c_parser_omp_target_update, c_parser_omp_target,
      	c_parser_omp_declare_simd, c_finish_omp_declare_simd,
      	c_parser_omp_declare_target, c_parser_omp_end_declare_target,
      	c_parser_omp_declare_reduction, c_parser_omp_declare): New functions.
      	(c_parser_omp_construct): Add p_name and mask vars.  Handle
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
      	PRAGMA_OMP_TEAMS.  Adjust c_parser_omp_for, c_parser_omp_parallel
      	and c_parser_omp_sections callers.
      	(c_parse_file): Initialize tparser.tokens and the_parser->tokens here.
      	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
      	OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
      	(OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
      	(OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
      	OMP_CLAUSE_DEPEND.
      	(OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
      	OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
      	OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
      	OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
      	OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
      	* c-typeck.c: Include tree-inline.h.
      	(c_finish_omp_cancel, c_finish_omp_cancellation_point,
      	handle_omp_array_sections_1, handle_omp_array_sections,
      	c_clone_omp_udr, c_find_omp_placeholder_r): New functions.
      	(c_finish_omp_clauses): Handle new OpenMP 4.0 clauses and
      	user defined reductions.
      	(c_tree_equal): New function.
      	* c-tree.h (temp_store_parm_decls, temp_pop_parm_decls,
      	c_finish_omp_cancel, c_finish_omp_cancellation_point, c_tree_equal,
      	c_omp_reduction_id, c_omp_reduction_decl, c_omp_reduction_lookup,
      	c_check_omp_declare_reduction_r): New prototypes.
      	* c-decl.c (current_omp_declare_target_attribute): New variable.
      	(c_decl_attributes): New function.
      	(start_decl, start_function): Use it instead of decl_attributes.
      	(temp_store_parm_decls, temp_pop_parm_decls, c_omp_reduction_id,
      	c_omp_reduction_decl, c_omp_reduction_lookup,
      	c_check_omp_declare_reduction_r): New functions.
      gcc/cp/
      	* decl.c (duplicate_decls): Error out for redeclaration of UDRs.
      	(declare_simd_adjust_this): New function.
      	(grokfndecl): If "omp declare simd" attribute is present,
      	call declare_simd_adjust_this if needed and
      	c_omp_declare_simd_clauses_to_numbers.
      	* cp-array-notation.c (expand_array_notation_exprs): Handle
      	OMP_TASKGROUP.
      	* cp-gimplify.c (cp_gimplify_expr): Handle OMP_SIMD and
      	OMP_DISTRIBUTE.  Handle is_invisiref_parm decls in
      	OMP_CLAUSE_REDUCTION.
      	(cp_genericize_r): Handle OMP_SIMD and OMP_DISTRIBUTE like
      	OMP_FOR.
      	(cxx_omp_privatize_by_reference): Return true for
      	is_invisiref_parm decls.
      	(cxx_omp_finish_clause): Adjust cxx_omp_create_clause_info
      	caller.
      	* pt.c (apply_late_template_attributes): For "omp declare simd"
      	attribute call tsubst_omp_clauses,
      	c_omp_declare_simd_clauses_to_decls, finish_omp_clauses
      	and c_omp_declare_simd_clauses_to_numbers.
      	(instantiate_class_template_1): Call cp_check_omp_declare_reduction
      	for UDRs.
      	(tsubst_decl): Handle UDRs.
      	(tsubst_omp_clauses): Add declare_simd argument, if true don't
      	call finish_omp_clauses.  Handle new OpenMP 4.0 clauses.
      	Handle non-NULL OMP_CLAUSE_REDUCTION_PLACEHOLDER on
      	OMP_CLAUSE_REDUCTION.
      	(tsubst_expr): For UDRs call pushdecl and
      	cp_check_omp_declare_reduction.  Adjust tsubst_omp_clauses
      	callers.  Handle OMP_SIMD, OMP_DISTRIBUTE, OMP_TEAMS,
      	OMP_TARGET_DATA, OMP_TARGET_UPDATE, OMP_TARGET, OMP_TASKGROUP.
      	Adjust finish_omp_atomic caller.
      	(tsubst_omp_udr): New function.
      	(instantiate_decl): For UDRs at block scope, don't call
      	start_preparsed_function/finish_function.  Call tsubst_omp_udr.
      	* semantics.c (cxx_omp_create_clause_info): Add need_dtor argument,
      	use it instead of need_default_ctor || need_copy_ctor.
      	(struct cp_check_omp_declare_reduction_data): New type.
      	(handle_omp_array_sections_1, handle_omp_array_sections,
      	omp_reduction_id, omp_reduction_lookup,
      	cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction_r,
      	cp_check_omp_declare_reduction, clone_omp_udr,
      	find_omp_placeholder_r, finish_omp_reduction_clause): New functions.
      	(finish_omp_clauses): Handle new OpenMP 4.0 clauses and user defined
      	reductions.
      	(finish_omp_for): Add CODE argument, use it instead of hardcoded
      	OMP_FOR.  Adjust c_finish_omp_for caller.
      	(finish_omp_atomic): Add seq_cst argument, adjust
      	c_finish_omp_atomic callers, handle seq_cst and new OpenMP 4.0
      	atomic variants.
      	(finish_omp_cancel, finish_omp_cancellation_point): New functions.
      	* decl2.c (mark_used): Force immediate instantiation of
      	DECL_OMP_DECLARE_REDUCTION_P decls.
      	(is_late_template_attribute): Return true for "omp declare simd"
      	attribute.
      	(cp_omp_mappable_type): New function.
      	(cplus_decl_attributes): Add implicit "omp declare target" attribute
      	if requested.
      	* parser.c (cp_debug_parser): Print
      	parser->colon_doesnt_start_class_def_p.
      	(cp_ensure_no_omp_declare_simd, cp_finalize_omp_declare_simd): New
      	functions.
      	(enum pragma_context): Add pragma_member and pragma_objc_icode.
      	(cp_parser_binary_expression): Handle no_toplevel_fold_p
      	even for binary operations other than comparison.
      	(cp_parser_linkage_specification): Call
      	cp_ensure_no_omp_declare_simd if needed.
      	(cp_parser_namespace_definition): Likewise.
      	(cp_parser_init_declarator): Call cp_finalize_omp_declare_simd.
      	(cp_parser_direct_declarator): Pass declarator to
      	cp_parser_late_return_type_opt.
      	(cp_parser_late_return_type_opt): Add declarator argument,
      	call cp_parser_late_parsing_omp_declare_simd for declare simd.
      	(cp_parser_class_specifier_1): Call cp_ensure_no_omp_declare_simd.
      	Parse UDRs before all other methods.
      	(cp_parser_member_specification_opt): Use pragma_member instead of
      	pragma_external.
      	(cp_parser_member_declaration): Call cp_finalize_omp_declare_simd.
      	(cp_parser_function_definition_from_specifiers_and_declarator,
      	cp_parser_save_member_function_body): Likewise.
      	(cp_parser_late_parsing_for_member): Handle UDRs specially.
      	(cp_parser_next_token_starts_class_definition_p): Don't allow
      	CPP_COLON if colon_doesnt_start_class_def_p flag is true.
      	(cp_parser_objc_interstitial_code): Use pragma_objc_icode
      	instead of pragma_external.
      	(cp_parser_omp_clause_name): Parse new OpenMP 4.0 clause names.
      	(cp_parser_omp_var_list_no_open): Parse array sections for
      	OMP_CLAUSE_{DEPEND,MAP,TO,FROM} clauses.  Add COLON argument,
      	if non-NULL, allow parsing to end with a colon rather than close
      	paren.
      	(cp_parser_omp_var_list): Adjust cp_parser_omp_var_list_no_open
      	caller.
      	(cp_parser_omp_clause_reduction): Handle user defined reductions.
      	(cp_parser_omp_clause_branch, cp_parser_omp_clause_cancelkind,
      	cp_parser_omp_clause_num_teams, cp_parser_omp_clause_thread_limit,
      	cp_parser_omp_clause_aligned, cp_parser_omp_clause_linear,
      	cp_parser_omp_clause_safelen, cp_parser_omp_clause_simdlen,
      	cp_parser_omp_clause_depend, cp_parser_omp_clause_map,
      	cp_parser_omp_clause_device, cp_parser_omp_clause_dist_schedule,
      	cp_parser_omp_clause_proc_bind, cp_parser_omp_clause_to,
      	cp_parser_omp_clause_from, cp_parser_omp_clause_uniform): New
      	functions.
      	(cp_parser_omp_all_clauses): Add finish_p argument.  Don't call
      	finish_omp_clauses if it is false.  Handle new OpenMP 4.0 clauses.
      	(cp_parser_omp_atomic): Parse seq_cst clause, pass
      	true if it is present to finish_omp_atomic.  Handle new OpenMP 4.0
      	atomic forms.
      	(cp_parser_omp_for_loop): Add CODE argument, pass it through
      	to finish_omp_for.  Change last argument to cclauses,
      	and adjust uses to grab parallel clauses from the array of all
      	the split clauses.
      	(cp_omp_split_clauses): New function.
      	(cp_parser_omp_simd): New function.
      	(cp_parser_omp_for): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs,
      	and call c_parser_omp_simd when parsing for simd.
      	(cp_parser_omp_sections_scope): If section-sequence doesn't start with
      	#pragma omp section, require exactly one structured-block instead of
      	sequence of statements.
      	(cp_parser_omp_sections): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined constructs.
      	(cp_parser_omp_parallel): Add p_name, mask and cclauses arguments.
      	Allow the function to be called also when parsing combined
      	constructs.
      	(cp_parser_omp_taskgroup, cp_parser_omp_cancel,
      	cp_parser_omp_cancellation_point, cp_parser_omp_distribute,
      	cp_parser_omp_teams, cp_parser_omp_target_data,
      	cp_parser_omp_target_update, cp_parser_omp_target,
      	cp_parser_omp_declare_simd, cp_parser_late_parsing_omp_declare_simd,
      	cp_parser_omp_declare_target, cp_parser_omp_end_declare_target,
      	cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction,
      	cp_parser_omp_declare): New functions.
      	(cp_parser_omp_construct): Add p_name and mask vars.  Handle
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
      	PRAGMA_OMP_TEAMS.  Adjust cp_parser_omp_for, cp_parser_omp_parallel
      	and cp_parser_omp_sections callers.
      	(cp_parser_pragma): Handle PRAGMA_OMP_CANCEL,
      	PRAGMA_OMP_CANCELLATION_POINT, PRAGMA_OMP_DECLARE_REDUCTION,
      	PRAGMA_OMP_DISTRIBUTE, PRAGMA_OMP_SIMD, PRAGMA_OMP_TASKGROUP,
      	PRAGMA_OMP_TEAMS, PRAGMA_OMP_TARGET, PRAGMA_OMP_END_DECLARE_TARGET.
      	Handle pragma_member and pragma_objc_icode like pragma_external.
      	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
      	OMP_SINGLE_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.
      	(OMP_PARALLEL_CLAUSE_MASK): Likewise.  Add OMP_CLAUSE_PROC_BIND.
      	(OMP_TASK_CLAUSE_MASK): Use OMP_CLAUSE_MASK_1 instead of 1.  Add
      	OMP_CLAUSE_DEPEND.
      	(OMP_SIMD_CLAUSE_MASK, OMP_CANCEL_CLAUSE_MASK,
      	OMP_CANCELLATION_POINT_CLAUSE_MASK, OMP_DISTRIBUTE_CLAUSE_MASK,
      	OMP_TEAMS_CLAUSE_MASK, OMP_TARGET_DATA_CLAUSE_MASK,
      	OMP_TARGET_UPDATE_CLAUSE_MASK, OMP_TARGET_CLAUSE_MASK,
      	OMP_DECLARE_SIMD_CLAUSE_MASK): Define.
      	* parser.h (struct cp_omp_declare_simd_data): New type.
      	(struct cp_parser): Add colon_doesnt_start_class_def_p and
      	omp_declare_simd fields.
      	* cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Define.
      	* cp-tree.h (struct lang_decl_fn): Add omp_declare_reduction_p
      	bit.
      	(DECL_OMP_DECLARE_REDUCTION_P): Define.
      	(OMP_FOR_GIMPLIFYING_P): Use OMP_LOOP_CHECK macro.
      	(struct saved_scope): Add omp_declare_target_attribute field.
      	(cp_omp_mappable_type, omp_reduction_id,
      	cp_remove_omp_priv_cleanup_stmt, cp_check_omp_declare_reduction,
      	finish_omp_cancel, finish_omp_cancellation_point): New prototypes.
      	(finish_omp_for): Add CODE argument.
      	(finish_omp_atomic): Add seq_cst argument.
      	(cxx_omp_create_clause_info): Add need_dtor argument.
      gcc/testsuite/
      	* c-c++-common/gomp/atomic-15.c: Adjust for C diagnostics.
      	Remove error test that is now valid in OpenMP 4.0.
      	* c-c++-common/gomp/atomic-16.c: New test.
      	* c-c++-common/gomp/cancel-1.c: New test.
      	* c-c++-common/gomp/depend-1.c: New test.
      	* c-c++-common/gomp/depend-2.c: New test.
      	* c-c++-common/gomp/map-1.c: New test.
      	* c-c++-common/gomp/pr58472.c: New test.
      	* c-c++-common/gomp/sections1.c: New test.
      	* c-c++-common/gomp/simd1.c: New test.
      	* c-c++-common/gomp/simd2.c: New test.
      	* c-c++-common/gomp/simd3.c: New test.
      	* c-c++-common/gomp/simd4.c: New test.
      	* c-c++-common/gomp/simd5.c: New test.
      	* c-c++-common/gomp/single1.c: New test.
      	* g++.dg/gomp/block-0.C: Adjust for stricter #pragma omp sections
      	parser.
      	* g++.dg/gomp/block-3.C: Likewise.
      	* g++.dg/gomp/clause-3.C: Adjust error messages.
      	* g++.dg/gomp/declare-simd-1.C: New test.
      	* g++.dg/gomp/declare-simd-2.C: New test.
      	* g++.dg/gomp/depend-1.C: New test.
      	* g++.dg/gomp/depend-2.C: New test.
      	* g++.dg/gomp/target-1.C: New test.
      	* g++.dg/gomp/target-2.C: New test.
      	* g++.dg/gomp/taskgroup-1.C: New test.
      	* g++.dg/gomp/teams-1.C: New test.
      	* g++.dg/gomp/udr-1.C: New test.
      	* g++.dg/gomp/udr-2.C: New test.
      	* g++.dg/gomp/udr-3.C: New test.
      	* g++.dg/gomp/udr-4.C: New test.
      	* g++.dg/gomp/udr-5.C: New test.
      	* g++.dg/gomp/udr-6.C: New test.
      	* gcc.dg/autopar/outer-1.c: Expect 4 instead of 5 loopfn matches.
      	* gcc.dg/autopar/outer-2.c: Likewise.
      	* gcc.dg/autopar/outer-3.c: Likewise.
      	* gcc.dg/autopar/outer-4.c: Likewise.
      	* gcc.dg/autopar/outer-5.c: Likewise.
      	* gcc.dg/autopar/outer-6.c: Likewise.
      	* gcc.dg/autopar/parallelization-1.c: Likewise.
      	* gcc.dg/gomp/block-3.c: Adjust for stricter #pragma omp sections
      	parser.
      	* gcc.dg/gomp/clause-1.c: Adjust error messages.
      	* gcc.dg/gomp/combined-1.c: Look for GOMP_parallel_loop_runtime
      	instead of GOMP_parallel_loop_runtime_start.
      	* gcc.dg/gomp/declare-simd-1.c: New test.
      	* gcc.dg/gomp/declare-simd-2.c: New test.
      	* gcc.dg/gomp/nesting-1.c: Adjust for stricter #pragma omp sections
      	parser.  Add further #pragma omp sections nesting tests.
      	* gcc.dg/gomp/target-1.c: New test.
      	* gcc.dg/gomp/target-2.c: New test.
      	* gcc.dg/gomp/taskgroup-1.c: New test.
      	* gcc.dg/gomp/teams-1.c: New test.
      	* gcc.dg/gomp/udr-1.c: New test.
      	* gcc.dg/gomp/udr-2.c: New test.
      	* gcc.dg/gomp/udr-3.c: New test.
      	* gcc.dg/gomp/udr-4.c: New test.
      	* gfortran.dg/gomp/appendix-a/a.35.5.f90: Add dg-error.
      
      Co-Authored-By: Richard Henderson <rth@redhat.com>
      Co-Authored-By: Tobias Burnus <burnus@net-b.de>
      
      From-SVN: r203408
      Jakub Jelinek committed
  12. 28 May, 2013 1 commit
    • Implemented Cilk Plus Array Notation for C Compiler. · 36536d79
      gcc/ChangeLog
      2013-05-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
      
      	* doc/extend.texi (C Extensions): Added documentation about Cilk 
      Plus
      	array notation built-in reduction functions.
      	* doc/passes.texi (Passes): Added documentation about changes done
      	for Cilk Plus.
      	* doc/invoke.texi (C Dialect Options): Added documentation about
      	the -fcilkplus flag.
      	* Makefile.in (C_COMMON_OBJS): Added 
      c-family/array-notation-common.o.
      	(BUILTINS_DEF): Depend on cilkplus.def.
      	* builtins.def: Include cilkplus.def.  Define 
      DEF_CILKPLUS_BUILTIN.
      	* builtin-types.def: Define BT_FN_INT_PTR_PTR_PTR.
      	* cilkplus.def: New file.
      
      gcc/c-family/ChangeLog
      2013-05-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
      
      	* c-common.c (c_define_builtins): When cilkplus is enabled, the
      	function array_notation_init_builtins is called.
      	(c_common_init_ts): Added ARRAY_NOTATION_REF as typed.
      	* c-common.def (ARRAY_NOTATION_REF): New tree.
      	* c-common.h (build_array_notation_expr): New function declaration.
      	(build_array_notation_ref): Likewise.
      	(extract_sec_implicit_index_arg): New extern declaration.
      	(is_sec_implicit_index_fn): Likewise.
      	(ARRAY_NOTATION_CHECK): New define.
      	(ARRAY_NOTATION_ARRAY): Likewise.
      	(ARRAY_NOTATION_START): Likewise.
      	(ARRAY_NOTATION_LENGTH): Likewise.
      	(ARRAY_NOTATION_STRIDE): Likewise.
      	* c-pretty-print.c (pp_c_postifix_expression): Added a new case for
      	ARRAY_NOTATION_REF.
      	(pp_c_expression): Likewise.
      	* c.opt (flag_enable_cilkplus): New flag.
      	* array-notation-common.c: New file.
      
      gcc/c/ChangeLog
      2013-05-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
      
      	* c-typeck.c (build_array_ref): Added a check to see if array's
      	index is greater than one.  If true, then emit an error.
      	(build_function_call_vec): Exclude error reporting and checking
      	for builtin array-notation functions.
      	(convert_arguments): Likewise.
      	(c_finish_return): Added a check for array notations as a return
      	expression.  If true, then emit an error.
      	(c_finish_loop): Added a check for array notations in a loop
      	condition.  If true then emit an error.
      	(lvalue_p): Added a ARRAY_NOTATION_REF case.
      	(build_binary_op): Added a check for array notation expr inside
      	op1 and op0.  If present, we call another function to find correct
      	type.
      	* Make-lang.in (C_AND_OBJC_OBJS): Added c-array-notation.o.
      	* c-parser.c (c_parser_compound_statement): Check if array
      	notation code is used in tree, if so, then transform them into
      	appropriate C code.
      	(c_parser_expr_no_commas): Check if array notation is used in LHS
      	or RHS, if so, then build array notation expression instead of
      	regular modify.
      	(c_parser_postfix_expression_after_primary): Added a check for
      	colon(s) after square braces, if so then handle it like an array
      	notation.  Also, break up array notations in unary op if found.
      	(c_parser_direct_declarator_inner): Added a check for array
      	notation.
      	(c_parser_compound_statement): Added a check for array notation in
      	a stmt.  If one is present, then expand array notation expr.
      	(c_parser_if_statement): Likewise.
      	(c_parser_switch_statement): Added a check for array notations in
      	a switch statement's condition.  If true, then output an error.
      	(c_parser_while_statement): Similarly, but for a while.
      	(c_parser_do_statement): Similarly, but for a do-while.
      	(c_parser_for_statement): Similarly, but for a for-loop.
      	(c_parser_unary_expression): Check if array notation is used in a
      	pre-increment or pre-decrement expression.  If true, then expand
      	them.
      	(c_parser_array_notation): New function.
      	* c-array-notation.c: New file.
      	* c-tree.h (is_cilkplus_reduce_builtin): Protoize.
      
      gcc/testsuite/ChangeLog
      2013-05-28  Balaji V. Iyer  <balaji.v.iyer@intel.com>
      
      	* c-c++-common/cilk-plus/AN/array_test1.c: New test.
      	* c-c++-common/cilk-plus/AN/array_test2.c: Likewise.
      	* c-c++-common/cilk-plus/AN/array_test_ND.c: Likewise.
      	* c-c++-common/cilk-plus/AN/builtin_func_double.c: Likewise.
      	* c-c++-common/cilk-plus/AN/builtin_func_double2.c: Likewise.
      	* c-c++-common/cilk-plus/AN/gather-scatter-errors.c: Likewise.
      	* c-c++-common/cilk-plus/AN/if_test.c: Likewise.
      	* c-c++-common/cilk-plus/AN/sec_implicit_ex.c: Likewise.
      	* c-c++-common/cilk-plus/AN/decl-ptr-colon.c: Likewise.
      	* c-c++-common/cilk-plus/AN/dimensionless-arrays.c: Likewise.
      	* c-c++-common/cilk-plus/AN/fn_ptr.c: Likewise.
      	* c-c++-common/cilk-plus/AN/fp_triplet_values.c: Likewise.
      	* c-c++-common/cilk-plus/AN/gather-scatter.c: Likewise.
      	* c-c++-common/cilk-plus/AN/misc.c: Likewise.
      	* c-c++-common/cilk-plus/AN/parser_errors.c: Likewise.
      	* c-c++-common/cilk-plus/AN/parser_errors2.c: Likewise.
      	* c-c++-common/cilk-plus/AN/parser_errors3.c: Likewise.
      	* c-c++-common/cilk-plus/AN/parser_errors4.c: Likewise.
      	* c-c++-common/cilk-plus/AN/rank_mismatch.c: Likewise.
      	* c-c++-common/cilk-plus/AN/rank_mismatch2.c: Likewise.
      	* c-c++-common/cilk-plus/AN/rank_mismatch3.c: Likewise.
      	* c-c++-common/cilk-plus/AN/sec_implicit.c: Likewise.
      	* c-c++-common/cilk-plus/AN/sec_implicit2.c: Likewise.
      	* c-c++-common/cilk-plus/AN/sec_reduce_max_min_ind.c: Likewise.
      	* c-c++-common/cilk-plus/AN/tst_lngth.c: Likewise.
      	* c-c++-common/cilk-plus/AN/vla.c: Likewise.
      	* c-c++-common/cilk-plus/AN/an-if.c: Likewise.
      	* c-c++-common/cilk-plus/AN/builtin_fn_custom.c: Likewise.
      	* c-c++-common/cilk-plus/AN/builtin_fn_mutating.c: Likewise.
      	* c-c++-common/cilk-plus/AN/comma_exp.c: Likewise.
      	* c-c++-common/cilk-plus/AN/conditional.c: Likewise.
      	* c-c++-common/cilk-plus/AN/exec-once.c: Likewise.
      	* c-c++-common/cilk-plus/AN/exec-once2.c: Likewise.
      	* c-c++-common/cilk-plus/AN/gather_scatter.c: Likewise.
      	* c-c++-common/cilk-plus/AN/n-ptr-test.c: Likewise.
      	* c-c++-common/cilk-plus/AN/side-effects-1.c: Likewise.
      	* c-c++-common/cilk-plus/AN/test_builtin_return.c: Likewise.
      	* c-c++-common/cilk-plus/AN/test_sec_limits.c: Likewise.
      	* gcc.dg/cilk-plus/cilk-plus.exp: New script.
      
      From-SVN: r199389
      Balaji V. Iyer committed
  13. 10 Jan, 2013 1 commit
  14. 04 Jan, 2013 1 commit
  15. 04 Dec, 2012 1 commit
    • re PR sanitizer/55439 (ThreadSanitizer: handle atomic operations) · c954bddd
      	PR sanitizer/55439
      	* Makefile.in (tsan.o): Depend on tree-ssa-propagate.h.
      	* sanitizer.def: Add __tsan_atomic* builtins.
      	* asan.c (initialize_sanitizer_builtins): Adjust to also
      	initialize __tsan_atomic* builtins.
      	* tsan.c: Include tree-ssa-propagate.h.
      	(enum tsan_atomic_action): New enum.
      	(tsan_atomic_table): New table.
      	(instrument_builtin_call): New function.
      	(instrument_gimple): Take pointer to gimple_stmt_iterator
      	instead of gimple_stmt_iterator.  Call instrument_builtin_call
      	on builtin call stmts.
      	(instrument_memory_accesses): Adjust instrument_gimple caller.
      	* builtin-types.def (BT_FN_BOOL_VPTR_PTR_I1_INT_INT,
      	BT_FN_BOOL_VPTR_PTR_I2_INT_INT, BT_FN_BOOL_VPTR_PTR_I4_INT_INT,
      	BT_FN_BOOL_VPTR_PTR_I8_INT_INT, BT_FN_BOOL_VPTR_PTR_I16_INT_INT): New.
      
      From-SVN: r194133
      Jakub Jelinek committed
  16. 03 Dec, 2012 1 commit
    • sanitizer.def: Add Address Sanitizer builtins. · 0e668eaf
      	* sanitizer.def: Add Address Sanitizer builtins.
      	Rename BUILT_IN_TSAN_READ_* to BUILT_IN_TSAN_READ* and
      	BUILT_IN_TSAN_WRITE_* to BUILT_IN_TSAN_WRITE*.
      	* Makefile.in (asan.o): Depend on langhooks.h.
      	(tsan.o): Depend on asan.h.
      	* asan.h (initialize_sanitizer_builtins): New prototype.
      	* asan.c: Include langhooks.h.
      	(report_error_func): Use builtin_decl_implicit of corresponding
      	BUILT_IN_ASAN_REPORT_{LOAD,STORE}*.
      	(asan_init_func): Removed.
      	(initialize_sanitizer_builtins): New function.
      	(asan_finish_file): Call it.  Use builtin_decl_implicit
      	on BUILT_IN_ASAN_{INIT,{,UN}REGISTER_GLOBALS}.
      	(asan_instrument): Call initialize_sanitizer_builtins.
      	* builtins.def (DEF_SANITIZER_BUILTIN): Change condition to
      	(flag_asan || flag_tsan).
      	* tsan.c: Include asan.h and tsan.h.
      	(get_memory_access_decl): Rename BUILT_IN_TSAN_{READ,WRITE}_*
      	to BUILT_IN_TSAN_{READ,WRITE}*.
      	(tsan_pass): Call initialize_sanitizer_builtins.
      	(tsan_gate, tsan_gate_O0): Don't check if
      	builtin_decl_implicit_p (BUILT_IN_TSAN_INIT) is true.
      	(tsan_finish_file): Call initialize_sanitizer_builtins.
      	* builtin-types.def (BT_FN_VOID_PTR_PTRMODE): New fn type.
      
      From-SVN: r194103
      Jakub Jelinek committed
  17. 14 Sep, 2012 1 commit
    • builtin-types.def (BT_FN_CONST_STRING): Add. · 3537a0cd
      2012-09-14  Richard Guenther  <rguenther@suse.de>
      
      	* builtin-types.def (BT_FN_CONST_STRING): Add.
      	* builtins.def (BUILT_IN_FILE, BUILT_IN_FUNCTION,
      	BUILT_IN_LINE): New builtins.
      	* gimplify.c (gimplify_call_expr): Expand them.
      	* doc/extend.texi (__builtin_LINE, __builtin_FUNCTION,
      	__builtin_FILE): Document.
      
      	* g++.dg/torture/builtin-location.C: New testcase.
      
      From-SVN: r191290
      Richard Guenther committed
  18. 11 Apr, 2012 1 commit
    • re PR target/52624 (missing __builtin_bswap16) · ac868f29
      	PR target/52624
      	* doc/extend.texi (Other Builtins): Document __builtin_bswap16.
      	(PowerPC AltiVec/VSX Built-in Functions): Remove it.
      	* doc/md.texi (Standard Names): Add bswap.
      	* builtin-types.def (BT_UINT16): New primitive type.
      	(BT_FN_UINT16_UINT16): New function type.
      	* builtins.def (BUILT_IN_BSWAP16): New.
      	* builtins.c (expand_builtin_bswap): Add TARGET_MODE argument.
      	(expand_builtin) <BUILT_IN_BSWAP16>: New case.  Pass TARGET_MODE to
      	expand_builtin_bswap.
      	(fold_builtin_bswap): Add BUILT_IN_BSWAP16 case.
      	(fold_builtin_1): Likewise.
      	(is_inexpensive_builtin): Likewise.
      	* optabs.c (expand_unop): Deal with bswap in HImode specially.  Add
      	missing bits for bswap to libcall code.
      	* tree.c (build_common_tree_nodes): Build uint16_type_node.
      	* tree.h (enum tree_index): Add TI_UINT16_TYPE.
      	(uint16_type_node): New define.
      	* config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_BSWAP_HI): Delete.
      	* config/rs6000/rs6000.c (rs6000_expand_builtin): Remove handling of
      	above builtin.
      	(rs6000_init_builtins): Likewise.
      	* config/rs6000/rs6000.md (bswaphi2): Add TARGET_POWERPC predicate.
      c-family/
      	* c-common.h (uint16_type_node): Rename into...
      	(c_uint16_type_node): ...this.
      	* c-common.c (c_common_nodes_and_builtins): Adjust for above renaming.
      	* c-cppbuiltin.c (builtin_define_stdint_macros): Likewise.
      
      From-SVN: r186308
      Eric Botcazou committed
  19. 25 Jan, 2012 1 commit
    • re PR lto/51698 ([trans-mem] TM runtime and application with LTO) · dda6ecae
              PR lto/51698
              * builtin-types.def: (BT_CONST_DOUBLE_PTR): New.
              (BT_FN_VOID_PTR_CONST_PTR_SIZE): New.
              (BT_FN_VOID_PTR_INT_SIZE): New.
              (BT_FN_UINT_UINT_VAR): Remove.
              (BT_FN_UINT32_UINT32_VAR): New.
              (BT_FN_DOUBLE_VPTR): Remove.
              (BT_FN_DOUBLE_CONST_DOUBLE_PTR): New.
              * gtm-builtins.def (_ITM_abortTransaction): Set return type to
              void.
              (_ITM_changeTransactionMode): Same.
              (_ITM_memmoveRtWt): Change return type to void.
              (_ITM_memcpyRtWt): Same.
              (_ITM_memsetW): Same.
              (_ITM_RaRD): Change types to double.
              (_ITM_RD): Same.
              (_ITM_RaWD): Same.
              (_ITM_RfWD): Same.
              * builtins.def (DEF_TM_BUILTIN): Set BOTH_P to true.
      testsuite/
              PR lto/51698
              * gcc.dg/lto/trans-mem-4_0.c: New.
              * gcc.dg/lto/trans-mem-4_1.c: New.
              * gcc.dg/lto/trans-mem-2_0.c: Provide correct argument types for
              TM builtins.
              * gcc.dg/lto/trans-mem-1_0.c: Require stdint_types.
              * gcc.dg/lto/trans-mem-1_1.c: Provide correct argument types for
              TM builtins.
              * gcc.dg/lto/trans-mem-3_0.c: Require stdint_types.
              * gcc.dg/lto/trans-mem-3_1.c: Provide correct argument types for
              TM builtins.
      
      From-SVN: r183537
      Aldy Hernandez committed
  20. 23 Jan, 2012 1 commit
  21. 08 Nov, 2011 1 commit
  22. 06 Nov, 2011 1 commit
  23. 27 Jun, 2011 1 commit
    • builtin-types.def (BT_FN_PTR_CONST_PTR_SIZE_VAR): New. · 45d439ac
      	* builtin-types.def (BT_FN_PTR_CONST_PTR_SIZE_VAR): New.
      	* builtins.def (BUILT_IN_ASSUME_ALIGNED): New builtin.
      	* tree-ssa-structalias.c (find_func_aliases_for_builtin_call,
      	find_func_clobbers): Handle BUILT_IN_ASSUME_ALIGNED.
      	* tree-ssa-ccp.c (bit_value_assume_aligned): New function.
      	(evaluate_stmt, execute_fold_all_builtins): Handle
      	BUILT_IN_ASSUME_ALIGNED.
      	* tree-ssa-dce.c (propagate_necessity): Likewise.
      	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1,
      	call_may_clobber_ref_p_1): Likewise.
      	* builtins.c (is_simple_builtin, expand_builtin): Likewise.
      	(expand_builtin_assume_aligned): New function.
      	* doc/extend.texi (__builtin_assume_aligned): Document.
      
      	* c-common.c (check_builtin_function_arguments): Handle
      	BUILT_IN_ASSUME_ALIGNED.
      
      	* gcc.dg/builtin-assume-aligned-1.c: New test.
      	* gcc.dg/builtin-assume-aligned-2.c: New test.
      	* gcc.target/i386/builtin-assume-aligned-1.c: New test.
      
      From-SVN: r175541
      Jakub Jelinek committed
  24. 03 Jan, 2011 1 commit
  25. 26 May, 2010 1 commit
    • demangle-expected: Add tests for __int128 and unsigned __int128 types. · a6766312
      libiberty/
      
      2010-05-26  Kai Tietz  <kai.tietz@onevision.com>
      
              * testsuite/demangle-expected: Add tests for __int128
              and unsigned __int128 types.
      
      gcc/testsuite
      2010-05-26  Kai Tietz  <kai.tietz@onevision.com>
      
      	* lib/target-supports.exp (check_effective_target_int128): New
      	function to check if __int128 types are available for target.
      	* testsuite/c-c++-common/int128-types-1.c: New.
      	* testsuite/c-c++-common/int128-1.c: New.
      	* testsuite/c-c++-common/int128-2.c: New.
      	* g++.dg/abi/mangle43.C: New.
      	* g++.dg/init/enum1.C: Handle __int128 case and add -Wno-overflow.
      	* g++.dg/cpp0x/nullptr04.C: Use __SIZE_TYPE__ for getting
      	pointer-wide scalar.
      	* g++.dg/other/pr25632.C: Likewise.
      	* g++.dg/other/large-size-array.C (DIM): Use ULLONG_MAX for win64 case.
      	* g++.dg/warn/pr13358-2.C: Add llp64 for check of special
      	overflow warnings.
      	* g++.dg/warn/pr13358-4.C: Likewise.
      	* g++.dg/warn/Wconversion-null-2.C:  Add 'long long' case.
      	* g++.dg/warn/Wconversion-null.C: Likewise.
      
      gcc/
      2010-05-26  Kai Tietz  <kai.tietz@onevision.com>
      
      	* builtin-types.def (BT_INT128): New primitive type.
      	(BT_UINT128): Likewise.
      	* c-common.c (c_common_r): Add __int128 keyword.
      	(c_common_type_for_size): Handle __int128.
      	(c_common_type_for_mode): Likewise.
      	(c_common_signed_or_unsigned_type): Likewise.
      	(c_common_nodes_and_builtins): Add builtin type
      	if target supports 128-bit integer scalar.
      	* c-common.h (enum rid): Add RID_INT128.
      	* c-cppbuiltin.c (c_cpp_builtins): Define __SIZEOF_INT128__
      	if target supports 128-bit integer scalar.
      	* c-decl.c (declspecs_add_type): Handle new keyword
      	__int128.
      	(finish_declspecs): Likewise.
      	* c-parser.c (c_token_starts_typename): Handle RID_INT128.
      	(c_token_starts_declspecs): Likewise.
      	(c_parser_declspecs): Likewise.
      	(c_parser_attributes): Likewise.
      	(c_parser_objc_selector): Likewise.
      	* c-pretty-print.c (pp_c_integer_constant): Handle __int128.
      	* c-tree.h (enum c_typespec_keyword): Add cts_int128.
      	* gimple.c (gimple_signed_or_unsigned_type): Handle int128 types.
      	* tree.c (make_or_reuse_type): Likewise.
      	(make_unsigned_type): Likewise.
      	(build_common_tree_nodes_2): Likewise.
      	* tree.h (enum integer_type_kind): Add itk_int128 and
      	itk_unsigned_int128.
      	(int128_integer_type_node): New define..
      	(int128_unsigned_type_node): New define.
      	* cp/cp-tree.h (cp_decl_specifier_seq): Add new bifield
      	explicit_int128_p.
      	* cp/decl.c (grokdeclarator): Handle __int128.
      	* cp/parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
      	(cp_parser_simple_type_specifier): Likewise.
      	* cp/rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
      	* cp/typeck.c (cp_common_type): Handle __int128.
      	* cp/mangle.c (integer_type_codes): Add itk_int128 and
      	itk_unsigned_int128.
      	* doc/extend.texi: Add documentation about __int128 type.
      
      From-SVN: r159879
      Kai Tietz committed
  26. 18 Jun, 2008 1 commit
    • targhooks.h (struct gcc_target): New member unwind_word_mode. · 7b0518e3
      	* targhooks.h (struct gcc_target): New member unwind_word_mode.
      	(default_unwind_word_mode): Add prototype.
      	* targhooks.c (default_unwind_word_mode): New function.
      	(default_eh_return_filter_mode): Return targetm.unwind_word_mode ()
      	instead of word_mode.
      	* target-def.h (TARGET_UNWIND_WORD_MODE): New macro.
      	(TARGET_INITIALIZER): Use it.
      
      	* c-common.c (handle_mode_attribute): Support "unwind_word"
      	mode attribute.
      	* unwind-generic.h (_Unwind_Word, _Unwind_Sword): Use it.
      
      	* except.c (init_eh): Use targetm.unwind_word_mode () instead of
      	word_mode to access SjLj_Function_Context member "data".
      	(sjlj_emit_dispatch_table): Likewise.  Also, perform type
      	conversion from targetm.eh_return_filter_mode () to
      	targetm.unwind_word_mode () if they differ.
      
      	* builtin-types.def (BT_UNWINDWORD): New primitive type.
      	(BT_FN_UNWINDWORD_PTR): New function type.
      	(BT_FN_WORD_PTR): Remove.
      	* builtins.def (BUILT_IN_EXTEND_POINTER): Use BT_FN_UNWINDWORD_PTR.
      	* except.c (expand_builtin_extend_pointer): Convert pointer to
      	targetm.unwind_word_mode () instead of word_mode.
      
      	* config/spu/spu-protos.h (spu_eh_return_filter_mode): Remove.
      	* config/spu/spu.c (spu_eh_return_filter_mode): Remove.
      	(spu_unwind_word_mode): New function.
      	(TARGET_EH_RETURN_FILTER_MODE): Do not define.
      	(TARGET_UNWIND_WORD_MODE): Define.
      	* config/spu/t-spu-elf (TARGET_LIBGCC2_CFLAGS): Remove -D__word__=SI.
      
      From-SVN: r136912
      Ulrich Weigand committed
  27. 06 Jun, 2008 1 commit
    • c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP value to 200805. · a68ab351
      	* 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
      Jakub Jelinek committed
  28. 23 May, 2008 1 commit
    • builtin-types.def (BT_FN_INT_INT_INT_INT_INT_INT_VAR): New. · 3bf5906b
      	* builtin-types.def (BT_FN_INT_INT_INT_INT_INT_INT_VAR): New.
      	* builtins.c (fold_builtin_fpclassify): New.
      	(fold_builtin_varargs): Handle BUILT_IN_FPCLASSIFY.
      	* builtins.def (BUILT_IN_FPCLASSIFY): New.
      	* c-common.c (handle_type_generic_attribute): Adjust to accept
      	fixed arguments before an elipsis.
      	(check_builtin_function_arguments): Handle BUILT_IN_FPCLASSIFY.
      	* doc/extend.texi: Document __builtin_fpclassify.
      
      testsuite:
      	* gcc.dg/builtins-error.c: Test __builtin_fpclassify.  Also
      	add tests for all previous type-generic builtins.
      	* gcc.dg/pr28796-2.c: Add -DUNSAFE flag.
      	* gcc.dg/tg-tests.h: Test __builtin_fpclassify.
      
      From-SVN: r135789
      Kaveh R. Ghazi committed
  29. 29 Aug, 2007 1 commit
    • builtin-types.def (BT_FN_PTR_PTR_SIZE): New type. · 4376b7cf
      	* builtin-types.def (BT_FN_PTR_PTR_SIZE): New type.
      	* builtins.def (BUILT_IN_REALLOC): New builtin.
      
      	* trans-array.c (gfc_grow_array): Use gfc_call_realloc.
      	(gfc_array_allocate): Use gfc_allocate_with_status and
      	gfc_allocate_array_with_status.
      	(gfc_array_deallocate): Use gfc_deallocate_with_status.
      	(gfc_trans_dealloc_allocated): Use gfc_deallocate_with_status.
      	* trans-stmt.c (gfc_trans_allocate): Use gfc_allocate_with_status.
      	(gfc_trans_deallocate): Use gfc_deallocate_with_status.
      	* trans.c (gfc_allocate_with_status, gfc_allocate_array_with_status,
      	gfc_deallocate_with_status, gfc_call_realloc): New functions.
      	* trans.h (gfc_allocate_with_status, gfc_allocate_array_with_status,
      	gfc_deallocate_with_status, gfc_call_realloc): New prototypes.
      	(gfor_fndecl_internal_realloc, gfor_fndecl_allocate,
      	gfor_fndecl_allocate_array, gfor_fndecl_deallocate): Remove.
      	* f95-lang.c (gfc_init_builtin_functions): Create decl for
      	BUILT_IN_REALLOC.
      	* trans-decl.c (gfor_fndecl_internal_realloc,
      	gfor_fndecl_allocate, gfor_fndecl_allocate_array,
      	gfor_fndecl_deallocate): Remove function decls.
      	(gfc_build_builtin_function_decls): Likewise.
      
      	* runtime/memory.c (internal_realloc, allocate, allocate_array,
      	deallocate): Remove functions.
      	* gfortran.map (_gfortran_allocate, _gfortran_allocate_array,
      	_gfortran_deallocate, _gfortran_internal_realloc): Remove symbols.
      	* libgfortran.h (error_codes): Add comment.
      
      	* gfortran.dg/alloc_comp_basics_1.f90: Update check.
      	* gfortran.dg/alloc_comp_constructor_1.f90: Update check.
      
      From-SVN: r127897
      Francois-Xavier Coudert committed
  30. 26 Jul, 2007 1 commit
  31. 11 May, 2007 1 commit
    • re PR other/31852 (Missing __builtin_memchr) · 2a5fce6d
      2007-05-11  Paolo Carlini  <pcarlini@suse.de>
      
      	PR other/31852
      	* builtin-types.def: Add BT_FN_PTR_CONST_PTR_INT_SIZE.
      	* builtins.def: Add BUILT_IN_MEMCHR, use the latter.
      	* builtins.c (fold_builtin_memchr): New.
      	(expand_builtin_memchr): Call the latter.
      	(expand_builtin, fold_builtin_3): Deal with BUILT_IN_MEMCHR.
      	* doc/extend.texi ([Other built-in functions provided by GCC]):
      	Document memchr.
      
      /testsuite
      2007-05-11  Paolo Carlini  <pcarlini@suse.de>
      
      	PR other/31852
      	* gcc.c-torture/execute/builtins/memchr.c: New.
      	* gcc.c-torture/execute/builtins/memchr-lib.c: New.
      	* gcc.c-torture/execute/builtins/lib/memchr.c: New.
      
      From-SVN: r124617
      Paolo Carlini committed
  32. 14 Feb, 2007 1 commit
  33. 10 Feb, 2007 1 commit
    • Makefile.in (libgcc-support, [...]): Add emutls.c. · 8893239d
      gcc/ChangeLog:
      * Makefile.in (libgcc-support, libgcc.mvars): Add emutls.c.
      * builtin-types.def (BT_WORD): Make unsigned.
      (BT_FN_VOID_PTR_WORD_WORD_PTR): New.
      * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
      (BUILT_IN_EMUTLS_REGISTER_COMMON): New.
      * c-decl.c (grokdeclarator): Don't error if !have_tls.
      * c-parser.c (c_parser_omp_threadprivate): Likewise.
      * dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
      emulated tls.
      * expr.c (emutls_var_address): New.
      (expand_expr_real_1): Expand emulated tls.
      (expand_expr_addr_expr_1): Likewise.
      * libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
      * output.h (emutls_finish): Declare.
      * toplev.c (compile_file): Call it.
      * tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
      address before wrapping in CONST.
      * varasm.c (emutls_htab, emutls_object_type): New.
      (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
      (get_emutls_object_name, get_emutls_object_type): New.
      (get_emutls_init_templ_addr, emutls_decl): New.
      (emutls_common_1, emutls_finish): New.
      (assemble_variable): When emulating tls, swap decls; generate
      constructor for the emutls objects.
      (do_assemble_alias): When emulating tls, swap decl and target name.
      (default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
      for emulated tls.
      * varpool.c (decide_is_variable_needed): Look at force_output.
      Recurse for emulated tls.
      (cgraph_varpool_remove_unreferenced_decls): Remove checks redundant
      with decide_is_variable_needed.
      * emutls.c: New file.
      * config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
      tls_object for real tls.
      gcc/cp/ChangeLog:
      * decl.c (grokvardecl): Don't error if !have_tls.
      (grokdeclarator): Likewise.
      * parser.c (cp_parser_omp_threadprivate): Likewise.
      gcc/fortran/ChangeLog:
      * f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
      and __emutls_register_common.
      * openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
      * trans-common.c (build_common_decl): Don't check have_tls.
      * trans-decl.c (gfc_finish_var_decl): Likewise.
      * types.def (BT_WORD, BT_FN_PTR_PTR): New.
      (BT_FN_VOID_PTR_WORD_WORD_PTR): New.
      gcc/testsuite/ChangeLog:
      * lib/target-supports.exp (check_effective_target_tls): Redefine
      to mean non-emulated tls.
      * gcc.dg/tls/alias-1.c: Remove tls requirement.
      * gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
      gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
      gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
      gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
      gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
      gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
      
      From-SVN: r121800
      Richard Henderson committed
  34. 13 Dec, 2006 1 commit
    • re PR tree-optimization/17687 (sincos tree representation causes extra addressable vars) · 75c7c595
      2006-12-13  Richard Guenther  <rguenther@suse.de>
      
      	PR tree-optimization/17687
      	* builtins.def (BUILT_IN_CEXPI, BUILT_IN_CEXPIF, BUILT_IN_CEXPIL):
      	New builtins for imaginary argument cexp.
      	* builtin-types.def (BT_FN_COMPLEX_FLOAT_FLOAT,
      	BT_FN_COMPLEX_DOUBLE_DOUBLE, BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE):
      	New required builtin types.
      	* builtins.c (expand_builtin_cexpi): Declare.
      	(mathfn_built_in): Handle BUILT_IN_CEXPI.
      	(expand_builtin_cexpi): New static helper.
      	(expand_builtin): Call it.
      	(do_mpfr_sincos): Adjust for CEXPI evaluation.
      	(fold_builtin_sincos): New function to fold sincos to cepxi.
      
      	* gcc.dg/builtins-59.c: New testcase.
      
      From-SVN: r119824
      Richard Guenther committed
  35. 01 Nov, 2006 1 commit
    • extend.texi (__builtin_bswap32): Document. · 167fa32c
      2006-09-07  Eric Christopher  <echristo@apple.com>
      	    Falk Hueffner  <falk@debian.org>
      
      	* doc/extend.texi (__builtin_bswap32): Document.
      	(__builtin_bswap64): Ditto.
      	* doc/libgcc.texi (bswapsi2): Document.
      	(bswapdi2): Ditto.
      	* doc/rtl.texi (bswap): Document.
      	* optabs.c (expand_unop): Don't widen a bswap.
      	(init_optabs): Init bswap. Set libfuncs explicitly
      	for bswapsi2 and bswapdi2.
      	* optabs.h (OTI_bswap): New.
      	(bswap_optab): Ditto.
      	* genopinit.c (optabs): Handle bswap_optab.
      	* tree.h (tree_index): Add TI_UINT32_TYPE and
      	TI_UINT64_TYPE.
      	(uint32_type_node): New.
      	(uint64_type_node): Ditto.
      	* tree.c (build_common_tree_nodes_2): Initialize
      	uint32_type_node and uint64_type_node.
      	* builtins.c (expand_builtin_bswap): New.
      	(expand_builtin): Call.
      	(fold_builtin_bswap): New.
      	(fold_builtin_1): Call.
      	* fold-const.c (tree_expr_nonnegative_p): Return true
      	for bswap.
      	* builtin-types.def (BT_UINT32): New.
      	(BT_UINT64): Ditto.
      	(BT_FN_UINT32_UINT32): Ditto.
      	(BT_FN_UINT64_UINT64): Ditto.
      	* builtins.def (BUILT_IN_BSWAP32): New.
      	(BUILT_IN_BSWAP64): Ditto.
      	* rtl.def (BSWAP): New.
      	* genattrtab.c (check_attr_value): New.
      	* libgcc2.c (__bswapSI2): New.
      	(__bswapDI2): Ditto.
      	* libgcc2.h (__bswapSI2): Declare.
      	(__bswapDI2): Ditto.
      	* mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2.
      	* simplify-rtx.c (simplify_const_unary_operation): Return
      	0 for BSWAP.
      	* libgcc-std.ver (__bwapsi2): Add.
      	(__bswapdi2): Ditto.
      	* reload1.c (eliminate_regs_1): Add bswap.
      	(elimination_effects): Ditto.
      	* config/i386/i386.h (x86_bswap): New.
      	(TARGET_BSWAP): Use.
      	* config/i386/i386.c (x86_bswap): Set.
      
      Co-Authored-By: Falk Hueffner <falk@debian.org>
      
      From-SVN: r118361
      Eric Christopher committed
  36. 09 Oct, 2006 1 commit
  37. 04 Oct, 2006 1 commit
    • Makefile.in (libgcc.mk, [...]): Add emutls.c. · e701a32a
      gcc/
              * Makefile.in (libgcc.mk, LIBGCC_DEPS): Add emutls.c.
              * builtin-types.def (BT_WORD): Make unsigned.
              (BT_FN_VOID_PTR_WORD_WORD_PTR): New.
              * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS): New.
              (BUILT_IN_EMUTLS_REGISTER_COMMON): New.
              * c-decl.c (grokdeclarator): Don't error if !have_tls.
              * c-parser.c (c_parser_omp_threadprivate): Likewise.
              * cgraph.c (decide_is_variable_needed): Look at force_output.
              Recurse for emulated tls.
              * cgraphunit.c (cgraph_varpool_remove_unreferenced_decls): Remove
              checks redundant with decide_is_variable_needed.
              (cgraph_build_static_cdtor): Do cgraph_varpool_assemble_pending_decls.
              * dwarf2out.c (loc_descriptor_from_tree_1): Don't do anything for
              emulated tls.
              * expr.c (emutls_var_address): New.
              (expand_expr_real_1): Expand emulated tls.
              (expand_expr_addr_expr_1): Likewise.
              * libgcc-std.ver: Add __emutls_get_address, __emutls_register_common.
              * output.h (emutls_finish): Declare.
              * toplev.c (compile_file): Call it.
              * tree-ssa-address.c (gen_addr_rtx): Check for const-ness of the
              address before wrapping in CONST.
              * varasm.c (emutls_htab, emutls_object_type): New.
              (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): New.
              (get_emutls_object_name, get_emutls_object_type): New.
              (get_emutls_init_templ_addr, emutls_decl): New.
              (emutls_common_1, emutls_finish): New.
              (assemble_variable): When emulating tls, swap decls; generate
              constructor for the emutls objects.
              (do_assemble_alias): When emulating tls, swap decl and target name.
              (default_encode_section_info): Don't add SYMBOL_FLAG_TLS_SHIFT
              for emulated tls.
              * emutls.c: New file.
              * config/sparc/sol2.h (ASM_DECLARE_OBJECT_NAME): Only emit
              tls_object for real tls.
      
      gcc/cp/
              * decl.c (grokvardecl): Don't error if !have_tls.
              (grokdeclarator): Likewise.
              * parser.c (cp_parser_omp_threadprivate): Likewise.
      
      gcc/fortran/
              * f95-lang.c (gfc_init_builtin_functions): Add __emutls_get_address
              and __emutls_register_common.
              * openmp.c (gfc_match_omp_threadprivate): Don't error if !have_tls.
              * trans-common.c (build_common_decl): Don't check have_tls.
              * trans-decl.c (gfc_finish_var_decl): Likewise.
              * types.def (BT_WORD, BT_FN_PTR_PTR): New.
              (BT_FN_VOID_PTR_WORD_WORD_PTR): New.
      
      gcc/testsuite/
              * lib/target-supports.exp (check_effective_target_tls): Redefine
              to mean non-emulated tls.
              * gcc.dg/tls/alias-1.c: Remove tls requirement.
              * gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
              gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
              gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
              gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
              gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
              gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
      
      From-SVN: r117440
      Richard Henderson committed
  38. 18 May, 2006 1 commit
  39. 18 Jan, 2006 1 commit
    • [multiple changes] · 953ff289
      2006-01-18  Richard Henderson  <rth@redhat.com>
      	    Jakub Jelinek  <jakub@redhat.com>
                  Diego Novillo  <dnovillo@redhat.com>
      
      	* libgomp: New directory.
      	* Makefile.def: Add target_module libgomp.
      	* Makefile.in: Regenerate.
      	* configure.in (target_libraries): Add target-libgomp.
      	* configure: Regenerate.
      
      
      contrib/
      
      2006-01-18  Richard Henderson  <rth@redhat.com>
                  Diego Novillo  <dnovillo@redhat.com>
      
      	* gcc_update (files_and_dependencies): Add libgomp files.
      
      
      gcc/
      
      2006-01-18  Richard Henderson  <rth@redhat.com>
                  Aldy Hernandez  <aldyh@redhat.com>
      	    Jakub Jelinek  <jakub@redhat.com>
                  Diego Novillo  <dnovillo@redhat.com>
      
      	* omp-low.c: New file.
      	* c-omp.c: New file.
      
      2006-01-18  Richard Henderson  <rth@redhat.com>
      	    Jakub Jelinek  <jakub@redhat.com>
                  Diego Novillo  <dnovillo@redhat.com>
      
      	* doc/invoke.texi: Document -fopenmp.
      	* tree-dump.h (debug_function): Declare.
      
      	* hooks.c (hook_bool_tree_bool_false): New function.
      	(hook_tree_tree_null): Remove.
      	(hook_tree_tree_tree_null): New.
      	* hooks.h: Update to match.
      
      	* tree-pretty-print.c (debug_tree_chain): New.
      	(print_generic_expr): Handle TDF_CHAIN.
      	(dump_generic_node): Handle BLOCK.
      	Do not abort with incomplete SWITCH_EXPRs.
      	Do not dump body of an OpenMP directive if TDF_SLIM is given.
      	<case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't
      	print space after directive name.
      	<OMP_FOR>: Handle printing OMP_FOR_PRE_BODY.
      	Handle OMP_MASTER and OMP_ORDERED.
      	Handle printing of OMP_BODY just in one place, goto
      	dump_omp_body in the rest of OMP_* nodes that have
      	OMP_BODY.
      	Don't handle clause nodes here.  Update omp statements to
      	use dump_omp_clauses.
      	Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION,
      	OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC,
      	OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF,
      	GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED,
      	GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE,
      	GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE.
      	Adjust output for GOMP_PARALLEL.
      	(dump_omp_clauses): New.
      	(print_declaration): Dump DECL_VALUE_EXPR.
      	(op_symbol_1): Split out of op_symbol.
      	(dumping_stmts): Remove.  Update all users.
      
      	* cgraph.c (cgraph_analyze_queue): New.
      	(cgraph_add_new_function): New.
      	* cgraph.h (cgraph_analyze_queue): Declare.
      	(cgraph_add_new_function): Declare.
      	(cgraph_lower_function): Remove.
      
      	* tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_*
      	nodes.  Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS
      	and TYPE_P nodes in its default clause.
      	(empty_body_p): New.
      	(tree_range_check_failed): New.
      	(build5_stat): New.
      
      	* tree.h (OMP_CLAUSE_REDUCTION_INIT,
      	OMP_CLAUSE_REDUCTION_MERGE,
      	OMP_CLAUSE_REDUCTION_PLACEHOLDER,
      	OMP_CLAUSE_PRIVATE_DEBUG,
      	OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY,
      	OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY,
      	OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND,
      	OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL,
      	OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR,
      	OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR,
      	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT,
      	OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT,
      	OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC,
      	OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST,
      	OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE
      	OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY,
      	OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY,
      	OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New.
      	(TREE_RANGE_CHECK): New.
      	(empty_body_p): Declare.
      	(enum omp_clause_default_kind): New.
      	(build_string_literal): Declare.
      	(enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New.
      	(build5_stat, build5): Declare.
      
      	* tree-pass.h (TDF_CHAIN): Define.
      	* tree-pass.h (PROP_gimple_lomp): Define.
      	(pass_lower_omp): Declare.
      
      	* diagnostic.h (debug_tree_chain): Declare.
      
      	* builtins.c (get_builtin_sync_mode): Use 0 as last argument to
      	mode_for_size.
      	(expand_builtin): Handle sync BUILT_IN_*_16 builtins.
      	* builtins.c (build_string_literal): Make extern.
      
      	* gcc.c (include_spec_function): New.
      	(static_spec_functions): Add it.
      	(main): Move load of libgomp.spec ...
      	(LINK_COMMAND_SPEC): ... here.
      	(link_gomp_spec): New.
      	(static_specs): Include it.
      	(LINK_COMMAND_SPEC): Add link_gomp.
      	(GOMP_SELF_SPECS): New.
      	(driver_self_specs): Include it.
      	(switch_matches): Don't mark inline.
      	(main): Load libgomp.spec.
      
      	* tree-gimple.c (is_gimple_stmt): True for OMP_MASTER,
      	OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION,
      	and OMP_SINGLE, OMP_FOR and OMP_PARALLEL.
      
      	* tree-gimple.h (enum omp_parallel): Declare.
      	(determine_parallel_type): Declare.
      	(omp_firstprivatize_variable): Declare.
      	(omp_reduction_init): Declare.
      	(diagnose_omp_structured_block_errors): Declare.
      	(struct walk_stmt_info): Add want_return_expr.
      	(struct walk_stmt_info): Add want_bind_expr, want_locations.
      	(find_omp_clause): Declare.
      	(insert_field_into_struct): Declare.
      	(struct walk_stmt_info): Move from tree-nested.c
      	(walk_stmts): Declare.
      
      	* c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP
      	to 200505.
      
      	* cgraphunit.c (cgraph_lower_function): Make static.
      	(cgraph_finalize_pending_functions): New.
      	(cgraph_finalize_function): Call it.
      	(cgraph_finalize_compilation_unit): Likewise.
      
      	* builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
      	BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
      	(BT_FN_UINT_UINT): New.
      	(DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7,
      	DEF_FUNCTION_TYPE_VAR_4): Document.
      	(BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT,
      	BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR,
      	BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT,
      	BT_FN_VOID_OMPFN_PTR_UINT_UINT,
      	BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
      	BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
      	BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New.
      
      	* builtins.def: Update DEF_BUILTIN comment to include COND argument.
      	Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins
      	into separate files.
      	(DEF_GOMP_BUILTIN): New.
      	(BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER,
      	BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END,
      	BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END,
      	BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START,
      	BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START,
      	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
      	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START,
      	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START,
      	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
      	BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT,
      	BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT,
      	BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT,
      	BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT,
      	BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT,
      	BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT,
      	BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
      	BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
      	BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT,
      	BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END,
      	BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
      	BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT,
      	BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END,
      	BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START,
      	BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New.
      	* sync-builtins.def: New file, moved from builtins.def.
      	* omp-builtins.def: New file, moved from builtins.def.
      
      	* c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.
      
      	* gimple-low.c (lower_function_body): Clear data.
      	(lower_stmt): Do not handle COMPOUND_EXPR.
      	Remove call to print_node_brief.
      
      	* c-tree.h (c_finish_omp_clauses): New prototype.
      	(C_DECL_THREADPRIVATE_P): Define.
      	(lookup_name_no_remap, c_omp_remap_private): Remove
      	(c_begin_omp_parallel, c_finish_omp_parallel): Update.
      	(check_for_loop_decls): Update decl.
      	(lookup_name_no_remap, c_omp_remap_private): Declare.
      	(build_indirect_ref, build_modify_expr, pushdecl,
      	pushdecl_top_level): Move to c-common.h.
      
      	* dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp
      	before the switch, but just in the 2 places that need it.
      
      	* c-decl.c (diagnose_mismatched_decls): Do not check for
      	mismatched thread-local attributes when OLDDECL is marked
      	threadprivate and NEWDECL has no thread-local attributes.
      	(merge_decls): Merge C_DECL_THREADPRIVATE_P.
      	(c_gimple_diagnostics_recursively): Rename from
      	c_warn_unused_result_recursively.  Invoke
      	diagnose_omp_structured_block_errors.
      	(check_for_loop_decls): Return a singular decl found.
      
      	* langhooks.c (lhd_omp_predetermined_sharing): Return
      	OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls.
      	(lhd_omp_firstprivatize_type_sizes): New.
      	(lhd_omp_assignment): New.
      	(lhd_omp_predetermined_sharing): New.
      
      	* langhooks.h (struct gimplify_omp_ctx): Forward declare.
      	(struct lang_hooks_for_types): Add
      	omp_firstprivatize_type_sizes, omp_privatize_by_reference,
      	omp_predetermined_sharing, omp_disregard_value_expr,
      	omp_private_debug_clause, omp_clause_default_ctor,
      	omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor.
      
      	(c_finish_omp_clauses): New.
      	(c_finish_bc_stmt): Diagnose break within omp for.
      	(c_begin_omp_parallel, c_finish_omp_parallel): New.
      	(build_unary_op): Return error_mark after reporting
      	a readonly_error.
      	(build_modify_expr): Likewise.
      
      	* gimplify.c: Include optabs.h and pointer-set.h.
      	(enum gimplify_omp_var_data): Declare.
      	(struct gimplify_omp_ctx): Declare.
      	(struct gimplify_ctx): Add fields prev_context, combined_pre_p
      	and combined_ctxp.
      	(gimplify_ctxp, gimplify_omp_ctxp): New local variables.
      	(push_gimplify_context, pop_gimplify_context): Allow nesting.
      	(splay_tree_compare_decl_uid): New.
      	(new_omp_context): New.
      	(delete_omp_context): New.
      	(gimple_add_tmp_var): Call omp_add_variable.
      	(gimplify_bind_expr): Likewise.
      	(gimplify_var_or_parm_decl): If omp_notice_variable returned
      	true, disregard DECL_VALUE_EXPR on the decl if any.
      	(gimplify_expr_in_ctx): New.
      	(omp_firstprivatize_variable, omp_firstprivatize_type_sizes
      	omp_add_variable, omp_notice_variable, omp_is_private
      	gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1
      	gimplify_adjust_omp_clauses, gimplify_omp_parallel
      	gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p
      	gimplify_omp_atomic_fetch_op, goa_stabilize_expr
      	gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex
      	gimplify_omp_atomic): New.
      	(gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
      	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
      	OMP_CRITICAL and OMP_ATOMIC.
      	(gimplify_body): Verify gimplify_ctxp is empty after gimplification.
      
      	* c-pragma.h (enum pragma_kind): Add
      	PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER,
      	PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR,
      	PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED,
      	PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR,
      	PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION,
      	PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE,
      	PRAGMA_OMP_THREADPRIVATE.
      
      	* tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS,
      	OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED,
      	OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE,
      	OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE,
      	OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION,
      	OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE,
      	OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS,
      	OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT,
      	OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define.
      
      	* print-tree.c (print_node): Dump DECL_VALUE_EXPR.
      
      	* tree-ssa-dce.c (find_control_dependence): Do not assume that
      	ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR).
      
      	* tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for
      	OpenMP directives.
      	(struct nesting_info): Add field_map,
      	suppress_expansion, debug_var_chain.
      	(create_nesting_tree): Initialize them.
      	(lookup_field_for_decl): Use field_map.
      	(get_nonlocal_debug_decl, get_local_debug_decl): New.
      	(convert_local_omp_clauses): New.
      	(finalize_nesting_tree_1): Add debug_var_chain to toplevel block.
      	(walk_body): Split out of walk_function.
      	(convert_nonlocal_omp_clauses, convert_local_omp_clauses): New.
      	(convert_nonlocal_reference): Handle omp statements.
      	(convert_local_reference): Likewise.
      	(unnest_nesting_tree_1): Split out of finalize_nesting_tree_1.
      	(unnest_nesting_tree): New.
      	(lower_nested_functions): Call it.
      	(insert_field_into_struct): Make extern.
      	(struct walk_stmt_info): Move to tree-gimple.h.
      	(walk_stmts): Make extern.
      
      	* omp-builtins.def: New file.
      
      	* tree-iterator.c (expr_only): Clarify comment.
      
      	* c-common.h (pushdecl_top_level, pushdecl,
      	build_modify_expr, build_indirect_ref,
      	c_finish_omp_master, c_finish_omp_critical,
      	c_finish_omp_ordered, c_finish_omp_barrier,
      	c_finish_omp_atomic, c_finish_omp_flush,
      	c_finish_omp_for, c_split_parallel_clauses,
      	omp_clause_default_kind, c_omp_sharing_predetermined,
      	c_omp_remap_decl): Declare.
      
      	* Makefile.in (BUILTINS_DEF): Add omp-builtins.def.
      	(OBJS-common): Add omp-low.o.
      	(c-omp.o, omp-low.o): Add.
      	(gimplify.o): Add dependency on $(OPTABS_H).
      	(GTFILES): Add omp-low.c.
      	(gt-stringpool.h): Add.
      
      	* tree-cfg.c (set_bb_for_stmt): Do not update the
      	block-to-labels map if we are currently expanding to RTL.
      	(tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P
      	checks.
      	Handle IDENTIFIER_NODE.
      	(tree_verify_flow_info): Do not ICE when emitting error
      	messages about invalid labels.
      	(dump_function_to_file): Reset CFUN before emitting the body
      	of the function.
      	(debug_function): New.
      
      	* passes.c (init_optimization_passes): Schedule
      	pass_lower_omp.
      
      	* langhooks-def.h (lhd_omp_predetermined_sharing,
      	lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes):
      	Declare.
      	(LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define.
      	(LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it.
      	(LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE,
      	LANG_HOOKS_OMP_PREDETERMINED_SHARING,
      	LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR,
      	LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE,
      	LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR,
      	LANG_HOOKS_OMP_CLAUSE_COPY_CTOR,
      	LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP,
      	LANG_HOOKS_OMP_CLAUSE_DTOR): Define.
      	(LANG_HOOK_DECLS): Use them.
      
      
      2006-01-18  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
      	    Richard Henderson  <rth@redhat.com>
      	    Jakub Jelinek  <jakub@redhat.com>
                  Diego Novillo  <dnovillo@redhat.com>
      
      	* c-parser.c (pragma_omp_clause): Define.
      	(c_parser_declaration_or_fndef): Document OpenMP syntax.
      	(c_parser_compound_statement): Likewise.
      	(c_parser_statement): Likewise.
      	(c_parser_pragma): Handle omp pragmas.
      	(OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK,
      	OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define.
      	(c_parser_omp_clause_name, check_no_duplicate_clause,
      	c_parser_omp_variable_list,
      	c_parser_omp_var_list_parens, c_parser_omp_clause_copyin,
      	c_parser_omp_clause_copyprivate,
      	c_parser_omp_clause_default,
      	c_parser_omp_clause_firstprivate, c_parser_omp_clause_if,
      	c_parser_omp_clause_lastprivate,
      	c_parser_omp_clause_nowait,
      	c_parser_omp_clause_num_threads,
      	c_parser_omp_clause_ordered, c_parser_omp_clause_private,
      	c_parser_omp_clause_reduction,
      	c_parser_omp_clause_schedule, c_parser_omp_clause_shared,
      	c_parser_omp_all_clauses, c_parser_omp_structured_block,
      	c_parser_omp_atomic, c_parser_omp_barrier,
      	c_parser_omp_critical, c_parser_omp_flush,
      	c_parser_omp_for_loop, c_parser_omp_for,
      	c_parser_omp_master, c_parser_omp_ordered,
      	c_parser_omp_sections_scope, c_parser_omp_sections,
      	c_parser_omp_parallel, c_parser_omp_single,
      	c_parser_omp_construct, c_parser_omp_threadprivate): New.
      	* c-pragma.c (init_pragma): Do omp pragma registration here.
      	* c.opt (fopenmp): New flag.
      
      
      2006-01-18  Eric Christopher  <echristo@apple.com>
      
      	* gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif.
      	* config/darwin.h (GOMP_SELF_SPECS): Define.
      
      
      testsuite/
      
      2006-01-18  Richard Henderson  <rth@redhat.com>
                  Aldy Hernandez  <aldyh@redhat.com>
      	    Jakub Jelinek  <jakub@redhat.com>
                  Diego Novillo  <dnovillo@redhat.com>
                  Uros Bizjak  <uros@kss-loka.si>
      
      	* testsuite/gcc.dg/gomp: New directory.
      
      From-SVN: r109902
      Diego Novillo committed
  40. 23 Dec, 2005 1 commit
    • backport: builtins.def: Move all DEF_SYNC_BUILTIN to ... · a0274e3e
              Merge from gomp-branch.
              * builtins.def: Move all DEF_SYNC_BUILTIN to ...
              * sync-builtins.def: ... new file.
              (BUILT_IN_FETCH_AND_ADD_16,
              BUILT_IN_FETCH_AND_SUB_16, BUILT_IN_FETCH_AND_OR_16,
              BUILT_IN_FETCH_AND_AND_16, BUILT_IN_FETCH_AND_XOR_16,
              BUILT_IN_FETCH_AND_NAND_16, BUILT_IN_ADD_AND_FETCH_16,
              BUILT_IN_SUB_AND_FETCH_16, BUILT_IN_OR_AND_FETCH_16,
              BUILT_IN_AND_AND_FETCH_16, BUILT_IN_XOR_AND_FETCH_16,
              BUILT_IN_NAND_AND_FETCH_16, BUILT_IN_BOOL_COMPARE_AND_SWAP_16,
              BUILT_IN_VAL_COMPARE_AND_SWAP_16, BUILT_IN_LOCK_TEST_AND_SET_16,
              BUILT_IN_LOCK_RELEASE_16): New builtins.
              * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
              BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
              * builtins.c (expand_builtin): Handle sync BUILT_IN_*_16 builtins.
              * c-common.c (enum c_builtin_type): Move to top-level from
              c_common_nodes_and_builtins enum builtin_type.
              (builtin_types): Move from c_common_nodes_and_builtins.
              (def_fn_type): New.
              (c_common_nodes_and_builtins): Use it.
              (def_builtin_1): Check for error_mark_node.
              (sync_resolve_size): Handle also 128 bit sync builtins.
              * Makefile.in (BUILTINS_DEF): New.  Use it instead of builtins.def.
      
              * config/i386/i386.h (x86_cmpxchg8b, x86_cmpxchg16b): New decls.
              (TARGET_CMPXCHG8B, TARGET_CMPXCHG16B): Define.
              * config/i386/i386.c (x86_cmpxchg8b, x86_cmpxchg16b): New variables.
              * config/i386/sync.md (CASMODE, DCASMODE): New mode macros.
              (doublemodesuffix, DCASHMODE): New mode attrs.
              (sync_compare_and_swap<mode>): Change into expand, use CASMODE
              instead of IMODE, if mode is wider than a word, expand into
              sync_double_compare_and_swap*.
              (*sync_compare_and_swap<mode>): New insn.
              (sync_double_compare_and_swap<mode>): Likewise.
              (*sync_double_compare_and_swapdi_pic): Likewise.
              (sync_compare_and_swap_cc<mode>): Use CASMODE instead of IMODE, if
              mode is wider than a word, expand into
              sync_double_compare_and_swap_cc*.
              (sync_double_compare_and_swap_cc<mode>): New insn.
              (*sync_double_compare_and_swap_ccdi_pic): Likewise.
      
      From-SVN: r108997
      Jakub Jelinek committed