Re-factor tree.h - Part 1.

This is the first patch in a series of patches to cleanup tree.h to
reduce the exposure it has all over the compiler.

In this patch, I'm moving functions that are used once into the files
that use them, and make them private to that file. These functions
were declared extern in tree.h and called from exactly one place.

The patch does not move EVERY function. This usually happens
when the function uses private state from its original file, and
moving that private state would mean moving other functions that made
no sense to move.

Additionally, the patch removes functions that were never used.

In subsequent patches, I will be moving out of tree.h extern definitions
that should be grouped in other files (e.g., all functions defined in
some FOO.c will be moved to the corresponding FOO.h). This will allow
me to remove the inclusion of tree.h from some files.

    * attribs.c (lookup_scoped_attribute_spec): Make static.
    (get_attribute_namespace): Likewise.
    * builtins.c (more_const_call_expr_args_p): Move from
    tree.h.
    (validate_arglist): Move earlier in the file. Make static.
    (expand_stack_restore): Move from stmt.c
    (expand_stack_save): Move from stmt.c
    (rewrite_call_expr_array): Move earlier in the file.
    (rewrite_call_expr_valist): Likewise.
    * cfgexpand.c: Include hard-reg-set.h before tree.h
    Include recog.h.
    Include output.h.
    (expand_asm_loc): Move from stmt.c.
    (n_occurrences): Move from stmt.c.
    (check_operand_nalternatives): Move from stmt.c.
    (tree_conflicts_with_clobbers_p): Move from stmt.c.
    (expand_asm_operands): Move from stmt.c
    (expand_asm_stmt): Move from stmt.c
    (expand_computed_goto): Move from stmt.c
    (expand_goto): Move from stmt.c
    (expand_null_return_1): Move from stmt.c
    (expand_null_return): Move from stmt.c
    (expand_value_return): Move from stmt.c
    (expand_return): Move from stmt.c
    (expand_main_function): Move from function.c
    (stack_protect_prologue): Move from function.c
    * cgraphclones.c (build_function_type_skip_args): Move from tree.c.
    (build_function_decl_skip_args): Move from tree.c.
    * explow.c (tree_expr_size): Move from tree.c.
    * expr.c (addr_expr_of_non_mem_decl_p): Remove.
    (fields_length): Move from tree.c.
    * fold-const.c (size_low_cst): Move from tree.c.
    (tree_expr_nonzero_warnv_p): Make static. Move earlier in the file.
    (tree_expr_nonzero_p): Make static. Move earlier in the file.
    (fold_build3_initializer_loc): Remove.
    (tree_invalid_nonnegative_warnv_p): Make static.
    * function.c (expand_main_function): Move to cfgexpand.c.
    (stack_protect_prologue): Move to cfgexpand.c.
    (set_insn_locations): Move earlier in the file.
    * gimple-fold.c: Include langhooks.h.
    (truth_type_for): Move from tree.c.
    * print-tree.c (print_vec_tree): Remove.
    * stmt.c (expand_computed_goto): Move to cfgexpand.c.
    (expand_goto): Move to cfgexpand.c.
    (n_occurrences): Move to cfgexpand.c.
    (expand_asm_loc): Move to cfgexpand.c
    (tree_conflicts_with_clobbers_p): Move to cfgexpand.c.
    (expand_asm_operands): Move to cfgexpand.c.
    (expand_asm_stmt): Move to cfgexpand.c.
    (check_operand_nalternatives): Move to cfgexpand.c
    (expand_null_return): Move to cfgexpand.c.
    (expand_value_return): Move to cfgexpand.c.
    (expand_null_return_1): Move to cfgexpand.c.
    (expand_return): Move to cfgexpand.c.
    (expand_stack_save): Move to builtins.c.
    (expand_stack_restore): Move to builtins.c
    * symtab.c: Include output.h.
    (decl_assembler_name_hash): Move from tree.c.
    (decl_assembler_name_equal): Move from tree.c.
    * trans-mem.c (is_tm_safe_or_pure): Move from tree.h.
    * tree-eh.c (in_array_bounds_p): Move from tree.c.
    (range_in_array_bounds_p): Move from tree.c.
    * tree-object-size.c (fini_object_sizes): Make static.
    * tree-ssa-dom.c (iterative_hash_exprs_commutative): Move from tree.h.
    * tree-vrp.c (ssa_name_nonnegative_p): Remove.
    * tree.c (decl_assembler_name_equal): Move to symtab.c.
    (tree_expr_size): Move to explow.c.
    (decl_assembler_name_hash): Move to symtab.c.
    (real_twop): Remove.
    (tree_expr_size): Move to explow.c.
    (stabilize_reference_1): Move earlier in the file. Make static.
    (omp_remove_redundant_declare_simd_attrs): Remove.
    (simple_cst_list_equal): Move earlier in the file. Make static.
    (size_low_cst): Move to fold-const.c.
    (build_type_no_quals): Remove.
    (build_function_type_skip_args): Move to cgraphclones.c.
    (build_function_decl_skip_args): Move to cgraphclones.c.
    (in_array_bounds_p): Move to tree-eh.c.
    (range_in_array_bounds_p): Move to tree-eh.c.
    (truth_type_for): Move to gimple-fold.c.
    (list_equal_p): remove.
    * tree.h (decl_assembler_name_equal): Remove.
    (decl_assembler_name_hash): Remove.
    (truth_type_for): Remove.
    (build_type_no_quals): Remove.
    (build_function_decl_skip_args): Remove.
    (in_array_bounds_p): Remove.
    (range_in_array_bounds_p): Remove.
    (size_low_cst): Remove.
    (omp_remove_redundant_declare_simd_attrs): Remove.
    (tree_expr_size): Remove.
    (fields_length): Remove.
    (stabilize_reference_1): Remove.
    (expand_goto): Remove.
    (expand_stack_save): Remove.
    (expand_stack_restore): Remove.
    (expand_return): Remove.
    (fold_build3_initializer_loc): Remove.
    (tree_expr_nonzero_p): Remove.
    (tree_invalid_nonnegative_warnv_p): Remove.
    (tree_expr_nonzero_warnv_p): Remove.
    (fold_builtin_snprintf_chk): Remove.
    (validate_arglist): Remove.
    (iterative_hash_exprs_commutative): Move to tree-ssa-dom.c.
    (simple_cst_list_equal): Remove.
    (real_twop): Remove.
    (expand_main_function): Remove.
    (stack_protect_prologue): Remove.
    (print_vec_tree): Remove.
    (lookup_scoped_attribute_spec): Remove.
    (get_attribute_namespace): Remove.
    (expand_computed_goto): Remove.
    (expand_asm_stmt): Remove.
    (list_equal_p): Remove.
    (ssa_name_nonnegative_p): Remove.
    (fini_object_sizes): Remove.
    (addr_expr_of_non_mem_decl_p): Remove.
    (is_tm_safe_or_pure): Move to trans-mem.c.
    (more_const_call_expr_args_p): Remove.
    (save_vtable_map_decl): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204606 138bc75d-0d04-0410-961f-82ee72b054a4
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204611 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/
	* target.def (can_use_doloop_p): New hook.
	* doc/tm.texi.in (TARGET_CAN_USE_DOLOOP_P): Add.
	* doc/tm.texi: Regenerate.
	* doc/md.texi (doloop_begin, doloop_end): Update documentation.
	* hooks.h (hook_bool_dint_dint_uint_true): Declare.
	* hooks.c (hook_bool_dint_dint_uint_true): New function.
	* targhooks.h (can_use_doloop_if_innermost): Declare.
	* targhooks.c (can_use_doloop_if_innermost): New function.
	* target.h: Include double-int.h.
	* loop-doloop.c (doloop_optimize): Call targetm.can_use_doloop_p.
	Remove iteration count, maximum iteration count, loop depth and
	enter-at-top inputs from doloop_begin and doloop_end.
	* config/arc/arc.md (doloop_begin, doloop_end): Update for new
	interface.
	* config/arc/arc.c (arc_can_use_doloop_p): New function.
	(TARGET_CAN_USE_DOLOOP_P): Define.
	* config/arm/thumb2.md (doloop_end): Update for new interface.
	* config/arm/arm.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/bfin/bfin.md (doloop_end): Update for new interface.
	* config/bfin/bfin.c (bfin_can_use_doloop_p): New function.
	(TARGET_CAN_USE_DOLOOP_P): Define.
	* config/c6x/c6x.md (doloop_end): Update for new interface.
	* config/ia64/ia64.md (doloop_end): Update for new interface.
	* config/ia64/ia64.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/mep/mep.md (doloop_begin, doloop_end): Update for new
	interface.
	* config/mep/mep.c (mep_emit_doloop): Likewise.
	(TARGET_CAN_USE_DOLOOP_P): Define.
	* config/rs6000/rs6000.md (doloop_end): Update for new interface.
	* config/rs6000/rs6000.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/s390/s390.md (doloop_end): Update for new interface.
	* config/sh/sh.md (doloop_end): Likewise.
	* config/spu/spu.md (doloop_end): Likewise.
	* config/spu/spu.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/tilegx/tilegx.md (doloop_end): Update for new interface.
	* config/tilegx/tilegx.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/tilepro/tilepro.md (doloop_end): Update for new interface.
	* config/tilepro/tilepro.c (TARGET_CAN_USE_DOLOOP_P): Define.
	* config/v850/v850.md (doloop_begin, doloop_end): Update for new
	interface.
	* config/v850/v850.c (TARGET_CAN_USE_DOLOOP_P): Define.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204614 138bc75d-0d04-0410-961f-82ee72b054a4
	PR libstdc++/58982
	* include/bits/stl_algobase.h (__copy_move::__copy_m): Use assertion
	to prevent using memmove() on non-assignable types.
	(__copy_move_backward::__copy_move_b): Likewise.
	* include/bits/stl_uninitialized.h (uninitialized_copy
	uninitialized_copy_n, uninitialized_fill, uninitialized_fill_n,
	__uninitialized_default, __uninitialized_default_n): Check for
	assignable as well as trivial.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/
	58982.cc: New.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
	58982.cc: New.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill/
	58982.cc: New.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
	58982.cc: New.
	* testsuite/25_algorithms/copy/58982.cc: New.
	* testsuite/25_algorithms/copy_n/58982.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204615 138bc75d-0d04-0410-961f-82ee72b054a4
