Make all of gimple_omp_task_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_task_clauses): Strengthen param from
	const_gimple to const gomp_task *.
	(gimple_omp_task_child_fn): Likewise.
	(gimple_omp_task_data_arg): Likewise.
	(gimple_omp_task_copy_fn): Likewise.
	(gimple_omp_task_arg_size): Likewise.
	(gimple_omp_task_arg_align): Likewise.
	(gimple_omp_task_clauses_ptr): Strengthen param from gimple to
	gomp_task *.
	(gimple_omp_task_set_clauses): Likewise.
	(gimple_omp_task_child_fn_ptr): Likewise.
	(gimple_omp_task_set_child_fn): Likewise.
	(gimple_omp_task_data_arg_ptr): Likewise.
	(gimple_omp_task_set_data_arg): Likewise.
	(gimple_omp_task_copy_fn_ptr): Likewise.
	(gimple_omp_task_set_copy_fn): Likewise.
	(gimple_omp_task_arg_size_ptr): Likewise.
	(gimple_omp_task_set_arg_size): Likewise.
	(gimple_omp_task_arg_align_ptr): Likewise.
	(gimple_omp_task_set_arg_align): Likewise.

	* cgraphbuild.c (pass_build_cgraph_edges::execute): Replace check
	for GIMPLE_OMP_TASK with a dyn_cast, introducing local "omp_task"
	and using it in place of "stmt" for typesafety.
	* gimple-walk.c (walk_gimple_op): Within case GIMPLE_OMP_TASK,
	introduce local "omp_task" via a checked cast, using it in place
	of "stmt" for typesafety.
	* gimple.c (gimple_copy): Likewise, introducing locals
	"omp_task_stmt" and "omp_task_copy".
	* omp-low.c (create_omp_child_function): Add a checked cast.
	(finish_taskreg_scan): Add checked casts.
	(optimize_omp_library_calls): Add a checked cast.
	(lower_depend_clauses): Strengthen param "stmt" from gimple to
	gomp_task *.
	(lower_omp_taskreg): Add a checked cast.
	* tree-inline.c (remap_gimple_stmt): Within case GIMPLE_OMP_TASK,
	introduce local "omp_task_stmt" via a checked cast, using it in
	place of "stmt" for typesafety.
Make all gimple_omp_for_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_for_kind): Strengthen param from
	const_gimple to const gomp_for *.
	(gimple_omp_for_combined_p): Likewise.
	(gimple_omp_for_combined_into_p): Likewise.
	(gimple_omp_for_clauses): Likewise.
	(gimple_omp_for_index): Likewise.
	(gimple_omp_for_initial): Likewise.
	(gimple_omp_for_final): Likewise.
	(gimple_omp_for_incr): Likewise.
	(gimple_omp_for_pre_body): Likewise.
	(gimple_omp_for_cond): Likewise.
	(gimple_omp_for_clauses_ptr): Strengthen param from gimple to
	gomp_for *.
	(gimple_omp_for_set_clauses): Likewise.
	(gimple_omp_for_index_ptr): Likewise.
	(gimple_omp_for_set_index): Likewise.
	(gimple_omp_for_initial_ptr): Likewise.
	(gimple_omp_for_set_initial): Likewise.
	(gimple_omp_for_final_ptr): Likewise.
	(gimple_omp_for_set_final): Likewise.
	(gimple_omp_for_incr_ptr): Likewise.
	(gimple_omp_for_set_incr): Likewise.
	(gimple_omp_for_pre_body_ptr): Likewise.
	(gimple_omp_for_set_pre_body): Likewise.
	(gimple_omp_for_set_cond): Likewise.
	(gimple_omp_for_collapse): Strengthen param from gimple to
	const gomp_for *.

	* gimple-walk.c (walk_gimple_op): Within case GIMPLE_OMP_FOR,
	introduce local "omp_for_stmt" via a checked cast and use it in
	place of "stmt" for typesafety.
	(walk_gimple_stmt): Add checked cast.
	* gimple.c (gimple_copy): Within case GIMPLE_OMP_FOR, introduce
	locals "omp_for_stmt" and "omp_for_copy" via checked casts and use
	them in place of "stmt" and "copy" for typesafety.
	* omp-low.c (determine_parallel_type): Add a checked cast.
	(build_outer_var_ref): Likewise.
	(find_combined_for): Within case GIMPLE_OMP_FOR,
	introduce local "omp_for_stmt" via a checked cast and use it in
	place of "stmt" for typesafety.
	(check_omp_nesting_restrictions): Add checked casts.
	(check_omp_nesting_restrictions): Likewise.  Within
	case GIMPLE_OMP_FOR, introduce local "omp_for_stmt" via a checked
	cast and use it in place of "stmt" for typesafety.
	(scan_omp_1_stmt): Add checked cast.
	(lower_rec_simd_input_clauses): Likewise.
	(lower_rec_input_clauses): Likewise.  Introduce two locals named
	"omp_for_ctx_stmt" via checked casts and use them in place of
	"ctx->stmt" for typesafety.
	(lower_lastprivate_clauses): Add checked cast.
	(lower_reduction_clauses): Likewise.
	(expand_omp_for_init_vars): Likewise.
	(expand_omp_for_generic): Introduce local "omp_for_inner_stmt" via
	a checked cast and use in place of "inner_stmt" for typesafety.
	(expand_omp_for_static_nochunk): Add checked cast.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_for): Introduce local "omp_for_stmt" via a checked
	cast and use in place of "last_stmt (region->entry)" for
	typesafety.
	(expand_omp): Add a checked cast.
	(diagnose_sb_0): Add checked casts.
	(diagnose_sb_1): Within	case GIMPLE_OMP_FOR, introduce local
	"omp_for_stmt" via a checked cast and use it in place of "stmt" for
	typesafety.
	(diagnose_sb_2): Likewise.
	* tree-inline.c (remap_gimple_stmt): Likewise, introducing locals
	"omp_for_stmt" and "omp_for_copy", using in place of "stmt" and
	"copy".
	(estimate_num_insns): Likewise, introducing local "omp_for_stmt"
	for use in place of "stmt".
	* tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
	(convert_local_reference_stmt): Likewise.
	(convert_gimple_call): Add a checked cast.