runtime: Correct flag (FlagNoGC => FlagNoInvokeGC).


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204617 138bc75d-0d04-0410-961f-82ee72b054a4
	* c-common.c (atomic_size_supported_p): New function.
	(resolve_overloaded_atomic_exchange)
	(resolve_overloaded_atomic_compare_exchange)
	(resolve_overloaded_atomic_load, resolve_overloaded_atomic_store):
	Use it instead of comparing size with a local list of sizes.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204618 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-09  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

	* function.c (NAME__MAIN): Move to...
	* cfgexpand.c (NAME__MAIN): ...here.

[BR]: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg01003.html


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204620 138bc75d-0d04-0410-961f-82ee72b054a4
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204623 138bc75d-0d04-0410-961f-82ee72b054a4
	* config/x86/fenv.c: New file.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204634 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-10  Kai Tietz  <ktietz@redhat.com>

	* config/i386/cygming-crtbegin.c (__gcc_register_frame):
	Increment load-count on use of LIBGCC_SONAME DLL.
	(hmod_libgcc): New static variable to hold handle of
	LIBGCC_SONAME DLL.
	(__gcc_deregister_frame): Decrement load-count of
	LIBGCC_SONAME DLL.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204635 138bc75d-0d04-0410-961f-82ee72b054a4
	* mode-switching.c (optimize_mode_switching): Mark block as
	nontransparent, if last_mode at block exit is different from no_mode.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204649 138bc75d-0d04-0410-961f-82ee72b054a4
        PR plugin/52862
        * configure.ac: Adding for exported symbols check
        and for rdynamic-check executable-extension.
        * configure: Regenerated.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204650 138bc75d-0d04-0410-961f-82ee72b054a4