Make remaining gimple_omp_teams_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_teams_clauses): Strengthen param from
	const_gimple to const gomp_teams *.
	(gimple_omp_teams_clauses_ptr): Strengthen param from gimple to
	gomp_teams *.

	* gimple-walk.c (walk_gimple_op): Add checked cast.
	* tree-inline.c (remap_gimple_stmt): Within case GIMPLE_OMP_TEAMS,
	introduce local "omp_teams_stmt" via a checked cast, and use in
	place of "stmt".
	* tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
	(convert_local_reference_stmt): Likewise.
Make all gimple_omp_sections_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_sections_clauses): Strengthen param from
	const_gimple to const gomp_sections *.
	(gimple_omp_sections_control): Likewise.
	(gimple_omp_sections_clauses_ptr): Strengthen param from gimple to
	gomp_sections *.
	(gimple_omp_sections_set_clauses): Likewise.
	(gimple_omp_sections_control_ptr): Likewise.
	(gimple_omp_sections_set_control): Likewise.

	* gimple-walk.c (walk_gimple_op): Within case GIMPLE_OMP_SECTIONS,
	introduce local "omp_sections_stmt" via a checked cast and use it
	in place of "stmt" for typesafety.
	* gimple.c (gimple_copy): Likewise, introducing locals
	"omp_sections_stmt" and "omp_sections_copy", using them in place
	of "stmt" and "copy".
	* omp-low.c (check_omp_nesting_restrictions): Add checked casts.
	* tree-inline.c (remap_gimple_stmt): Within case
	GIMPLE_OMP_SECTIONS, introduce local "omp_sections_stmt" via a
	checked cast and use it in place of "stmt" for typesafety.
	* tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
	(convert_local_reference_stmt): Likewise.
Make all gimple_omp_return_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (struct gimple_statement_omp_return): Rename to...
	(struct gomp_return): ...this.
	(is_a_helper <gimple_statement_omp_return *>::test): Rename to...
	(is_a_helper <gomp_return *>::test): ...this.
	(is_a_helper <const gimple_statement_omp_return *>::test): Rename to...
	(is_a_helper <const gomp_return *>::test): ...this.
	(gimple_build_omp_return): Strengthen return type from gimple to
	gomp_return *.
	(gimple_omp_return_set_nowait): Likewise for param.
	(gimple_omp_return_set_lhs): Likewise.
	(gimple_omp_return_lhs_ptr): Likewise.
	(gimple_omp_return_nowait_p): Strengthen param from const_gimple
	to const gomp_return *.
	(gimple_omp_return_lhs): Likewise.

	* gimple-pretty-print.c (dump_gimple_omp_return): Strengthen param
	from gimple to gomp_return *.
	(pp_gimple_stmt_1): Add checked cast.
	* gimple-walk.c (walk_gimple_op): Likewise.
	* gimple.c (gimple_build_omp_return): Strengthen return type and
	local "p" from gimple to gomp_return *.
	* omp-low.c (remove_exit_barrier): Replace check against
	GIMPLE_OMP_RETURN with a dyn_cast, introducing local
	"omp_return_stmt" and using it in place of "stmt".
	(expand_omp_for_generic): Introduce local "omp_return_stmt" via a
	checked cast, using it in place of "gsi_stmt (gsi)".
	(expand_omp_for_static_nochunk): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_sections): Introduce local "omp_return_stmt" via a
	checked cast, using it in place of "gsi_stmt (si)".
	(expand_omp_single): Likewise.
	(maybe_add_implicit_barrier_cancel): Strengthen local "omp_return"
	from gimple to gomp_return * via a checked cast.
Convert remaining gimple_omp_single_ accessors to be typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_single_clauses): Strengthen param from
	const_gimple to const gomp_single *.
	(gimple_omp_single_clauses_ptr): Strengthen param from gimple to
	gomp_single *.

	* gimple-walk.c (walk_gimple_op): Add checked cast.
	* tree-inline.c (remap_gimple_stmt): Within case
	GIMPLE_OMP_SINGLE, introduce local "omp_single_stmt" via a
	checked cast and use in place of "stmt".
	* tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
	(convert_local_reference_stmt): Likewise.
Make remaining gimple_omp_target_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_target_clauses): Strengthen param from
	const_gimple to const gomp_target *.
	(gimple_omp_target_kind): Likewise.
	(gimple_omp_target_clauses_ptr): Strengthen param from gimple to
	gomp_target *.

	* gimple-walk.c (walk_gimple_op): Add checked cast.
	* omp-low.c (scan_sharing_clauses): Add checked casts.
	(create_omp_child_function): Likewise.
	(check_omp_nesting_restrictions): Likewise.
	(expand_omp_target): Likewise.
	(build_omp_regions_1): Likewise.
	(make_gimple_omp_edges): Likewise.
	* tree-inline.c (remap_gimple_stmt): Within case
	GIMPLE_OMP_TARGET, introduce local "omp_target_stmt" via a checked
	cast and use it in place of "stmt" for typesafety.
	* tree-nested.c (convert_nonlocal_reference_stmt): Likewise.
	(convert_local_reference_stmt): Likewise.
	(convert_tramp_reference_stmt): Add checked cast.
	(convert_gimple_call): Within case GIMPLE_OMP_TARGET, introduce
	local "omp_target_stmt" via a checked cast and use it in place of
	"stmt" for typesafety.
Make remainging gimple_omp_parallel_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_omp_parallel_combined_p): Strengthen param from
	const_gimple to const gomp_parallel *.
	(gimple_omp_parallel_clauses): Likewise.
	(gimple_omp_parallel_set_combined_p): Strengthen param from gimple
	to gomp_parallel *.

	* omp-low.c (get_ws_args_for): Add checked cast.
	(determine_parallel_type): Likewise.
	(create_omp_child_function): Likewise.
	(lower_lastprivate_clauses): Likewise.
	(expand_omp_taskreg): Likewise.
	(expand_omp_for_init_vars): Likewise.
	(expand_omp_for_static_nochunk): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(lower_omp_for): Likewise.
	(lower_omp_taskreg): Replace check against GIMPLE_OMP_PARALLEL
	with a dyn_cast, introducing local "par_stmt" and using it in
	place of "stmt" for typesafety.
Make remaining gimple_eh_filter_ accessors typesafe

gcc/ChangeLog.gimple-classes:
	* gimple.h (gimple_eh_filter_types): Strengthen param from
	const_gimple to const geh_filter *.
	(gimple_eh_filter_types_ptr): Strengthen param from gimple to
	geh_filter *.
	(gimple_eh_filter_failure_ptr): Likewise.
	(gimple_eh_filter_failure): Likewise.

	* gimple-low.c (lower_try_catch): Add a checked cast.
	(gimple_try_catch_may_fallthru): Likewise.
	* gimple-walk.c (walk_gimple_op): Likewise.
	(walk_gimple_stmt): Likewise.
	* omp-low.c (lower_omp_1): Likewise.
	* tree-cfg.c (verify_gimple_in_seq_2): Likewise.
	(do_warn_unused_result): Likewise.
	* tree-eh.c (collect_finally_tree): Likewise.
	(replace_goto_queue_1): Likewise.
	(lower_eh_filter): Strengthen local "inner" from gimple to
	geh_filter * via a checked cast.
	(refactor_eh_r): Add a checked cast.
	* tree-inline.c (remap_gimple_stmt): Within case
	GIMPLE_EH_FILTER, introduce local "filter_stmt" via a checked cast
	and use in place of "stmt".
	(estimate_num_insns): Add checked cast.
Introduce gpredict subclass and use it for all gimple_predict_ accessors

gcc/ChangeLog.gimple-classes:
	* coretypes.h (struct gpredict): Add forward declaration.
	* doc/gimple.texi (Class hierarchy of GIMPLE statements): Add
	gpredict.
	* gimple-pretty-print.c (pp_gimple_stmt_1): Within case
	GIMPLE_PREDICT, add local "predict_stmt" via a checked cast and
	use it in place of "stmt".
	* gimple.c (gimple_build_predict): Strengthen return type and
	local "p" from gimple to gpredict *.
	* gimple.h (struct gpredict): New subclass of
	gimple_statement_base, adding invariant that code is
	GIMPLE_PREDICT.
	(is_a_helper <gpredict *>::test): New.
	(gimple_build_predict): Strengthen return type from gimple to
	gpredict *.
	(gimple_predict_predictor): Strengthen param from const_gimple to
	const gpredict *.
	(gimple_predict_outcome): Likewise.
	(gimple_predict_set_predictor): Strengthen param from gimple to
	gpredict *.
	(gimple_predict_set_outcome): Likewise.
	* predict.c (tree_bb_level_predictions): Convert check for
	GIMPLE_PREDICT to a dyn_cast, introducing local "predict_stmt" and
	using it in place of "stmt" for typesafety.