Fixed typo about bug-number ...

        PR plugin/52872
        * configure.ac: Adding for exported symbols check
        and for rdynamic-check executable-extension.
        * configure: Regenerated.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204651 138bc75d-0d04-0410-961f-82ee72b054a4
Set close-on-exec flag when opening files.

2013-11-10  Janne Blomqvist  <jb@gcc.gnu.org>

	* configure.ac: Check presence of mkostemp.
	* io/unix.c (set_close_on_exec): New function.
	(tempfile_open): Use mkostemp and O_CLOEXEC if available, fallback
	to calling set_close_on_exec.
	(regular_file): Add O_CLOEXEC to flags if defined.
	(open_external): Call set_close_on_exec if O_CLOEXEC is not
	defined.
	* config.h.in: Regenerated.
	* configure: Regenerated.
	* Makefile.in: Regenerated.
	* aclocal.m4: Regenerated.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204654 138bc75d-0d04-0410-961f-82ee72b054a4
2013-11-10  Paolo Carlini  <paolo.carlini@oracle.com>

	* cvt.c (cp_convert_to_pointer): Call build_ptrmemfunc before
	maybe_warn_zero_as_null_pointer_constant to avoid duplicate
	-Wzero-as-null-pointer-constant diagnostics.

	* typeck.c (build_ptrmemfunc): Use cp_build_c_cast.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204655 138bc75d-0d04-0410-961f-82ee72b054a4
Daily bump.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204658 138bc75d-0d04-0410-961f-82ee72b054a4
       * tree-ssa-threadupdate.c (mark_threaded_blocks): Truncate jump
        threading paths first, then perform PHI node checks if applicable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204659 138bc75d-0d04-0410-961f-82ee72b054a4
        * config/arc/arc.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Define.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204666 138bc75d-0d04-0410-961f-82ee72b054a4
	* config.host (arm-wrs-vxworks): Replace arm/t-vxworks with arm/t-elf
	in tmake_file.
	* config/arm/t-vxworks: Delete.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204669 138bc75d-0d04-0410-961f-82ee72b054a4
	PR libstdc++/54562
	* include/std/mutex (__timed_mutex_impl::__clock_t): Use
	high_resolution_clock for absolute timeouts, because
	pthread_mutex_timedlock uses CLOCK_REALTIME not CLOCK_MONOTONIC.
	(__timed_mutex_impl::_M_try_lock_for): Use steady_clock for relative
	timeouts as per [thread.req.timing].
	(__timed_mutex_impl::_M_try_lock_until<Clock,Duration>): Convert to
	__clock_t time point instead of using _M_try_lock_for.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204672 138bc75d-0d04-0410-961f-82ee72b054a4