Commit Graph

1475 Commits

Author SHA1 Message Date
Aldy Hernandez d39d05a75b dwarf2out.c (decl_ultimate_origin): Update comment.
* dwarf2out.c (decl_ultimate_origin): Update comment.
	* tree.c (block_ultimate_origin): Same.

From-SVN: r215396
2014-09-19 16:02:21 +00:00
Jan Hubicka f83fba1eb0 tree.c (need_assembler_name_p): Store C++ type mangling only for aggregates.
* tree.c (need_assembler_name_p): Store C++ type mangling only
	for aggregates.

From-SVN: r215238
2014-09-13 16:12:20 +00:00
Marek Polacek 8909b58efa tree.c (protected_set_expr_location): Don't check whether T is non-null here.
* tree.c (protected_set_expr_location): Don't check whether T is
	non-null here.

From-SVN: r215234
2014-09-13 05:59:47 +00:00
Marc Glisse d9a72d17e6 tree.c (integer_each_onep): New function.
2014-09-12  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* tree.c (integer_each_onep): New function.
	* tree.h (integer_each_onep): Declare it.
	* fold-const.c (fold_binary_loc): Use it for ~A + 1 to -A and
	-A - 1 to ~A.  Disable (X & 1) ^ 1, (X ^ 1) & 1 and ~X & 1 to
	(X & 1) == 0 for vector and complex.
gcc/testsuite/
	* gcc.dg/vec-andxor1.c: New file.

From-SVN: r215209
2014-09-12 10:42:47 +00:00
Jan Hubicka 1ee85ee19b common.opt (flto-odr-type-merging): New flag.
* common.opt (flto-odr-type-merging): New flag.
	* ipa-deivrt.c (hash_type_name): Use ODR names for hasing if availale.
	(types_same_for_odr): Likewise.
	(odr_subtypes_equivalent_p): Likewise.
	(add_type_duplicate): Do not walk type variants.
	(register_odr_type): New function.
	* ipa-utils.h (register_odr_type): Declare.
	(odr_type_p): New function.
	* langhooks.c (lhd_set_decl_assembler_name): Do not compute
	TYPE_DECLs
	* doc/invoke.texi (-flto-odr-type-merging): Document.
	* tree.c (need_assembler_name_p): Compute ODR names when asked
	for it.
	* tree.h (DECL_ASSEMBLER_NAME): Update comment.

	* lto.c (lto_read_decls): Register ODR types.

From-SVN: r215196
2014-09-11 23:16:42 +00:00
Aldy Hernandez 09f2f0aaa2 Revert mistakenly committed change.
From-SVN: r214917
2014-09-04 18:22:13 +00:00
Aldy Hernandez 60081a2b59 Merge remote-tracking branch 'origin/aldyh/debug-early' into debug-early
Conflicts:
	gcc/ChangeLog.debug-early
	gcc/dwarf2out.c

From-SVN: r214915
2014-09-04 18:08:42 +00:00
Aldy Hernandez 9de41e5786 Revert incorrect merging of debug-early branch.
From-SVN: r214914
2014-09-04 18:04:14 +00:00
Aldy Hernandez c5a3685015 Merge remote-tracking branch 'origin/aldyh/debug-early' into debug-early
Conflicts:
	gcc/ChangeLog.debug-early
	gcc/dwarf2out.c

From-SVN: r214912
2014-09-04 16:38:29 +00:00
Aldy Hernandez 989f386cf0 + * c/c-decl.c (write_global_declarations_1): Call global_decl() + with early=true.
+       * c/c-decl.c (write_global_declarations_1): Call global_decl()
+       with early=true.
+       (write_global_declarations_2): Call global_decl() with
+       early=false.
+       * dbxout.c (dbxout_global_decl): New argument.
+       * debug.c (do_nothing_debug_hooks): Use debug_nothing_tree_bool
+       for global_decl hook.
+       (debug_nothing_tree_bool): New.
+       (struct gcc_debug_hooks): New argument to global_decl.
+       * dwarf2out.c (output_die): Add misc debugging information.
+       (gen_variable_die): Do not reparent children.
+       (dwarf2out_global_decl): Add new documentation.  Add EARLY
+       argument.
+       (dwarf2out_decl): Make sure we don't generate new DIEs if we
+       already have a DIE.
+       * cp/name-lookup.c (do_namespace_alias): New argument to
+       global_decl debug hook.
+       * fortran/trans-decl.c (gfc_emit_parameter_debug_info): Same.
+       * godump.c (go_global_decl): Same.
+       * lto/lto-lang.c (lto_write_globals): Same.
+       * sdbout.c (sdbout_global_decl): Same.
+       * toplev.c (emit_debug_global_declarations): Same.
+       * vmsdbgout.c (vmsdbgout_global_decl): Same.
+       * tree.c (free_lang_data_in_decl): Do not call
+       dwarf2out_early_decl from here.

From-SVN: r214911
2014-09-04 16:38:21 +00:00
Aldy Hernandez 73179e4a24 dearly: Emit DIEs for decls early in the compilation process.
This is the original patch from Michael Matz, ported to a more recent
mainline.

From-SVN: r214906
2014-09-04 16:37:36 +00:00
Jakub Jelinek 9a771876d3 cilk-builtins.def (__cilkrts_cilk_for_32): New.
gcc/
	* cilk-builtins.def (__cilkrts_cilk_for_32): New.
	(__cilkrts_cilk_for_64): Likewise.
	* cilk-common.c (declare_cilk_for_builtin): New function.
	(cilk_init_builtins): Declare __cilkrts_cilk_for_32 and
	__cilkrts_cilk_for_64 bultins.
	* cilk.h (enum cilk_tree_index): Added CILK_TI_F_LOOP_32 and
	CILK_TI_F_LOOP_64.
	(cilk_for_32_fndecl): New define.
	(cilk_for_64_fndecl): Likewise.
	* gimple-pretty-print.c (dump_gimple_omp_for): Correct hadling of
	GF_OMP_FOR_KIND_CILKFOR cases; Added NE_EXPR case.
	* gimple.h (enum gf_mask): Added GF_OMP_FOR_KIND_CILKFOR; adjusted
	GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_SIMD, GF_OMP_FOR_COMBINED,
	GF_OMP_FOR_COMBINED_INTO.
	* gimplify.c (gimplify_scan_omp_clauses): Added
	OMP_CLAUSE__CILK_FOR_COUNT_ case.
	(gimplify_adjust_omp_clauses): Ditto.
	(gimplify_omp_for): Added CILK_FOR case.
	(gimplify_expr): Ditto.
	* omp-low.c: Include cilk.h.
	(extract_omp_for_data): Set appropriate kind for
	GF_OMP_FOR_KIND_CILKFOR; added check for GF_OMP_FOR_KIND_CILKFOR.
	(scan_sharing_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_ cases.
	(create_omp_child_function_name): Added second argument to handle
	cilk_for case.
	(cilk_for_check_loop_diff_type): New function.
	(expand_cilk_for_call): Likewise.
	(expand_cilk_for): Likewise.
	(create_omp_child_function): Set cilk_for_count; handle the cases when
	it is true; call create_omp_child_function_name with second argument.
	(expand_omp_taskreg): Set is_cilk_for and handle cases when it's true.
	(expand_omp_for): Handle case of GF_OMP_FOR_KIND_CILKFOR.
	* tree-core.h (omp_clause_code): Added OMP_CLAUSE__CILK_FOR_COUNT_.
	* tree-nested.c (convert_nonlocal_omp_clauses): Added
	OMP_CLAUSE__CILK_FOR_COUNT_ case.
	(convert_local_omp_clauses): Ditto.
	* tree-pretty-print.c (dump_omp_clause): Added
	OMP_CLAUSE__CILK_FOR_COUNT_ and OMP_CLAUSE_SCHEDULE_CILKFOR cases.
	(dump_generic_node): Added CILK_FOR case.
	* tree.c (omp_clause_num_ops): New element
	OMP_CLAUSE__CILK_FOR_COUNT_ (1).
	(omp_clause_code_name): New element _Cilk_for_count_.
	(walk_tree_1): Added OMP_CLAUSE__CILK_FOR_COUNT_ case.
	* tree.def: Add tree code for CILK_FOR.

gcc/c/
	* c-parser.c (c_parser_cilk_for): New function.
	(c_parser_cilk_grainsize): Likewise.
	(c_get_temp_regvar): Likewise.
	(c_parser_statement_after_labels): Added RID_CILK_FOR case.
	(c_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
	(c_parser_omp_for_loop): Added CILK_FOR and CILK_SIMD checks.
	* c-typeck.c (c_finish_omp_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_
	case.

gcc/cp/
	* cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
	simplified.
	* parser.c (cp_parser_cilk_for): New function.
	(cp_parser_cilk_grainsize): Likewise.
	(cp_parser_statement): Added RID_CILK_FOR case.
	(cp_parser_omp_for_cond): Added CILK_FOR check.
	(cp_parser_omp_for_loop_init): Change function argument to accept
	tree_code instead just a bool flag; change the check to use that
	tree_code; check for initialization declaration in case of Cilk_for.
	(cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
	changed call to cp_parser_omp_for_loop_init according new arguments'
	list.
	(cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
	* pt.c (tsubst_expr): Added CILK_FOR case.
	* semantics.c: Include convert.h.
	(finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
	case; added OMP_CLAUSE__CILK_FOR_COUNT_.
	(handle_omp_for_class_iterator): New argument lastp and its usage;
	added NE_EXPR case.
	(finish_omp_for): Changed call to handle_omp_for_class_iterator
	according new arguments' list; in case of Cilk_for save very first
	decl and create empty stmt_list block; use block to build correct
	statement tree.

gcc/c-family/
	* c-cilkplus.c (cilk_for_number_of_iterations): New function.
	* c-common.c (c_common_reswords): Added _Cilk_for.
	* c-common.h (enum rid): Added RID_CILK_FOR.
	(cilk_for_number_of_iterations): Add declaration.
	* c-omp.c (c_finish_omp_for): Added checks for CILK_SIMD and
	CILK_FOR.
	* c-pragma.c (init_pragma): Register "grainsize" pragma.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_CILK_GRAINSIZE.

gcc/testsuite/
	* c-c++-common/cilk-plus/CK/cilk-fors.c: New test.
	* c-c++-common/cilk-plus/CK/cilk-for-2.c: New test.
	* c-c++-common/cilk-plus/CK/cilk-for-3.c: New test.
	* c-c++-common/cilk-plus/CK/cilk_for_errors.c: New test.
	* c-c++-common/cilk-plus/CK/cilk_for_grain.c: New test.
	* c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: New test.
	* c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: New test.
	* c-c++-common/cilk-plus/CK/nested_cilk_for.c: New test.
	* g++.dg/cilk-plus/CK/cf3.cc: New test.
	* g++.dg/cilk-plus/CK/cilk-for-tplt.cc: New test.
	* g++.dg/cilk-plus/CK/for1.cc: New test.
	* g++.dg/cilk-plus/CK/stl_iter.cc: New test.
	* g++.dg/cilk-plus/CK/stl_rev_iter.cc: New test.
	* g++.dg/cilk-plus/CK/stl_test.cc: New test.

Co-Authored-By: Balaji V. Iyer <balaji.v.iyer@intel.com>
Co-Authored-By: Igor Zamyatin <igor.zamyatin@intel.com>

From-SVN: r214818
2014-09-02 12:52:29 +00:00
Richard Biener 6cd87a2ea5 re PR lto/62190 (LTO DWARF produces __unknown__ type for unsigned int function argument type)
2014-08-20  Richard Biener  <rguenther@suse.de>

	PR lto/62190
	* tree.c (build_common_tree_nodes): Use make_or_reuse_type
	to build uint{16,32,64}_type_node.

From-SVN: r214216
2014-08-20 11:06:48 +00:00
Jason Merrill 33cb682bce re PR bootstrap/62077 (--with-build-config=bootstrap-lto fails)
PR bootstrap/62077
gcc/
	* tree.c (type_hash_canon): Uncomment assert.
gcc/cp/
	* tree.c (build_min_array_type, set_array_type_canon): Split out...
	(build_cplus_array_type): ...from here.  Only call build_array_type
	for main variants.

From-SVN: r214030
2014-08-15 13:27:58 -04:00
Richard Biener 0cff9154ec tree.c (type_hash_lookup, [...]): Merge into ...
2014-08-14  Richard Biener  <rguenther@suse.de>

	* tree.c (type_hash_lookup, type_hash_add): Merge into ...
	(type_hash_canon): ... this and avoid 2nd lookup for the add.

From-SVN: r213956
2014-08-14 11:15:41 +00:00
Yury Gribov c62ccb9a0a Move inlining of Asan memory checks to sanopt pass.
Change asan-instrumentation-with-call-threshold to more closely match LLVM.

2014-08-11  Yury Gribov  <y.gribov@samsung.com>

gcc/
	* asan.c (asan_check_flags): New enum.
	(build_check_stmt_with_calls): Removed function.
	(build_check_stmt): Split inlining logic to
	asan_expand_check_ifn.
	(instrument_derefs): Rename parameter.
	(instrument_mem_region_access): Rename parameter.
	(instrument_strlen_call): Likewise.
	(asan_expand_check_ifn): New function.
	(asan_instrument): Remove old code.
	(pass_sanopt::execute): Change handling of
	asan-instrumentation-with-call-threshold.
	(asan_clear_shadow): Fix formatting.
	(asan_function_start): Likewise.
	(asan_emit_stack_protection): Likewise.
	* doc/invoke.texi (asan-instrumentation-with-call-threshold):
	Update description.
	* internal-fn.c (expand_ASAN_CHECK): New function.
	* internal-fn.def (ASAN_CHECK): New internal function.
	* params.def (PARAM_ASAN_INSTRUMENTATION_WITH_CALL_THRESHOLD):
	Update description.
	(PARAM_ASAN_USE_AFTER_RETURN): Likewise.
	* tree.c: Small comment fix.

gcc/testsuite/
	* c-c++-common/asan/inc.c: Update test.
	* c-c++-common/asan/instrument-with-calls-2.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-1.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-2.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-3.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-4.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-5.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-6.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-7.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-8.c: Likewise.
	* c-c++-common/asan/no-redundant-instrumentation-9.c: Likewise.

From-SVN: r213807
2014-08-11 06:12:12 +00:00
Yury Gribov b78475cf73 Added fnspec to internal functions.
2014-08-11  Yury Gribov  <y.gribov@samsung.com>

gcc/
        * gimple.c (gimple_call_fnspec): Support internal functions.
        (gimple_call_return_flags): Use const.
        * Makefile.in (GTFILES): Add internal-fn.h to list of GC files.
        * internal-fn.def: Add fnspec information.
        * internal-fn.h (internal_fn_fnspec): New function.
        (init_internal_fns): Declare new function.
        * internal-fn.c (internal_fn_fnspec_array): New global variable.
        (init_internal_fns): New function.
        * tree-core.h: Update macro call.
        * tree.c (build_common_builtin_nodes): Initialize internal fns.

From-SVN: r213806
2014-08-11 06:06:29 +00:00
Trevor Saunders 9f25a338f9 remove pointer-set.[ch]
gcc/

	* Makefile.in: Remove references to pointer-set.c and pointer-set.h.
	* alias.c, cfgexpand.c, cgraphbuild.c,
	config/aarch64/aarch64-builtins.c, config/aarch64/aarch64.c,
	config/alpha/alpha.c, config/darwin.c, config/i386/i386.c,
	config/i386/winnt.c, config/ia64/ia64.c, config/m32c/m32c.c,
	config/mep/mep.c, config/mips/mips.c, config/rs6000/rs6000.c,
	config/s390/s390.c, config/sh/sh.c, config/sparc/sparc.c,
	config/spu/spu.c, config/stormy16/stormy16.c, config/tilegx/tilegx.c,
	config/tilepro/tilepro.c, config/xtensa/xtensa.c, dominance.c,
	dse.c, except.c, gengtype.c, gimple-expr.c,
	gimple-ssa-strength-reduction.c, gimplify.c, ifcvt.c,
	ipa-visibility.c, lto-streamer.h, omp-low.c, predict.c, stmt.c,
	tree-affine.c, tree-cfg.c, tree-eh.c, tree-inline.c, tree-nested.c,
	tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-ssa-loop-niter.c,
	tree-ssa-phiopt.c, tree-ssa-structalias.c, tree-ssa-uninit.c,
	tree-ssa.c, tree.c, var-tracking.c, varpool.c: Remove includes of
	pointer-set.h.
	* pointer-set.c: Remove file.
	* pointer-set.h: Remove file.

gcc/c-family/

	* c-gimplify.c, cilk.c: Remove includes of pointer-set.h.

gcc/c/

	* c-typeck.c: Remove include of pointer-set.h.

gcc/cp/

	* class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
	optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.

From-SVN: r213738
2014-08-07 20:52:50 +00:00
Trevor Saunders 6e2830c3db add a hash_set based on hash_table
This allows us to replace the usage of pointer_set outside of
pointer_map with a nicer interface.

gcc/ada/

	* gcc-interface/trans.c: Use hash_set instead of pointer_set.

gcc/c-family/

	* c-gimplify.c: Use hash_set instead of pointer_set.

gcc/c/

	* c-decl.c: Use hash_set instead of pointer_set.

gcc/cp/

	* class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
	method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
	instead of pointer_set.

gcc/fortran/

	* openmp.c, trans-decl.c: Use hash_set instead of pointer_set.

gcc/

	* hash-set.h: new File.
	* cfgexpand.c, cfgloop.c, cgraph.c, cgraphbuild.c, cgraphunit.c,
	cprop.c, cse.c, gimple-walk.c, gimple-walk.h, gimplify.c, godump.c,
	ipa-devirt.c, ipa-pure-const.c, ipa-visibility.c, ipa.c, lto-cgraph.c,
	lto-streamer-out.c, stmt.c, tree-cfg.c, tree-core.h, tree-eh.c,
	tree-inline.c, tree-inline.h, tree-nested.c, tree-pretty-print.c,
	tree-ssa-loop-niter.c, tree-ssa-phiopt.c, tree-ssa-threadedge.c,
	tree-ssa-uninit.c, tree.c, tree.h, value-prof.c, varasm.c,
	varpool.c: Use hash_set instead of pointer_set.

gcc/lto/

	* lto-partition.c, lto-partition.h: Use hash_set instead of
	pointer_set.

From-SVN: r213516
2014-08-02 11:23:49 +00:00
Andi Kleen 50de5793fc Change inchash to name space.
Change class inchash to move into a inchash namespace as requested.
The class is now inchash::hash

Rename iterative_hstate_expr to inchash::add_expr
... and convert existing users. It wasn't possible to use hash::,
because that lead to name space conflicts with cp and objc.

So class inchash is now inchash::hash and iterative_hstate_expr
is now inchash::add_expr.

gcc/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* inchash.h (inchash): Change inchash class to namespace.
	(class hash): ... Rename from inchash.
	(add_object): Move from macro to class template.
	* lto-streamer-out.c (hash_tree): Change inchash
	to inchash::hash.
	* tree.c (build_type_attribute_qual_variant): Dito.
	(type_hash_list): Dito.
	(attribute_hash_list): Dito.
	(iterative_hstate_expr): Rename to inchash::add_expr
	(build_range_type_1): Change inchash to inchash::hash
	and use hash::add_expr.
	(build_array_type_1): Dito.
	(build_function_type): Dito
	(build_method_type_directly): Dito.
	(build_offset_type): Dito.
	(build_complex_type): Dito.
	(make_vector_type): Dito.
	* tree.h (iterative_hash_expr): Dito.

gcc/lto/:

2014-07-31  Andi Kleen  <ak@linux.intel.com>

	* lto.c (hash_canonical_type): Use inchash::hash
	and use inchash::add_expr.
	(iterative_hash_canonical_type): Dito.

From-SVN: r213394
2014-08-01 02:51:46 +00:00
Andi Kleen 56fdfd3e85 Convert the tree.c type hashing over to inchash
v2: Use commutative interface. Be much nearer to the old
code.

gcc/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* tree.c (build_type_attribute_qual_variant): Use inchash.
	(type_hash_list): Dito.
	(attribute_hash_list): Dito
	(iterative_hstate_expr): Dito.
	(iterative_hash_expr): Dito.
	(build_range_type_1): Dito.
	(build_array_type_1): Dito.
	(build_function_type): Dito.
	(build_method_type_directly): Dito.
	(build_offset_type): Dito.
	(build_complex_type): Dito.
	(make_vector_type): Dito.
	* tree.h (iterative_hash_expr): Add compat wrapper.
	(iterative_hstate_expr): Add.

gcc/lto/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* lto.c (hash_canonical_type): Call iterative_hstate_expr.

From-SVN: r213056
2014-07-25 13:39:36 +00:00
Andi Kleen 6d8eb96b44 Add an abstract incremental hash data type
Some files in gcc, like lto or tree, do large scale incremential hashing.
The current jhash implementation of this could be likely improved
by using an incremential hash that does not do a full rehashing
for every new value added.

This patch adds a new "inchash" class that abstracts the internal
state of the hash. This makes it easier to plug in new hashes
and also cleans up the code a bit.

Right now it is just implemented in the same way as the old
iterative hash in tree.c. The previous iterative hash code
from tree.c moved into a new separate file. Also I fixed up all
users to include the new header.

It should not really significantly change any hashing by itself,
it's mostly a cleanup at this point.

v2: Remove begin. Add commutative interface.
Add merge hash interface.  Add add_flag.

gcc/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* Makefile.in (OBJS): Add inchash.o.
	(PLUGIN_HEADERS): Add inchash.h.
	* ipa-devirt.c: Include inchash.h.
	* lto-streamer-out.c: Dito.
	* tree-ssa-dom.c: Dito.
	* tree-ssa-pre.c: Dito.
	* tree-ssa-sccvn.c: Dito.
	* tree-ssa-tail-merge.c: Dito.
	* asan.c: Dito.
	* tree.c (iterative_hash_hashval_t): Move to ...
	(iterative_hash_host_wide_int): Move to ...
	* inchash.c: Here. New file.
	* tree.h (iterative_hash_hashval_t): Move to ...
	(iterative_hash_host_wide_int): Move to ...
	* inchash.h: Here. New file.

gcc/lto/:

2014-07-25  Andi Kleen  <ak@linux.intel.com>

	* lto.c: Include inchash.h

From-SVN: r213054
2014-07-25 13:39:05 +00:00
Martin Liska 9041d2e6d2 IPA C++ refactoring 2/N
* cgraph.h (varpool_node):
  (availability get_availability (void)):
    created from cgraph_variable_initializer_availability
  (inline varpool_node *ultimate_alias_target (availability *availability = NULL)
    creted from: cgraph_variable_initializer_availability
  (inline varpool_node *get_alias_target (void)): created from varpool_alias_target
  (void finalize_named_section_flags (void)):
    created from varpool_finalize_named_section_flags
  (bool assemble_decl (void)): created from varpool_assemble_decl
  (void analyze (void)): created from varpool_analyze_node
  (bool call_for_node_and_aliases (bool (*callback) (varpool_node *, void *),
    void *data, bool include_overwritable)): created fromvarpool_for_node_and_aliases
  (void remove_initializer (void)): created from varpool_remove_initializer
  (tree get_constructor (void)): created from varpool_get_constructor
  (bool externally_visible_p (void)): created from varpool_externally_visible_p
  (bool ctor_useable_for_folding_p (void)): created from varpool_ctor_useable_for_folding_p
  (inline bool all_refs_explicit_p ()): created from varpool_all_refs_explicit_p
  (inline bool can_remove_if_no_refs_p (void)): created from varpool_can_remove_if_no_refs
  (static inline varpool_node *get (const_tree decl)): created from varpool_get_node
  (static void finalize_decl (tree decl)): created from varpool_finalize_decl
  (static bool output_variables (void)): created from varpool_output_variables
  (static varpool_node * create_extra_name_alias (tree alias, tree decl)):
    created from varpool_extra_name_alias
  (static varpool_node * create_alias (tree, tree)): created from varpool_create_variable_alias
  (static void dump_varpool (FILE *f)): created from dump_varpool
  (static void DEBUG_FUNCTION debug_varpool (void)): created from debug_varpool
  (static varpool_node *create_empty (void)): created from varpool_create_empty_node
  (static varpool_node *get_create (tree decl)): created from varpool_node_for_decl
  (static varpool_node *get_for_asmname (tree asmname)): created from varpool_node_for_asm
  (void assemble_aliases (void)): created from assemble_aliases

From-SVN: r212984
2014-07-24 12:25:27 +00:00
Martin Liska d52f529517 IPA C++ refactoring 1/N
* cgraph.h (symtab_node):
  (void register_symbol (void)): created from symtab_register_node
  (void remove (void)): created from symtab_remove_node
  (void dump (FILE *f)): created from dump_symtab_node
  (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node
  (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node
  (struct ipa_ref *add_reference (symtab_node *referred_node,
    enum ipa_ref_use use_type)): created from add_reference 
  (struct ipa_ref *add_reference (symtab_node *referred_node,
    enum ipa_ref_use use_type, gimple stmt)): created from add_reference
  (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type,
    gimple stmt)): created from maybe_add_reference
  (bool semantically_equivalent_p (symtab_node *target)): created from
    symtab_semantically_equivalent_p
  (void remove_from_same_comdat_group (void)): created from
    remove_from_same_comdat_group
  (void add_to_same_comdat_group (symtab_node *old_node)): created from
    symtab_add_to_same_comdat_group
  (void dissolve_same_comdat_group_list (void)): created from
    symtab_dissolve_same_comdat_group_list
  (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p
  (symtab_node *ultimate_alias_target (enum availability *avail = NULL)):
    created from symtab_alias_ultimate_target
  (inline symtab_node *next_defined_symbol (void)): created from
    symtab_next_defined_symbol
  (bool resolve_alias (symtab_node *target)): created from
    symtab_resolve_alias
  (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *),
    void *data, bool include_overwrite)): created from symtab_for_node_and_aliases
  (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias
  (inline symtab_node *get_alias_target (void)): created from symtab_alias_target
  (void set_section (const char *section)): created from set_section_1 
  (enum availability get_availability (void)): created from symtab_node_availability
  (void make_decl_local (void)): created from symtab_make_decl_local
  (bool real_symbol_p (void)): created from symtab_read_node
  (can_be_discarded_p (void)): created from symtab_can_be_discarded
  (inline bool comdat_local_p (void)): created from symtab_comdat_local_p
  (inline bool in_same_comdat_group_p (symtab_node *target)): created from
    symtab_in_same_comdat_p;
  (bool address_taken_from_non_vtable_p (void)): created from
    address_taken_from_non_vtable_p
  (static inline symtab_node *get (const_tree decl)): created from symtab_get_node
  (static void dump_table (FILE *)): created from dump_symtab
  (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab
  (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab
  (static bool used_from_object_file_p_worker (symtab_node *node)): created from
    symtab_used_from_object_file_p 
  (void dump_base (FILE *)): created from dump_symtab_base
  (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base
  (void unregister (void)): created from symtab_unregister_node
  (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info
  (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section
  (static bool noninterposable_alias (symtab_node *node, void *data)): created from
    symtab_nonoverwritable_alias_1
  * cgraph.h (cgraph_node):
  (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)):
    created from cgraph_remove_node_and_inline_clones
  (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references
  (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt,
    bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones
  (cgraph_node *function_symbol (enum availability *avail = NULL)):
    created from cgraph_function_node
  (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original,
    vec<cgraph_edge *> redirect_callers, bool call_duplication_hook,
    struct cgraph_node *new_inlined_to, bitmap args_to_skip)):
    created from cgraph_create_clone 
  (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers,
    vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)):
    created from cgraph_create_virtual_clone
  (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node
  (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers,
    bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning
  (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers,
    vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return,
    bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)):
    created from cgraph_function_version_info
  (struct cgraph_function_version_info *insert_new_function_version (void)):
    created from insert_new_cgraph_node_version
  (struct cgraph_function_version_info *function_version (void)): created from
    get_cgraph_node_version
  (void analyze (void)): created from analyze_function
  (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting,
    HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset,
    tree real_alias) cgraph_add_thunk
  (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target
  (cgraph_node *ultimate_alias_target (availability *availability = NULL)):
    created from cgraph_function_or_thunk_node
  (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)):
    created from expand_thunk
  (void reset (void)): created from cgraph_reset_node
  (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper
  (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node
  (void remove (void)): created from cgraph_remove_node
  (void dump (FILE *f)): created from dump_cgraph_node
  (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node
  (bool get_body (void)): created from cgraph_get_body
  (void release_body (void)): created from cgraph_release_function_body
  (void unnest (void)): created from cgraph_unnest_node
  (void make_local (void)): created from cgraph_make_node_local
  (void mark_address_taken (void)): created from cgraph_mark_address_taken_node
  (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt,
    gcov_type count, int freq)): created from cgraph_create_edge
  (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags,
    gcov_type count, int freq)): created from cgraph_create_indirect_edge
  (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt,
    gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)):
    created from cgraph_create_edge_including_clones
  (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge
  (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node
  (void remove_callers (void)): created from cgraph_node_remove_callers
  (void remove_callees (void)): created from cgraph_node_remove_callees
  (enum availability get_availability (void)): created from cgraph_function_body_availability
  (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag
  (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag
  (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag
  (void call_duplication_hooks (cgraph_node *node2)): created from
    cgraph_call_node_duplication_hooks
  (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *),
    void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases
  (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data),
    void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases
  (void call_function_insertion_hooks (void)):
    created from cgraph_call_function_insertion_hooks
  (inline void mark_force_output (void)): created from cgraph_mark_force_output_node
  (bool local_p (void)): created from cgraph_local_node
  (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p
  (bool cannot_return_p (void)): created from cgraph_node_cannot_return
  (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p
  (inline bool only_called_directly_or_aliased_p (void)):
    created from cgraph_only_called_directly_or_aliased_p
  (bool will_be_removed_from_program_if_no_direct_calls_p (void)):
    created from cgraph_will_be_removed_from_program_if_no_direct_calls
  (bool can_remove_if_no_direct_calls_and_refs_p (void)):
    created from cgraph_can_remove_if_no_direct_calls_and_refs_p
  (bool can_remove_if_no_direct_calls_p (void)):
    created from cgraph_can_remove_if_no_direct_calls_p
  (inline bool has_gimple_body_p (void)):
    created from cgraph_function_with_gimple_body_p
  (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p
  (static void dump_cgraph (FILE *f)): created from dump_cgraph
  (static inline void debug_cgraph (void)): created from debug_cgraph
  (static void record_function_versions (tree decl1, tree decl2)):
    created from record_function_versions
  (static void delete_function_version (tree decl)):
    created from delete_function_version
  (static void add_new_function (tree fndecl, bool lowered)):
    created from cgraph_add_new_function
  (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node
  (static cgraph_node * create (tree decl)): created from cgraph_create_node
  (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node
  (static cgraph_node * get_create (tree)): created from cgraph_get_create_node
  (static cgraph_node *get_for_asmname (tree asmname)):
    created from cgraph_node_for_asm
  (static cgraph_node * create_same_body_alias (tree alias, tree decl)):
    created from cgraph_same_body_alias 
  (static bool used_from_object_file_p_worker (cgraph_node *node,
    void *): new function
  (static bool non_local_p (cgraph_node *node, void *)):
    created from cgraph_non_local_node_p_1
  (static void DEBUG_FUNCTION verify_cgraph_nodes (void)):
    created from verify_cgraph
  (static bool make_local (cgraph_node *node, void *)):
    created from cgraph_make_node_local
  (static cgraph_node *create_alias (tree alias, tree target)):
    created from cgraph_create_function_alias
  (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee,
    gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)):
    created from cgraph_create_edge_1
  * cgraph.h (varpool_node):
  (void remove (void)): created from varpool_remove_node
  (void dump (FILE *f)): created from dump_varpool_node

From-SVN: r212982
2014-07-24 12:07:13 +00:00
Jan Hubicka ad115a3c32 tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL, NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL...
* tree.c (tree_code_size): Add TRANSLATION_UNIT_DECL,
	NAMESPACE_DECL, IMPORTED_DECL and NAMELIST_DECL;
	call langhook for unknown declaration.
	(find_decls_types_r): Do not walk DECL_ARGUMENT_FLD.
	* tree.h (DECL_ARGUMENTS): Update.
	* print-tree.c (print_node): Update.
	* tree-core.h (tree_decl_non_common): Remove arguments.
	(tree_function_decl): Add arguments.

	* class.c (build_clone): Do not clear assembler names of
	templates.
	* decl.c (cp_tree_node_structure): Add TEMPLATE_DECL.
	* cp-objcp-common.c (cp_tree_size): Add TEMPLATE_DECL
	as a special case return sizeof (struct tree_decl_non_common)
	for other decls.
	(cp_common_init_ts): Do not initialize NAMESPACE_DECL;
	initialize TEMPLATE_DECL as MARK_TS_DECL_COMMON.
	* cp/cp-tree.h (tree_template_decl): New structure.
	(cp_tree_node_structure_enum): Add TS_CP_TEMPLATE_DECL.
	(union cp_lang_tree_node): Add template_decl.
	(DECL_TEMPLATE_PARMS, DECL_TEMPLATE_RESULT): Update.

	* lto/lto.c (mentions_vars_p_decl_non_common): Skip
	DECL_ARGUMENT_FLD.
	mentions_vars_p_function): Do DECL_ARGUMENTS.
	(lto_fixup_prevailing_decls): Update.

	* objc-act.c (objc_common_tree_size): New function.
	* objc-act.h (KEYWORD_KEY_NAME, KEYWORD_ARG_NAME): Add type
	checking.
	(INSTANCE_METHOD_OR_CLASS_METHOD_DECL_CHECK): New macro.
	(METHOD_SEL_NAME, METHOD_SEL_ARGS, METHOD_ADD_ARGS,
 	METHOD_ADD_ARGS_ELLIPSIS_P, METHOD_DEFINITION, METHOD_ENCODING,
	METHOD_TYPE_ATTRIBUTES, METHOD_PROPERTY_CONTEXT): Add type checking.
	(METHOD_SEL_ARGS): Use decl_common.size instead of
	decl_non_common.result.
	(PROPERTY_NAME, PROPERTY_GETTER_NAME, PROPERTY_SETTER_NAME,
	PROPERTY_READONLY, PROPERTY_NONATOMIC, PROPERTY_ASSIGN_SEMANTICS,
	PROPERTY_IVAR_NAME, PROPERTY_DYNAMIC, PROPERTY_HAS_NO_GETTER,
	PROPERTY_HAS_NO_SETTER, PROPERTY_OPTIONAL): Add type checking.
	(objc_common_tree_size): Declare.
	* objc/objc-lang.c (LANG_HOOKS_TREE_SIZE): New macro.

From-SVN: r212549
2014-07-15 10:17:32 +00:00
Jan Hubicka c59f720328 tree.c (type_in_anonymous_namespace_p): Ignore TREE_PUBLIC on builtin types.
* tree.c (type_in_anonymous_namespace_p): Ignore TREE_PUBLIC
	on builtin types.
	* ipa-devirt.c: Include stor-layout.h and intl.h
	(odr_subtypes_equivalent_p): New function.
	(warn_odr): New function.
	(warn_type_mismatch): New function.
	(odr_types_equivalent_p): New function.
	(add_type_duplicate): Use it.
	* common.opt (Wodr): New flag.
	* doc/invoke.texi (Wodr): Document new warning.

From-SVN: r212481
2014-07-12 15:34:45 +00:00
Trevor Saunders 558d255943 remove has_execute
gcc/

	* tree-pass.h (pass_data): Remove has_execute member.
	* passes.c (execute_one_pass): Don't check pass->has_execute.
	* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
	cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
	compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
	config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
	config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
	config/sh/sh_optimize_sett_clrt.cc, config/sh/sh_treg_combine.cc,
	config/sparc/sparc.c, cprop.c, cse.c, dce.c, df-core.c, dse.c,
	dwarf2cfi.c, except.c, final.c, function.c, fwprop.c, gcse.c,
	gimple-low.c, gimple-ssa-isolate-paths.c,
	gimple-ssa-strength-reduction.c, graphite.c, ifcvt.c, init-regs.c,
	ipa-comdats.c, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c,
	ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c,
	ipa-split.c, ipa-visibility.c, ipa.c, ira.c, jump.c, loop-init.c,
	lower-subreg.c, mode-switching.c, modulo-sched.c, omp-low.c, passes.c,
	postreload-gcse.c, postreload.c, predict.c, recog.c, ree.c,
	reg-stack.c, regcprop.c, reginfo.c, regrename.c, reorg.c, sched-rgn.c,
	stack-ptr-mod.c, store-motion.c, tracer.c, trans-mem.c,
	tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c,
	tree-eh.c, tree-emutls.c, tree-if-conv.c, tree-into-ssa.c,
	tree-loop-distribution.c, tree-nrv.c, tree-object-size.c,
	tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c,
	tree-sra.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
	tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
	tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
	tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c,
	web.c: Remove initializer for pass_data::has_execute.

From-SVN: r212383
2014-07-09 03:06:49 +00:00
Jan Hubicka 549bcbd17f tree.c (decls_same_for_odr, [...]): Remove.
* tree.c (decls_same_for_odr, decls_same_for_odr,
	types_same_for_odr): Remove.
	(type_in_anonymous_namespace_p): Constify argument.
	* tree.h (types_same_for_odr, type_in_anonymous_namespace_p):
	Constify.
	* ipa-devirt.c (odr_type_d): Add ODR_VIOLATED field.
	(main_odr_variant): New function.
	(hash_type_name): Make static; update assert; do not ICE on
	non-records.
	(types_same_for_odr): Bring here from tree.c; simplify
	and remove old structural comparing code that doesn't work
	for templates.
	(odr_hasher::equal): Update assert.
	(add_type_duplicate): Return true when bases should be computed;
	replace incomplete loader by complete; do not output duplicated
	warnings; do not ICE on non-records; set odr_violated flag.
	(get_odr_type): Be ready to replace incomplete type by complete
	one; work on ODR variants instead of main variants; reorder item
	in array so bases have still smaller indexes.
	(dump_type_inheritance_graph): Be ready for holdes in odr_types
	array.
	(possible_polymorphic_call_targets): Do not ICE when BINFO is NULL.

From-SVN: r212218
2014-07-02 03:19:45 +00:00
Jan Hubicka aaf8a23ef3 class.c (check_methods, [...]): Guard VINDEX checks by FUNCTION_DECL check.
* class.c (check_methods, create_vtable_ptr, determine_key_method,
	add_vcall_offset_vtbl_entries_1): Guard VINDEX checks by FUNCTION_DECL check.
	* cp-tree.h (lang_decl_ns): Add ns_using and ns_users.
	(DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): Use lang_decl_ns.
	(DECL_NAMESPACE_ASSOCIATIONS): Use DECL_INITIAL.
	(DECL_TEMPLATE_INSTANTIATIONS): Use DECL_SIZE_UNIT.
	* tree.c (find_decls_types_r): Do not check DECL_VINDEX for TYPE_DECL.
	* tree.h (DECL_VINDEX, DECL_SAVED_TREE): Restrict to DECL_FUNCTION.
	* tree-core.h (tree_decl_non_common): Move saved_tree and vindex...
	(tree_function_decl): ... here.
	* tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Move
	streaming of vindex to ...
	(write_ts_function_decl_tree_pointers): ... here.

	* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
	Do not stream DECL_VINDEX.
	(lto_input_ts_function_decl_tree_pointers): Stream it here.

	* lto.c (mentions_vars_p_decl_non_common): Move DECL_VINDEX check to ..
	(mentions_vars_p_function): ... here.
	(compare_tree_sccs_1): Update VINDEX checks.
	(lto_fixup_prevailing_decls): Likewise.

From-SVN: r211960
2014-06-24 23:14:26 +00:00
Marek Polacek 0e37a2f33d asan.c (pass_sanopt::execute): Handle IFN_UBSAN_BOUNDS.
* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_BOUNDS.
	* flag-types.h (enum sanitize_code): Add SANITIZE_BOUNDS and or it
	into SANITIZE_UNDEFINED.
	* doc/invoke.texi: Describe -fsanitize=bounds.
	* gimplify.c (gimplify_call_expr): Add gimplification of internal
	functions created in the FEs.
	* internal-fn.c: Move "internal-fn.h" after "tree.h".
	(expand_UBSAN_BOUNDS): New function.
	* internal-fn.def (UBSAN_BOUNDS): New internal function.
	* internal-fn.h: Don't define internal functions here.
	* opts.c (common_handle_option): Add -fsanitize=bounds.
	* sanitizer.def (BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS,
	BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS_ABORT): Add.
	* tree-core.h: Define internal functions here.
	(struct tree_base): Add ifn field.
	* tree-pretty-print.c: Include "internal-fn.h".
	(dump_generic_node): Handle functions without CALL_EXPR_FN.
	* tree.c (get_callee_fndecl): Likewise.
	(build_call_expr_internal_loc): New function.
	* tree.def (CALL_EXPR): Update description.
	* tree.h (CALL_EXPR_IFN): Define.
	(build_call_expr_internal_loc): Declare.
	* ubsan.c (get_ubsan_type_info_for_type): Return 0 for non-arithmetic
	types.
	(ubsan_type_descriptor): Change bool parameter to enum
	ubsan_print_style.  Adjust the code.  Add handling of
	UBSAN_PRINT_ARRAY.
	(ubsan_expand_bounds_ifn): New function.
	(ubsan_expand_null_ifn): Adjust ubsan_type_descriptor call.
	(ubsan_build_overflow_builtin): Likewise.
	(instrument_bool_enum_load): Likewise.
	(ubsan_instrument_float_cast): Likewise.
	* ubsan.h (enum ubsan_print_style): New enum.
	(ubsan_expand_bounds_ifn): Declare.
	(ubsan_type_descriptor): Adjust declaration.  Use a default parameter.
c-family/
	* c-gimplify.c: Include "c-ubsan.h" and "pointer-set.h".
	(ubsan_walk_array_refs_r): New function.
	(c_genericize): Instrument array bounds.
	* c-ubsan.c: Include "internal-fn.h".
	(ubsan_instrument_division): Mark instrumented arrays as having
	side effects.  Adjust ubsan_type_descriptor call.
	(ubsan_instrument_shift): Likewise.
	(ubsan_instrument_vla): Adjust ubsan_type_descriptor call.
	(ubsan_instrument_bounds): New function.
	(ubsan_array_ref_instrumented_p): New function.
	(ubsan_maybe_instrument_array_ref): New function.
	* c-ubsan.h (ubsan_instrument_bounds): Declare.
	(ubsan_array_ref_instrumented_p): Declare.
	(ubsan_maybe_instrument_array_ref): Declare.
testsuite/
	* c-c++-common/ubsan/bounds-1.c: New test.
	* c-c++-common/ubsan/bounds-2.c: New test.
	* c-c++-common/ubsan/bounds-3.c: New test.
	* c-c++-common/ubsan/bounds-4.c: New test.
	* c-c++-common/ubsan/bounds-5.c: New test.
	* c-c++-common/ubsan/bounds-6.c: New test.

From-SVN: r211859
2014-06-20 21:20:51 +00:00
Jan Hubicka 569b1784fe cgraph.h (struct symtab_node): Add field in_init_priority_hash (set_init_priority...
* cgraph.h (struct symtab_node): Add field in_init_priority_hash
	(set_init_priority, get_init_priority, set_fini_priority,
	get_fini_priority): New methods.
	* tree.c (init_priority_for_decl): Remove.
	(init_ttree): Do not initialize init priority.
	(decl_init_priority_lookup, decl_fini_priority_lookup): Rewrite.
	(decl_priority_info): Remove.
	(decl_init_priority_insert): Rewrite.
	(decl_fini_priority_insert): Rewrite.
	* tree.h (tree_priority_map_eq, tree_priority_map_hash,
	tree_priority_map_marked_p): Remove.
	* lto-cgraph.c (lto_output_node, input_node): Stream init priorities.
	* lto-streamer-out.c (hash_tree): Do not hash priorities.
	* tree-streamer-out.c (pack_ts_decl_with_vis_value_fields): Do
	not output priorities.
	(pack_ts_function_decl_value_fields): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do
	not input priorities.
	(unpack_ts_function_decl_value_fields): Likewise.
	* symtab.c (symbol_priority_map): Declare.
	(init_priority_hash): Declare.
	(symtab_unregister_node): Unregister from priority hash, too.
	(symtab_node::get_init_priority, cgraph_node::get_fini_priority):
	New methods.
	(symbol_priority_map_eq, symbol_priority_map_hash): New functions.
	(symbol_priority_info): New function.
	(symtab_node::set_init_priority, cgraph_node::set_fini_priority):
	New methods.
	* tree-core.h (tree_priority_map): Remove.

	* lto.c (compare_tree_sccs_1): Do not compare priorities.

From-SVN: r211838
2014-06-20 07:09:27 +00:00
Jan Hubicka 56363ffd48 c-common.c (handle_tls_model_attribute): Use set_decl_tls_model.
* c-family/c-common.c (handle_tls_model_attribute): Use set_decl_tls_model.
	* cgraph.h (struct varpool_node): Add tls_model.
	* tree.c (decl_tls_model, set_decl_tls_model): New functions.
	* tree.h (DECL_TLS_MODEL): Update.
	(DECL_THREAD_LOCAL_P): Check that variable is static.
	(decl_tls_model): Declare.
	(set_decl_tls_model): Declare.
	* tree-emutls.c (get_emutls_init_templ_addr): First build decl and then
	set symbol prorperties.
	(get_emutls_init_templ_addr): Cleanup.
	(new_emutls_decl): Update.
	* lto-cgraph.c (lto_output_varpool_node): Stream TLS model
	(lto_input_varpool_node): Likewise.
	* lto-streamer-out.c (hash_tree): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do
	not stream DECL_TLS_MODEL.
	* tree-profile.c (init_ic_make_global_vars): Use
	set_decl_tls_model.
	* tree-core.h (tree_decl_with_vis): Remove tls_model;
	update comments.

	* c-parser.c (c_parser_omp_threadprivate): Likewise.
	* c-decl.c (merge_decls): Likewise.

	* decl.c (duplicate_decls): Use set_decl_tls_model.
	(grokdeclarator): Likewise.
	* semantics.c (finish_id_expression): Check TLS only for
	static variables.
	(finish_omp_threadprivate): Use decl_default_tls_model.
	* decl2.c (get_guard): Likewise.
	* call.c (make_temporary_var_for_ref_to_temp): Likewise.

	* gcc-interface/utils.c (process_attributes): Use
	set_decl_tls_model.

	* trans-common.c (build_common_decl): Use
	set_decl_tls_model.
	* trans-decl.c (gfc_finish_var_decl): Likewise.
	(get_proc_pointer_decl): Likewise.

	* lto.c (compare_tree_sccs_1): Do not compare DECL_TLS_MODEL.

From-SVN: r211689
2014-06-15 23:38:29 +00:00
Jan Hubicka f961457f88 symtab.c (section_hash): New hash.
* symtab.c (section_hash): New hash.
	(symtab_unregister_node): Clear section before freeing.
	(hash_section_hash_entry): New haser.
	(eq_sections): New function.
	(symtab_node::set_section_for_node): New method.
	(set_section_1): Update.
	(symtab_node::set_section): Take string instead of tree as parameter.
	(symtab_resolve_alias): Update.
	* cgraph.h (section_hash_entry_d): New structure.
	(section_hash_entry): New typedef.
	(cgraph_node): Change comdat_group_ to x_comdat_group,
	change section_ to x_section and turn into section_hash_entry;
	update accestors; put set_section_for_node offline.
	* tree.c (decl_section_name): Turn into string.
	(set_decl_section_name): Change parameter to be string.
	* tree.h (decl_section_name, set_decl_section_name): Update prototypes.
	* sdbout.c (sdbout_one_type): Update.
	* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Update.
	* varasm.c (IN_NAMED_SECTION, get_named_section, resolve_unique_section,
	hot_function_section, get_named_text_section, USE_SELECT_SECTION_FOR_FUNCTIONS,
	default_function_rodata_section, make_decl_rtl, default_unique_section):
	Update.
	* config/c6x/c6x.c (c6x_in_small_data_p): Update.
	(c6x_elf_unique_section): Update.
	* config/nios2/nios2.c (nios2_in_small_data_p): Update.
	* config/pa/pa.c (pa_function_section): Update.
	* config/pa/pa.h (IN_NAMED_SECTION_P): Update.
	* config/ia64/ia64.c (ia64_in_small_data_p): Update.
	* config/arc/arc.c (arc_in_small_data_p): Update.
	* config/arm/unknown-elf.h (IN_NAMED_SECTION_P): Update.
	* config/mcore/mcore.c (mcore_unique_section): Update.
	* config/mips/mips.c (mips16_build_function_stub): Update.
	(mips16_build_call_stub): Update.
	(mips_function_rodata_section): Update.
	(mips_in_small_data_p): Update.
	* config/score/score.c (score_in_small_data_p): Update.
	* config/rx/rx.c (rx_in_small_data): Update.
	* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Update.
	(rs6000_xcoff_asm_named_section): Update.
	(rs6000_xcoff_unique_section): Update.
	* config/frv/frv.c (frv_string_begins_with): Update.
	(frv_in_small_data_p): Update.
	* config/v850/v850.c (v850_encode_data_area): Update.
	* config/bfin/bfin.c (DECL_SECTION_NAME): Update.
	(bfin_handle_l1_data_attribute): Update.
	(bfin_handle_l2_attribute): Update.
	* config/mep/mep.c (mep_unique_section): Update.
	* config/microblaze/microblaze.c (microblaze_elf_in_small_data_p): Update.
	* config/h8300/h8300.c (h8300_handle_eightbit_data_attribute): Update.
	(h8300_handle_tiny_data_attribute): Update.
	* config/m32r/m32r.c (m32r_in_small_data_p): Update.
	(m32r_in_small_data_p): Update.
	* config/alpha/alpha.c (alpha_in_small_data_p): Update.
	* config/i386/i386.c (ix86_in_large_data_p): Update.
	* config/i386/winnt.c (i386_pe_unique_section): Update.
	* config/darwin.c (darwin_function_section): Update.
	* config/lm32/lm32.c (lm32_in_small_data_p): Update.
	* tree-emutls.c (get_emutls_init_templ_addr): Update.
	(new_emutls_decl): Update.
	* lto-cgraph.c (lto_output_node, input_node, input_varpool_node,
	input_varpool_node): Update.
	(ead_string_cst): Turn to ...
	(read_string): ... this one.
	* dwarf2out.c (secname_for_decl): Update.
	* asan.c (asan_protect_global): Update.

	* c-family/c-common.c (handle_section_attribute): Update handling for
	section names that are no longer trees.

	* java/class.c (build_utf8_ref): Update handling for section names
	that are no longer trees.
	(emit_register_classes_in_jcr_section): Update.

	* vtable-class-hierarchy.c: Update handling for section names
	that are no longer trees.
	* decl.c (duplicate_decls): Likewise.

	* gcc-interface/utils.c:  Update handling for section names
	that are no longer trees.

From-SVN: r211489
2014-06-12 04:03:49 +00:00
Jan Hubicka e257a17cb9 varasm.c (set_implicit_section): New function.
* varasm.c (set_implicit_section): New function.
	(resolve_unique_section): Use it to set implicit section
	for aliases, too.
	(get_named_text_section): Use symtab_get_node (decl)->implicit_section
	(default_function_section): Likewise.
	(decl_binds_to_current_def_p): Constify argument.
	* varasm.h (decl_binds_to_current_def_p): Update prototype.
	* asan.c (asan_protect_global): Use symtab_get_node (decl)->implicit_section.
	* symtab.c (dump_symtab_base): Dump implicit sections.
	(verify_symtab_base): Verify sanity of sectoins and comdats.
	(symtab_resolve_alias): Alias share the section of its target.
	(set_section_1): New function.
	(symtab_node::set_section): Move here, recurse to aliases.
	(verify_symtab): Check for duplicated symtab lists.
	* tree-core.h (implicit_section_name_p): Remove.
	* tree-vect-data-refs.c: Include varasm.h.
	(vect_can_force_dr_alignment_p): Fix conditional on when
	decl bints to current definition; use
	symtab_get_node (decl)->implicit_section.
	* cgraph.c (cgraph_make_node_local_1): Fix section set.
	* cgraph.h (struct symtab_node): Add implicit_section.
	(set_section): Rename to ...
	(set_section_for_node): ... this one.
	(set_section): Declare.
	* tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): Remove.
	* lto-cgraph.c (lto_output_node, lto_output_varpool_node,
	input_overwrite_node, input_varpool_node): Stream implicit_section.
	* ipa.c (symtab_remove_unreachable_nodes): Do not check symtab before
	removal; it will fail in LTO.
	
	* vtable-class-hierarchy.c: Use symtab_get_node (var_decl)->implicit_section.
	* optimize.c (cdtor_comdat_group): Fix handling of aliases.
	(maybe_clone_body): Move symbol across comdat groups.
	* method.c (use_thunk): Copy implicit section flag.

	* go/go-gcc.cc (Gcc_backend::global_variable_set_init): Use
	symtab_get_node(var_decl)->implicit_section.

	* lto.c (read_cgraph_and_symbols): Remove unreachable symbols.
	(do_whole_program_analysis): Use verify_symtab.

From-SVN: r211434
2014-06-11 05:51:23 +00:00
Marc Glisse 00f30445f4 re PR c++/54442 (Const overloads resolution failure)
2014-06-09  Marc Glisse  <marc.glisse@inria.fr>

	PR c++/54442
gcc/
	* tree.c (build_qualified_type): Use a canonical type for
	TYPE_CANONICAL.
gcc/testsuite/
	* g++.dg/pr54442.C: New file.

From-SVN: r211377
2014-06-09 15:07:24 +00:00
Jan Hubicka 24d047a30a symtab.c (dump_symtab_base): Update dumping.
* symtab.c (dump_symtab_base): Update dumping.
	(symtab_make_decl_local): Clear only DECL_COMDAT.
	* tree-vect-data-refs.c (Check that variable is static before
	tampering with sections.
	* cgraphclones.c (duplicate_thunk_for_node): Do not clear section name.
	(cgraph_create_virtual_clone): Likewise.
	* tree.c (decl_comdat_group, decl_comdat_group_id): Constify argument.
	(decl_section_name, set_decl_section_name): New accessors.
	(find_decls_types_r): Do not walk section name
	* tree.h (DECL_SECTION_NAME): Implement using
	decl_section_name.
	(decl_comdat_group, decl_comdat_group_id): Constify.
	(decl_section_name, set_decl_section_name): Update.
	* varpool.c (varpool_finalize_named_section_flags): Use
	get_section.
	* cgraph.c (cgraph_add_thunk): Reset node instead of rebuilding.
	(cgraph_make_node_local_1): Clear section and comdat group.
	* cgraph.h (set_comdat_group): Sanity check.
	(get_section, set_section): New.
	* ipa-comdats.c (ipa_comdats): Use get_section.
	* ipa.c (ipa_discover_readonly_nonaddressable_var): Likewise.
	* lto-streamer-out.c: Do not follow section names.
	* c-family/c-common.c (handle_section_attribute):
	Update.
	* lto-cgraph.c (lto_output_node): Output section.
	(lto_output_varpool_node): Likewise.
	(read_comdat_group): Rename to ...
	(read_identifier): ... this one.
	(read_string_cst): New function.
	(input_node, input_varpool_node): Input section names.
	* tree-emutls.c (get_emutls_init_templ_addr): Update.
	(new_emutls_decl): Update.
	(secname_for_decl): Check section names only of static
	vars.
	* config/mep/mep.c (mep_unique_section): Use set_decl_section_name.
	* config/i386/winnt.c (i386_pe_unique_section): Likewise.
	* config/i386/i386.c (x86_64_elf_unique_section): Likewise.
	* config/c6x/c6x.c (c6x_elf_unique_section): Likewise.
	* config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Likewise.
	* config/mcore/mcore.c (mcore_unique_section): Likewise.
	* config/mips/mips.c (mips16_build_function_stub): Likewise.
	* config/v850/v850.c (v850_insert_attributes): Likewise.
	* config/h8300/h8300.c: (h8300_handle_eightbit_data_attribute):
	Likewise.
	(h8300_handle_tiny_data_attribute): Likewise.
	* config/bfin/bfin.c (bfin_handle_l1_text_attribute): Likewise.
	(bfin_handle_l2_attribute): Likewise.
	* tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Do not read section name.

	* lto.c (mentions_vars_p_decl_with_vis, compare_tree_sccs_1,
	lto_fixup_prevailing_decls): Skip section names.

	* go-gcc.cc (global_variable_set_init): Use
	set_decl_section_name.

	* gcc-interface/utils.c (process_attributes): Use it.

	* c-decl.c (merge_decls): Use set_decl_section_name.
	(duplicate_decls): Remove node if it exists.

	* class.c (build_utf8_ref): Use set_decl_section_name.
	(emit_register_classes_in_jcr_section): Likewise.
	(emit_register_classes_in_jcr_section): Likewise.

	* method.c (use_thunk): Use set_decl_section_name.
	* optimize.c (maybe_clone_body): Use set_decl_section_name.
	* decl.c (duplicate_decls): Likewise.
	* vtable-class-hierarchy.c: Likewise.

From-SVN: r211363
2014-06-09 02:30:30 +00:00
Martin Liska 8a57e88dc6 New attribute lookup function addition
* tree.h (private_lookup_attribute_starting): New function.
	(lookup_attribute_starting): Likewise.
	* tree.c (private_lookup_attribute_starting): Likewise.

From-SVN: r211219
2014-06-04 09:44:33 +00:00
Andrew MacLeod 9b2b72791e expr.h: Remove prototypes of functions defined in builtins.c.
* expr.h: Remove prototypes of functions defined in builtins.c.
	* tree.h: (build_call_expr_*, build_string_literal): Add prototypes.
	Remove prototypes of functions defined in builtins.c.
	* builtins.h: Update prototype list to include all exported functions.
	* builtins.c: (default_libc_has_function, gnu_libc_has_function,
	no_c99_libc_has_function): Move to targhooks.c
	(build_string_literal, build_call_expr_loc_array,
	build_call_expr_loc_vec, build_call_expr_loc, build_call_expr): Move
	to tree.c.
	(expand_builtin_object_size, fold_builtin_object_size): Make static.
	* targhooks.c (default_libc_has_function, gnu_libc_has_function,
	no_c99_libc_has_function): Relocate from builtins.c.
	* tree.c: Include builtins.h.
	(build_call_expr_loc_array, build_call_expr_loc_vec,
	build_call_expr_loc, build_call_expr, build_string_literal): Relocate
	from builtins.c.
	* fold-const.h (fold_fma): Move prototype to builtins.h.
	* realmpfr.h (do_mpc_arg2): Move prototype to builtins.h.

	* fortran/trans.c (trans_runtime_error_vararg): Call
	fold_build_call_array_loc instead of fold_builtin_call_array.

	* asan.c: Include builtins.h.
	* cfgexpand.c: Likewise.
	* convert.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimplify.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* stmt.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-stmts.c: Likewise.

	c
	* c-decl.c: Include builtins.h.
	* c-parser.c: Likewise.

	cp
	* decl.c: Include builtins.h.
	* semantics.c: Likewise.

	go
	* go-gcc.cc: Include builtins.h.

	lto
	* lto-symtab.c: Include builtins.h.

	config
	* aarch64/aarch64.c: Include builtins.h.
	* alpha/alpha.c: Likewise.
	* arc/arc.c: Likewise.
	* arm/arm.c: Likewise.
	* avr/avr.c: Likewise.
	* bfin/bfin.c: Likewise.
	* c6x/c6x.c: Likewise.
	* cr16/cr16.c: Likewise.
	* cris/cris.c: Likewise.
	* epiphany/epiphany.c: Likewise.
	* fr30/fr30.c: Likewise.
	* frv/frv.c: Likewise.
	* h8300/h8300.c: Likewise.
	* i386/i386.c: Likewise.
	* i386/winnt.c: Likewise.
	* ia64/ia64.c: Likewise.
	* iq2000/iq2000.c: Likewise.
	* lm32/lm32.c: Likewise.
	* m32c/m32c.c: Likewise.
	* m32r/m32r.c: Likewise.
	* m68k/m68k.c: Likewise.
	* mcore/mcore.c: Likewise.
	* mep/mep.c: Likewise.
	* microblaze/microblaze.c: Likewise.
	* mips/mips.c: Likewise.
	* mmix/mmix.c: Likewise.
	* mn10300/mn10300.c: Likewise.
	* moxie/moxie.c: Likewise.
	* msp430/msp430.c: Likewise.
	* nds32/nds32.c: Likewise.
	* pa/pa.c: Likewise.
	* pdp11/pdp11.c: Likewise.
	* picochip/picochip.c: Likewise.
	* rl78/rl78.c: Likewise.
	* rs6000/rs6000.c: Likewise.
	* rx/rx.c: Likewise.
	* s390/s390.c: Likewise.
	* score/score.c: Likewise.
	* sh/sh.c: Likewise.
	* sparc/sparc.c: Likewise.
	* spu/spu.c: Likewise.
	* stormy16/stormy16.c: Likewise.
	* tilegx/tilegx.c: Likewise.
	* tilepro/tilepro.c: Likewise.
	* v850/v850.c: Likewise.
	* vax/vax.c: Likewise.
	* xtensa/xtensa.c: Likewise.

From-SVN: r211145
2014-06-02 20:13:44 +00:00
Jason Merrill d67ff7b75d re PR c++/47202 (Endless recursion during mangling)
PR c++/47202
gcc/cp/
	* decl.c (cxx_comdat_group): Return a decl.
	* optimize.c (cdtor_comdat_group): Get its DECL_ASSEMBLER_NAME.
gcc/
	* cgraph.h (symtab_node::get_comdat_group_id): New.
	* cgraphunit.c (analyze_functions): Call it.
	* symtab.c (dump_symtab_node): Likewise.
	* tree.c (decl_comdat_group_id): New.
	* tree.h: Declare it.
	* lto-streamer-out.c (write_symbol): Use it.
	* trans-mem.c (ipa_tm_create_version_alias): Likewise.

From-SVN: r211026
2014-05-28 12:38:23 -04:00
Jan Hubicka 50efcce1d5 tree.h (decl_comdat_group): Declare.
* tree.h (decl_comdat_group): Declare.
	* cgraph.h (symtab_in_same_comdat_p): Move offline to ...
	* tree.c (decl_comdat_group): Here.

From-SVN: r210956
2014-05-27 04:18:38 +00:00
Richard Biener a9243bfced system.h: Define __STDC_FORMAT_MACROS before including inttypes.h.
2014-05-23  Richard Biener  <rguenther@suse.de>

	* system.h: Define __STDC_FORMAT_MACROS before
	including inttypes.h.
	* hwint.h (HOST_WIDEST_INT, HOST_BITS_PER_WIDEST_INT,
	HOST_WIDEST_INT_PRINT, HOST_WIDEST_INT_PRINT_DEC,
	HOST_WIDEST_INT_PRINT_DEC_C, HOST_WIDEST_INT_PRINT_UNSIGNED,
	HOST_WIDEST_INT_PRINT_HEX, HOST_WIDEST_INT_PRINT_DOUBLE_HEX,
	HOST_WIDEST_INT_C): Remove.
	(PRId64, PRIi64, PRIo64, PRIu64, PRIx64, PRIX64): Define
	if C99 inttypes.h is not available.

	* coretypes.h (gcov_type, gcov_type_unsigned): Use [u]int64_t.
	* gcov-io.h (gcov_type, gcov_type_unsigned): Likewise.
	* gcov-io.c (gcov_histo_index): Drop non-64bit hwi case.
	* cfgloop.h (struct niter_desc): Use uint64_t for niter field.
	* bitmap.c (struct bitmap_descriptor_d): Use uint64_t for counters.
	(struct output_info): Likewise.
	(print_statistics): Adjust.
	(dump_bitmap_statistics): Likewise.
	* bt-load.c (migrate_btr_defs): Print with PRId64.
	* cfg.c (dump_edge_info, dump_bb_info): Likewise.
	(MAX_SAFE_MULTIPLIER): Adjust.
	* cfghooks.c (dump_bb_for_graph): Print with PRId64.
	* cgraph.c (cgraph_redirect_edge_call_stmt_to_callee,
	dump_cgraph_node): Likewise.
	* final.c (dump_basic_block_info): Likewise.
	* gcov-dump.c (tag_counters, tag_summary, dump_working_sets): Likewise.
	* gcov.c (format_gcov): Likewise.
	* ipa-cp.c (good_cloning_opportunity_p): Likewise.  Use int64_t
	for calculation.
	(get_clone_agg_value): Use HOST_WIDE_INT for offset.
	* ipa-inline.c (compute_max_insns): Use int64_t for calcuation.
	(inline_small_functions, dump_overall_stats, dump_inline_stats):
	Use PRId64 for dumping.
	* ipa-profile.c (dump_histogram, ipa_profile): Likewise.
	* ira-color.c (struct allocno_hard_regs): Use int64_t for cost.
	(add_allocno_hard_regs): Adjust.
	* loop-doloop.c (doloop_modify): Print using PRId64.
	* loop-iv.c (inverse): Compute in uint64_t.
	(determine_max_iter, iv_number_of_iterations): Likewise.
	* loop-unroll.c (decide_peel_completely, decide_peel_simple):
	Print using PRId64.
	* lto-streamer-out.c (write_symbol): Use uint64_t.
	* mcf.c (CAP_INFINITY): Use int64_t maximum.
	(dump_fixup_edge, create_fixup_graph, cancel_negative_cycle,
	find_max_flow, adjust_cfg_counts): Use int64_t and dump with PRId64.
	* modulo-sched.c (const_iteration_count): Use int64_t.
	(sms_schedule): Dump using PRId64.
	* predict.c (dump_prediction): Likewise.
	* pretty-print.h (pp_widest_integer): Remove.
	* profile.c (get_working_sets, is_edge_inconsistent,
	is_inconsistent, read_profile_edge_counts): Dump using PRId64.
	* tree-pretty-print.c (pp_double_int): Remove case handling
	HOST_BITS_PER_DOUBLE_INT == HOST_BITS_PER_WIDEST_INT.
	* tree-ssa-math-opts.c (struct symbolic_number): Use uint64_t
	and adjust users.
	(pass_optimize_bswap::execute): Remove restriction on hosts.
	* tree-streamer-in.c (streamer_alloc_tree): Use HOST_WIDE_INT.
	* tree-streamer-out.c (streamer_write_tree_header): Likewise.
	* tree.c (widest_int_cst_value): Remove.
	* tree.h (widest_int_cst_value): Likewise.
	* value-prof.c (dump_histogram_value): Print using PRId64.
	* gengtype.c (main): Also inject int64_t.
	* ggc-page.c (struct max_alignment): Use int64_t.
	* alloc-pool.c (struct allocation_object_def): Likewise.
	* ira-conflicts.c (build_conflict_bit_table): Use uint64_t
	for computation.
	* doc/tm.texi.in: Remove reference to HOST_WIDEST_INT.
	* doc/tm.texi: Regenerated.
	* gengtype-lex.l (IWORD): Handle [u]int64_t.
	* config/sh/sh.c (expand_cbranchdi4): Use gcov_type.
	* config/mmix/mmix-protos.h (mmix_intval, mmix_shiftable_wyde_value,
	mmix_output_register_setting): Use [u]int64_t in prototypes.
	* config/mmix/mmix.c (mmix_print_operand, mmix_output_register_setting,
	mmix_shiftable_wyde_value, mmix_output_shiftvalue_op_from_str,
	mmix_output_octa, mmix_output_shifted_value): Adjust.
	(mmix_intval): Adjust.  Remove unreachable case.
	* config/mmix/mmix.md (*nonlocal_goto_receiver_expanded): Use
	int64_t.

	lto/
	* lto.c (lto_parse_hex): Use int64_t.
	(lto_resolution_read): Likewise.

From-SVN: r210931
2014-05-26 10:42:43 +00:00
Jan Hubicka aede2c10ca tree-core.h (tree_decl_with_vis): Replace comdat_group by symtab_node pointer.
* tree-core.h (tree_decl_with_vis): Replace comdat_group by
	symtab_node pointer.
	* tree.c (copy_node_stat): Be sure tonot copy
	symtab_node pointer.
	(find_decls_types_r): Do not walk COMDAT_GROUP.
	* tree.h (DECL_COMDAT_GROUP): Revamp to use decl_comdat_group.
	* varasm.c (make_decl_one_only): Use set_comdat_group;
	create node if needed.
	* ipa-inline-transform.c (save_inline_function_body): Update
	way we decl->symtab mapping.
	* symtab.c (symtab_hash, hash_node, eq_node
	symtab_insert_node_to_hashtable): Remove.
	(symtab_register_node): Update.
	(symtab_unregister_node): Update.
	(symtab_get_node): Reimplement as inline function.
	(symtab_add_to_same_comdat_group): Update.
	(symtab_dissolve_same_comdat_group_list): Update.
	(dump_symtab_base): Update.
	(verify_symtab_base): Update.
	(symtab_make_decl_local): Update.
	(fixup_same_cpp_alias_visibility): Update.
	(symtab_nonoverwritable_alias): Update.
	* cgraphclones.c (set_new_clone_decl_and_node_flags): Update.
	* ipa.c (update_visibility_by_resolution_info): UPdate.
	* bb-reorder.c: Include cgraph.h
	* lto-streamer-out.c (DFS_write_tree_body, hash_tree): Do not deal
	with comdat groups.
	* ipa-comdats.c (set_comdat_group, ipa_comdats): Update.
	* cgraph.c (cgraph_get_create_node): Update.
	* cgraph.h (struct symtab_node): Add get_comdat_group, set_comdat_group
	and comdat_group_.
	(symtab_get_node): Make inline.
	(symtab_insert_node_to_hashtable): Remove.
	(symtab_can_be_discarded): Update.
	(decl_comdat_group): New function.
	* tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Update.
	* lto-cgraph.c (lto_output_node, lto_output_varpool_node): Stream out
	comdat group name.
	(read_comdat_group): New function.
	(input_node, input_varpool_node): Use it.
	* trans-mem.c (ipa_tm_create_version_alias): Update code creating
	comdat groups.
	* mips.c (mips_start_unique_function): Likewise.
	(ix86_code_end): Likewise.
	(rs6000_code_end): Likweise.
	* tree-streamer-out.c (DECL_COMDAT_GROUP): Do not stream
	comdat group.

	* lto-symtab.c (lto_symtab_merge_symbols): Update code setting
	symtab pointer.
	* lto.c (compare_tree_sccs_1): Do not compare comdat groups.

	* optmize.c (maybe_thunk_body): Use set_comdat_group.
	(maybe_clone_body): Likewise.
	* decl.c (duplicate_decls): Update code duplicating comdat group;
	do not copy symtab pointer; before freeing newdecl remove it
	from symtab.
	* decl2.c (constrain_visibility): Use set_comdat_group.

	* c-decl.c (merge_decls): Preserve symtab node pointers.
	(duplicate_decls): Free new decl.

From-SVN: r210901
2014-05-24 22:00:14 +00:00
Richard Sandiford 632f2871ed tree.def (VOID_CST): New.
gcc/
	* tree.def (VOID_CST): New.
	* tree-core.h (TI_VOID): New.
	* tree.h (void_node): New.
	* tree.c (tree_node_structure_for_code, tree_code_size)
	(iterative_hash_expr): Handle VOID_CST.
	(build_common_tree_nodes): Initialize void_node.

gcc/c-family/
	* c-common.h (CTI_VOID_ZERO, void_zero_node): Delete.
	* c-common.c (c_common_nodes_and_builtins): Don't initialize
	void_zero_node.
	* c-pretty-print.c (pp_c_void_constant): New function.
	(c_pretty_printer::constant, c_pretty_printer::primary_expression)
	(c_pretty_printer::expression): Handle VOID_CST.
	* cilk.c (extract_free_variables): Likewise.
	* c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift)
	(ubsan_instrument_vla): Use void_node instead of void_zero_node.

gcc/c/
	* c-array-notation.c (expand_array_notations): Use void_node
	instead of void_zero_node.

gcc/cp/
	* cvt.c (convert_to_void): Use void_node instead of void_zero_node.
	* cp-array-notation.c (replace_invariant_exprs): Likewise.
	(expand_array_notation): Handle VOID_CST.
	* error.c (dump_expr): Likewise.
	* cxx-pretty-print.c (cxx_pretty_printer::primary_expression)
	(cxx_pretty_printer::expression): Likewise.
	(pp_cxx_new_expression): Use void_node instead of void_zero_node.
	* decl.c (register_dtor_fn): Likewise.
	* init.c (build_raw_new_expr, build_new_1, build_vec_init)
	(build_delete, push_base_cleanups): Likewise.
	* mangle.c (write_expression): Likewise.
	* semantics.c (finish_break_stmt, empty_expr_stmt_p): Likewise.
	* pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
	(tsubst, tsubst_copy, build_non_dependent_expr): Handle VOID_CST.
	* tree.c (cp_tree_equal): Likewise.
	(build_dummy_object, is_dummy_object, stabilize_expr): Use void_node
	instead of void_zero_node.
	* typeck.c (check_return_expr): Likewise.
	* typeck2.c (build_functional_cast): Likewise.

From-SVN: r210692
2014-05-21 11:00:35 +00:00
Trevor Saunders 766090c20f use templates instead of gengtype for typed allocation functions
gcc/ChangeLog:

	* alias.c (record_alias_subset): Adjust.
	* bitmap.c (bitmap_element_allocate): Likewise.
	(bitmap_gc_alloc_stat): Likewise.
	* cfg.c (init_flow): Likewise.
	(alloc_block): Likewise.
	(unchecked_make_edge): Likewise.
	* cfgloop.c (alloc_loop): Likewise.
	(flow_loops_find): Likewise.
	(rescan_loop_exit): Likewise.
	* cfgrtl.c (init_rtl_bb_info): Likewise.
	* cgraph.c (insert_new_cgraph_node_version): Likewise.
	(cgraph_allocate_node): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_allocate_init_indirect_info): Likewise.
	* cgraphclones.c (cgraph_clone_edge): Likewise.
	* cgraphunit.c (add_asm_node): Likewise.
	(init_lowered_empty_function): Likewise.
	* config/aarch64/aarch64.c (aarch64_init_machine_status):
	Likewise.
	* config/alpha/alpha.c (alpha_init_machine_status): Likewise.
	(alpha_use_linkage): Likewise.
	* config/arc/arc.c (arc_init_machine_status): Likewise.
	* config/arm/arm.c (arm_init_machine_status): Likewise.
	* config/avr/avr.c (avr_init_machine_status): Likewise.
	* config/bfin/bfin.c (bfin_init_machine_status): Likewise.
	* config/c6x/c6x.c (c6x_init_machine_status): Likewise.
	* config/cris/cris.c (cris_init_machine_status): Likewise.
	* config/darwin.c (machopic_indirection_name): Likewise.
	(darwin_build_constant_cfstring): Likewise.
	(darwin_enter_string_into_cfstring_table): Likewise.
	* config/epiphany/epiphany.c (epiphany_init_machine_status):
	* Likewise.
	* config/frv/frv.c (frv_init_machine_status): Likewise.
	* config/i386/i386.c (get_dllimport_decl): Likewise.
	(ix86_init_machine_status): Likewise.
	(assign_386_stack_local): Likewise.
	* config/i386/winnt.c (i386_pe_record_external_function):
	Likewise.
	(i386_pe_maybe_record_exported_symbol): Likewise.
	(i386_pe_record_stub): Likewise.
	* config/ia64/ia64.c (ia64_init_machine_status): Likewise.
	* config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise.
	* config/m32c/m32c.c (m32c_init_machine_status): Likewise.
	(m32c_note_pragma_address): Likewise.
	* config/mep/mep.c (mep_init_machine_status): Likewise.
	(mep_note_pragma_flag): Likewise.
	* config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise.
	(mips16_local_alias): Likewise.
	(mips_init_machine_status): Likewise.
	* config/mmix/mmix.c (mmix_init_machine_status): Likewise.
	* config/moxie/moxie.c (moxie_init_machine_status): Likewise.
	* config/msp430/msp430.c (msp430_init_machine_status): Likewise.
	* config/nds32/nds32.c (nds32_init_machine_status): Likewise.
	* config/nios2/nios2.c (nios2_init_machine_status): Likewise.
	* config/pa/pa.c (pa_init_machine_status): Likewise.
	(pa_get_deferred_plabel): Likewise.
	* config/rl78/rl78.c (rl78_init_machine_status): Likewise.
	* config/rs6000/rs6000.c (builtin_function_type): Likewise.
	(rs6000_init_machine_status): Likewise.
	(output_toc): Likewise.
	* config/s390/s390.c (s390_init_machine_status): Likewise.
	* config/score/score.c (score_output_external): Likewise.
	* config/sparc/sparc.c (sparc_init_machine_status): Likewise.
	* config/spu/spu.c (spu_init_machine_status): Likewise.
	* config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise.
	* config/tilepro/tilepro.c (tilepro_init_machine_status):
	* Likewise.
	* config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise.
	* coverage.c (coverage_end_function): Likewise.
	* dbxout.c (dbxout_init): Likewise.
	* doc/gty.texi: Don't mention variable_size attribute.
	* dwarf2cfi.c (new_cfi): Adjust.
	(new_cfi_row): Likewise.
	(copy_cfi_row): Likewise.
	(create_cie_data): Likewise.
	* dwarf2out.c (dwarf2out_alloc_current_fde): Likewise.
	(new_loc_descr): Likewise.
	(find_AT_string_in_table): Likewise.
	(add_addr_table_entry): Likewise.
	(new_die): Likewise.
	(add_var_loc_to_decl): Likewise.
	(clone_die): Likewise.
	(clone_as_declaration): Likewise.
	(break_out_comdat_types): Likewise.
	(new_loc_list): Likewise.
	(add_loc_descr_to_each): Likewise.
	(add_location_or_const_value_attribute): Likewise.
	(add_linkage_name): Likewise.
	(lookup_filename): Likewise.
	(dwarf2out_var_location): Likewise.
	(new_line_info_table): Likewise.
	(dwarf2out_init): Likewise.
	(mem_loc_descriptor): Likewise.
	(loc_descriptor): Likewise.
	(add_const_value_attribute): Likewise.
	(tree_add_const_value_attribute): Likewise.
	(comp_dir_string): Likewise.
	(dwarf2out_vms_debug_main_pointer): Likewise.
	(string_cst_pool_decl): Likewise.
	* emit-rtl.c (set_mem_attrs): Likewise.
	(get_reg_attrs): Likewise.
	(start_sequence): Likewise.
	(init_emit): Likewise.
	(init_emit_regs): Likewise.
	* except.c (init_eh_for_function): Likewise.
	(gen_eh_region): Likewise.
	(gen_eh_region_catch): Likewise.
	(gen_eh_landing_pad): Likewise.
	(add_call_site): Likewise.
	* function.c (add_frame_space): Likewise.
	(insert_temp_slot_address): Likewise.
	(assign_stack_temp_for_type): Likewise.
	(get_hard_reg_initial_val): Likewise.
	(allocate_struct_function): Likewise.
	(prepare_function_start): Likewise.
	(types_used_by_var_decl_insert): Likewise.
	* gengtype.c (variable_size_p): Remove function.
	(enum alloc_quantity): Remove enum.
	(write_typed_alloc_def): Remove function.
	(write_typed_struct_alloc_def): Likewise.
	(write_typed_typedef_alloc_def): Likewise.
	(write_typed_alloc_defns): Likewise.
	(main): Adjust.
	* ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust.
	(ggc_cleared_alloc_ptr_array_two_args): Likewise.
	* ggc.h (ggc_alloc): new function.
	(ggc_cleared_alloc): Likewise.
	(ggc_vec_alloc): Template on type of vector element, and remove
	element size argument.
	(ggc_cleared_vec_alloc): Likewise.
	* gimple.c (gimple_build_omp_for): Adjust.
	(gimple_copy): Likewise.
	* ipa-cp.c (get_replacement_map): Likewise.
	(find_aggregate_values_for_callers_subset): Likewise.
	(known_aggs_to_agg_replacement_list): Likewise.
	* ipa-devirt.c (get_odr_type): Likewise.
	* ipa-prop.c (ipa_node_duplication_hook): Likewise.
	(read_agg_replacement_chain): Likewise.
	* loop-iv.c (get_simple_loop_desc): Likewise.
	* lto-cgraph.c (input_node_opt_summary): Likewise.
	* lto-section-in.c (lto_new_in_decl_state): Likewise.
	* lto-streamer-in.c (lto_input_eh_catch_list): Likewise.
	(input_eh_region): Likewise.
	(input_eh_lp): Likewise.
	(input_cfg): Likewise.
	* optabs.c (set_optab_libfunc): Likewise.
	(init_tree_optimization_optabs): Likewise.
	(set_conv_libfunc): Likewise.
	* passes.c (do_per_function_toporder): Likewise.
	* rtl.h: Don't use variable_size gty attribute.
	* sese.c (if_region_set_false_region): Adjust.
	* stringpool.c (gt_pch_save_stringpool): Likewise.
	* target-globals.c (save_target_globals): Likewise.
	* toplev.c (general_init): Likewise.
	* trans-mem.c (record_tm_replacement): Likewise.
	(split_bb_make_tm_edge): Likewise.
	* tree-cfg.c (move_sese_region_to_fn): Likewise.
	* tree-data-ref.h (lambda_vector_new): Likewise.
	* tree-eh.c (add_stmt_to_eh_lp_fn): Likewise.
	* tree-iterator.c (tsi_link_before): Likewise.
	(tsi_link_after): Likewise.
	* tree-scalar-evolution.c (new_scev_info_str): Likewise.
	* tree-ssa-loop-niter.c (record_estimate): Likewise.
	* tree-ssa-operands.c (ssa_operand_alloc): Likewise.
	* tree-ssa-operands.h: Don't use variable_size gty attribute.
	* tree-ssa.c (init_tree_ssa): Adjust.
	* tree-ssanames.c (set_range_info): Likewise.
	(get_ptr_info): Likewise.
	(duplicate_ssa_name_ptr_info): Likewise.
	(duplicate_ssa_name_range_info): Likewise.
	* tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise.
	(unpack_ts_fixed_cst_value_fields): Likewise.
	* tree.c (build_fixed): Likewise.
	(build_real): Likewise.
	(build_string): Likewise.
	(decl_priority_info): Likewise.
	(decl_debug_expr_insert): Likewise.
	(decl_value_expr_insert): Likewise.
	(decl_debug_args_insert): Likewise.
	(type_hash_add): Likewise.
	(build_omp_clause): Likewise.
	* ubsan.c (decl_for_type_insert): Likewise.
	* varasm.c (get_unnamed_section): Likewise.
	(get_noswitch_section): Likewise.
	(get_section): Likewise.
	(get_block_for_section): Likewise.
	(create_block_symbol): Likewise.
	(build_constant_desc): Likewise.
	(create_constant_pool): Likewise.
	(force_const_mem): Likewise.
	(record_tm_clone_pair): Likewise.
	* varpool.c (varpool_create_empty_node): Likewise.

gcc/c/ChangeLog:

	* c-decl.c (finish_struct): Adjust.
	(finish_enum): Likewise.
	(bind): Adjust.
	(record_inline_static): Likewise.
	(push_scope): Likewise.
	(make_label): Likewise.
	(lookup_label_for_goto): Likewise.
	(finish_struct): Likewise.
	(finish_enum): Likewise.
	(store_parm_decls): Likewise.
	(c_push_function_context): Likewise.
	* c-lang.h: Remove usage of variable_size gty attribute.
	* c-parser.c (c_parse_init): Adjust.
	(c_parse_file): Likewise.

gcc/java/ChangeLog:

	* class.c (add_method_1): Adjust.
	(java_treetreehash_new): Likewise.
	* constants.c (set_constant_entry): Likewise.
	(cpool_for_class): Likewise.
	* decl.c (make_binding_level): Likewise.
	(java_dup_lang_specific_decl): Likewise.
	* expr.c (add_type_assertion): Likewise.
	* java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise.
	(lang_decl): don't use variable_size gty attribute.
	(MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust.
	(lang_type): Don't use variable_size gty attribute.
	* jcf-parse.c (java_parse_file): Adjust.
	(process_zip_dir): Likewise.
	* jcf.h: Remove usage of variable_size gty attribute.
	* jcf-reader.c (jcf_parse_constant_pool): Adjust.
	(jcf_parse_bootstrap_methods): Likewise.

gcc/objc/ChangeLog:

	* objc-act.c (objc_build_string_object): Adjust.
	(continue_class): Likewise.
	* objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise.
	* objc-map.c (objc_map_alloc_ggc): Likewise.
	(objc_map_private_resize): Likewise.
	* objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init):
	Likewise.
	(hash_name_enter): Likewise.

gcc/cp/ChangeLog:

	* class.c (sorted_fields_type_new): Adjust.
	* cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise.
	* cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
	* cp-tree.h: Remove usage of variable_size gty attribute.
	* decl.c (make_label_decl): Adjust.
	(check_goto): Likewise.
	(start_preparsed_function): Likewise.
	(save_function_data): Likewise.
	* lex.c (init_reswords): Likewise.
	(retrofit_lang_decl): Likewise.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.
	* name-lookup.c (binding_entry_make): Likewise.
	(binding_table_construct): Likewise.
	(binding_table_new): Likewise.
	(cxx_binding_make): Likewise.
	(pushdecl_maybe_friend_1): Likewise.
	(begin_scope): Likewise.
	(push_to_top_level): Likewise.
	* parser.c (cp_lexer_alloc): Likewise.
	(cp_lexer_new_from_tokens): Likewise.
	(cp_token_cache_new): Likewise.
	(cp_parser_context_new): Likewise.
	(cp_parser_new): Likewise.
	(cp_parser_nested_name_specifier_opt): Likewise.
	(cp_parser_template_id): Likewise.
	* pt.c (maybe_process_partial_specialization): Likewise.
	(register_specialization): Likewise.
	(add_pending_template): Likewise.
	(lookup_template_class_1): Likewise.
	(push_tinst_level): Likewise.
	* semantics.c (register_constexpr_fundef): Likewise.
	(cxx_eval_call_expression): Likewise.
	* typeck2.c (abstract_virtuals_error_sfinae): Likewise.

gcc/fortran/ChangeLog:

	* f95-lang.c (pushlevel): Adjust.
	* trans-decl.c (gfc_allocate_lang_decl): Adjust.
	(gfc_find_module): Likewise.
	* trans-types.c (gfc_get_nodesc_array_type): Likewise.
	(gfc_get_array_type_bounds): Likewise.
	(gfc_nonrestricted_type): Likewise.
	* trans.h: Don't use variable_size gty attribute.

gcc/ada/ChangeLog:

	* gcc-interface/ada-tree.h: Remove usage of variable_size gty
	annotation.
	* gcc-interface/decl.c (annotate_value): Adjust.
	* gcc-interface/trans.c (Attribute_to_gnu): Likewise.
	(push_range_check_info): Likewise.
	(Loop_Statement_to_gnu): Likewise.
	(Subprogram_Body_to_gnu): Likewise.
	(Compilation_Unit_to_gnu): Likewise.
	(start_stmt_group): Likewise.
	* gcc-interface/utils.c (init_gnat_utils): Likewise.
	(gnat_pushlevel): Likewise.
	(maybe_pad_type): Likewise.

gcc/go/ChangeLog:

	* go-lang.c (struct GTY): Don't use variable_size gty attribute.

gcc/c-family/ChangeLog:

	* c-common.h (sorted_fields_type): Remove variable_size GTY attribute.
	* c-pragma.c (push_alignment): Adjust.
	(handle_pragma_push_options): Likewise.

gcc/lto/ChangeLog:

	* lto-tree.h: Don't use variable_size gty attribute.
	* lto.c (lto_read_in_decl_state): Adjust.
	(create_subid_section_table): Likewise.
	(lto_flatten_files): Likewise.
	(read_cgraph_and_symbols): Likewise.

gcc/objcp/ChangeLog:

	* objcp-decl.h: Adjust.

From-SVN: r210566
2014-05-17 23:07:23 +00:00
Trevor Saunders 231120e5d4 rm a bunch of _stat allocation functions
Now that we can use c++ default arguments there's no reason to use
functions and wrapper macros.

gcc/ChangeLog:

	* dwarf2out.c (tree_add_const_value_attribute): Call
	ggc_internal_cleared_alloc instead of ggc_alloc_cleared_atomic.
	* gengtype.c (write_typed_alloc_def): Call ggc_internal_<x>alloc
	instead of ggc_internal_<x>alloc_stat.
	* ggc-common.c (ggc_internal_cleared_alloc): Drop _stat suffix.
	(ggc_realloc): Likewise.
	* ggc-none.c (ggc_internal_alloc): Likewise.
	(ggc_internal_cleared_alloc): Likewise.
	* ggc-page.c: Likewise.
	* ggc.h (ggc_internal_alloc_stat): Likewise.
	(ggc_internal_alloc): Remove macro.
	(ggc_internal_cleared_alloc_stat): Drop _stat suffix.
	(ggc_internal_cleared_alloc): Remove macro.
	(GGC_RESIZEVEC): Adjust.
	(ggc_resizevar): Remove macro.
	(ggc_internal_vec_alloc_stat): Drop _stat suffix.
	(ggc_internal_cleared_vec_alloc_stat): Likewise.
	(ggc_internal_vec_cleared_alloc): Remove macro.
	(ggc_alloc_atomic_stat): Drop _stat suffix.
	(ggc_alloc_atomic): Remove macro.
	(ggc_alloc_cleared_atomic): Remove macro.
	(ggc_alloc_string_stat): Drop _stat suffix.
	(ggc_alloc_string): Remove macro.
	(ggc_alloc_rtx_def_stat): Adjust.
	(ggc_alloc_tree_node_stat): Likewise.
	(ggc_alloc_cleared_tree_node_stat): Likewise.
	(ggc_alloc_cleared_gimple_statement_stat): Likewise.
	(ggc_alloc_cleared_simd_clone_stat): Likewise.
	* gimple.c (gimple_build_omp_for): Likewise.
	(gimple_copy): Likewise.
	* stringpool.c (ggc_alloc_string_stat): Drop _stat suffix.
	* toplev.c (realloc_for_line_map): Adjust.
	* tree-data-ref.h (lambda_vector_new): Likewise.
	* tree-phinodes.c (allocate_phi_node): Likewise.
	* tree.c (grow_tree_vec_stat): Likewise.
	* vec.h (va_gc::reserve): Adjust.

gcc/java/ChangeLog:

	* constants.c (set_constant_entry): Adjust.

From-SVN: r210565
2014-05-17 23:06:33 +00:00
Jakub Jelinek dd2fc5256e tree.h (OMP_CLAUSE_LINEAR_STMT): Define.
* tree.h (OMP_CLAUSE_LINEAR_STMT): Define.
	* tree.c (omp_clause_num_ops): Increase OMP_CLAUSE_LINEAR
	number of operands to 3.
	(walk_tree_1): Walk all operands of OMP_CLAUSE_LINEAR.
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Handle OMP_CLAUSE_DEPEND.
	* gimplify.c (gimplify_scan_omp_clauses): Handle
	OMP_CLAUSE_LINEAR_STMT.
	* omp-low.c (lower_rec_input_clauses): Fix typo.
	(maybe_add_implicit_barrier_cancel, lower_omp_1): Add
	cast between Fortran boolean_type_node and C _Bool if
	needed.
gcc/fortran/
	* gfortran.h (gfc_statement): Add ST_OMP_CANCEL,
	ST_OMP_CANCELLATION_POINT, ST_OMP_TASKGROUP, ST_OMP_END_TASKGROUP,
	ST_OMP_SIMD, ST_OMP_END_SIMD, ST_OMP_DO_SIMD, ST_OMP_END_DO_SIMD,
	ST_OMP_PARALLEL_DO_SIMD, ST_OMP_END_PARALLEL_DO_SIMD and
	ST_OMP_DECLARE_SIMD.
	(gfc_omp_namelist): New typedef.
	(gfc_get_omp_namelist): Define.
	(OMP_LIST_UNIFORM, OMP_LIST_ALIGNED, OMP_LIST_LINEAR,
	OMP_LIST_DEPEND_IN, OMP_LIST_DEPEND_OUT): New clause list kinds.
	(gfc_omp_proc_bind_kind, gfc_omp_cancel_kind): New enums.
	(gfc_omp_clauses): Change type of lists to gfc_omp_namelist *.
	Add inbranch, notinbranch, cancel, proc_bind, safelen_expr and
	simdlen_expr fields.
	(gfc_omp_declare_simd): New typedef.
	(gfc_get_omp_declare_simd): Define.
	(gfc_namespace): Add omp_declare_simd field.
	(gfc_exec_op): Add EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
	EXEC_OMP_TASKGROUP, EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD and
	EXEC_OMP_PARALLEL_DO_SIMD.
	(gfc_omp_atomic_op): Add GFC_OMP_ATOMIC_MASK, GFC_OMP_ATOMIC_SEQ_CST
	and GFC_OMP_ATOMIC_SWAP.
	(gfc_code): Change type of omp_namelist field to gfc_omp_namelist *.
	(gfc_free_omp_namelist, gfc_free_omp_declare_simd,
	gfc_free_omp_declare_simd_list, gfc_resolve_omp_declare_simd): New
	prototypes.
	* trans-stmt.h (gfc_trans_omp_declare_simd): New prototype.
	* symbol.c (gfc_free_namespace): Call gfc_free_omp_declare_simd.
	* openmp.c (gfc_free_omp_clauses): Free safelen_expr and
	simdlen_expr.  Use gfc_free_omp_namelist instead of
	gfc_free_namelist.
	(gfc_free_omp_declare_simd, gfc_free_omp_declare_simd_list): New
	functions.
	(gfc_match_omp_variable_list): Add end_colon, headp and
	allow_sections arguments.  Handle parsing of array sections.
	Use *omp_namelist* instead of *namelist* data structure and
	functions/macros.  Allow termination at : character.
	(OMP_CLAUSE_ALIGNED, OMP_CLAUSE_DEPEND, OMP_CLAUSE_INBRANCH,
	OMP_CLAUSE_LINEAR, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_PROC_BIND,
	OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_UNIFORM): Define.
	(gfc_match_omp_clauses): Change first and needs_space variables
	into arguments with default values.  Parse inbranch, notinbranch,
	proc_bind, safelen, simdlen, uniform, linear, aligned and
	depend clauses.
	(OMP_PARALLEL_CLAUSES): Add OMP_CLAUSE_PROC_BIND.
	(OMP_DECLARE_SIMD_CLAUSES, OMP_SIMD_CLAUSES): Define.
	(OMP_TASK_CLAUSES): Add OMP_CLAUSE_DEPEND.
	(gfc_match_omp_do_simd): New function.
	(gfc_match_omp_flush): Use *omp_namelist* instead of *namelist*
	data structure and functions/macros.
	(gfc_match_omp_simd, gfc_match_omp_declare_simd,
	gfc_match_omp_parallel_do_simd): New functions.
	(gfc_match_omp_atomic): Handle seq_cst clause.  Handle atomic swap.
	(gfc_match_omp_taskgroup, gfc_match_omp_cancel_kind,
	gfc_match_omp_cancel, gfc_match_omp_cancellation_point): New
	functions.
	(resolve_omp_clauses): Add where, omp_clauses and ns arguments.
	Use *omp_namelist* instead of *namelist* data structure and
	functions/macros.  Resolve uniform, aligned, linear, depend,
	safelen and simdlen clauses.
	(resolve_omp_atomic): Adjust for GFC_OMP_ATOMIC_{MASK,SEQ_CST,SWAP}
	addition, recognize atomic swap.
	(gfc_resolve_omp_parallel_blocks): Use gfc_omp_namelist instead
	of gfc_namelist.  Handle EXEC_OMP_PARALLEL_DO_SIMD the same as
	EXEC_OMP_PARALLEL_DO.
	(gfc_resolve_do_iterator): Use *omp_namelist* instead of *namelist*
	data structure and functions/macros.
	(resolve_omp_do): Likewise.  Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD.
	(gfc_resolve_omp_directive): Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD and EXEC_OMP_CANCEL.  Adjust
	resolve_omp_clauses caller.
	(gfc_resolve_omp_declare_simd): New function.
	* parse.c (decode_omp_directive): Parse cancellation point, cancel,
	declare simd, end do simd, end simd, end parallel do simd,
	end taskgroup, parallel do simd, simd and taskgroup directives.
	(case_executable): Add ST_OMP_CANCEL and ST_OMP_CANCELLATION_POINT.
	(case_exec_markers): Add ST_OMP_TASKGROUP, case ST_OMP_SIMD,
	ST_OMP_DO_SIMD and ST_OMP_PARALLEL_DO_SIMD.
	(case_decl): Add ST_OMP_DECLARE_SIMD.
	(gfc_ascii_statement): Handle ST_OMP_CANCEL,
	ST_OMP_CANCELLATION_POINT, ST_OMP_TASKGROUP, ST_OMP_END_TASKGROUP,
	ST_OMP_SIMD, ST_OMP_END_SIMD, ST_OMP_DO_SIMD, ST_OMP_END_DO_SIMD,
	ST_OMP_PARALLEL_DO_SIMD, ST_OMP_END_PARALLEL_DO_SIMD and
	ST_OMP_DECLARE_SIMD.
	(parse_omp_do): Handle ST_OMP_SIMD, ST_OMP_DO_SIMD and
	ST_OMP_PARALLEL_DO_SIMD.
	(parse_omp_atomic): Adjust for GFC_OMP_ATOMIC_* additions.
	(parse_omp_structured_block): Handle ST_OMP_TASKGROUP and
	ST_OMP_PARALLEL_DO_SIMD.
	(parse_executable): Handle ST_OMP_SIMD, ST_OMP_DO_SIMD,
	ST_OMP_PARALLEL_DO_SIMD and ST_OMP_TASKGROUP.
	* trans-decl.c (gfc_get_extern_function_decl,
	gfc_create_function_decl): Call gfc_trans_omp_declare_simd if
	needed.
	* frontend-passes.c (gfc_code_walker): Handle EXEC_OMP_SIMD,
	EXEC_OMP_DO_SIMD and EXEC_OMP_PARALLEL_DO_SIMD.  Walk
	safelen_expr and simdlen_expr.  Walk expressions in gfc_omp_namelist
	of depend, aligned and linear clauses.
	* match.c (match_exit_cycle): Handle EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD
	and EXEC_OMP_PARALLEL_DO_SIMD.
	(gfc_free_omp_namelist): New function.
	* dump-parse-tree.c (show_namelist): Removed.
	(show_omp_namelist): New function.
	(show_omp_node): Handle OpenMP 4.0 additions.
	(show_code_node): Handle EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
	EXEC_OMP_DO_SIMD, EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and
	EXEC_OMP_TASKGROUP.
	* match.h (gfc_match_omp_cancel, gfc_match_omp_cancellation_point,
	gfc_match_omp_declare_simd, gfc_match_omp_do_simd,
	gfc_match_omp_parallel_do_simd, gfc_match_omp_simd,
	gfc_match_omp_taskgroup): New prototypes.
	* trans-openmp.c (gfc_trans_omp_variable): Add declare_simd
	argument, handle it.  Allow current_function_decl to be NULL.
	(gfc_trans_omp_variable_list): Add declare_simd argument, pass
	it through to gfc_trans_omp_variable and disregard whether
	sym is referenced if declare_simd is true.  Work on gfc_omp_namelist
	instead of gfc_namelist.
	(gfc_trans_omp_reduction_list): Work on gfc_omp_namelist instead of
	gfc_namelist.  Adjust gfc_trans_omp_variable caller.
	(gfc_trans_omp_clauses): Add declare_simd argument, pass it through
	to gfc_trans_omp_variable{,_list} callers.  Work on gfc_omp_namelist
	instead of gfc_namelist.  Handle inbranch, notinbranch, safelen,
	simdlen, depend, uniform, linear, proc_bind and aligned clauses.
	Handle cancel kind.
	(gfc_trans_omp_atomic): Handle seq_cst clause, handle atomic swap,
	adjust for GFC_OMP_ATOMIC_* changes.
	(gfc_trans_omp_cancel, gfc_trans_omp_cancellation_point): New
	functions.
	(gfc_trans_omp_do): Add op argument, handle simd translation into
	generic.
	(GFC_OMP_SPLIT_SIMD, GFC_OMP_SPLIT_DO, GFC_OMP_SPLIT_PARALLEL,
	GFC_OMP_SPLIT_NUM, GFC_OMP_MASK_SIMD, GFC_OMP_MASK_DO,
	GFC_OMP_MASK_PARALLEL): New.
	(gfc_split_omp_clauses, gfc_trans_omp_do_simd): New functions.
	(gfc_trans_omp_parallel_do): Rework to use gfc_split_omp_clauses.
	(gfc_trans_omp_parallel_do_simd, gfc_trans_omp_taskgroup): New
	functions.
	(gfc_trans_omp_directive): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	Adjust gfc_trans_omp_do caller.
	(gfc_trans_omp_declare_simd): New function.
	* st.c (gfc_free_statement): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	For EXEC_OMP_FLUSH call gfc_free_omp_namelist instead of
	gfc_free_namelist.
	* module.c (omp_declare_simd_clauses): New variable.
	(mio_omp_declare_simd): New function.
	(mio_symbol): Call it.
	* trans.c (trans_code): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	* resolve.c (gfc_resolve_blocks): Handle EXEC_OMP_DO_SIMD,  
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	(resolve_code): Handle EXEC_OMP_CANCEL,
	EXEC_OMP_CANCELLATION_POINT, EXEC_OMP_DO_SIMD,
	EXEC_OMP_PARALLEL_DO_SIMD, EXEC_OMP_SIMD and EXEC_OMP_TASKGROUP.
	(resolve_types): Call gfc_resolve_omp_declare_simd.
gcc/testsuite/
	* gfortran.dg/gomp/affinity-1.f90: New test.
libgomp/
	* testsuite/libgomp.fortran/cancel-do-1.f90: New test.
	* testsuite/libgomp.fortran/cancel-do-2.f90: New test.
	* testsuite/libgomp.fortran/cancel-parallel-1.f90: New test.
	* testsuite/libgomp.fortran/cancel-parallel-3.f90: New test.
	* testsuite/libgomp.fortran/cancel-sections-1.f90: New test.
	* testsuite/libgomp.fortran/cancel-taskgroup-2.f90: New test.
	* testsuite/libgomp.fortran/declare-simd-1.f90: New test.
	* testsuite/libgomp.fortran/declare-simd-2.f90: New test.
	* testsuite/libgomp.fortran/declare-simd-3.f90: New test.
	* testsuite/libgomp.fortran/depend-1.f90: New test.
	* testsuite/libgomp.fortran/depend-2.f90: New test.
	* testsuite/libgomp.fortran/omp_atomic5.f90: New test.
	* testsuite/libgomp.fortran/simd1.f90: New test.
	* testsuite/libgomp.fortran/simd2.f90: New test.
	* testsuite/libgomp.fortran/simd3.f90: New test.
	* testsuite/libgomp.fortran/simd4.f90: New test.
	* testsuite/libgomp.fortran/taskgroup1.f90: New test.

From-SVN: r210313
2014-05-11 22:26:36 +02:00
Kenneth Zadeck 807e902eea Merge in wide-int.
From-SVN: r210113
2014-05-06 16:25:05 +00:00
Trevor Saunders be55bfe6cf pass cfun to pass::execute
gcc/
	* passes.c (opt_pass::execute): Adjust.
	(pass_manager::execute_pass_mode_switching): Likewise.
	(early_local_passes::execute): Likewise.
	(execute_one_pass): Pass cfun to the pass's execute method.
	* tree-pass.h (opt_pass::execute): Add function * argument.
	* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
	cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
	compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
	config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
	config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
	config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
	except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
	gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
	graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
	ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
	ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
	lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
	postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
	reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
	store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
	tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
	tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
	tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
	tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
	tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
	tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
	tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
	tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
	Adjust.

From-SVN: r209482
2014-04-17 12:37:34 +00:00
Trevor Saunders 0481253d15 remove has_gate
gcc/
	* passes.c (dump_one_pass): don't check pass->has_gate.
	(execute_ipa_summary_passes): Likewise.
	(execute_one_pass): Likewise.
	(ipa_write_summaries_2): Likewise.
	(ipa_write_optimization_summaries_1): Likewise.
	(ipa_read_optimization_summaries_1): Likewise.
	(execute_ipa_stmt_fixups): Likewise.
	* tree-pass.h (pass_data::has_gate): Remove.
	* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
	cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
	compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
	config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
	config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
	config/sh/sh_optimize_sett_clrt.cc, config/sh/sh_treg_combine.cc,
	config/sparc/sparc.c, cprop.c, cse.c, dce.c, df-core.c, dse.c,
	dwarf2cfi.c, except.c, final.c, function.c, fwprop.c, gcse.c,
	gimple-low.c, gimple-ssa-isolate-paths.c,
	gimple-ssa-strength-reduction.c, graphite.c, ifcvt.c, init-regs.c,
	ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
	ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa.c,
	ira.c, jump.c, loop-init.c, lower-subreg.c, mode-switching.c,
	modulo-sched.c, omp-low.c, postreload-gcse.c, postreload.c, predict.c,
	recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c,
	reorg.c, sched-rgn.c, stack-ptr-mod.c, store-motion.c, tracer.c,
	trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c,
	tree-complex.c, tree-eh.c, tree-emutls.c, tree-if-conv.c,
	tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
	tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-profile.c,
	tree-sra.c, tree-ssa-ccp.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
	tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
	tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
	tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
	Adjust.

gcc/testsuite/
	* g++.dg/plugin/dumb_plugin.c, g++.dg/plugin/selfassign.c,
	gcc.dg/plugin/one_time_plugin.c, gcc.dg/plugin/selfassign.c: Adjust.

From-SVN: r209479
2014-04-17 12:36:56 +00:00
Richard Biener 349e621099 tree.c (iterative_hash_expr): Use enum tree_code_class to store TREE_CODE_CLASS.
2014-04-15  Richard Biener  <rguenther@suse.de>

	* tree.c (iterative_hash_expr): Use enum tree_code_class
	to store TREE_CODE_CLASS.
	(tree_block): Likewise.
	(tree_set_block): Likewise.
	* tree.h (fold_build_pointer_plus_loc): Use
	convert_to_ptrofftype_loc.

From-SVN: r209406
2014-04-15 08:08:06 +00:00
Paolo Carlini 9dba4b5565 tree.h (TYPE_IDENTIFIER): Declare.
2014-04-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* tree.h (TYPE_IDENTIFIER): Declare.
	* tree.c (subrange_type_for_debug_p): Use it.
	* godump.c (go_format_type): Likewise.
	* dwarf2out.c (is_cxx_auto, modified_type_die,
	gen_type_die_with_usage, gen_type_die_with_usage): Likewise.
	* dbxout.c (dbxout_type, dbxout_symbol): Likewise.

/cp
2014-04-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* cp-tree.h (TYPE_IDENTIFIER): Remove declaration.
      	    
/objcp
2014-04-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* objcp-decl.h (OBJC_TYPE_NAME, OBJC_SET_TYPE_NAME): Use
	TYPE_IDENTIFIER.

/ada
2014-04-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* gcc-interface/decl.c (gnat_to_gnu_entity, components_to_record):
	Use TYPE_IDENTIFIER.
	* gcc-interface/utils.c (make_aligning_type, maybe_pad_type,
	finish_record_type, rest_of_record_type_compilation): Likewise.

From-SVN: r209390
2014-04-14 18:10:27 +00:00
Richard Biener 3c1c08d6d7 re PR c++/60474 (Crash in tree_class_check)
2014-03-10  Richard Biener  <rguenther@suse.de>

	PR middle-end/60474
	* tree.c (signed_or_unsigned_type_for): Handle OFFSET_TYPEs.

	* g++.dg/torture/pr60474.C: New testcase.

From-SVN: r208451
2014-03-10 13:27:16 +00:00
Jakub Jelinek 7ee9c16fa8 re PR c++/60082 (Certain Cilk keywords executable Hanging for -O1)
PR c++/60082
	* tree.c (build_common_builtin_nodes): Set ECF_LEAF for
	__builtin_setjmp_receiver.

	Revert
	2014-02-05  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* g++.dg/cilk-plus/CK/catch_exc.cc: Disable test for -O1.
	* c-c++-common/cilk-plus/CK/spawner_inline.c: Likewise.

From-SVN: r207597
2014-02-07 11:49:08 +01:00
Jan Hubicka 39960d1cfa re PR ipa/59882 (internal compiler error: Segmentation fault)
PR ipa/59882
	* tree.c (get_binfo_at_offset): Do not get confused by empty classes;
	* g++.dg/torture/pr59882.C: New testcase

From-SVN: r207451
2014-02-04 06:28:22 +00:00
Jason Merrill 404c2aeaae re PR c++/59633 (ICE with __attribute((vector_size(...))) for enum)
PR c++/59633
gcc/
	* tree.c (walk_type_fields): Handle VECTOR_TYPE.
gcc/cp/
	* decl2.c (attributes_naming_typedef_ok): New.
	* cp-tree.h: Declare it.
	* decl.c (grokdeclarator): Check it.
	* tree.c (no_linkage_check): Handle VECTOR_TYPE.

From-SVN: r207302
2014-01-30 09:21:31 -05:00
Jakub Jelinek 09b22f48d4 re PR middle-end/59917 (ICE in calc_dfs_tree, at dominance.c:401)
PR middle-end/59917
	PR tree-optimization/59920
	* tree.c (build_common_builtin_nodes): Remove
	__builtin_setjmp_dispatcher initialization.
	* omp-low.h (make_gimple_omp_edges): Add a new int * argument.
	* profile.c (branch_prob): Use gsi_start_nondebug_after_labels_bb
	instead of gsi_after_labels + manually skipping debug stmts.
	Don't ignore bbs with BUILT_IN_SETJMP_DISPATCHER, instead
	ignore bbs with IFN_ABNORMAL_DISPATCHER.
	* tree-inline.c (copy_edges_for_bb): Remove
	can_make_abnormal_goto argument, instead add abnormal_goto_dest
	argument.  Ignore computed_goto_p stmts.  Don't call
	make_abnormal_goto_edges.  If a call might need abnormal edges
	for non-local gotos, see if it already has an edge to
	IFN_ABNORMAL_DISPATCHER or if it is IFN_ABNORMAL_DISPATCHER
	with true argument, don't do anything then, otherwise add
	EDGE_ABNORMAL from the call's bb to abnormal_goto_dest.
	(copy_cfg_body): Compute abnormal_goto_dest, adjust copy_edges_for_bb
	caller.
	* gimple-low.c (struct lower_data): Remove calls_builtin_setjmp.
	(lower_function_body): Don't emit __builtin_setjmp_dispatcher.
	(lower_stmt): Don't set data->calls_builtin_setjmp.
	(lower_builtin_setjmp): Adjust comment.
	* builtins.def (BUILT_IN_SETJMP_DISPATCHER): Remove.
	* tree-cfg.c (found_computed_goto): Remove.
	(factor_computed_gotos): Remove.
	(make_goto_expr_edges): Return bool, true for computed gotos.
	Don't call make_abnormal_goto_edges.
	(build_gimple_cfg): Don't set found_computed_goto, don't call
	factor_computed_gotos.
	(computed_goto_p): No longer static.
	(make_blocks): Don't set found_computed_goto.
	(get_abnormal_succ_dispatcher, handle_abnormal_edges): New functions.
	(make_edges): If make_goto_expr_edges returns true, push bb
	into ab_edge_goto vector, for stmt_can_make_abnormal_goto calls
	instead of calling make_abnormal_goto_edges push bb into ab_edge_call
	vector.  Record mapping between bbs and OpenMP regions if there
	are any, adjust make_gimple_omp_edges caller.  Call
	handle_abnormal_edges.
	(make_abnormal_goto_edges): Remove.
	* tree-cfg.h (make_abnormal_goto_edges): Remove.
	(computed_goto_p, get_abnormal_succ_dispatcher): New prototypes.
	* internal-fn.c (expand_ABNORMAL_DISPATCHER): New function.
	* builtins.c (expand_builtin): Don't handle
	BUILT_IN_SETJMP_DISPATCHER.
	* internal-fn.def (ABNORMAL_DISPATCHER): New.
	* omp-low.c (make_gimple_omp_edges): Add region_idx argument, when
	filling *region also set *region_idx to (*region)->entry->index.

	* gcc.dg/pr59920-1.c: New test.
	* gcc.dg/pr59920-2.c: New test.
	* gcc.dg/pr59920-3.c: New test.
	* c-c++-common/gomp/pr59917-1.c: New test.
	* c-c++-common/gomp/pr59917-2.c: New test.

From-SVN: r207231
2014-01-29 12:02:46 +01:00
Jan Hubicka f910753dbe re PR ipa/59775 (internal compiler error: Segmentation fault)
PR ipa/59775
	* tree.c (get_binfo_at_offset): Look harder for virtual bases.

From-SVN: r206694
2014-01-17 01:04:59 +00:00
Jakub Jelinek e83b8e2e24 re PR target/58115 (testcase gcc.target/i386/intrinsics_4.c failure)
PR target/58115
	* tree-core.h (struct target_globals): New forward declaration.
	(struct tree_target_option): Add globals field.
	* tree.h (TREE_TARGET_GLOBALS): Define.
	(prepare_target_option_nodes_for_pch): New prototype.
	* target-globals.h (struct target_globals): Define even if
	!SWITCHABLE_TARGET.
	* tree.c (prepare_target_option_node_for_pch,
	prepare_target_option_nodes_for_pch): New functions.
	* config/i386/i386.h (SWITCHABLE_TARGET): Define.
	* config/i386/i386.c: Include target-globals.h.
	(ix86_set_current_function): Instead of doing target_reinit
	unconditionally, use save_target_globals_default_opts and
	restore_target_globals.
c-family/
	* c-pch.c (c_common_write_pch): Call
	prepare_target_option_nodes_for_pch.

From-SVN: r206478
2014-01-09 19:25:19 +01:00
Richard Sandiford 23a5b65a92 Update copyright years in gcc/
From-SVN: r206289
2014-01-02 22:23:26 +00:00
Oleg Endo 2c8326a568 asan.c: Remove struct tags when referring to class varpool_node.
* asan.c: Remove struct tags when referring to class varpool_node.
	* cgraph.h: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* dbxout.c: Likewise.
	* dwarf2out.c: Likewise.
	* gimple-fold.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* passes.c: Likewise.
	* toplev.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.

	* cp/decl2.c: Remove struct tags when referring to class varpool_node.

	* lto/lto.c: Remove struct tags when referring to class varpool_node.
	* lto/lto-partition.c: Likewise.
	* lto/lto-symtab.c: Likewise.

From-SVN: r205733
2013-12-06 10:40:53 +00:00
Tobias Burnus 5f673c6a1c re PR debug/37132 (Debug: No DW_TAG_namelist emitted for NAMELISTS)
gcc/
2013-12-04  Tobias Burnus  <burnus@net-b.de>

        PR debug/37132
        * lto-streamer.h (LTO_tags): Add LTO_namelist_decl_ref.
        * tree.def (NAMELIST_DECL): Add.
        * tree.h (NAMELIST_DECL_ASSOCIATED_DECL): New macro.
        * tree.c (initialize_tree_contains_struct): Add asserts for it.
        * dwarf2out.c (gen_namelist_decl): New function.
        (gen_decl_die, dwarf2out_decl): Call it.
        (dwarf2out_imported_module_or_decl_1): Handle NAMELIST_DECL.
        * lto-streamer-in.c (lto_input_tree_ref): Handle NAMELIST_DECL.
        (lto_input_tree_ref, lto_input_tree_1): Update lto_tag_check_range
        call.
        * lto-streamer-out.c (lto_output_tree_ref): Handle
        * NAMELIST_DECL.

gcc/fortran
2013-12-04  Tobias Burnus  <burnus@net-b.de>

        PR debug/37132
        * trans-decl.c (generate_namelist_decl, create_module_nml_decl):
        New static functions.
        (gfc_generate_module_vars, generate_local_vars): Call them.
        (gfc_trans_use_stmts): Handle namelists for debug genertion.

From-SVN: r205679
2013-12-04 20:59:42 +01:00
Ilya Enkovich 089d122746 revert: cgraph.h (varpool_node): Add need_bounds_init field.
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
2013-11-29 12:12:39 +00:00
Andrew MacLeod fceec4d3d7 hooks.h (hook_uint_mode_0): Add Prototype.
* hooks.h (hook_uint_mode_0): Add Prototype.
	* hooks.c (hook_uint_mode_0): New default function.
	* target.def (atomic_align_for_mode): New target hook.
	* tree.c (build_atomic_base): Add alignment override parameter.
	(build_common_tree_nodes): Use atomic alignment override.
	* doc/tm.texi.in (TARGET_ATOMIC_ALIGN_FOR_MODE): Define.
	* doc/tm.texi (TARGET_ATOMIC_ALIGN_FOR_MODE): Add description.

From-SVN: r205273
2013-11-22 16:19:21 +00:00
Andrew MacLeod 2fb9a547b4 gimple.h: Remove all includes.
* gimple.h: Remove all includes.
	(recalculate_side_effects): Move prototype to gimplify.h.
	* Makefile.in (PLUGIN_HEADERS): Add flattened gimple.h includes.
	* gengtype.c (open_base_files): Add gimple.h include list.
	* gimplify.h (recalculate_side_effects): Relocate prototype here.
	* gimple.c: Adjust include list.
	(recalculate_side_effects): Move to gimplify.c.
	* gimplify.c: Adjust include list.
	(recalculate_side_effects): Relocate from gimple.c.
	* alias.c: Add required include files removed from gimple.h.
	* asan.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* data-streamer.c: Likewise.
	* data-streamer-in.c: Likewise.
	* data-streamer-out.c: Likewise.
	* dse.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimple-walk.c: Likewise.
	* gimplify-me.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* internal-fn.c: Likewise.
	* ipa.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-devirt.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* langhooks.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-compress.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* omp-low.c: Likewise.
	* opts-global.c: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* sese.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* symtab.c: Likewise.
	* targhooks.c: Likewise.
	* toplev.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vrp.c: Likewise.
	* tsan.c: Likewise.
	* ubsan.c: Likewise.
	* value-prof.c: Likewise.
	* varpool.c: Likewise.
	* var-tracking.c: Likewise.
	* vtable-verify.c: Likewise.

	* ada/gcc-interface/trans.c: Add required include files from gimple.h.

	* c/c-typeck.c: Add required include files from gimple.h.

	* c-family/c-common.c: Add required include files from gimple.h.
	* c-family/c-gimplify.c: Likewise
	* c-family/cilk.c: Likewise

	* cp/class.c: Add required include files from gimple.h.
	* cp/cp-gimplify.c: Likewise
	* cp/decl2.c: Likewise
	* cp/init.c: Likewise
	* cp/optimize.c: Likewise
	* cp/pt.c: Likewise
	* cp/semantics.c: Likewise
	* cp/tree.c: Likewise
	* cp/typeck.c: Likewise
	* cp/vtable-class-hierarchy.c: Likewise

	* fortran/trans.c: Add required include files from gimple.h.
	* fortran/trans-expr.c: Likewise
	* fortran/trans-openmp.c: Likewise

	* go/gofrontend/expressions.cc: Add required include files from
	gimple.h.
	* go/gofrontend/gogo-tree.cc: Likewise
	* go/gofrontend/types.cc: Likewise
	* go/go-gcc.cc: Likewise
	* go/go-lang.c: Likewise

	* java/java-gimplify.c: Add required include files from gimple.h.

	* lto/lto.c: Add required include files from gimple.h.
	* lto/lto-lang.c: Likewise
	* lto/lto-object.c: Likewise
	* lto/lto-partition.c: Likewise
	* lto/lto-symtab.c: Likewise

	* objc/objc-act.c: Add required include files from gimple.h.

	* config/darwin.c: Add required include files removed from gimple.h.
	* config/aarch64/aarch64-builtins.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/winnt.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/tilegx/tilegx.c: Likewise.
	* config/tilepro/tilepro.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.

	* testsuite/gcc.dg/plugin/finish_unit_plugin.c: Add required include
	files removed from gimple.h.
	* testsuite/gcc.dg/plugin/ggcplug.c: Likewise.
	* testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise.
	* testsuite/gcc.dg/plugin/selfassign.c: Likewise.
	* testsuite/gcc.dg/plugin/start_unit_plugin.c: Likewise.
	* testsuite/g++.dg/plugin/selfassign.c: Likewise.

From-SVN: r205272
2013-11-22 15:58:51 +00:00
David Malcolm 8400e75ec4 Remove macros that implicitly use input_location
gcc/
	* input.h (input_line): Remove.
	(input_filename): Likewise.
	(in_system_header): Likewise.
	* tree.h (EXPR_LOC_OR_HERE): Remove.
	* config/bfin/bfin.c (output_file_start): Remove use of
	input_filename macro.
	* builtins.c (c_strlen): Remove use of EXPR_LOC_OR_HERE macro.
	* gimplify.c (internal_get_tmp_var): Likewise.
	EXPR_LOC_OR_HERE macro.
	(shortcut_cond_expr): Likewise.
	* tree-diagnostic.c (diagnostic_report_current_function): Remove
	use of input_filename macro.
	* tree.c (get_file_function_name): Likewise.

gcc/ada
	* gcc-interface/utils2.c (build_call_raise): Remove use of
	input_line macro.
	(build_call_raise_range): Likewise.
	(build_call_raise_column): Likewise.

gcc/c-family
	* c-common.c (unsafe_conversion_p): Remove use of
	EXPR_LOC_OR_HERE macro.
	(conversion_warning): Likewise.
	(warnings_for_convert_and_check): Likewise.
	(warn_for_collisions_1): Likewise.
	(shorten_compare): Likewise, and remove use of in_system_header
	macro, using the location from the former.
	* c-lex.c (dump_one_header): Remove use of input_filename macro.
	(cb_def_pragma): Remove use of in_system_header macro.
	(lex_string): Likewise.
	* c-pragma.c (handle_pragma_float_const_decimal64): Likewise.

gcc/c
	* c-decl.c (define_label, shadow_tag_warned)
	(check_bitfield_type_and_width, grokdeclarator, grokparms,
	store_parm_decls_newstyle, store_parm_decls_oldstyle)
	(declspecs_add_type): Remove use of in_system_header macro.
	* c-parser.c (c_parser_unary_expression): Likewise.
	* c-typeck.c (store_init_value, process_init_element)
	(c_start_case): Likewise.

	* c-decl.c (build_enumerator): Remove use of EXPR_LOC_OR_HERE
	macro.

	* c-parser.c (c_parser_set_source_position_from_token): Remove
	reference to in_system_header from comment.

gcc/cp
	* call.c (build_integral_nontype_arg_conv): Remove use of
	EXPR_LOC_OR_HERE macro.
	(convert_like_real): Likewise.
	(convert_arg_to_ellipsis): Likewise.
	(build_cxx_call): Likewise.
	(perform_implicit_conversion_flags): Likewise.
	(initialize_reference): Likewise.
	* cvt.c (cp_convert_to_pointer): Likewise.
	(convert_to_reference): Likewise.
	(ocp_convert): Likewise.
	(convert_to_void): Likewise.
	* decl.c (pop_label): Update comment.
	(pop_switch): Remove use of EXPR_LOC_OR_HERE macro.
	(check_tag_decl): Remove use of in_system_header macro.
	(make_rtl_for_nonlocal_decl): Remove use of input_filename
	macro.
	(compute_array_index_type): Remove use of in_system_header
	macro.
	(grokdeclarator): Likewise.
	* error.c (dump_global_iord): Remove use of input_filename
	macro.
	(location_of): Remove use of EXPR_LOC_OR_HERE macro.
	(maybe_warn_cpp0x): Remove use of in_system_header macro.
	* init.c (build_new_1): Remove use of EXPR_LOC_OR_HERE macro.
	* lex.c (handle_pragma_interface): Remove use of input_filename
	macro.
	(handle_pragma_implementation): Likewise.
	(cxx_make_type): Likewise.
	(in_main_input_context): Likewise.
	* name-lookup.c (push_binding_level): Remove use of
	input_line macro.
	(leave_scope): Likewise.
	(resume_scope): Likewise.
	* parser.c (cp_parser_unqualified_id): Remove use of
	in_system_header macro.
	(cp_parser_cast_expression): Likewise.
	(cp_parser_declaration_seq_opt): Likewise.
	(cp_parser_enumerator_list): Likewise.
	(cp_parser_parameter_declaration_clause): Likewise.
	(cp_parser_exception_specification_opt): Likewise.
	* pt.c (unify_arg_conversion): Remove use of EXPR_LOC_OR_HERE
	macro.
	(convert_nontype_argument): Likewise.
	(push_tinst_level): Remove use of in_system_header macro.
	(tsubst_copy_and_build): Remove use of EXPR_LOC_OR_HERE
	macros.
	(do_decl_instantiation): Remove use of in_system_header macro.
	(do_type_instantiation): Likewise.
	* semantics.c (finish_call_expr): Remove use of EXPR_LOC_OR_HERE
	macro.
	(begin_class_definition): Remove use of input_filename macro.
	(cxx_eval_call_expression): Remove use of EXPR_LOC_OR_HERE
	macro.
	(cxx_eval_constant_expression): Likewise.
	(potential_constant_expression_1): Likewise.
	* typeck.c (decay_conversion): Likewise.
	(rationalize_conditional_expr): Likewise.
	(build_x_compound_expr_from_list): Likewise.
	(convert_for_assignment): Likewise.
	* typeck2.c (check_narrowing): Likewise.

gcc/fortran
	* trans.c (trans_runtime_error_vararg): Remove use of input_line
	macro.

gcc/java
	* class.c (maybe_layout_super_class): Update comment.
	* decl.c (java_add_stmt): Remove use of input_filename macro.
	* jcf-parse.c (set_source_filename): Remove use of
	input_filename macro.
	(parse_class_file): Remove use of input_line and input_filename
	macros.
	(java_parse_file): Remove use of input_filename macro.

From-SVN: r205262
2013-11-22 14:18:13 +00:00
Diego Novillo d8a2d370dc Factor unrelated declarations out of tree.h.
This patch applies the rule that functions defined in FOO.c must be
declared in FOO.h. One of the worst offenders in the code base is
tree.h, unsurprisingly.

The patch creates several new headers: attribs.h calls.h fold-const.h
gcc-symtab.h print-rtl.h print-tree.h stmt.h stor-layout.h stringpool.h
tree-nested.h tree-object-size.h varasm.h.

Functions in each corresponding .c file got moved to those headers and
others that already existed. I wanted to make this patch as mechanical
as possible, so I made no attempt to fix problems like having
build_addr defined in tree-inline.c. I left that for later.

There were some declarations that I could not move out of tree.h
because of header poisoning or the use of target macros. We forbid the
inclusion of things like expr.h from FE files. While that's a
reasonable idea, the FE file *still* manage to at expr.c functionality
because the declarations they want to use were defined in tree.h.

The affected files are builtins.h, emit-rtl.h and expr.h.

If that functionality is allowed to be accessed from the FEs,
then I will later move those functions out of expr.c into tree.c.
I have moved these declarations to the bottom of tree.h so they
are easy to identify later.

There is a namespace collision with libcpp. The file gcc/symtab.c
cannot use gcc/symtab.h because the #include command picks up
libcpp/include/symtab.h first. So I named this file gcc-symtab.h
for now.

Finally, I added a new header to PLUGIN_HEADERS to account for the
tree.h refactoring. I did not add all headers factored out of tree.h
because it is unclear (and impossible to tell) what plugins need.
This adds the one header used by the plugins in the testsuite.

This will be changing quite dramatically as we progress with the header
refactoring.

This patch should offer some minimal incremental build advantages
by reducing the size of tree.h. Changes that would otherwise
affected tree.h, will now go to other headers which are less
frequently included.

	* tree.h: Include fold-const.h.
	(aggregate_value_p): Moved to function.h.
	(alloca_call_p): Moved to calls.h.
	(allocate_struct_function): Moved to function.h.
	(apply_tm_attr): Moved to attribs.h.
	(array_at_struct_end_p): Moved to expr.h.
	(array_ref_element_size): Moved to tree-dfa.h.
	(array_ref_low_bound): Moved to tree-dfa.h.
	(array_ref_up_bound): Moved to tree.h.
	(assemble_alias): Moved to cgraph.h.
	(bit_from_pos): Moved to stor-layout.h.
	(build_addr): Moved to tree-nested.h.
	(build_duplicate_type): Moved to tree-inline.h.
	(build_fold_addr_expr): Moved to fold-const.h.
	(build_fold_addr_expr_with_type): Moved to fold-const.h.
	(build_fold_addr_expr_with_type_loc): Moved to fold-const.h.
	(build_fold_indirect_ref): Moved to fold-const.h.
	(build_fold_indirect_ref_loc): Moved to fold-const.h.
	(build_personality_function): Moved to tree.h.
	(build_range_check): Moved to fold-const.h.
	(build_simple_mem_ref): Moved to fold-const.h.
	(build_simple_mem_ref_loc): Moved to fold-const.h.
	(build_tm_abort_call): Moved to trans-mem.h.
	(byte_from_pos): Moved to stor-layout.h.
	(call_expr_flags): Moved to calls.h.
	(can_move_by_pieces): Moved to expr.h.
	(categorize_ctor_elements): Moved to expr.h.
	(change_decl_assembler_name): Moved to gcc-symtab.h.
	(combine_comparisons): Moved to fold-const.h.
	(complete_ctor_at_level_p): Moved to tree.h.
	(component_ref_field_offset): Moved to tree-dfa.h.
	(compute_builtin_object_size): Moved to tree-object-size.h.
	(compute_record_mode): Moved to stor-layout.h.
	(constant_boolean_node): Moved to fold-const.h.
	(constructor_static_from_elts_p): Moved to varasm.h.
	(cxx11_attribute_p): Moved to attribs.h.
	(debug_body): Moved to print-tree.h.
	(debug_find_tree): Moved to tree-inline.h.
	(debug_fold_checksum): Moved to fold-const.h.
	(debug_head): Moved to print-tree.h.
	(debug_head): Moved to print-tree.h.
	(debug_raw): Moved to print-tree.h.
	(debug_tree): Moved to print-tree.h.
	(debug_vec_tree): Moved to print-tree.h.
	(debug_verbose): Moved to print-tree.h.
	(debug_verbose): Moved to print-tree.h.
	(decl_attributes): Moved to attribs.h.
	(decl_binds_to_current_def_p): Moved to varasm.h.
	(decl_default_tls_model): Moved to varasm.h.
	(decl_replaceable_p): Moved to varasm.h.
	(div_if_zero_remainder): Moved to fold-const.h.
	(double_int mem_ref_offset): Moved to fold-const.h.
	(dump_addr): Moved to print-tree.h.
	(element_precision): Moved to machmode.h.
	(expand_dummy_function_end): Moved to function.h.
	(expand_function_end): Moved to function.h.
	(expand_function_start): Moved to function.h.
	(expand_label): Moved to stmt.h.
	(expr_first): Moved to tree-iterator.h.
	(expr_last): Moved to tree-iterator.h.
	(finalize_size_functions): Moved to stor-layout.h.
	(finish_builtin_struct): Moved to stor-layout.h.
	(finish_record_layout): Moved to stor-layout.h.
	(fixup_signed_type): Moved to stor-layout.h.
	(fixup_unsigned_type): Moved to stor-layout.h.
	(flags_from_decl_or_type): Moved to calls.h.
	(fold): Moved to fold-const.h.
	(fold_abs_const): Moved to fold-const.h.
	(fold_binary): Moved to fold-const.h.
	(fold_binary_loc): Moved to fold-const.h.
	(fold_binary_to_constant): Moved to fold-const.h.
	(fold_build1): Moved to fold-const.h.
	(fold_build1_initializer_loc): Moved to fold-const.h.
	(fold_build1_loc): Moved to fold-const.h.
	(fold_build1_stat_loc): Moved to fold-const.h.
	(fold_build2): Moved to fold-const.h.
	(fold_build2_initializer_loc): Moved to fold-const.h.
	(fold_build2_loc): Moved to fold-const.h.
	(fold_build2_stat_loc): Moved to fold-const.h.
	(fold_build3): Moved to fold-const.h.
	(fold_build3_loc): Moved to fold-const.h.
	(fold_build3_stat_loc): Moved to fold-const.h.
	(fold_build_call_array): Moved to fold-const.h.
	(fold_build_call_array_initializer): Moved to fold-const.h.
	(fold_build_call_array_initializer_loc): Moved to fold-const.h.
	(fold_build_call_array_loc): Moved to fold-const.h.
	(fold_build_cleanup_point_expr): Moved to fold-const.h.
	(fold_convert): Moved to fold-const.h.
	(fold_convert_loc): Moved to fold-const.h.
	(fold_convertible_p): Moved to fold-const.h.
	(fold_defer_overflow_warnings): Moved to fold-const.h.
	(fold_deferring_overflow_warnings_p): Moved to fold-const.h.
	(fold_fma): Moved to fold-const.h.
	(fold_ignored_result): Moved to fold-const.h.
	(fold_indirect_ref): Moved to fold-const.h.
	(fold_indirect_ref_1): Moved to fold-const.h.
	(fold_indirect_ref_loc): Moved to fold-const.h.
	(fold_read_from_constant_string): Moved to fold-const.h.
	(fold_real_zero_addition_p): Moved to fold-const.h.
	(fold_single_bit_test): Moved to fold-const.h.
	(fold_strip_sign_ops): Moved to fold-const.h.
	(fold_ternary): Moved to fold-const.h.
	(fold_ternary_loc): Moved to fold-const.h.
	(fold_unary): Moved to tree-data-ref.h.
	(fold_unary_ignore_overflow): Moved to fold-const.h.
	(fold_unary_ignore_overflow_loc): Moved to fold-const.h.
	(fold_unary_loc): Moved to fold-const.h.
	(fold_unary_to_constant): Moved to fold-const.h.
	(fold_undefer_and_ignore_overflow_warnings): Moved to fold-const.h.
	(fold_undefer_overflow_warnings): Moved to fold-const.h.
	(folding_initializer): Moved to fold-const.h.
	(free_temp_slots): Moved to function.h.
	(generate_setjmp_warnings): Moved to function.h.
	(get_attribute_name): Moved to attribs.h.
	(get_identifier): Moved to stringpool.h.
	(get_identifier_with_length): Moved to stringpool.h.
	(get_inner_reference): Moved to tree.h.
	(gimple_alloca_call_p): Moved to calls.h.
	(gimplify_parameters): Moved to function.h.
	(highest_pow2_factor): Moved to expr.h.
	(indent_to): Moved to print-tree.h.
	(init_attributes): Moved to attribs.h.
	(init_dummy_function_start): Moved to function.h.
	(init_function_start): Moved to function.h.
	(init_inline_once): Moved to tree-inline.h.
	(init_object_sizes): Moved to tree-object-size.h.
	(init_temp_slots): Moved to function.h.
	(init_tree_optimization_optabs): Moved to optabs.h.
	(initialize_sizetypes): Moved to stor-layout.h.
	(initializer_constant_valid_for_bitfield_p): Moved to varasm.h.
	(initializer_constant_valid_p): Moved to varasm.h.
	(int_const_binop): Moved to fold-const.h.
	(internal_reference_types): Moved to stor-layout.h.
	(invert_tree_comparison): Moved to fold-const.h.
	(invert_truthvalue): Moved to fold-const.h.
	(invert_truthvalue_loc): Moved to fold-const.h.
	(is_tm_ending_fndecl): Moved to trans-mem.h.
	(is_tm_may_cancel_outer): Moved to trans-mem.h.
	(is_tm_pure): Moved to trans-mem.h.
	(is_tm_safe): Moved to trans-mem.h.
	(layout_decl): Moved to stor-layout.h.
	(layout_type): Moved to stor-layout.h.
	(lookup_attribute_spec): Moved to attribs.h.
	(make_accum_type): Moved to stor-layout.h.
	(make_decl_one_only): Moved to varasm.h.
	(make_decl_rtl): Moved to tree.h.
	(make_decl_rtl_for_debug): Moved to varasm.h.
	(make_fract_type): Moved to stor-layout.h.
	(make_or_reuse_sat_signed_accum_type): Moved to stor-layout.h.
	(make_or_reuse_sat_signed_fract_type): Moved to stor-layout.h.
	(make_or_reuse_sat_unsigned_accum_type): Moved to stor-layout.h.
	(make_or_reuse_sat_unsigned_fract_type): Moved to stor-layout.h.
	(make_or_reuse_signed_accum_type): Moved to stor-layout.h.
	(make_or_reuse_signed_fract_type): Moved to stor-layout.h.
	(make_or_reuse_unsigned_accum_type): Moved to stor-layout.h.
	(make_or_reuse_unsigned_fract_type): Moved to stor-layout.h.
	(make_range): Moved to fold-const.h.
	(make_range_step): Moved to fold-const.h.
	(make_sat_signed_accum_type): Moved to stor-layout.h.
	(make_sat_signed_fract_type): Moved to stor-layout.h.
	(make_sat_unsigned_accum_type): Moved to stor-layout.h.
	(make_sat_unsigned_fract_type): Moved to stor-layout.h.
	(make_signed_accum_type): Moved to stor-layout.h.
	(make_signed_fract_type): Moved to stor-layout.h.
	(make_signed_type): Moved to stor-layout.h.
	(make_unsigned_accum_type): Moved to stor-layout.h.
	(make_unsigned_fract_type): Moved to stor-layout.h.
	(make_unsigned_type): Moved to stor-layout.h.
	(mark_decl_referenced): Moved to varasm.h.
	(mark_referenced): Moved to varasm.h.
	(may_negate_without_overflow_p): Moved to fold-const.h.
	(maybe_get_identifier): Moved to stringpool.h.
	(merge_ranges): Moved to fold-const.h.
	(merge_weak): Moved to varasm.h.
	(mode_for_size_tree): Moved to stor-layout.h.
	(multiple_of_p): Moved to fold-const.h.
	(must_pass_in_stack_var_size): Moved to calls.h.
	(must_pass_in_stack_var_size_or_pad): Moved to calls.h.
	(native_encode_expr): Moved to fold-const.h.
	(native_interpret_expr): Moved to fold-const.h.
	(non_lvalue): Moved to fold-const.h.
	(non_lvalue_loc): Moved to fold-const.h.
	(normalize_offset): Moved to stor-layout.h.
	(normalize_rli): Moved to stor-layout.h.
	(notice_global_symbol): Moved to varasm.h.
	(omit_one_operand): Moved to fold-const.h.
	(omit_one_operand_loc): Moved to fold-const.h.
	(omit_two_operands): Moved to fold-const.h.
	(omit_two_operands_loc): Moved to fold-const.h.
	(operand_equal_p): Moved to tree-data-ref.h.
	(parse_input_constraint): Moved to stmt.h.
	(parse_output_constraint): Moved to stmt.h.
	(place_field): Moved to stor-layout.h.
	(pop_function_context): Moved to function.h.
	(pop_temp_slots): Moved to function.h.
	(pos_from_bit): Moved to stor-layout.h.
	(preserve_temp_slots): Moved to function.h.
	(print_node): Moved to print-tree.h.
	(print_node_brief): Moved to print-tree.h.
	(print_rtl): Moved to rtl.h.
	(process_pending_assemble_externals): Moved to varasm.h.
	(ptr_difference_const): Moved to fold-const.h.
	(push_function_context): Moved to function.h.
	(push_struct_function): Moved to function.h.
	(push_temp_slots): Moved to function.h.
	(record_tm_replacement): Moved to trans-mem.h.
	(relayout_decl): Moved to stor-layout.h.
	(resolve_asm_operand_names): Moved to stmt.h.
	(resolve_unique_section): Moved to varasm.h.
	(rli_size_so_far): Moved to stor-layout.h.
	(rli_size_unit_so_far): Moved to stor-layout.h.
	(round_down): Moved to fold-const.h.
	(round_down_loc): Moved to fold-const.h.
	(round_up): Moved to fold-const.h.
	(round_up_loc): Moved to fold-const.h.
	(set_decl_incoming_rtl): Moved to emit-rtl.h.
	(set_decl_rtl): Moved to tree.h.
	(set_min_and_max_values_for_integral_type): Moved to stor-layout.h.
	(set_user_assembler_name): Moved to varasm.h.
	(setjmp_call_p): Moved to calls.h.
	(size_binop): Moved to fold-const.h.
	(size_binop_loc): Moved to fold-const.h.
	(size_diffop): Moved to fold-const.h.
	(size_diffop_loc): Moved to fold-const.h.
	(size_int_kind): Moved to fold-const.h.
	(stack_protect_epilogue): Moved to function.h.
	(start_record_layout): Moved to stor-layout.h.
	(supports_one_only): Moved to varasm.h.
	(swap_tree_comparison): Moved to fold-const.h.
	(tm_malloc_replacement): Moved to trans-mem.h.
	(tree build_fold_addr_expr_loc): Moved to fold-const.h.
	(tree build_invariant_address): Moved to fold-const.h.
	(tree_binary_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_binary_nonzero_warnv_p): Moved to fold-const.h.
	(tree_call_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_expr_nonnegative_p): Moved to fold-const.h.
	(tree_expr_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_output_constant_def): Moved to varasm.h.
	(tree_overlaps_hard_reg_set): Moved to stmt.h.
	(tree_single_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_single_nonzero_warnv_p): Moved to fold-const.h.
	(tree_swap_operands_p): Moved to fold-const.h.
	(tree_unary_nonnegative_warnv_p): Moved to fold-const.h.
	(tree_unary_nonzero_warnv_p): Moved to fold-const.h.
	(update_alignment_for_field): Moved to stor-layout.h.
	(use_register_for_decl): Moved to function.h.
	(variable_size): Moved to rtl.h.
	(vector_type_mode): Moved to stor-layout.h.
	* cgraph.h: Corresponding changes.
	* emit-rtl.h: Corresponding changes.
	* expr.h: Corresponding changes.
	* function.h: Corresponding changes.
	* optabs.h: Corresponding changes.
	* trans-mem.h: Corresponding changes.
	Protect against multiple inclusion.
	* tree-inline.h: Corresponding changes.
	* tree-iterator.h: Corresponding changes.
	* tree-dfa.h: Include expr.h.
	* tree-ssanames.h: Include stringpool.h.
	* attribs.h: New file.
	* calls.h: New file.
	* fold-const.h: New file.
	* gcc-symtab.h: New file.
	* print-rtl.h: New file.
	* print-tree.h: New file.
	* stmt.h: New file.
	* stor-layout.h: New file.
	* strinpool.h: New file.
	* tree-nested.h: New file
	* tree-object-size.h: New file.
	* varasm.h: New file.
	* Makefile.in (PLUGIN_HEADERS): Add stringpool.h.

	* alias.c: Include varasm.h.
	Include expr.h.
	* asan.c: Include calls.h.
	Include stor-layout.h.
	Include varasm.h.
	* attribs.c: Include stringpool.h.
	Include attribs.h.
	Include stor-layout.h.
	* builtins.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	Include tree-object-size.h.
	* calls.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	Include attribs.h.
	* cfgexpand.c: Include stringpool.h.
	Include varasm.h.
	Include stor-layout.h.
	Include stmt.h.
	Include print-tree.h.
	* cgraph.c: Include varasm.h.
	Include calls.h.
	Include print-tree.h.
	* cgraphclones.c: Include stringpool.h.
	Include function.h.
	Include emit-rtl.h.
	Move inclusion of rtl.h earlier in the file.
	* cgraphunit.c: Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	* cilk-common.c: Include stringpool.h.
	Include stor-layout.h.
	* combine.c: Include stor-layout.h.
	* config/aarch64/aarch64-builtins.c: Include stor-layout.h.
	Include stringpool.h.
	Include calls.h.
	* config/aarch64/aarch64.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/alpha/alpha.c: Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/arc/arc.c: Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	Include calls.h.
	* config/arm/arm.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/avr/avr-c.c: Include stor-layout.h.
	* config/avr/avr-log.c: Include print-tree.h.
	* config/avr/avr.c: Include print-tree.h.
	Include calls.h.
	Include stor-layout.h.
	Include stringpool.h.
	* config/bfin/bfin.c: Include varasm.h.
	Include calls.h.
	* config/c6x/c6x.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	* config/cr16/cr16.c: Include stor-layout.h.
	Include calls.h.
	* config/cris/cris.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	Include stmt.h.
	* config/darwin.c: Include stringpool.h.
	Include varasm.h.
	Include stor-layout.h.
	* config/epiphany/epiphany.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	* config/fr30/fr30.c: Include stor-layout.h.
	Include varasm.h.
	* config/frv/frv.c: Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	* config/h8300/h8300.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	* config/i386/i386.c: Include stringpool.h.
	Include attribs.h.
	Include calls.h.
	Include stor-layout.h.
	Include varasm.h.
	* config/i386/winnt-cxx.c: Include stringpool.h.
	Include attribs.h.
	* config/i386/winnt.c: Include stringpool.h.
	Include varasm.h.
	* config/ia64/ia64-c.c: Include stringpool.h.
	* config/ia64/ia64.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/iq2000/iq2000.c: Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/lm32/lm32.c: Include calls.h.
	* config/m32c/m32c.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/m32r/m32r.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	Include calls.h.
	* config/m68k/m68k.c: Include calls.h.
	Include stor-layout.h.
	Include varasm.h.
	* config/mcore/mcore.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	Include calls.h.
	* config/mep/mep.c: Include varasm.h.
	Include calls.h.
	Include stringpool.h.
	Include stor-layout.h.
	* config/microblaze/microblaze.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/mips/mips.c: Include varasm.h.
	Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	* config/mmix/mmix.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/mn10300/mn10300.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/moxie/moxie.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/msp430/msp430.c: Include stor-layout.h.
	Include calls.h.
	* config/nds32/nds32.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/pa/pa.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	Include calls.h.
	* config/pdp11/pdp11.c: Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/picochip/picochip.c: Include calls.h.
	Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	* config/rl78/rl78.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/rs6000/rs6000-c.c: Include stor-layout.h.
	Include stringpool.h.
	* config/rs6000/rs6000.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include print-tree.h.
	Include varasm.h.
	* config/rx/rx.c: Include varasm.h.
	Include stor-layout.h.
	Include calls.h.
	* config/s390/s390.c: Include print-tree.h.
	Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/score/score.c: Include stringpool.h.
	Include calls.h.
	Include varasm.h.
	Include stor-layout.h.
	* config/sh/sh-c.c: Include stringpool.h.
	Include attribs.h.h.
	* config/sh/sh.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/sol2-c.c: Include stringpool.h.
	Include attribs.h.
	* config/sol2-cxx.c: Include stringpool.h.
	* config/sol2.c: Include stringpool.h.
	Include varasm.h.
	* config/sparc/sparc.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/spu/spu-c.c: Include stringpool.h.
	* config/spu/spu.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* config/stormy16/stormy16.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/tilegx/tilegx.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/tilepro/tilepro.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/v850/v850-c.c: Include stringpool.h.
	Include attribs.h.
	* config/v850/v850.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include calls.h.
	* config/vax/vax.c: Include calls.h.
	Include varasm.h.
	* config/vms/vms.c: Include stringpool.h.
	* config/vxworks.c: Include stringpool.h.
	* config/xtensa/xtensa.c: Include stringpool.h.
	Include stor-layout.h.
	Include calls.h.
	Include varasm.h.
	* convert.c: Include stor-layout.h.
	* coverage.c: Include stringpool.h.
	Include stor-layout.h.
	* dbxout.c: Include varasm.h.
	Include stor-layout.h.
	* dojump.c: Include stor-layout.h.
	* dse.c: Include stor-layout.h.
	* dwarf2asm.c: Include stringpool.h.
	Include varasm.h.
	* dwarf2cfi.c: Include stor-layout.h.
	* dwarf2out.c: Include rtl.h.
	Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include function.h.
	Include emit-rtl.h.
	Move inclusion of rtl.h earlier in the file.
	* emit-rtl.c: Include varasm.h.
	* except.c: Include stringpool.h.
	Include stor-layout.h.
	* explow.c: Include stor-layout.h.
	* expmed.c: Include stor-layout.h.
	* expr.c: Include stringpool.h.
	Include stor-layout.h.
	Include attribs.h.
	Include varasm.h.
	* final.c: Include varasm.h.
	* fold-const.c: Include stor-layout.h.
	Include calls.h.
	Include tree-iterator.h.
	* function.c: Include stor-layout.h.
	Include varasm.h.
	Include stringpool.h.
	* genattrtab.c (write_header): Emit includes for varasm.h,
	stor-layout.h and calls.h.
	* genautomata.c (main): Likewise.
	* genemit.c: Likewise.
	* genopinit.c: Likewise.
	* genoutput.c (output_prologue): Likewise.
	* genpeep.c: Likewise.
	* genpreds.c (write_insn_preds_c): Likewise.
	* gengtype.c (open_base_files): Add stringpool.h.
	* gimple-expr.c: Include stringpool.h.
	Include stor-layout.h.
	* gimple-fold.c: Include stringpool.h.
	Include expr.h.
	Include stmt.h.
	Include stor-layout.h.
	* gimple-low.c: Include tree-nested.h.
	Include calls.h.
	* gimple-pretty-print.c: Include stringpool.h.
	* gimple-ssa-strength-reduction.c: Include stor-layout.h.
	Include expr.h.
	* gimple-walk.c: Include stmt.h.
	* gimple.c: Include calls.h.
	Include stmt.h.
	Include stor-layout.h.
	* gimplify.c: Include stringpool.h.
	Include calls.h.
	Include varasm.h.
	Include stor-layout.h.
	Include stmt.h.
	Include print-tree.h.
	Include expr.h.
	* gimplify-me.c: Include stmt.h
	Include stor-layout.h
	* internal-fn.c: Include stor-layout.h.
	* ipa-devirt.c: Include print-tree.h.
	Include calls.h.
	* ipa-inline-analysis.c: Include stor-layout.h.
	Include stringpool.h.
	Include print-tree.h.
	* ipa-inline.c: Include trans-mem.h.
	Include calls.h.
	* ipa-prop.c: Include expr.h.
	Include stor-layout.h.
	Include print-tree.h.
	* ipa-pure-const.c: Include print-tree.h.
	Include calls.h.
	* ipa-reference.c: Include calls.h.
	* ipa-split.c: Include stringpool.h.
	Include expr.h.
	Include calls.h.
	* ipa.c: Include calls.h.
	Include stringpool.h.
	* langhooks.c: Include stringpool.h.
	Include attribs.h.
	* lto-cgraph.c: Include stringpool.h.
	* lto-streamer-in.c: Include stringpool.h.
	* lto-streamer-out.c: Include stor-layout.h.
	Include stringpool.h.
	* omp-low.c: Include stringpool.h.
	Include stor-layout.h.
	Include expr.h.
	* optabs.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	* passes.c: Include varasm.h.
	* predict.c: Include calls.h.
	* print-rtl.c: Include print-tree.h.
	* print-tree.c: Include varasm.h.
	Include print-rtl.h.
	Include stor-layout.h.
	* realmpfr.c: Include stor-layout.h.
	* reg-stack.c: Include varasm.h.
	* sdbout.c: Include varasm.h.
	Include stor-layout.h.
	* simplify-rtx.c: Include varasm.h.
	* stmt.c: Include varasm.h.
	Include stor-layout.h.
	* stor-layout.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	Include print-tree.h.
	* symtab.c: Include rtl.h.
	Include print-tree.h.
	Include varasm.h.
	Include function.h.
	Include emit-rtl.h.
	* targhooks.c: Include stor-layout.h.
	Include varasm.h.
	* toplev.c: Include varasm.h.
	Include tree-inline.h.
	* trans-mem.c: Include calls.h.
	Include function.h.
	Include rtl.h.
	Include emit-rtl.h.
	* tree-affine.c: Include expr.h.
	* tree-browser.c: Include print-tree.h.
	* tree-call-cdce.c: Include stor-layout.h.
	* tree-cfg.c: Include trans-mem.h.
	Include stor-layout.h.
	Include print-tree.h.
	* tree-complex.c: Include stor-layout.h.
	* tree-data-ref.c: Include expr.h.
	* tree-dfa.c: Include stor-layout.h.
	* tree-eh.c: Include expr.h.
	Include calls.h.
	* tree-emutls.c: Include stor-layout.h.
	Include varasm.h.
	* tree-if-conv.c: Include stor-layout.h.
	* tree-inline.c: Include stor-layout.h.
	Include calls.h.
	* tree-loop-distribution.c: Include stor-layout.h.
	* tree-nested.c: Include stringpool.h.
	Include stor-layout.h.
	* tree-object-size.c: Include tree-object-size.h.
	* tree-outof-ssa.c: Include stor-layout.h.
	* tree-parloops.c: Include stor-layout.h.
	Include tree-nested.h.
	* tree-pretty-print.c: Include stor-layout.h.
	Include expr.h.
	* tree-profile.c: Include varasm.h.
	Include tree-nested.h.
	* tree-scalar-evolution.c: Include expr.h.
	* tree-sra.c: Include stor-layout.h.
	* tree-ssa-address.c: Include stor-layout.h.
	* tree-ssa-ccp.c: Include stor-layout.h.
	* tree-ssa-dce.c: Include calls.h.
	* tree-ssa-dom.c: Include stor-layout.h.
	* tree-ssa-forwprop.c: Include stor-layout.h.
	* tree-ssa-ifcombine.c: Include stor-layout.h.
	* tree-ssa-loop-ivopts.c: Include stor-layout.h.
	* tree-ssa-loop-niter.c: Include calls.h.
	Include expr.h.
	* tree-ssa-loop-prefetch.c: Include stor-layout.h.
	* tree-ssa-math-opts.c: Include stor-layout.h.
	* tree-ssa-operands.c: Include stmt.h.
	Include print-tree.h.
	* tree-ssa-phiopt.c: Include stor-layout.h.
	* tree-ssa-reassoc.c: Include stor-layout.h.
	* tree-ssa-sccvn.c: Include stor-layout.h.
	* tree-ssa-sink.c: Include stor-layout.h.
	* tree-ssa-strlen.c: Include stor-layout.h.
	* tree-ssa-structalias.c: Include stor-layout.h.
	Include stmt.h.
	* tree-ssa-tail-merge.c: Include stor-layout.h.
	Include trans-mem.h.
	* tree-ssa-uncprop.c: Include stor-layout.h.
	* tree-ssa.c: Include stor-layout.h.
	* tree-ssanames.c: Include stor-layout.h.
	* tree-streamer-in.c: Include stringpool.h.
	* tree-streamer-out.c: Include stor-layout.h.
	* tree-switch-conversion.c: Include varasm.h.
	Include stor-layout.h.
	* tree-tailcall.c: Include stor-layout.h.
	* tree-vect-data-refs.c: Include stor-layout.h.
	* tree-vect-generic.c: Include stor-layout.h.
	* tree-vect-loop.c: Include stor-layout.h.
	* tree-vect-patterns.c: Include stor-layout.h.
	* tree-vect-slp.c: Include stor-layout.h.
	* tree-vect-stmts.c: Include stor-layout.h.
	* tree-vectorizer.c: Include stor-layout.h.
	* tree-vrp.c: Include stor-layout.h.
	Include calls.h.
	* tree.c: Include stor-layout.h.
	Include calls.h.
	Include attribs.h.
	Include varasm.h.
	* tsan.c: Include expr.h.
	* ubsan.c: Include stor-layout.h.
	Include stringpool.h.
	* value-prof.c: Include tree-nested.h.
	Include calls.h.
	* var-tracking.c: Include varasm.h.
	Include stor-layout.h.
	* varasm.c: Include stor-layout.h.
	Include stringpool.h.
	Include gcc-symtab.h.
	Include varasm.h.
	* varpool.c: Include varasm.h.
	* vmsdbgout.c: Include varasm.h.
	* xcoffout.c: Include varasm.h.

ada/ChangeLog

	* gcc-interface/decl.c: Include stringpool.h
	Include stor-layout.h
	* gcc-interface/misc.c: Include stor-layout.h
	Include print-tree.h
	* gcc-interface/trans.c: Include stringpool.h
	Include stor-layout.h
	Include stmt.h
	Include varasm.h
	* gcc-interface/utils.c: Include stringpool.h
	Include stor-layout.h
	Include attribs.h
	Include varasm.h
	* gcc-interface/utils2.c: Include stringpool.h
	Include stor-layout.h
	Include attribs.h
	Include varasm.h

c-family/ChangeLog

	* c-common.c: Include fold-const.h.
	Include stor-layout.h.
	Include calls.h.
	Include stringpool.h.
	Include attribs.h.
	Include varasm.h.
	Include trans-mem.h.
	* c-cppbuiltin.c: Include stor-layout.h.
	Include stringpool.h.
	* c-format.c: Include stringpool.h.
	* c-lex.c: Include stringpool.h.
	Include stor-layout.h.
	* c-pragma.c: Include stringpool.h.
	Include attribs.h.
	Include varasm.h.
	Include gcc-symtab.h.
	* c-pretty-print.c: Include stor-layout.h.
	Include attribs.h.
	* cilk.c: Include stringpool.h.
	Include calls.h.

c/ChangeLog

	* c-decl.c: Include print-tree.h.
	Include stor-layout.h.
	Include varasm.h.
	Include attribs.h.
	Include stringpool.h.
	* c-lang.c: Include fold-const.h.
	* c-parser.c: Include stringpool.h.
	Include attribs.h.
	Include stor-layout.h.
	Include varasm.h.
	Include trans-mem.h.
	* c-typeck.c: Include stor-layout.h.
	Include trans-mem.h.
	Include varasm.h.
	Include stmt.h.

cp/ChangeLog

	* call.c: Include stor-layout.h.
	Include trans-mem.h.
	Include stringpool.h.
	* class.c: Include stringpool.h.
	Include stor-layout.h.
	Include attribs.h.
	* cp-gimplify.c: Include stor-layout.h.
	* cvt.c: Include stor-layout.h.
	* decl.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include attribs.h.
	Include calls.h.
	* decl2.c: Include stringpool.h.
	Include varasm.h.
	Include attribs.h.
	Include stor-layout.h.
	Include calls.h.
	* error.c: Include stringpool.h.
	* except.c: Include stringpool.h.
	Include trans-mem.h.
	Include attribs.h.
	* init.c: Include stringpool.h.
	Include varasm.h.
	* lambda.c: Include stringpool.h.
	* lex.c: Include stringpool.h.
	* mangle.c: Include stor-layout.h.
	Include stringpool.h.
	* method.c: Include stringpool.h.
	Include varasm.h.
	* name-lookup.c: Include stringpool.h.
	Include print-tree.h.
	Include attribs.h.
	* optimize.c: Include stringpool.h.
	* parser.c: Include print-tree.h.
	Include stringpool.h.
	Include attribs.h.
	Include trans-mem.h.
	* pt.c: Include stringpool.h.
	Include varasm.h.
	Include attribs.h.
	Include stor-layout.h.
	* ptree.c: Include print-tree.h.
	* repo.c: Include stringpool.h.
	* rtti.c: Include stringpool.h.
	Include stor-layout.h.
	* semantics.c: Include stmt.h.
	Include varasm.h.
	Include stor-layout.h.
	Include stringpool.h.
	* tree.c: Include stor-layout.h.
	Include print-tree.h.
	Include tree-iterator.h.
	* typeck.c: Include stor-layout.h.
	Include varasm.h.
	* typeck2.c: Include stor-layout.h.
	Include varasm.h.
	* vtable-class-hierarchy.c: Include stringpool.h.
	Include stor-layout.h.

fortran/ChangeLog

	* decl.c: Include stringpool.h.
	* iresolve.c: Include stringpool.h.
	* match.c: Include stringpool.h.
	* module.c: Include stringpool.h.
	* target-memory.c: Include stor-layout.h.
	* trans-common.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	* trans-const.c: Include stor-layout.h.
	* trans-decl.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	Include attribs.h.
	* trans-expr.c: Include stringpool.h.
	* trans-intrinsic.c: Include stringpool.h.
	Include tree-nested.h.
	Include stor-layout.h.
	* trans-io.c: Include stringpool.h.
	Include stor-layout.h.
	* trans-openmp.c: Include stringpool.h.
	* trans-stmt.c: Include stringpool.h.
	* trans-types.c: Include stor-layout.h.
	Include stringpool.h.
	* trans.c: Include stringpool.h.

go/ChangeLog

	* go-backend.c: Include stor-layout.h.
	* go-gcc.cc: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	* go-lang.c: Include stor-layout.h.

java/ChangeLog

	* builtins.c: Include stor-layout.h.
	Include stringpool.h.
	* class.c: Include stringpool.h.
	Include stor-layout.h.
	Include varasm.h.
	* constants.c: Include stringpool.h.
	Include stor-layout.h.
	* decl.c: Include stor-layout.h.
	Include stringpool.h.
	Include varasm.h.
	* except.c: Include stringpool.h.
	Include stor-layout.h.
	* expr.c: Include stringpool.h.
	Include stor-layout.h.
	* jcf-parse.c: Include stringpool.h.
	* mangle.c: Include stringpool.h.
	* resource.c: Include stringpool.h.
	Include stor-layout.h.
	* typeck.c: Include stor-layout.h.
	Include stringpool.h.
	* verify-glue.c: Include stringpool.h.

lto/ChangeLog
	* lto-lang.c: Include stringpool.h.
	Include stor-layout.h.
	* lto-partition.c: Include gcc-symtab.h.
	* lto.c: Include stor-layout.h.

objc/ChangeLog
	* objc-act.c: Include stringpool.h.
	Include stor-layout.h.
	Include attribs.h.
	* objc-encoding.c: Include stringpool.h.
	Include stor-layout.h.
	* objc-gnu-runtime-abi-01.c: Include stringpool.h.
	* objc-next-runtime-abi-01.c:
	Include stringpool.h.
	* objc-next-runtime-abi-02.c: Include stringpool.h.
	* objc-runtime-shared-support.c: Include stringpool.h.

testsuite/ChangeLog

	* gcc.dg/plugin/selfassign.c: Include stringpool.h.
	* gcc.dg/plugin/start_unit_plugin.c: Likewise.

From-SVN: r205023
2013-11-19 07:31:09 -05:00
Kenneth Zadeck bd6337aaeb tree.c (int_fits_type_p): Change GET_MODE_BITSIZE to GET_MODE_PRECISION.
2013-11-18 Kenneth Zadeck <zadeck@naturalbridge.com>

	* tree.c (int_fits_type_p): Change GET_MODE_BITSIZE to
	GET_MODE_PRECISION.
	* fold-const.c (fold_single_bit_test_into_sign_test)
	(fold_binary_loc):  Change GET_MODE_BITSIZE to
	GET_MODE_PRECISION.

From-SVN: r204987
2013-11-19 00:00:17 +00:00
Richard Sandiford 7d362f6c2b c-common.c (convert_vector_to_pointer_for_subscript): Remove cast to unsigned type.
gcc/c-family/
	* c-common.c (convert_vector_to_pointer_for_subscript): Remove
	cast to unsigned type.

gcc/
	* tree.h (tree_to_uhwi): Return an unsigned HOST_WIDE_INT.
	* tree.c (tree_to_uhwi): Return an unsigned HOST_WIDE_INT.
	(tree_ctz): Remove cast to unsigned type.
	* builtins.c (fold_builtin_memory_op): Likewise.
	* dwarf2out.c (descr_info_loc): Likewise.
	* godump.c (go_output_typedef): Likewise.
	* omp-low.c (expand_omp_simd): Likewise.
	* stor-layout.c (excess_unit_span): Likewise.
	* tree-object-size.c (addr_object_size): Likewise.
	* tree-sra.c (analyze_all_variable_accesses): Likewise.
	* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
	(simplify_rotate): Likewise.
	* tree-ssa-strlen.c (adjust_last_stmt, handle_builtin_memcpy)
	(handle_pointer_plus): Likewise.
	* tree-switch-conversion.c (check_range): Likewise.
	* tree-vect-patterns.c (vect_recog_rotate_pattern): Likewise.
	* tsan.c (instrument_builtin_call): Likewise.
	* cfgexpand.c (defer_stack_allocation): Add cast to HOST_WIDE_INT.
	* trans-mem.c (tm_log_add): Likewise.
	* config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Likewise.
	* config/arm/arm.c (aapcs_vfp_sub_candidate): Likewise.
	* config/rs6000/rs6000.c (rs6000_aggregate_candidate): Likewise.
	* config/mips/mips.c (r10k_safe_mem_expr_p): Make offset unsigned.

From-SVN: r204964
2013-11-18 14:52:56 +00:00
Richard Sandiford b23b672e8d tree.h (host_integerp, [...]): Delete.
gcc/
	* tree.h (host_integerp, tree_low_cst): Delete.
	* tree.c (host_integerp, tree_low_cst): Delete.

From-SVN: r204963
2013-11-18 14:52:42 +00:00
Richard Sandiford ae7e9dddb8 decl.c, [...]: Replace tree_low_cst (..., 1) with tree_to_uhwi throughout.
gcc/ada/
	* gcc-interface/decl.c, gcc-interface/utils.c, gcc-interface/utils2.c:
	Replace tree_low_cst (..., 1) with tree_to_uhwi throughout.

gcc/c-family/
	* c-common.c, c-cppbuiltin.c: Replace tree_low_cst (..., 1) with
	tree_to_uhwi throughout.

gcc/c/
	* c-decl.c, c-typeck.c: Replace tree_low_cst (..., 1) with
	tree_to_uhwi throughout.

gcc/cp/
	* call.c, class.c, decl.c, error.c: Replace tree_low_cst (..., 1) with
	tree_to_uhwi throughout.

gcc/objc/
	* objc-encoding.c: Replace tree_low_cst (..., 1) with tree_to_uhwi
	throughout.

gcc/
	* alias.c, asan.c, builtins.c, cfgexpand.c, cgraph.c,
	config/aarch64/aarch64.c, config/alpha/predicates.md,
	config/arm/arm.c, config/darwin.c, config/epiphany/epiphany.c,
	config/i386/i386.c, config/iq2000/iq2000.c, config/m32c/m32c-pragma.c,
	config/mep/mep-pragma.c, config/mips/mips.c,
	config/picochip/picochip.c, config/rs6000/rs6000.c, cppbuiltin.c,
	dbxout.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, fold-const.c,
	function.c, gimple-fold.c, godump.c, ipa-cp.c, ipa-prop.c, omp-low.c,
	predict.c, sdbout.c, stor-layout.c, trans-mem.c, tree-object-size.c,
	tree-sra.c, tree-ssa-ccp.c, tree-ssa-forwprop.c,
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c,
	tree-ssa-loop-prefetch.c, tree-ssa-strlen.c, tree-stdarg.c,
	tree-switch-conversion.c, tree-vect-generic.c, tree-vect-loop.c,
	tree-vect-patterns.c, tree-vrp.c, tree.c, tsan.c, ubsan.c, varasm.c:
	Replace tree_low_cst (..., 1) with tree_to_uhwi throughout.

From-SVN: r204961
2013-11-18 14:52:19 +00:00
Richard Sandiford 9439e9a1a4 c-common.c, [...]: Replace tree_low_cst (..., 0) with tree_to_shwi throughout.
gcc/c-family/
	* c-common.c, c-format.c, c-omp.c, c-pretty-print.c: Replace
	tree_low_cst (..., 0) with tree_to_shwi throughout.

gcc/c/
	* c-parser.c: Replace tree_low_cst (..., 0) with tree_to_shwi
	throughout.

gcc/cp/
	* class.c, dump.c, error.c, init.c, method.c, parser.c, semantics.c:
	Replace tree_low_cst (..., 0) with tree_to_shwi throughout.

gcc/go/
	* gofrontend/expressions.cc: Replace tree_low_cst (..., 0) with
	tree_to_shwi throughout.

gcc/java/
	* class.c, expr.c: Replace tree_low_cst (..., 0) with tree_to_shwi
	throughout.

gcc/objc/
	* objc-next-runtime-abi-02.c: Replace tree_low_cst (..., 0) with
	tree_to_shwi throughout.

gcc/
	* builtins.c, cilk-common.c, config/aarch64/aarch64.c,
	config/alpha/alpha.c, config/arm/arm.c, config/c6x/predicates.md,
	config/i386/i386.c, config/ia64/predicates.md, config/s390/s390.c,
	coverage.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c, expr.h,
	fold-const.c, gimple-fold.c, godump.c, ipa-prop.c, omp-low.c,
	predict.c, rtlanal.c, sdbout.c, stmt.c, stor-layout.c, targhooks.c,
	tree-cfg.c, tree-data-ref.c, tree-inline.c, tree-ssa-forwprop.c,
	tree-ssa-loop-prefetch.c, tree-ssa-phiopt.c, tree-ssa-sccvn.c,
	tree-ssa-strlen.c, tree-stdarg.c, tree-vect-data-refs.c,
	tree-vect-patterns.c, tree.c, tree.h, var-tracking.c, varasm.c:
	Replace tree_low_cst (..., 0) with tree_to_shwi throughout.

From-SVN: r204959
2013-11-18 14:52:03 +00:00
Richard Sandiford 7c5efc1206 tree.h (tree_to_shwi, [...]): Declare, with inline expansions.
gcc/
	* tree.h (tree_to_shwi, tree_to_uhwi): Declare, with inline expansions.
	* tree.c (tree_to_shwi, tree_to_uhwi): New functions.

From-SVN: r204958
2013-11-18 14:51:45 +00:00
Richard Sandiford cc269bb6d9 decl.c, [...]: Replace host_integerp (..., 1) with tree_fits_uhwi_p throughout.
gcc/ada/
	* gcc-interface/decl.c, gcc-interface/misc.c, gcc-interface/utils.c:
	Replace host_integerp (..., 1) with tree_fits_uhwi_p throughout.

gcc/c-family/
	* c-ada-spec.c, c-common.c, c-pretty-print.c: Replace
	host_integerp (..., 1) with tree_fits_uhwi_p throughout.

gcc/cp/
	* decl.c: Replace host_integerp (..., 1) with tree_fits_uhwi_p
	throughout.

gcc/
	* builtins.c, config/alpha/alpha.c, config/iq2000/iq2000.c,
	config/mips/mips.c, dbxout.c, dwarf2out.c, expr.c, fold-const.c,
	gimple-fold.c, godump.c, omp-low.c, predict.c, sdbout.c, stor-layout.c,
	tree-dfa.c, tree-sra.c, tree-ssa-forwprop.c, tree-ssa-loop-prefetch.c,
	tree-ssa-phiopt.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-vect-data-refs.c, tree-vect-patterns.c,
	tree.c, varasm.c, alias.c, cfgexpand.c, config/aarch64/aarch64.c,
	config/arm/arm.c, config/epiphany/epiphany.c, config/i386/i386.c,
	config/m32c/m32c-pragma.c, config/mep/mep-pragma.c,
	config/rs6000/rs6000.c, config/sparc/sparc.c, emit-rtl.c, function.c,
	gimplify.c, ipa-prop.c, stmt.c, trans-mem.c, tree-cfg.c,
	tree-object-size.c, tree-ssa-ccp.c, tree-ssa-loop-ivcanon.c,
	tree-stdarg.c, tree-switch-conversion.c, tree-vect-generic.c,
	tree-vrp.c, tsan.c, ubsan.c: Replace host_integerp (..., 1) with
	tree_fits_uhwi_p throughout.

From-SVN: r204956
2013-11-18 14:51:26 +00:00
Richard Sandiford 9541ffee8c cuintp.c: Replace host_integerp (..., 0) with tree_fits_shwi_p throughout.
gcc/ada/
	* gcc-interface/cuintp.c: Replace host_integerp (..., 0) with
	tree_fits_shwi_p throughout.

gcc/c-family/
	* c-ada-spec.c, c-common.c, c-format.c, c-pretty-print.c: Replace
	host_integerp (..., 0) with tree_fits_shwi_p throughout.

gcc/c/
	* c-parser.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
	throughout.

gcc/cp/
	* error.c, init.c, parser.c, semantics.c: Replace
	host_integerp (..., 0) with tree_fits_shwi_p throughout.

gcc/go/
	* gofrontend/expressions.cc: Replace host_integerp (..., 0) with
	tree_fits_shwi_p throughout.

gcc/java/
	* class.c, expr.c: Replace host_integerp (..., 0) with
	tree_fits_shwi_p throughout.

gcc/
	* builtins.c, config/alpha/alpha.c, config/c6x/predicates.md,
	config/ia64/predicates.md, config/iq2000/iq2000.c, config/mips/mips.c,
	config/s390/s390.c, dbxout.c, dwarf2out.c, except.c, explow.c, expr.c,
	expr.h, fold-const.c, gimple-fold.c, gimple-ssa-strength-reduction.c,
	gimple.c, godump.c, graphite-scop-detection.c, graphite-sese-to-poly.c,
	omp-low.c, predict.c, rtlanal.c, sdbout.c, simplify-rtx.c,
	stor-layout.c, tree-data-ref.c, tree-dfa.c, tree-pretty-print.c,
	tree-sra.c, tree-ssa-alias.c, tree-ssa-forwprop.c,
	tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c,
	tree-ssa-phiopt.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c,
	tree-ssa-strlen.c, tree-ssa-structalias.c, tree-vect-data-refs.c,
	tree-vect-patterns.c, tree-vectorizer.h, tree.c, var-tracking.c,
	varasm.c: Replace host_integerp (..., 0) with tree_fits_shwi_p
	throughout.

From-SVN: r204955
2013-11-18 14:51:10 +00:00
Richard Sandiford b04268a57f tree.h (tree_fits_shwi_p, [...]): Declare.
gcc/
	* tree.h (tree_fits_shwi_p, tree_fits_uhwi_p): Declare.
	* tree.c (tree_fits_shwi_p, tree_fits_uhwi_p): Define.

From-SVN: r204954
2013-11-18 14:50:47 +00:00
Andrew MacLeod 1fe37220af gimple.h: Reorder prototypes to match .c declaration order...
* gimple.h: Reorder prototypes to match .c declaration order, and remove
	protyotypes for functions not in gimple.c.
	(LABEL): Move to tree-into-ssa.c.
	* gimple.c: Remove unused prototypes.
	(get_base_address): Move to tree.c.
	* tree.c (get_base_address): Relocate from gimple.c.
	* builtins.h (validate_gimple_arglist): Add prototype.
	* trans-mem.h (compute_transaction_bits, is_tm_ending): Add prototype.
	* cfgexpand.h: New File.
	(gimple_assign_rhs_to_tree, estimated_stack_frame_size): Add protoype.
	* tree.h (build_addr): Move to tree-nested.h.
	* tree-nested.h: New File.
	(build_addr, lower_nested_functions, insert_field_into_struct): Add
	prototypes.
	* tree-inline.h (estimated_stack_frame_size): Remove prototype.
	* ipa-inline-analysis.c: Include cfgexpand.h.
	* cgraphunit.c: Include tree-nested.h.
	* omp-low.c: Likewise.
	* tree-parloops.c: Likewise.
	* gimple-low.h: Likewise.
	* tree-profile.h: Likewise.
	* expr.c: Include cfgexpand.h.
	* tree-affine.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssa-loop-im.c: Include trans-mem.h.
	* tree-ssa-tail-merge.c: Likewise.
	* value-prof.c: Include builtins.h and tree-nested.h.
	* tree-into-ssa.c (LABEL): Define here.

	* fortran/trans-intrinsic.c: Include tree-nested.h.

From-SVN: r204919
2013-11-17 16:14:46 +00:00
Andrew MacLeod 18f429e29c gimplify-be.h: New file.
* gimplify-be.h:  New file.  Add prototypes.
	* gimplify.h: Don't include gimple.h.
	(struct gimplify_hasher, struct gimplify_ctx, is_gimple_sizepos,
	gimplify_hasher::hash, gimplify_hasher::equal): Relocate from gimple.h.
	* gimple.h (struct gimplify_hasher, gimplify_hasher::hash,
	gimplify_hasher::equal, struct gimplify_ctx, is_gimple_sizepos): Move
	to gimplify.h.
	(enum gsi_iterator_update): Move to gimple-iterator.h.
	* gimple-iterator.h (enum gsi_iterator_update): Relocate from gimple.h.
	* gimplify-be.c: New File.
	(force_gimple_operand_1, force_gimple_operand,
	force_gimple_operand_gsi_1, force_gimple_operand_gsi): Relocate from
	gimplify.c.
	* gimplify.c (force_gimple_operand_1, force_gimple_operand,
	force_gimple_operand_gsi_1, force_gimple_operand_gsi): Move to
	gimplify-be.c.
	* Makefile.in (OBJS): Add gimplify-be.o
	* asan.c: Include only gimplify.h, gimplify-be.h, and/or gimple.h as
	required.
	* cfgloopmanip.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* gimple-expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa.c: Likewise.
	* langhooks.c: Likewise.
	* omp-low.c: Likewise.
	* sese.c: Likewise.
	* stor-layout.c: Likewise.
	* targhooks.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* value-prof.c: Likewise.
	* config/aarch64/aarch64.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/tilegx/tilegx.c: Likewise.
	* config/tilepro/tilepro.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.

	* c/c-typeck.c: Include only gimplify.h and gimple.h as needed.
	* c-family/c-common.c: Likewise.
	* c-family/c-gimplify.c: Likewise.
	* c-family/cilk.c: Likewise.

	* cp/class.c: Include only gimplify.h and gimple.h as needed.
	* cp/cp-gimplify.c: Likewise.
	* cp/error.c: Likewise.
	* cp/init.c: Likewise.
	* cp/optimize.c: Likewise.
	* cp/pt.c: Likewise.
	* cp/semantics.c: Likewise.
	* cp/tree.c: Likewise.
	* cp/vtable-class-hierarchy.c: Likewise.

	* fortran/trans-expr.c: Include only gimplify.h and gimple.h as needed.
	* fortran/trans-openmp.c: Likewise.

	* go/go-lang.c: Include only gimplify.h and gimple.h as needed.

	* java/java-gimplify.c: Include only gimplify.h and gimple.h as needed.

	* objc/objc-act.c: Include only gimplify.h and gimple.h as needed.

From-SVN: r204812
2013-11-14 19:39:38 +00:00
Andrew Macleod 5be5c23841 gimple-walk.h: New File.
* gimple-walk.h: New File.  Relocate prototypes from gimple.h.
	(struct walk_stmt_info):  Relocate here from gimple.h.
	* gimple-iterator.h: New File.  Relocate prototypes from gimple.h.
	(struct gimple_stmt_iterator_d): Relocate here from gimple.h.
	(gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
	gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
	gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
	gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
	gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h.
	* gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h.
	(gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb,
	gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt,
	gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug,
	gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb,
	gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h.
	(struct walk_stmt_info): Move to gimple-walk.h.
	(gimple_seq_set_location): Move to gimple.c
	* gimple-walk.c: New File.
	(walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op,
	walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops,
	walk_stmt_load_store_ops): Relocate here from gimple.c.
	* gimple-iterator.c: Include gimple-iterator.h.
	* gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm,
	walk_gimple_op, walk_gimple_stmt, get_base_loadstore,
	walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to
	gimple-walk.c.
	(gimple_seq_set_location): Relocate from gimple.h.
	* tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c.
	* tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h.
	* gengtype.c (open_base_files): Add gimple-iterator.h to include list.
	* Makefile.in (OBJS): Add gimple-walk.o

	* asan.c: Update Include list as required for gimple-iterator.h and
	gimple-walk.h.
	* cfgexpand.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-isolate-paths.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimplify.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-profile.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-split.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* omp-low.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* sese.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* value-prof.c: Likewise.
	* vtable-verify.c: Likewise.

	* config/aarch64/aarch64-builtins.c: Include gimple-iterator.h.
	* config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h.
	* testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h.
	* testsuite/gcc.dg/plugin/selfassign.c: Likewise.

From-SVN: r204763
2013-11-13 23:54:17 +00:00
Adam Butcher 0dca5025f0 Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.
gcc/
	* tree.c (grow_tree_vec_stat): New function ...
	* tree.h (grow_tree_vec_stat) (grow_tree_vec): ... and its declaration
	and macro front-end.

gcc/cp/
	PR c++/58534
	PR c++/58536
	PR c++/58548
	PR c++/58549
	PR c++/58637
	* parser.h (struct cp_parser): New members implicit_template_parms,
	implicit_template_scope and auto_is_implicit_function_template_parm_p.
	* parser.c (add_implicit_template_parms): Refactor as ...
	(synthesize_implicit_template_parm): ... this to append a new template
	type parm to the current template parameter list (introducing a new list
	if necessary).  Removed push_deferring_access_checks.
	(finish_fully_implicit_template): Removed pop_deferring_access_checks.
	(cp_parser_new): Initialize new cp_parser members.
	(cp_parser_parameter_declaration_clause): Consider auto as implicit
	template parm when parsing a parameter declaration (unless parsing an
	explicit specialization).
	(cp_parser_parameter_declaration_list): Remove local
	implicit_template_parms counter and reset cp_parser implicit template
	state when complete.
	(cp_parser_lambda_expression): Reset implicit template cp_parser members
	whilst generating lambda class.
	(cp_parser_function_definition_after_declarator): Reset implicit
	template cp_parser members whilst parsing function definition.
	(make_generic_type_name): Respell '<autoN>' as 'auto:N' which works
	better with template diagnostics.
	(cp_parser_simple_type_specifier): Synthesize implicit template parm on
	parsing 'auto' if auto_is_implicit_function_template_parm_p and provide
	diagnostics ...
	* decl.c (grokdeclarator): ... that were previously done here.

gcc/testsuite/g++.dg/
	* cpp1y/pr58534.C: New testcase.
	* cpp1y/pr58536.C: New testcase.
	* cpp1y/pr58548.C: New testcase.
	* cpp1y/pr58549.C: New testcase.
	* cpp1y/pr58637.C: New testcase.

From-SVN: r204714
2013-11-12 20:17:33 +00:00
Diego Novillo 862d0b359f 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.

From-SVN: r204606
2013-11-08 17:46:16 -05:00
Joseph Myers 267bac1078 tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC.
gcc:
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* tree-core.h (enum cv_qualifier): Add TYPE_QUAL_ATOMIC.
	(enum tree_index): Add TI_ATOMICQI_TYPE, TI_ATOMICHI_TYPE,
	TI_ATOMICSI_TYPE, TI_ATOMICDI_TYPE and TI_ATOMICTI_TYPE.
	(struct tree_base): Add atomic_flag field.
	* tree.h (TYPE_ATOMIC): New accessor macro.
	(TYPE_QUALS, TYPE_QUALS_NO_ADDR_SPACE): Add TYPE_QUAL_ATOMIC.
	(TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC): New macro.
	(atomicQI_type_node, atomicHI_type_node, atomicSI_type_node)
	(atomicDI_type_node, atomicTI_type_node): New macros for type
	nodes.
	* tree.c (set_type_quals): Set TYPE_ATOMIC.
	(find_atomic_core_type): New function.
	(build_qualified_type): Adjust alignment for qualified types.
	(build_atomic_base): New function
	(build_common_tree_nodes): Build atomicQI_type_node,
	atomicHI_type_node, atomicSI_type_node, atomicDI_type_node and
	atomicTI_type_node.
	* print-tree.c (print_node): Print atomic qualifier.
	* tree-pretty-print.c (dump_generic_node): Print atomic type
	attribute.
	* target.def (atomic_assign_expand_fenv): New hook.
	* doc/tm.texi.in (TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New @hook.
	* doc/tm.texi: Regenerate.
	* targhooks.c (default_atomic_assign_expand_fenv): New function.
	* targhooks.h (default_atomic_assign_expand_fenv): Declare.
	* sync-builtins.def (__atomic_feraiseexcept): New built-in
	function.
	* config/i386/i386-builtin-types.def (VOID_FTYPE_PUSHORT): New
	function type.
	* config/i386/i386.c (enum ix86_builtins): Add
	IX86_BUILTIN_FNSTENV, IX86_BUILTIN_FLDENV, IX86_BUILTIN_FNSTSW and
	IX86_BUILTIN_FNCLEX.
	(bdesc_special_args): Add __builtin_ia32_fnstenv,
	__builtin_ia32_fldenv, __builtin_ia32_fnstsw and
	__builtin_ia32_fnclex.
	(ix86_expand_builtin): Handle the new built-in functions.
	(ix86_atomic_assign_expand_fenv): New function.
	(TARGET_ATOMIC_ASSIGN_EXPAND_FENV): New macro.
	* config/i386/i386.md (UNSPECV_FNSTENV, UNSPECV_FLDENV)
	(UNSPECV_FNSTSW, UNSPECV_FNCLEX): New unspecs.
	(fnstenv, fldenv, fnstsw, fnclex): New insns.

gcc/c-family:
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>
	    Joseph Myers  <joseph@codesourcery.com>

	* c-common.h (enum rid): Add RID_ATOMIC.
	* c-common.c (c_common_reswords): Add _Atomic.
	(sync_resolve_params): Use TYPE_MAIN_VARIANT on pointer argument.
	(keyword_is_type_qualifier): Accept RID_ATOMIC.
	* c-format.c (check_format_types): Check for extra _Atomic
	qualifiers in format argument.
	* c-pretty-print.c (pp_c_cv_qualifiers): Handle atomic qualifier.
	(pp_c_type_qualifier_list): Mention _Atomic in comment.

gcc/c:
2013-11-05  Joseph Myers  <joseph@codesourcery.com>
	    Andrew MacLeod  <amacleod@redhat.com>

	* c-aux-info.c (gen_type): Handle atomic qualifier.
	* c-decl.c (validate_proto_after_old_defn): Do not remove atomic
	qualifiers when compating types.
	(shadow_tag_warned): Handle atomic_p in declspecs.
	(quals_from_declspecs): Likewise.
	(start_decl): Use c_type_promotes_to when promoting argument
	types.
	(grokdeclarator): Handle _Atomic.
	(get_parm_info): Diagnose any qualifier on "void" as only
	parameter.
	(store_parm_decls_oldstyle): Do not remove atomic qualifiers when
	comparing types.  Use c_type_promotes_to when promoting argument
	types.
	(finish_function): Use c_type_promotes_to when promoting argument
	types.
	(build_null_declspecs): Handle atomic_p in declspecs.
	(declspecs_add_qual): Handle RID_ATOMIC.
	* c-parser.c (c_token_starts_typename, c_token_is_qualifier)
	(c_token_starts_declspecs): Handle RID_ATOMIC.
	(c_parser_declspecs): Handle atomic type specifiers and
	qualifiers.
	(c_parser_typeof_specifier): Remove const and _Atomic qualifiers
	from types of expressions with atomic type.
	(c_parser_direct_declarator_inner): Use convert_lvalue_to_rvalue.
	(c_parser_attribute_any_word): Handle RID_ATOMIC.
	(c_parser_initializer, c_parser_initelt, c_parser_initval)
	(c_parser_statement_after_labels, c_parser_switch_statement)
	(c_parser_for_statement, c_parser_expr_no_commas)
	(c_parser_conditional_expression, c_parser_binary_expression)
	(c_parser_cast_expression, c_parser_unary_expression)
	(c_parser_postfix_expression)
	(c_parser_postfix_expression_after_primary, c_parser_expression):
	Use convert_lvalue_to_rvalue.
	(c_parser_expression_conv, c_parser_expr_list): Document
	conversion of lvalues to rvalues.  Use convert_lvalue_to_rvalue.
	(c_parser_objc_synchronized_statement): Use
	convert_lvalue_to_rvalue.
	(c_parser_objc_selector): Handle RID_ATOMIC.
	(c_parser_objc_receiver, c_parser_array_notation): Use
	convert_lvalue_to_rvalue.
	* c-tree.h (ctsk_typeof): Adjust comment to mention use for
	_Atomic (type-name).
	(struct c_declspecs): Add atomic_p field.
	(convert_lvalue_to_rvalue): Declare.
	* c-typeck.c (c_type_promotes_to): Promote atomic types to
	corresponding atomic types.
	(qualify_type): Don't add _Atomic qualifiers from second argument.
	(comp_target_types): Do not allow _Atomic mismatches.
	(type_lists_compatible_p): Do not remove atomic qualifiers when
	comparing types.
	(really_atomic_lvalue, convert_lvalue_to_rvalue)
	(build_atomic_assign): New functions.
	(build_unary_op): Use build_atomic_assign for atomic increment and
	decrement.
	(build_conditional_expr): Do not treat _Atomic void as a qualified
	version of void.
	(build_modify_expr): Use build_atomic_assign for atomic LHS.
	(find_anonymous_field_with_type, convert_to_anonymous_field)
	(convert_for_assignment): Do not remove atomic qualifiers when
	comparing types.
	(digest_init): Do not accept initialization of arrays of atomic
	elements by string constants.
	(build_asm_expr): Use convert_lvalue_to_rvalue.
	(build_binary_op): Do not treat _Atomic void as a qualified
	version of void.

gcc/objc:
2013-11-05  Andrew MacLeod  <amacleod@redhat.com>

	* objc-act.c (objc_push_parm): Handle atomic qualifier.

gcc/testsuite:
2013-11-05  Joseph Myers  <joseph@codesourcery.com>

	* lib/target-supports.exp
	(check_effective_target_fenv_exceptions): New function.
	* lib/atomic-dg.exp, gcc.dg/atomic/atomic.exp: New files.
	* gcc.dg/atomic/c11-atomic-exec-1.c,
	gcc.dg/atomic/c11-atomic-exec-2.c,
	gcc.dg/atomic/c11-atomic-exec-3.c,
	gcc.dg/atomic/c11-atomic-exec-4.c,
	gcc.dg/atomic/c11-atomic-exec-5.c, gcc.dg/c11-atomic-1.c,
	gcc.dg/c11-atomic-2.c, gcc.dg/c11-atomic-3.c,
	gcc.dg/c90-atomic-1.c, gcc.dg/c99-atomic-1.c: New tests.

libatomic:
2013-11-05  Joseph Myers  <joseph@codesourcery.com>

	* fenv.c: New file.
	* libatomic.map (LIBATOMIC_1.1): New symbol version.  Include
	__atomic_feraiseexcept.
	* configure.ac (libtool_VERSION): Change to 2:0:1.
	(fenv.h): Test for header.
	* Makefile.am (libatomic_la_SOURCES): Add fenv.c.
	* Makefile.in, auto-config.h.in, configure: Regenerate.

From-SVN: r204544
2013-11-07 21:15:25 +00:00
Richard Biener 3f5c390ddd tree.c (drop_tree_overflow): New function.
2013-11-06  Richard Biener  <rguenther@suse.de>

	* tree.c (drop_tree_overflow): New function.
	* tree.h (drop_tree_overflow): Declare.
	* gimplify.c (gimplify_expr): Drop TREE_OVERFLOW.
	* tree-vrp.c (range_int_cst_singleton_p): Use
	is_overflow_infinity instead of testing TREE_OVERFLOW.
	(extract_range_from_assert): Likewise.
	(zero_nonzero_bits_from_vr): Likewise.
	(extract_range_basic): Likewise.
	(register_new_assert_for): Use drop_tree_overflow.
	(vrp_visit_phi_node): Likewise.

From-SVN: r204454
2013-11-06 13:08:06 +00:00
Tobias Burnus 6d7f7e0a63 invoke.texi (-fopenmp-simd): Document new option.
2013-11-05  Tobias Burnus  <burnus@net-b.de>

gcc/
        * doc/invoke.texi (-fopenmp-simd): Document new option.
        * gimplify.c (gimplify_body): Accept -fopenmp-simd.
        * omp-low.c (execute_expand_omp, execute_lower_omp): Ditto.
        * tree.c (attribute_value_equal): Ditto.

gcc/fortran/
        * lang.opt (fopenmp-simd): New option.
        * gfortran.h (gfc_option_t): Add gfc_flag_openmp_simd.
        * options.c (gfc_handle_option): Handle it.

gcc/c-family/
        * c.opt (fopenmp-simd): New option.
        * c-pragma.c (omp_pragmas): Move pragmas which can contain simd
        * to ...
        (omp_pragmas): ... this new struct.
        (c_pp_lookup_pragma): Also walk omp_pragmas.
        (init_pragma): Init pragmas for -fopenmp-simd.

gcc/c
        * c-parser.c (c_parser_omp_for, c_parser_omp_parallel,
        c_parser_omp_distribute, c_parser_omp_teams,
        c_parser_omp_target, c_parser_omp_declare): Handle
        -fopenmp-simd.

gcc/cp
        * parser.c (cp_parser_omp_for, cp_parser_omp_parallel,
        cp_parser_omp_distribute, cp_parser_omp_teams,
cp_parser_omp_target,
        cp_parser_omp_declare): Handle
        -fopenmp-simd.

gcc/testsuite/
        * g++.dg/gomp/openmp-simd-1.C: New.
        * g++.dg/gomp/openmp-simd-2.C: New.
        * gcc.dg/gomp/openmp-simd-1.c: New.
        * gcc.dg/gomp/openmp-simd-2.c: New.

From-SVN: r204382
2013-11-05 08:29:47 +01:00
Jakub Jelinek eae76e53d9 tree.c (tree_ctz): New function.
* tree.c (tree_ctz): New function.
	* tree.h (tree_ctz): New prototype.
	* tree-ssanames.h (get_range_info, get_nonzero_bits): Change
	first argument from tree to const_tree.
	* tree-ssanames.c (get_range_info, get_nonzero_bits): Likewise.
	* tree-vectorizer.h (vect_generate_tmps_on_preheader): New prototype.
	* tree-vect-loop-manip.c (vect_generate_tmps_on_preheader): No longer
	static.
	* expr.c (highest_pow2_factor): Reimplemented using tree_ctz.
	* tree-vect-loop.c (vect_analyze_loop_operations,
	vect_transform_loop): Don't force scalar loop for bound just because
	number of iterations is unknown, only do it if it is not known to be
	a multiple of vectorization_factor.
	* builtins.c (get_object_alignment_2): Use tree_ctz on offset.

From-SVN: r204257
2013-10-31 14:57:05 +01:00
Ilya Enkovich ea9637cdcd tree-core.h (tree_index): Add TI_POINTER_BOUNDS_TYPE.
* 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.

From-SVN: r204199
2013-10-30 09:09:44 +00:00
David Malcolm 67348ccc9c Autogenerated fixes of "->symbol." to "->"
This is the autogenerated part of the conversion of the symtable types
to a C++ class hierarchy.

gcc/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* asan.c (asan_finish_file): Update for conversion of symtab types to
	a true class hierarchy.
	* cfgexpand.c (estimated_stack_frame_size): Likewise.
	* cgraph.c (cgraph_get_body): Likewise.
	(cgraph_get_create_real_symbol_node): Likewise.
	(verify_cgraph_node): Likewise.
	(verify_edge_corresponds_to_fndecl): Likewise.
	(verify_edge_count_and_frequency): Likewise.
	(cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise.
	(cgraph_can_remove_if_no_direct_calls_p): Likewise.
	(cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise.
	(cgraph_node_cannot_return): Likewise.
	(cgraph_set_pure_flag_1): Likewise.
	(cgraph_set_const_flag_1): Likewise.
	(cgraph_set_nothrow_flag_1): Likewise.
	(cgraph_make_node_local_1): Likewise.
	(cgraph_for_node_and_aliases): Likewise.
	(cgraph_for_node_thunks_and_aliases): Likewise.
	(cgraph_node_can_be_local_p): Likewise.
	(cgraph_node_cannot_be_local_p_1): Likewise.
	(cgraph_function_body_availability): Likewise.
	(dump_cgraph_node): Likewise.
	(cgraph_rtl_info): Likewise.
	(cgraph_mark_address_taken_node): Likewise.
	(cgraph_remove_node): Likewise.
	(cgraph_release_function_body): Likewise.
	(cgraph_update_edges_for_call_stmt_node): Likewise.
	(cgraph_redirect_edge_call_stmt_to_callee): Likewise.
	(cgraph_make_edge_direct): Likewise.
	(cgraph_resolve_speculation): Likewise.
	(cgraph_speculative_call_info): Likewise.
	(cgraph_turn_edge_to_speculative): Likewise.
	(cgraph_create_edge_1): Likewise.
	(cgraph_set_call_stmt): Likewise.
	(cgraph_node_for_asm): Likewise.
	(cgraph_add_thunk): Likewise.
	(cgraph_same_body_alias): Likewise.
	(cgraph_create_function_alias): Likewise.
	(cgraph_create_node): Likewise.
	(cgraph_create_empty_node): Likewise.
	(record_function_versions): Likewise.
	(used_from_object_file_p): Likewise.
	* cgraph.h (symtab_can_be_discarded): Likewise.
	(symtab_real_symbol_p): Likewise.
	(cgraph_mark_force_output_node): Likewise.
	(cgraph_edge_recursive_p): Likewise.
	(symtab_alias_target): Likewise.
	(varpool_all_refs_explicit_p): Likewise.
	(varpool_can_remove_if_no_refs): Likewise.
	(cgraph_only_called_directly_or_aliased_p): Likewise.
	(cgraph_next_function_with_gimple_body): Likewise.
	(cgraph_first_function_with_gimple_body): Likewise.
	(cgraph_function_with_gimple_body_p): Likewise.
	(cgraph_next_function): Likewise.
	(cgraph_first_function): Likewise.
	(cgraph_next_defined_function): Likewise.
	(cgraph_first_defined_function): Likewise.
	(varpool_next_defined_variable): Likewise.
	(varpool_first_defined_variable): Likewise.
	(varpool_next_static_initializer): Likewise.
	(varpool_first_static_initializer): Likewise.
	(varpool_next_variable): Likewise.
	(varpool_first_variable): Likewise.
	(varpool_node_name): Likewise.
	(varpool): Likewise.
	(cgraph): Likewise.
	(is_a_helper <varpool_node>::test): Likewise.
	(is_a_helper <cgraph_node>::test): Likewise.
	(varpool_variable_node): Likewise.
	(cgraph_function_or_thunk_node): Likewise.
	(varpool_alias_target): Likewise.
	(cgraph_alias_target): Likewise.
	(cgraph_node_name): Likewise.
	(varpool_node_asm_name): Likewise.
	(cgraph_node_asm_name): Likewise.
	* cgraphbuild.c (remove_cgraph_callee_edges): Likewise.
	(cgraph_rebuild_references): Likewise.
	(rebuild_cgraph_edges): Likewise.
	(record_eh_tables): Likewise.
	(build_cgraph_edges): Likewise.
	(mark_store): Likewise.
	(mark_load): Likewise.
	(mark_address): Likewise.
	(record_type_list): Likewise.
	(record_reference): Likewise.
	* cgraphclones.c (cgraph_materialize_all_clones): Likewise.
	(cgraph_materialize_clone): Likewise.
	(cgraph_function_versioning): Likewise.
	(cgraph_copy_node_for_versioning): Likewise.
	(update_call_expr): Likewise.
	(cgraph_find_replacement_node): Likewise.
	(cgraph_create_virtual_clone): Likewise.
	(cgraph_clone_node): Likewise.
	* cgraphunit.c (compile): Likewise.
	(output_weakrefs): Likewise.
	(output_in_order): Likewise.
	(expand_function): Likewise.
	(assemble_thunks_and_aliases): Likewise.
	(expand_thunk): Likewise.
	(mark_functions_to_output): Likewise.
	(handle_alias_pairs): Likewise.
	(analyze_functions): Likewise.
	(walk_polymorphic_call_targets): Likewise.
	(varpool_finalize_decl): Likewise.
	(process_function_and_variable_attributes): Likewise.
	(cgraph_process_same_body_aliases): Likewise.
	(analyze_function): Likewise.
	(cgraph_add_new_function): Likewise.
	(cgraph_finalize_function): Likewise.
	(referred_to_p): Likewise.
	(cgraph_reset_node): Likewise.
	(cgraph_process_new_functions): Likewise.
	(enqueue_node): Likewise.
	(decide_is_symbol_needed): Likewise.
	* coverage.c (coverage_compute_profile_id): Likewise.
	* dbxout.c (dbxout_expand_expr): Likewise.
	* dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise.
	(reference_to_unused): Likewise.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
	* gimplify.c (unvisit_body): Likewise.
	(unshare_body): Likewise.
	* ipa-cp.c (ipcp_generate_summary): Likewise.
	(ipcp_decision_stage): Likewise.
	(identify_dead_nodes): Likewise.
	(decide_whether_version_node): Likewise.
	(decide_about_value): Likewise.
	(perhaps_add_new_callers): Likewise.
	(create_specialized_node): Likewise.
	(update_profiling_info): Likewise.
	(ipcp_propagate_stage): Likewise.
	(estimate_local_effects): Likewise.
	(good_cloning_opportunity_p): Likewise.
	(devirtualization_time_bonus): Likewise.
	(propagate_constants_accross_call): Likewise.
	(initialize_node_lattices): Likewise.
	(ipcp_cloning_candidate_p): Likewise.
	(determine_versionability): Likewise.
	(print_all_lattices): Likewise.
	(print_lattice): Likewise.
	(ipcp_discover_new_direct_edges): Likewise.
	* ipa-devirt.c (ipa_devirt): Likewise.
	(likely_target_p): Likewise.
	(update_type_inheritance_graph): Likewise.
	(possible_polymorphic_call_target_p): Likewise.
	(dump_possible_polymorphic_call_targets): Likewise.
	(devirt_variable_node_removal_hook): Likewise.
	(record_binfo): Likewise.
	(maybe_record_node): Likewise.
	(build_type_inheritance_graph): Likewise.
	* ipa-inline-analysis.c (inline_write_summary): Likewise.
	(inline_generate_summary): Likewise.
	(inline_analyze_function): Likewise.
	(do_estimate_growth): Likewise.
	(simple_edge_hints): Likewise.
	(estimate_node_size_and_time): Likewise.
	(estimate_edge_devirt_benefit): Likewise.
	(compute_inline_parameters): Likewise.
	(estimate_function_body_sizes): Likewise.
	(compute_bb_predicates): Likewise.
	(initialize_inline_failed): Likewise.
	(dump_inline_summary): Likewise.
	(dump_inline_edge_summary): Likewise.
	* ipa-inline-transform.c (inline_transform): Likewise.
	(preserve_function_body_p): Likewise.
	(save_inline_function_body): Likewise.
	(inline_call): Likewise.
	(clone_inlined_nodes): Likewise.
	(can_remove_node_now_p): Likewise.
	(can_remove_node_now_p_1): Likewise.
	* ipa-inline.c (early_inliner): Likewise.
	(early_inline_small_functions): Likewise.
	(inline_always_inline_functions): Likewise.
	(ipa_inline): Likewise.
	(flatten_function): Likewise.
	(inline_small_functions): Likewise.
	(speculation_useful_p): Likewise.
	(recursive_inlining): Likewise.
	(update_caller_keys): Likewise.
	(reset_edge_caches): Likewise.
	(update_edge_key): Likewise.
	(edge_badness): Likewise.
	(relative_time_benefit): Likewise.
	(want_inline_self_recursive_call_p): Likewise.
	(want_inline_small_function_p): Likewise.
	(want_early_inline_function_p): Likewise.
	(num_calls): Likewise.
	(can_early_inline_edge_p): Likewise.
	(can_inline_edge_p): Likewise.
	(report_inline_failed_reason): Likewise.
	* ipa-profile.c (ipa_profile): Likewise.
	(ipa_propagate_frequency): Likewise.
	(ipa_propagate_frequency_1): Likewise.
	(ipa_profile_generate_summary): Likewise.
	* ipa-prop.c (ipcp_transform_function): Likewise.
	(read_replacements_section): Likewise.
	(ipa_prop_read_section): Likewise.
	(ipa_modify_call_arguments): Likewise.
	(ipa_print_node_params): Likewise.
	(propagate_controlled_uses): Likewise.
	(update_indirect_edges_after_inlining): Likewise.
	(remove_described_reference): Likewise.
	(ipa_make_edge_direct_to_target): Likewise.
	(ipa_analyze_node): Likewise.
	(ipa_analyze_params_uses): Likewise.
	(ipa_compute_jump_functions): Likewise.
	(ipa_get_callee_param_type): Likewise.
	(ipa_print_node_jump_functions): Likewise.
	(ipa_initialize_node_params): Likewise.
	(ipa_populate_param_decls): Likewise.
	(ipa_func_spec_opts_forbid_analysis_p): Likewise.
	(write_agg_replacement_chain): Likewise.
	(ipa_write_node_info): Likewise.
	(ipa_edge_duplication_hook): Likewise.
	(try_decrement_rdesc_refcount): Likewise.
	* ipa-pure-const.c (propagate_nothrow): Likewise.
	(propagate_pure_const): Likewise.
	(pure_const_read_summary): Likewise.
	(pure_const_write_summary): Likewise.
	(analyze_function): Likewise.
	* ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise.
	(ipa_ref_referring_ref_list): Likewise.
	* ipa-ref.c (ipa_clear_stmts_in_references): Likewise.
	(ipa_remove_stmt_references): Likewise.
	(ipa_find_reference): Likewise.
	(ipa_dump_referring): Likewise.
	(ipa_dump_references): Likewise.
	(ipa_record_reference): Likewise.
	* ipa-reference.c (ipa_reference_read_optimization_summary): Likewise.
	(ipa_reference_write_optimization_summary): Likewise.
	(write_node_summary_p): Likewise.
	(propagate): Likewise.
	(read_write_all_from_decl): Likewise.
	(generate_summary): Likewise.
	(analyze_function): Likewise.
	(propagate_bits): Likewise.
	(ipa_reference_get_not_written_global): Likewise.
	(ipa_reference_get_not_read_global): Likewise.
	* ipa-split.c (execute_split_functions): Likewise.
	(split_function): Likewise.
	* ipa-utils.c (ipa_merge_profiles): Likewise.
	(dump_cgraph_node_set): Likewise.
	(ipa_reverse_postorder): Likewise.
	(ipa_edge_within_scc): Likewise.
	(ipa_get_nodes_in_cycle): Likewise.
	(ipa_free_postorder_info): Likewise.
	(ipa_reduced_postorder): Likewise.
	(searchc): Likewise.
	(recursive_call_p): Likewise.
	* ipa.c (ipa_cdtor_merge): Likewise.
	(record_cdtor_fn): Likewise.
	(function_and_variable_visibility): Likewise.
	(varpool_externally_visible_p): Likewise.
	(cgraph_externally_visible_p): Likewise.
	(comdat_can_be_unshared_p): Likewise.
	(comdat_can_be_unshared_p_1): Likewise.
	(address_taken_from_non_vtable_p): Likewise.
	(ipa_discover_readonly_nonaddressable_vars): Likewise.
	(symtab_remove_unreachable_nodes): Likewise.
	(walk_polymorphic_call_targets): Likewise.
	(process_references): Likewise.
	(enqueue_node): Likewise.
	(has_addr_references_p): Likewise.
	(cgraph_non_local_node_p_1): Likewise.
	* is-a.h (varpool_analyze_node): Likewise.
	* lto-cgraph.c (input_symtab): Likewise.
	(merge_profile_summaries): Likewise.
	(input_cgraph_1): Likewise.
	(input_edge): Likewise.
	(input_varpool_node): Likewise.
	(input_node): Likewise.
	(input_overwrite_node): Likewise.
	(compute_ltrans_boundary): Likewise.
	(output_refs): Likewise.
	(lto_output_varpool_node): Likewise.
	(lto_output_node): Likewise.
	(reachable_from_other_partition_p): Likewise.
	(referenced_from_other_partition_p): Likewise.
	(lto_output_edge): Likewise.
	(output_node_opt_summary): Likewise.
	(add_node_to): Likewise.
	(reachable_from_this_partition_p): Likewise.
	(lto_set_symtab_encoder_in_partition): Likewise.
	(lto_symtab_encoder_in_partition_p): Likewise.
	(lto_set_symtab_encoder_encode_initializer): Likewise.
	(lto_symtab_encoder_encode_initializer_p): Likewise.
	(lto_set_symtab_encoder_encode_body): Likewise.
	(lto_symtab_encoder_encode_body_p): Likewise.
	* lto-section-in.c (lto_free_function_in_decl_state_for_node):
	Likewise.
	* lto-streamer-in.c (lto_read_body): Likewise.
	(fixup_call_stmt_edges): Likewise.
	(fixup_call_stmt_edges_1): Likewise.
	* lto-streamer-out.c (produce_symtab): Likewise.
	(output_symbol_p): Likewise.
	(write_symbol): Likewise.
	(lto_output): Likewise.
	(copy_function): Likewise.
	(output_function): Likewise.
	* passes.c (function_called_by_processed_nodes_p): Likewise.
	(ipa_write_optimization_summaries): Likewise.
	(ipa_write_summaries): Likewise.
	(do_per_function_toporder): Likewise.
	(do_per_function): Likewise.
	(dump_passes): Likewise.
	* symtab.c (symtab_semantically_equivalent_p): Likewise.
	(symtab_nonoverwritable_alias): Likewise.
	(symtab_nonoverwritable_alias_1): Likewise.
	(symtab_for_node_and_aliases): Likewise.
	(symtab_resolve_alias): Likewise.
	(fixup_same_cpp_alias_visibility): Likewise.
	(symtab_alias_ultimate_target): Likewise.
	(symtab_used_from_object_file_p): Likewise.
	(verify_symtab_base): Likewise.
	(dump_symtab_base): Likewise.
	(symtab_node_name): Likewise.
	(symtab_node_asm_name): Likewise.
	(symtab_dissolve_same_comdat_group_list): Likewise.
	(symtab_add_to_same_comdat_group): Likewise.
	(symtab_unregister_node): Likewise.
	(symtab_insert_node_to_hashtable): Likewise.
	(symtab_register_node): Likewise.
	(unlink_from_assembler_name_hash): Likewise.
	(insert_to_assembler_name_hash): Likewise.
	(eq_assembler_name): Likewise.
	(hash_node_by_assembler_name): Likewise.
	(eq_node): Likewise.
	(hash_node): Likewise.
	* toplev.c (wrapup_global_declaration_2): Likewise.
	* trans-mem.c (ipa_tm_execute): Likewise.
	(ipa_tm_transform_clone): Likewise.
	(ipa_tm_transform_transaction): Likewise.
	(ipa_tm_transform_calls_redirect): Likewise.
	(ipa_tm_insert_gettmclone_call): Likewise.
	(ipa_tm_insert_irr_call): Likewise.
	(ipa_tm_create_version): Likewise.
	(ipa_tm_create_version_alias): Likewise.
	(ipa_tm_mark_forced_by_abi_node): Likewise.
	(ipa_tm_mark_force_output_node): Likewise.
	(ipa_tm_diagnose_tm_safe): Likewise.
	(ipa_tm_mayenterirr_function): Likewise.
	(ipa_tm_scan_irr_function): Likewise.
	(ipa_tm_note_irrevocable): Likewise.
	(ipa_tm_scan_calls_clone): Likewise.
	(get_cg_data): Likewise.
	* tree-eh.c (tree_could_trap_p): Likewise.
	* tree-emutls.c (ipa_lower_emutls): Likewise.
	(create_emultls_var): Likewise.
	(lower_emutls_function_body): Likewise.
	(gen_emutls_addr): Likewise.
	(emutls_decl): Likewise.
	(new_emutls_decl): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	(optimize_inline_calls): Likewise.
	(expand_call_inline): Likewise.
	(estimate_num_insns): Likewise.
	(copy_bb): Likewise.
	(delete_unreachable_blocks_update_callgraph): Likewise.
	* tree-nested.c (gimplify_all_functions): Likewise.
	(create_nesting_tree): Likewise.
	(check_for_nested_with_variably_modified): Likewise.
	* tree-pretty-print.c (dump_function_header): Likewise.
	* tree-profile.c (tree_profiling): Likewise.
	* tree-sra.c (ipa_sra_preliminary_function_checks): Likewise.
	(modify_function): Likewise.
	(convert_callers): Likewise.
	(convert_callers_for_node): Likewise.
	* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
	(associate_varinfo_to_alias): Likewise.
	(create_variable_info_for): Likewise.
	(get_constraint_for_ssa_var): Likewise.
	* tree-vectorizer.c (increase_alignment): Likewise.
	* tree.c (find_decls_types_in_var): Likewise.
	(find_decls_types_in_node): Likewise.
	(free_lang_data_in_decl): Likewise.
	* value-prof.c (gimple_ic_transform): Likewise.
	(gimple_ic): Likewise.
	(check_ic_target): Likewise.
	(init_node_map): Likewise.
	* varasm.c (decl_binds_to_current_def_p): Likewise.
	(default_binds_local_p_1): Likewise.
	(dump_tm_clone_pairs): Likewise.
	(assemble_alias): Likewise.
	(find_decl): Likewise.
	(mark_decl_referenced): Likewise.
	* varpool.c (varpool_for_node_and_aliases): Likewise.
	(varpool_extra_name_alias): Likewise.
	(varpool_create_variable_alias): Likewise.
	(add_new_static_var): Likewise.
	(varpool_finalize_named_section_flags): Likewise.
	(varpool_remove_unreferenced_decls): Likewise.
	(enqueue_node): Likewise.
	(varpool_assemble_decl): Likewise.
	(assemble_aliases): Likewise.
	(varpool_analyze_node): Likewise.
	(cgraph_variable_initializer_availability): Likewise.
	(varpool_add_new_variable): Likewise.
	(ctor_for_folding): Likewise.
	(dump_varpool_node): Likewise.
	(varpool_remove_initializer): Likewise.
	(varpool_remove_node): Likewise.
	(varpool_node_for_decl): Likewise.
	(varpool_create_empty_node): Likewise.
	* config/i386/i386.c (ix86_generate_version_dispatcher_body):
	Likewise.
	(ix86_get_function_versions_dispatcher): Likewise.

gcc/ada/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* gcc-interface/trans.c (finalize_nrv): Update for conversion of
	symtab types to a true class hierarchy.
	* gcc-interface/utils.c (gnat_write_global_declarations): Likewise.

gcc/c-family/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* c-gimplify.c (c_genericize): Update for conversion of symtab types
	to a true class hierarchy.
	* c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise.

gcc/cp/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* call.c (mark_versions_used): Update for conversion of symtab types
	to a true class hierarchy.
	* decl2.c (cp_write_global_declarations): Likewise.
	(clear_decl_external): Likewise.
	(build_java_method_aliases): Likewise.
	(collect_candidates_for_java_method_aliases): Likewise.
	(mark_needed): Likewise.
	(var_finalized_p): Likewise.
	(maybe_make_one_only): Likewise.
	(maybe_emit_vtables): Likewise.
	* lambda.c (maybe_add_lambda_conv_op): Likewise.
	* method.c (use_thunk): Likewise.
	* optimize.c (maybe_clone_body): Likewise.
	* tree.c (cp_fix_function_decl_p): Likewise.

gcc/java/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* decl.c (java_mark_decl_local): Update for conversion of symtab types
	to a true class hierarchy.

gcc/lto/

	Patch autogenerated by refactor_symtab.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 58bb219cc090b2f4516a9297d868c245495ee622

	* lto-partition.c (lto_promote_cross_file_statics): Update for
	conversion of symtab types to a true class hierarchy.
	(rename_statics): Likewise.
	(promote_symbol): Likewise.
	(privatize_symbol_name): Likewise.
	(lto_balanced_map): Likewise.
	(varpool_node_cmp): Likewise.
	(node_cmp): Likewise.
	(lto_1_to_1_map): Likewise.
	(undo_partition): Likewise.
	(add_symbol_to_partition): Likewise.
	(contained_in_symbol): Likewise.
	(add_symbol_to_partition_1): Likewise.
	(add_references_to_partition): Likewise.
	(symbol_partitioned_p): Likewise.
	(get_symbol_class): Likewise.
	(lto_max_map): Likewise.
	* lto-symtab.c (lto_symtab_prevailing_decl): Likewise.
	(lto_symtab_merge_symbols): Likewise.
	(lto_symtab_merge_symbols_1): Likewise.
	(lto_symtab_merge_decls): Likewise.
	(lto_symtab_merge_decls_1): Likewise.
	(lto_symtab_merge_decls_2): Likewise.
	(lto_symtab_resolve_symbols): Likewise.
	(lto_symtab_resolve_can_prevail_p): Likewise.
	(lto_symtab_symbol_p): Likewise.
	(lto_symtab_resolve_replaceable_p): Likewise.
	(lto_symtab_merge): Likewise.
	(lto_varpool_replace_node): Likewise.
	(lto_cgraph_replace_node): Likewise.
	* lto.c (lto_main): Likewise.
	(do_whole_program_analysis): Likewise.
	(materialize_cgraph): Likewise.
	(read_cgraph_and_symbols): Likewise.
	(cmp_partitions_order): Likewise.
	(lto_materialize_function): Likewise.
	(has_analyzed_clone_p): Likewise.

From-SVN: r204171
2013-10-29 18:30:00 +00:00
Ilya Enkovich 65f55baca4 mode-classes.def (MODE_POINTER_BOUNDS): New.
* 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: r204045
2013-10-25 05:36:14 +00:00
Andrew MacLeod 442b4905f4 tree-ssa.h: Remove all #include's
* tree-ssa.h: Remove all #include's
	* gengtype.c (open_base_files): Adjust include list for gtype-desc.c.
	* alias.c: Move required includes from tree-ssa.h.
	* asan.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* dse.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* ggc-page.c: Likewise.
	* gimple-builder.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple-streamer-out.c: Likewise.
	* gimplify.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* loop-init.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-in.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* omp-low.c: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* sese.c: Likewise.
	* targhooks.c: Likewise.
	* tracer.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-copy.c: Likewise.
	* tree-ssa-copyrename.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-ifcombine.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-ch.c: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop-unswitch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sink.c: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tsan.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varpool.c: Likewise.
	* vtable-verify.c: Likewise.

From-SVN: r203967
2013-10-23 12:16:58 +00:00
Paulo Matos 5806f4814c tree-core.h (tree_code_name): Remove.
gcc/
	* tree-core.h (tree_code_name): Remove.
	* tree.h (get_tree_code_name): New prototype.
	* tree.c (tree_code_name): Make static.
	(get_tree_code_name): New function.
	(dump_tree_statistics, tree_check_failed, tree_not_check_failed, 
	tree_class_check_failed, tree_range_check_failed,
	tree_not_class_check_failed, omp_clause_check_failed,
	tree_contains_struct_check_failed, tree_operand_check_failed): Use new
	wrapper get_tree_code_name instead of calling tree_code_name directly.
	* tree-vrp.c (dump_asserts_for): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-pretty-print.c (do_niy, dump_generic_node): Likewise.
	* tree-pretty-print.h (pp_unsupported_tree): Likewise.
	* lto-streamer-out.c (lto_write_tree, DFS_write_tree): Likewise.
	* tree-ssa-dom.c (print_expr_hash_elt): Likewise.
	* gimple-pretty-print.c (dump_unary_rhs, dump_binary_rhs,
	dump_ternary_rhs, dump_gimple_assign, dump_gimple_cond,
	dump_gimple_omp_for): Likewise.
	* tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise.
	* tree-ssa-pre.c (print_pre_expr): Likewise.
	* ipa-prop.c (ipa_print_node_jump_functions_for_edge): Likewise.
	* print-tree.c (print_node_brief, print_node): Likewise.
	* gimple.c (gimple_check_failed): Likewise.
	* lto-streamer.c (lto_tag_name, print_lto_report): Likewise.
	* config/frv/frv.c (frv_init_cumulative_args): Likewise.
	* config/mep/mep.c (mep_validate_vliw): Likewise.
	* config/iq2000/iq2000.c (init_cumulative_args): Likewise.
	* config/rs6000/rs6000.c (init_cumulative_args): Likewise.

gcc/cp/
	* error.c (code_to_string): Use new wrapper get_tree_code_name.
	* cxx-pretty-print.c (pp_cxx_assignment_operator): Likewise.
	* pt.c (tsubst): Likewise.
	* semantics.c (cxx_eval_constant_expression,
	potential_constant_expression_1): Likewise.
	* mangle.c (MANGLE_TRACE_TREE, dump_substitution_candidates,
	add_substitution, find_substitution): Likewise.

From-SVN: r203695
2013-10-16 12:09:17 +02:00
Sriraman Tallam bf7b5747bb re PR target/57756 (Function target attribute is retaining state of previously seen function)
PR target/57756

The root-cause of this PR is that global_options is not restored to
default before calling ix86_valid_target_attribute_tree and hence
target attributes are incorrectly processed sometimes.

This patch refactors code in i386.c in functions in the call-chain of 
ix86_valid_target_attribute_tree to use any gcc_options struct passed
as a parameter. It replaces existing code which always uses the
global_options struct.

2013-10-15 Sriraman Tallam  <tmsriram@google.com>

	PR target/57756
	* optc-save-gen.awk: Add extra parameter to the save and restore
	target calls.
	* opth-gen.awk: Generate new TARGET_* macros  to accept a parameter.
	* tree.c (build_optimization_node): New parameter.  Add extra parameter
	to call to cl_optimization_save.
	(build_target_option_node): New parameter. Add extra parameter
	to call to cl_target_option_save.
	* tree.h (build_optimization_node): New parameter.
	(build_target_option_node): New parameter.
	* c-family/c-common.c (handle_optimize_attribute): Fix calls to
	build_optimization_node and build_target_option_node.
	* c-family/c-pragma.c (handle_pragma_optimize): Ditto.
	(handle_pragma_push_options): Ditto.
	* toplev.c (process_options): Ditto.
	* opts.c (init_options_struct): Check for opts_set non-null.
	* target.def (target_option.save): New parameter.
	(target_option.restore): New parameter.
	* tm.texi: Generate.
	* config/i386/i386-c.c (ix86_target_macros_internal): Ditto.
	(ix86_pragma_target_parse): Ditto.
	* config/i386/i386-protos.h (ix86_valid_target_attribute_tree): New
	parameters.
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Fix calls
	to  build_optimization_node and build_target_option_node.
	(rs6000_valid_attribute_p): Ditto.
	(rs6000_pragma_target_parse): Ditto.
	* config/i386/i386.opt (x_ix86_target_flags_explicit): New TargetSave
	data.
	* config/i386/i386.h:
	TARGET_64BIT_P: New Macro
	TARGET_MMX_P: New Macro.
	TARGET_3DNOW_P: New Macro.
	TARGET_3DNOW_A_P: New Macro.
	TARGET_SSE_P: New Macro.
	TARGET_SSE2_P: New Macro.
	TARGET_SSE3_P: New Macro.
	TARGET_SSSE3_P: New Macro.
	TARGET_SSE4_1_P: New Macro.
	TARGET_SSE4_2_P: New Macro.
	TARGET_AVX_P: New Macro.
	TARGET_AVX2_P: New Macro.
	TARGET_AVX512F_P: New Macro.
	TARGET_AVX512PF_P: New Macro.
	TARGET_AVX512ER_P: New Macro.
	TARGET_AVX512CD_P: New Macro.
	TARGET_FMA_P: New Macro.
	TARGET_SSE4A_P: New Macro.
	TARGET_FMA4_P: New Macro.
	TARGET_XOP_P: New Macro.
	TARGET_LWP_P: New Macro.
	TARGET_ABM_P: New Macro.
	TARGET_BMI_P: New Macro.
	TARGET_BMI2_P: New Macro.
	TARGET_LZCNT_P: New Macro.
	TARGET_TBM_P: New Macro.
	TARGET_POPCNT_P: New Macro.
	TARGET_SAHF_P: New Macro.
	TARGET_MOVBE_P: New Macro.
	TARGET_CRC32_P: New Macro.
	TARGET_AES_P: New Macro.
	TARGET_PCLMUL_P: New Macro.
	TARGET_CMPXCHG16B_P: New Macro.
	TARGET_FSGSBASE_P: New Macro.
	TARGET_RDRND_P: New Macro.
	TARGET_F16C_P: New Macro.
	TARGET_RTM_P: New Macro.
	TARGET_HLE_P: New Macro.
	TARGET_RDSEED_P: New Macro.
	TARGET_PRFCHW_P: New Macro.
	TARGET_ADX_P: New Macro.
	TARGET_FXSR_P: New Macro.
	TARGET_XSAVE_P: New Macro.
	TARGET_XSAVEOPT_P: New Macro.
	TARGET_LP64_P: New Macro.
	TARGET_X32_P: New Macro.
	TARGET_FPMATH_DEFAULT_P: New Macro.
	TARGET_FLOAT_RETURNS_IN_80387_P: New Macro.
	* config/i386/i386.c (ix86_option_override_internal): New parameters.
	opts and opts_set.
	Change ix86_tune_string to access opts->x_ix86_tune_string.
	Change ix86_isa_flags to access opts->x_ix86_isa_flags.
	Change ix86_arch_string to access opts->x_ix86_arch_string.
	Change ix86_stringop_alg to access opts->x_ix86_stringop_alg.
	Change ix86_pmode to access opts->x_ix86_pmode.
	Change ix86_abi to access opts->x_ix86_abi.
	Change ix86_cmodel to access opts->x_ix86_cmodel.
	Change ix86_asm_dialect to access opts->x_ix86_asm_dialect.
	Change ix86_isa_flags_explicit to access
	opts->x_ix86_isa_flags_explicit.
	Change ix86_dump_tunes to access opts->x_ix86_dump_tunes.
	Change ix86_regparm to access opts->x_ix86_regparm.
	Change ix86_branch_cost to access opts->x_ix86_branch_cost.
	Change ix86_preferred_stack_boundary_arg to access
	opts->x_ix86_preferred_stack_boundary_arg.
	Change ix86_force_align_arg_pointer to access
	opts->x_ix86_force_align_arg_pointer.
	Change ix86_incoming_stack_boundar_arg to access
	opts->x_ix86_incoming_stack_boundar_arg.
	Change ix86_fpmath to access opts->x_ix86_fpmath.
	Change ix86_veclibabi_type to access opts->x_ix86_veclibabi_type.
	Change ix86_recip_name to access opts->x_ix86_recip_name.
	Change ix86_stack_protector_guard to access
	opts->x_ix86_stack_protector_guard.
	Change ix86_tune_memcpy_strategy to access
	opts->x_ix86_tune_memcpy_strategy.
	Change ix86_tune_memset_strategy to access
	opts->x_ix86_tune_memset_strategy.
	Change global_options to access opts.
	Change global_options_set to access opts_set.
        Change TARGET_64BIT to TARGET_64BIT_P (opts->...)
        Change TARGET_MMX to TARGET_MMX_P (opts->...)
        Change TARGET_3DNOW to TARGET_3DNOW_P (opts->...)
        Change TARGET_3DNOW_A to TARGET_3DNOW_A_P (opts->...)
        Change TARGET_SSE to TARGET_SSE_P (opts->...)
        Change TARGET_SSE2 to TARGET_SSE2_P (opts->...)
        Change TARGET_SSE3 to TARGET_SSE3_P (opts->...)
        Change TARGET_SSSE3 to TARGET_SSSE3_P (opts->...)
        Change TARGET_SSE4_1 to TARGET_SSE4_1_P (opts->...)
        Change TARGET_SSE4_2 to TARGET_SSE4_2_P (opts->...)
        Change TARGET_AVX to TARGET_AVX_P (opts->...)
        Change TARGET_AVX2 to TARGET_AVX2_P (opts->...)
        Change TARGET_AVX512F to TARGET_AVX512F_P (opts->...)
        Change TARGET_AVX512PF to TARGET_AVX512PF_P (opts->...)
        Change TARGET_AVX512ER to TARGET_AVX512ER_P (opts->...)
        Change TARGET_AVX512CD to TARGET_AVX512CD_P (opts->...)
        Change TARGET_FMA to TARGET_FMA_P (opts->...)
        Change TARGET_SSE4A to TARGET_SSE4A_P (opts->...)
        Change TARGET_FMA4 to TARGET_FMA4_P (opts->...)
        Change TARGET_XOP to TARGET_XOP_P (opts->...)
        Change TARGET_LWP to TARGET_LWP_P (opts->...)
        Change TARGET_ABM to TARGET_ABM_P (opts->...)
        Change TARGET_BMI to TARGET_BMI_P (opts->...)
        Change TARGET_BMI2 to TARGET_BMI2_P (opts->...)
        Change TARGET_LZCNT to TARGET_LZCNT_P (opts->...)
        Change TARGET_TBM to TARGET_TBM_P (opts->...)
        Change TARGET_POPCNT to TARGET_POPCNT_P (opts->...)
        Change TARGET_SAHF to TARGET_SAHF_P (opts->...)
        Change TARGET_MOVBE to TARGET_MOVBE_P (opts->...)
        Change TARGET_CRC32 to TARGET_CRC32_P (opts->...)
        Change TARGET_AES to TARGET_AES_P (opts->...)
        Change TARGET_PCLMUL to TARGET_PCLMUL_P (opts->...)
        Change TARGET_CMPXCHG16B to TARGET_CMPXCHG16B_P (opts->...)
        Change TARGET_FSGSBASE to TARGET_FSGSBASE_P (opts->...)
        Change TARGET_RDRND to TARGET_RDRND_P (opts->...)
        Change TARGET_F16C to TARGET_F16C_P (opts->...)
        Change TARGET_RTM to TARGET_RTM_P (opts->...)
        Change TARGET_HLE to TARGET_HLE_P (opts->...)
        Change TARGET_RDSEED to TARGET_RDSEED_P (opts->...)
        Change TARGET_PRFCHW to TARGET_PRFCHW_P (opts->...)
        Change TARGET_ADX to TARGET_ADX_P (opts->...)
        Change TARGET_FXSR to TARGET_FXSR_P (opts->...)
        Change TARGET_XSAVE to TARGET_XSAVE_P (opts->...)
        Change TARGET_XSAVEOPT to TARGET_XSAVEOPT_P (opts->...)
        Change TARGET_LP64 to TARGET_LP64_P (opts->...)
        Change TARGET_X32 to TARGET_X32_P (opts->...)
        Change TARGET_FPMATH_DEFAULT to TARGET_FPMATH_DEFAULT_P (opts->...)
        Change TARGET_FLOAT_RETURNS_IN_80387 to
	 TARGET_FLOAT_RETURNS_IN_80387_P (opts->...)
	(ix86_function_specific_save): New parameter. Use opts-> fields
	to replace global fields.
	(ix86_function_specific_restore): Ditto.
	(ix86_valid_target_attribute_inner_p): New parameters.
	Fix recursive call.
	Fix call to ix86_handle_option and set_option.
	(ix86_valid_target_attribute_tree): New parameters.
	Change global_options to access opts.
	Change global_options_set to access opts_set.
	Fix call to ix86_valid_target_attribute_inner_p.
	Change ix86_tune_string to access opts->x_ix86_tune_string.
	Change ix86_arch_string to access opts->x_ix86_arch_string.
	Change ix86_fpmath to access opts->x_ix86_fpmath
	Fix call to ix86_option_override_internal.
	Fix call to ix86_add_new_builtins.
	Fix calls to build_optimization_node and build_target_option_node.
	(ix86_valid_target_attribute_p): Remove access to global_options.
	Use new gcc_options structure func_options.
	Fix call to ix86_valid_target_attribute_tree.
	Fix call to  build_optimization_node.
	(get_builtin_code_for_version):	Fix call to
	ix86_valid_target_attribute_tree.

	PR target/57756
	* gcc.target/i386/pr57756.c: New test.
	* gcc.target/i386/pr57756_2.c: New test.

From-SVN: r203634
2013-10-15 21:43:21 +00:00
Jakub Jelinek acf0174b6f target.c: New file.
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
2013-10-11 11:26:50 +02:00
Andrew MacLeod 481d1b8153 tree-flow.h: Remove some prototypes.
* tree-flow.h: Remove some prototypes.
	* tree.h: Remove some protypes, add a couple.
	* tree.c (using_eh_for_cleanups_flag, using_eh_for_cleanups,
	using_eh_for_cleanups_p): Add interface routines for front ends.
	* tree-eh.h: New file.  Add protoptyes.
	* tree-eh.c (using_eh_for_cleanups_p, using_eh_for_cleanups): Delete.
	(add_stmt_to_eh_lp_fn): Make static.
	(lower_try_finally): Use new using_eh_for_cleanups_p.
	* emit-rtl.c: Include tree-eh.h.
	* gimple.h: Include tree-eh.h.

From-SVN: r203273
2013-10-08 12:13:13 +00:00
Andrew Macleod cf2d1b38ca tree-flow.h: Include new .h files.
* tree-flow.h: Include new .h files.  Move prototypes.
	* tree-cfgcleanup.h: New file.  Add prototypes from tree-flow.h.
	* tree-dfa.h: New File.  Add prototypes from tree-flow.h.
	(get_addr_base_and_unit_offset_1) Move from tree-flow-inline.h.
	* tree-pretty-print.h: Add prototypes from tree-flow.h.
	* tree-into-ssa.h: New File.  Add prototypes from tree-flow.h.
	({debug|dump}*): Move debugging prototypes out of tree-into-ssa.c.
	* tree-into-ssa.c ({debug|dump}*): Move prototypes to header file.
	* tree.h (get_ref_base_and_extent): Move prototype out.
	* tree-flow-inline.h (get_addr_base_and_unit_offset_1): Move to 
	tree-dfa.h.
	* gimple-low.h: New File.  Add prototypes from tree-flow.h.
	* gimple-low.c (try_catch_may_fallthru, block_may_fallthru): Move to...
	* tree.c (try_catch_may_fallthru, block_may_fallthru): Here.
	* tree-scalar-evolution.c: Include tree.h.
	* sese.c: Include tree.h.
	* dumpfile.c: Move gimple-pretty-print.h include after tree.h.
	* dwarf2out.c: Include tree-dfa.h.
	* tree-chrec.c: Include tree.h.
	* tree-data-ref.c: Include tree.h.

From-SVN: r203113
2013-10-02 13:19:29 +00:00
Richard Sandiford c328471880 alloc-pool.c, [...]: Add missing whitespace before "(".
gcc/
	* alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c,
	bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c,
	cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c,
	cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c,
	combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h,
	cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c,
	df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c,
	dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c,
	errors.c, except.c, expmed.c, expr.c, file-find.c, final.c,
	fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c,
	gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c,
	genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c,
	genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c,
	genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c,
	gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c,
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c,
	gimple.h, godump.c, graphite-clast-to-gimple.c,
	graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c,
	graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c,
	hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h,
	ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c,
	ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c,
	ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c,
	loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c,
	lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c,
	mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c,
	pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c,
	predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c,
	profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c,
	regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c,
	reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c,
	sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c,
	statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h,
	system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c,
	tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c,
	tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h,
	tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c,
	tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c,
	tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c,
	tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c,
	tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c,
	tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,
	tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
	tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c,
	tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c,
	tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
	tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
	tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
	tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c,
	tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c,
	tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
	tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c,
	tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c,
	varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing
	whitespace before "(".

From-SVN: r203004
2013-09-28 08:42:34 +00:00
Richard Biener ed0d30514f re PR bootstrap/58521 (bootstrap failure: ICE in mem_ref_in_stmt, at tree-ssa-loop-im.c:677)
2013-09-25  Richard Biener  <rguenther@suse.de>

	PR middle-end/58521
	* tree.c (iterative_hash_expr): Remove MEM_REF special handling.

From-SVN: r202889
2013-09-25 09:51:13 +00:00
Richard Biener f40333afeb re PR tree-optimization/58513 (*var and MEM[(const int &)var] (var has int* type) are not treated as the same data ref.)
2013-09-24  Richard Biener  <rguenther@suse.de>

	PR middle-end/58513
	* tree.c (reference_alias_ptr_type): Move ...
	* alias.c (reference_alias_ptr_type): ... here and implement
	in terms of the new reference_alias_ptr_type_1.
	(ref_all_alias_ptr_type_p): New helper.
	(get_deref_alias_set_1): Drop flag_strict_aliasing here,
	use ref_all_alias_ptr_type_p.
	(get_deref_alias_set): Add flag_strict_aliasing check here.
	(reference_alias_ptr_type_1): New function, split out from ...
	(get_alias_set): ... here.
	(alias_ptr_types_compatible_p): New function.
	* alias.h (reference_alias_ptr_type): Declare.
	(alias_ptr_types_compatible_p): Likewise.
	* tree.h (reference_alias_ptr_type): Remove.
	* fold-const.c (operand_equal_p): Use alias_ptr_types_compatible_p
	to compare MEM_REF alias types.

	* g++.dg/vect/pr58513.cc: New testcase.

From-SVN: r202865
2013-09-24 11:04:04 +00:00
Andrew MacLeod 7a30045280 tree-ssa.h: New.
* tree-ssa.h: New.  Move content from tree-flow.h and
	tree-flow-inline.h.
	* tree-flow.h (_edge_var_map, edge_var_map_vector): Move to tree-ssa.h.
	Move prototypes belonging to tree-ssa.c.
	* tree-flow-inline.h (redirect_edge_var_map_def, 
	redirect_edge_var_map_result, redirect_edge_var_map_location): Move to
	tree-ssa.h.
	* gimple.h: Adjust prototypes.
	* tree-ssa.c (useless_type_conversion_p, types_compatible_p): Move to...
	* gimple.c (useless_type_conversion_p, types_compatible_p):  Here.
	* tree.h: Move prototype to tree-ssa.h.
	* gengtype.c (open_base_files): Replace tree-flow.h with tree-ssa.h.
	* Makefile.in: (TREE_SSA_H, TREE_FLOW_H): Adjust dependencies.
	* alias.c, asan.c, builtins.c, calls.c, cfgexpand.c, cfghooks.c,
	cfgloop.c, cfgloopmanip.c, cgraph.c, cgraphbuild.c, cgraphclones.c,
	cgraphunit.c, dse.c, except.c, expr.c, final.c, fold-const.c,
	ggc-page.c, gimple-fold.c, gimple-iterator.c, gimple-low.c,
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c,
	gimple-streamer-in.c, gimple-streamer-out.c, gimple.c, gimplify.c,
	graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c,
	graphite-interchange.c, graphite-optimize-isl.c, graphite-poly.c,
	graphite-scop-detection.c, graphite-sese-to-poly.c, graphite.c,
	ipa-cp.c, ipa-inline-analysis.c, ipa-inline-transform.c, ipa-inline.c,
	ipa-prop.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c,
	loop-init.c, lto-cgraph.c, lto-section-in.c, lto-section-out.c,
	lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, omp-low.c,
	passes.c, predict.c, print-tree.c, profile.c, sese.c, targhooks.c,
	tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c,
	tree-chrec.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-eh.c,
	tree-emutls.c, tree-if-conv.c, tree-inline.c, tree-into-ssa.c,
	tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nrv.c,
	tree-object-size.c, tree-optimize.c, tree-outof-ssa.c, tree-parloops.c,
	tree-phinodes.c, tree-predcom.c, tree-pretty-print.c, tree-profile.c,
	tree-scalar-evolution.c, tree-sra.c, tree-ssa*.c, tree-stdarg.c,
	tree-streamer-in.c, tree-switch-conversion.c, tree-tailcall.c,
	tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c,
	tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c,
	tree-vect-stmts.c, tree-vectorizer.c, tree-vrp.c, tsan.c,
	value-prof.c, var-tracking.c,
	varpool.c, vtable-verify.c: Replace tree-flow.h with tree-ssa.h

From-SVN: r202523
2013-09-12 13:03:18 +00:00
Jan Hubicka 7d2ba4711f tree.c (types_same_for_odr): Drop overactive check.
* tree.c (types_same_for_odr): Drop overactive check.
	* ipa-devirt.c (hash_type_name): Likewise.

From-SVN: r202302
2013-09-05 23:25:48 +00:00
Jan Hubicka 61a74079b0 Makefile.in (ipa-devirt.o): Add dependency on diagnostic.h
* Makefile.in (ipa-devirt.o): Add dependency on diagnostic.h
	* ipa-devirt.c: Include diganostic.h
	(odr_type_d): Add types and types_set.
	(hash_type_name): Work for types with vtables during LTO.
	(odr_hasher::remove): Fix comment; destroy types_set.
	(add_type_duplicate): New function,
	(get_odr_type): Use it.
	(dump_type_inheritance_graph): Dump type duplicates.
	* ipa.c (symtab_remove_unreachable_nodes): Build type inheritance
	graph.
	* tree.c (types_same_for_odr): Give exact answers on types with
	virtual tables.

From-SVN: r202258
2013-09-04 14:14:28 +00:00
Marek Polacek de5a5fa139 Merge ubsan into trunk.
From-SVN: r202113
2013-08-30 16:12:58 +00:00
Jan Hubicka 47500756e5 * tree.c (set_call_expr_flags): Fix handling of TM_PURE.
From-SVN: r202098
2013-08-30 08:11:41 +00:00
Jakub Jelinek 74bf76ed78 Makefile.in (omp-low.o): Depend on $(TARGET_H).
* Makefile.in (omp-low.o): Depend on $(TARGET_H).
	* cfgloop.h (struct loop): Add safelen, force_vect, simduid.
	* function.h (struct function): Add has_force_vect_loops and
	has_simduid_loops.
	* gimple-pretty-print.c (dump_gimple_omp_for): Handle
	GF_OMP_FOR_KIND*.
	* gimple.c (gimple_build_omp_critical): Add KIND argument and
	handle it.
	* gimple.def: Update CLAUSES comments.
	* gimple.h (enum gf_mask): Add GF_OMP_FOR_KIND_{FOR,SIMD}.
	(gimple_build_omp_for): Add argument to prototype.
	(gimple_omp_for_kind): New.
	(gimple_omp_for_set_kind): New.
	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_LINEAR to
	GOVD_DATA_SHARE_CLASS.
	(enum omp_region_type): Add ORT_SIMD.
	(gimple_add_tmp_var): Handle ORT_SIMD.
	(gimplify_var_or_parm_decl): Same.
	(is_gimple_stmt): Same.
	(omp_firstprivatize_variable): Same.
	(omp_add_variable): Only use splay_tree_insert if lookup failed.
	(omp_notice_variable): Handle ORT_SIMD.
	(omp_is_private): Add SIMD argument and handle it as well as
	ORT_SIMD.
	(omp_check_private): Handle ORT_SIMD.
	(gimplify_scan_omp_clauses): Handle OMP_CLAUSE_LINEAR and
	OMP_CLAUSE_SAFELEN.
	(gimplify_adjust_omp_clauses_1): Handle GOVD_LINEAR.
	Handle OMP_CLAUSE_LASTPRIVATE.
	(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_LINEAR and
	OMP_CLAUSE_SAFELEN.
	(gimplify_omp_for): Handle OMP_SIMD and OMP_CLAUSE_LINEAR.
	(gimplify_expr): Handle OMP_SIMD.
	* internal-fn.c (expand_GOMP_SIMD_LANE): New.
	(expand_GOMP_SIMD_VF): New.
	(expand_GOMP_SIMD_LAST_LANE): New.
	* internal-fn.def (GOMP_SIMD_LANE): New.
	(GOMP_SIMD_VF): New.
	(GOMP_SIMD_LAST_LANE): New.
	* omp-low.c: Include target.h.
	(extract_omp_for_data): Handle OMP_SIMD, OMP_CLAUSE_LINEAR,
	OMP_CLAUSE_SAFELEN.
	(check_omp_nesting_restrictions): Same.
	(omp_max_vf): New.
	(lower_rec_simd_input_clauses): New.
	(lower_rec_input_clauses): Handle OMP_SIMD, GF_OMP_FOR_KIND_SIMD,
	OMP_CLAUSE_LINEAR.
	(lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR,
	GF_OMP_FOR_KIND_SIMD, OMP_SIMD.
	(expand_omp_build_assign): New.
	(expand_omp_for_init_counts): New.
	(expand_omp_for_init_vars): New.
	(extract_omp_for_update_vars): New.
	(expand_omp_for_generic): Use expand_omp_for_{init,update}_vars
	and rewrite accordingly.
	(expand_omp_simd): New.
	(expand_omp_for): Use expand_omp_simd.
	(lower_omp_for_lastprivate): Unshare vinit when appropriate.
	(lower_omp_for): Do not lower the body.
	* tree-data-ref (get_references_in_stmt): Allow IFN_GOMP_SIMD_LANE
	in their own loops.
	* tree-flow.h (find_omp_clause): Remove prototype.
	* tree-if-conv.c (main_tree_if_conversion): Run if doing if
	conversion, forcing vectorization of the loop, or if
	flag_tree_vectorize.
	(gate_tree_if_conversion): Similarly.
	* tree-inline.c (remap_gimple_stmt): Pass for kind argument to
	gimple_build_omp_for.
	(copy_cfg_body): set has_force_vect_loops and has_simduid_loops.
	* tree-parloops (create_parallel_loop): Pass kind argument to
	gimple_build_omp_for.
	* tree-pretty-print.c (dump_omp_clause): Add cases for
	OMP_CLAUSE_UNIFORM, OMP_CLAUSE_LINEAR, OMP_CLAUSE_SAFELEN,
	OMP_CLAUSE__SIMDUID_.
	(dump_generic_node): Handle OMP_SIMD.
	* tree-ssa-ccp.c (likely_value): Handle IFN_GOMP_SIMD*.
	* tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely_1): Do not
	unroll OMP_SIMD loops here.
	* tree-ssa-loop.c (gate_tree_vectorize): Run if
	has_force_vect_loops.
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Handle
	loop->safelen
	(vect_analyze_data_refs): Handle simd loops.
	* tree-vect-loop.c (vectorizable_live_operation): Handle
	IFN_GOMP_SIMD*.
	* tree-vect-stmts.c (vectorizable_call): Handle
	IFN_GOMP_SIMD_LANE.
	(vectorizable_store): Handle STMT_VINFO_SIMD_LANE_ACCESS_P.
	(vectorizable_load): Same.
	* tree-vectorizer.c: Include hash-table.h and
	tree-ssa-propagate.h.
	(struct simduid_to_vf): New.
	(simduid_to_vf::hash): New.
	(simduid_to-vf::equal): New.
	(struct simd_array_to_simduid): New.
	(simd_array_to_simduid::hash): New.
	(simd_array_to_simduid::equal): New.
	(adjust_simduid_builtins): New.
	(struct note_simd_array_uses_struct): New.
	(note_simd_array_uses_cb): New.
	(note_simd_array_uses): New.
	(vectorize_loops): Handle simd hints and adjust simd builtins
	accordingly.
	* tree-vectorizer.h (struct _stmt_vec_info): Add
	simd_lane_access_p field.
	(STMT_VINFO_SIMD_LANE_ACCESS_P): New macro.
	* tree.c (omp_clause_num_ops): Add entries for OMP_CLAUSE_LINEAR,
	OMP_CLAUSE_SAFELEN, OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_UNIFORM.
	(omp_clause_code_name): Same.
	(walk_tree_1): Handle OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN,
	OMP_CLAUSE__SIMDUID_, OMP_CLAUSE_LINEAR.
	* tree.def (OMP_SIMD): New entry.
	* tree.h (enum omp_clause_code): Add entries for
	OMP_CLAUSE_LINEAR, OMP_CLAUSE_UNIFORM, OMP_CLAUSE_SAFELEN,
	OMP_CLAUSE__SIMDUID_.
	(OMP_CLAUSE_DECL): Adjust range for new clauses.
	(OMP_CLAUSE_LINEAR_NO_COPYIN): New.
	(OMP_CLAUSE_LINEAR_NO_COPYOUT): New.
	(OMP_CLAUSE_LINEAR_STEP): New.
	(OMP_CLAUSE_SAFELEN_EXPR): New.
	(OMP_CLAUSE__SIMDUID__DECL): New.
	(find_omp_clause): New prototype.
cp/
	* cp-tree.h (CP_OMP_CLAUSE_INFO): Adjust range for new clauses.

Co-Authored-By: Aldy Hernandez <aldyh@redhat.com>

From-SVN: r202029
2013-08-27 18:38:00 +00:00
Marc Glisse 0cadbfaa89 re PR other/57324 (Undefined behavior issues found with clang's -fsanitize=undefined)
2013-08-24  Marc Glisse  <marc.glisse@inria.fr>

	PR other/57324
	* hwint.h (HOST_WIDE_INT_UC, HOST_WIDE_INT_1U, HOST_WIDE_INT_M1,
	HOST_WIDE_INT_M1U): New macros.
	* fold-const.c (sign_bit_p, build_range_check, fold_unary_loc,
	fold_binary_loc, fold_ternary_loc): Use the new macros. Use an
	unsigned -1 for lshift.
	* cse.c (cse_insn): Likewise.
	* double-int.c (rshift_double, lshift_double): Likewise.
	* builtins.c (fold_builtin_bitop): Likewise.
	* combine.c (force_to_mode): Likewise.
	* tree.c (integer_pow2p, tree_log2, tree_floor_log2): Likewise.
	* simplify-rtx.c (simplify_const_unary_operation,
	simplify_const_binary_operation): Likewise.
	* tree-stdarg.c (va_list_counter_bump, va_list_ptr_read,
	check_va_list_escapes): Likewise.
	* rtlanal.c (nonzero_bits1): Likewise.
	* expmed.c (expand_smod_pow2): Likewise.
	* tree-ssa-structalias.c (UNKNOWN_OFFSET): Use HOST_WIDE_INT_MIN.

From-SVN: r201953
2013-08-23 22:16:08 +00:00
Jan Hubicka eefe9a995c Makeifle-in (ipa-devirt.o): New.
* Makeifle-in (ipa-devirt.o): New.
	(GTFILES): Add ipa-utils.h and ipa-devirt.c
	* cgraphunit.c (decide_is_symbol_needed): Do not care about virtuals.
	(analyze_functions): Look into possible targets of polymorphic call.
	* dumpfile.c (dump_files): Add type-inheritance dump.
	* dumpfile.h (TDI_inheritance): New.
	* ipa-devirt.c: New file.
	* ipa-utils.h (odr_type_d): Forward declare.
	(odr_type): New type.
	(build_type_inheritance_graph): Declare.
	(possible_polymorphic_call_targets): Declare and introduce inline
	variant when only edge is pased.
	(dump_possible_polymorphic_call_targets): Likewise.
	* timevar.def (TV_IPA_INHERITANCE, TV_IPA_VIRTUAL_CALL): New.
	* tree.c (type_in_anonymous_namespace_p): Break out from ...
	(types_same_for_odr): ... here.
	* tree.h (type_in_anonymous_namespace_p): Declare.

	* g++.dg/ipa/type-inheritance-1.C: New testcase.

From-SVN: r201836
2013-08-19 10:14:06 +00:00
Jan Hubicka 1d5755efee cgraph.c (cgraph_create_indirect_edge): Discover polymorphic calls and record basic info into indirect_info.
* cgraph.c (cgraph_create_indirect_edge): Discover
	polymorphic calls and record basic info into indirect_info.
	* gimple-fold.c (gimple_fold_call): When doing BINFO based
	devirtualization, ignore objc function calls.
	* ipa-cp.c (initialize_node_lattices): Be ready for polymorphic
	call with no parm index info.
	* ipa-prop.c (ipa_analyze_call_uses): Likewise.
	* tree.c (virtual_method_call_p): New function.
	* tree.h (virtual_method_call_p): Declare.

From-SVN: r201824
2013-08-18 09:22:42 +00:00
Jan Hubicka 5945bebf44 re PR middle-end/58179 (obj_type_ref ICE building libobjc)
PR middle-end/58179
	* tree.c (obj_type_ref_class): Do not ICE on non-method calls.

From-SVN: r201817
2013-08-17 18:14:18 +00:00
Jan Hubicka c49bdb2ee9 gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Add new arugment expected_type.
* gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Add new
	arugment expected_type.
	(gimple_fold_call): Use it.
	* gimple.h (gimple_extract_devirt_binfo_from_cst): Update prototype.
	* ipa-cp.c (ipa_get_indirect_edge_target_1): Update.
	* ipa-prop.c (ipa_analyze_virtual_call_uses): Use
	obj_type_ref_class.
	(try_make_edge_direct_virtual_call): Likewise.
	* tree.c (obj_type_ref_class): New.
	* tree.h (obj_type_ref_class): Use it.

From-SVN: r201789
2013-08-16 12:38:04 +00:00
David Malcolm 27a4cd485d Automated conversion of passes to C++ classes
gcc/

	Patch autogenerated by refactor_passes.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 03fe39476a4c4ea450b49e087cfa817b5f92021e

	* asan.c (pass_asan): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_asan): ...new pass_data instance and...
	(make_pass_asan): ...new function.
	(pass_asan_O0): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_asan_O0): ...new pass_data instance and...
	(make_pass_asan_O0): ...new function.
	* auto-inc-dec.c (pass_inc_dec): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_inc_dec): ...new pass_data instance and...
	(make_pass_inc_dec): ...new function.
	* bb-reorder.c (pass_reorder_blocks): Convert from a global struct to
	a subclass of rtl_opt_pass along with...
	(pass_data_reorder_blocks): ...new pass_data instance and...
	(make_pass_reorder_blocks): ...new function.
	(pass_duplicate_computed_gotos): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_duplicate_computed_gotos): ...new pass_data instance and...
	(make_pass_duplicate_computed_gotos): ...new function.
	(pass_partition_blocks): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_partition_blocks): ...new pass_data instance and...
	(make_pass_partition_blocks): ...new function.
	* bt-load.c (pass_branch_target_load_optimize1): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_branch_target_load_optimize1): ...new pass_data instance
	and...
	(make_pass_branch_target_load_optimize1): ...new function.
	(pass_branch_target_load_optimize2): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_branch_target_load_optimize2): ...new pass_data instance
	and...
	(make_pass_branch_target_load_optimize2): ...new function.
	* cfgcleanup.c (pass_jump): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_jump): ...new pass_data instance and...
	(make_pass_jump): ...new function.
	(pass_jump2): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_jump2): ...new pass_data instance and...
	(make_pass_jump2): ...new function.
	* cfgexpand.c (pass_expand): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_expand): ...new pass_data instance and...
	(make_pass_expand): ...new function.
	* cfgrtl.c (pass_free_cfg): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_free_cfg): ...new pass_data instance and...
	(make_pass_free_cfg): ...new function.
	(pass_into_cfg_layout_mode): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_into_cfg_layout_mode): ...new pass_data instance and...
	(make_pass_into_cfg_layout_mode): ...new function.
	(pass_outof_cfg_layout_mode): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_outof_cfg_layout_mode): ...new pass_data instance and...
	(make_pass_outof_cfg_layout_mode): ...new function.
	* cgraphbuild.c (pass_build_cgraph_edges): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_build_cgraph_edges): ...new pass_data instance and...
	(make_pass_build_cgraph_edges): ...new function.
	(pass_rebuild_cgraph_edges): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_rebuild_cgraph_edges): ...new pass_data instance and...
	(make_pass_rebuild_cgraph_edges): ...new function.
	(pass_remove_cgraph_callee_edges): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_remove_cgraph_callee_edges): ...new pass_data instance
	and...
	(make_pass_remove_cgraph_callee_edges): ...new function.
	* combine-stack-adj.c (pass_stack_adjustments): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_stack_adjustments): ...new pass_data instance and...
	(make_pass_stack_adjustments): ...new function.
	* combine.c (pass_combine): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_combine): ...new pass_data instance and...
	(make_pass_combine): ...new function.
	* compare-elim.c (pass_compare_elim_after_reload): Convert from a
	global struct to a subclass of rtl_opt_pass along with...
	(pass_data_compare_elim_after_reload): ...new pass_data instance
	and...
	(make_pass_compare_elim_after_reload): ...new function.
	* cprop.c (pass_rtl_cprop): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_rtl_cprop): ...new pass_data instance and...
	(make_pass_rtl_cprop): ...new function.
	* cse.c (pass_cse): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_cse): ...new pass_data instance and...
	(make_pass_cse): ...new function.
	(pass_cse2): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_cse2): ...new pass_data instance and...
	(make_pass_cse2): ...new function.
	(pass_cse_after_global_opts): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_cse_after_global_opts): ...new pass_data instance and...
	(make_pass_cse_after_global_opts): ...new function.
	* dce.c (pass_ud_rtl_dce): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_ud_rtl_dce): ...new pass_data instance and...
	(make_pass_ud_rtl_dce): ...new function.
	(pass_fast_rtl_dce): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_fast_rtl_dce): ...new pass_data instance and...
	(make_pass_fast_rtl_dce): ...new function.
	* df-core.c (pass_df_initialize_opt): Convert from a global struct to
	a subclass of rtl_opt_pass along with...
	(pass_data_df_initialize_opt): ...new pass_data instance and...
	(make_pass_df_initialize_opt): ...new function.
	(pass_df_initialize_no_opt): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_df_initialize_no_opt): ...new pass_data instance and...
	(make_pass_df_initialize_no_opt): ...new function.
	(pass_df_finish): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_df_finish): ...new pass_data instance and...
	(make_pass_df_finish): ...new function.
	* dse.c (pass_rtl_dse1): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_dse1): ...new pass_data instance and...
	(make_pass_rtl_dse1): ...new function.
	(pass_rtl_dse2): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_dse2): ...new pass_data instance and...
	(make_pass_rtl_dse2): ...new function.
	* dwarf2cfi.c (pass_dwarf2_frame): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_dwarf2_frame): ...new pass_data instance and...
	(make_pass_dwarf2_frame): ...new function.
	* except.c (pass_set_nothrow_function_flags): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_set_nothrow_function_flags): ...new pass_data instance
	and...
	(make_pass_set_nothrow_function_flags): ...new function.
	(pass_convert_to_eh_region_ranges): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_convert_to_eh_region_ranges): ...new pass_data instance
	and...
	(make_pass_convert_to_eh_region_ranges): ...new function.
	* final.c (pass_compute_alignments): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_compute_alignments): ...new pass_data instance and...
	(make_pass_compute_alignments): ...new function.
	(pass_final): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_final): ...new pass_data instance and...
	(make_pass_final): ...new function.
	(pass_shorten_branches): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_shorten_branches): ...new pass_data instance and...
	(make_pass_shorten_branches): ...new function.
	(pass_clean_state): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_clean_state): ...new pass_data instance and...
	(make_pass_clean_state): ...new function.
	* function.c (pass_instantiate_virtual_regs): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_instantiate_virtual_regs): ...new pass_data instance and...
	(make_pass_instantiate_virtual_regs): ...new function.
	(pass_leaf_regs): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_leaf_regs): ...new pass_data instance and...
	(make_pass_leaf_regs): ...new function.
	(pass_thread_prologue_and_epilogue): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_thread_prologue_and_epilogue): ...new pass_data instance
	and...
	(make_pass_thread_prologue_and_epilogue): ...new function.
	(pass_match_asm_constraints): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_match_asm_constraints): ...new pass_data instance and...
	(make_pass_match_asm_constraints): ...new function.
	* fwprop.c (pass_rtl_fwprop): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_rtl_fwprop): ...new pass_data instance and...
	(make_pass_rtl_fwprop): ...new function.
	(pass_rtl_fwprop_addr): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_fwprop_addr): ...new pass_data instance and...
	(make_pass_rtl_fwprop_addr): ...new function.
	* gcse.c (pass_rtl_pre): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_pre): ...new pass_data instance and...
	(make_pass_rtl_pre): ...new function.
	(pass_rtl_hoist): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_hoist): ...new pass_data instance and...
	(make_pass_rtl_hoist): ...new function.
	* gimple-low.c (pass_lower_cf): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_lower_cf): ...new pass_data instance and...
	(make_pass_lower_cf): ...new function.
	* gimple-ssa-strength-reduction.c (pass_strength_reduction): Convert
	from a global struct to a subclass of gimple_opt_pass along with...
	(pass_data_strength_reduction): ...new pass_data instance and...
	(make_pass_strength_reduction): ...new function.
	* ifcvt.c (pass_rtl_ifcvt): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_rtl_ifcvt): ...new pass_data instance and...
	(make_pass_rtl_ifcvt): ...new function.
	(pass_if_after_combine): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_if_after_combine): ...new pass_data instance and...
	(make_pass_if_after_combine): ...new function.
	(pass_if_after_reload): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_if_after_reload): ...new pass_data instance and...
	(make_pass_if_after_reload): ...new function.
	* init-regs.c (pass_initialize_regs): Convert from a global struct to
	a subclass of rtl_opt_pass along with...
	(pass_data_initialize_regs): ...new pass_data instance and...
	(make_pass_initialize_regs): ...new function.
	* ipa-cp.c (pass_ipa_cp): Convert from a global struct to a subclass
	of ipa_opt_pass_d along with...
	(pass_data_ipa_cp): ...new pass_data instance and...
	(make_pass_ipa_cp): ...new function.
	* ipa-inline-analysis.c (pass_inline_parameters): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_inline_parameters): ...new pass_data instance and...
	(make_pass_inline_parameters): ...new function.
	* ipa-inline.c (pass_early_inline): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_early_inline): ...new pass_data instance and...
	(make_pass_early_inline): ...new function.
	(pass_ipa_inline): Convert from a global struct to a subclass of
	ipa_opt_pass_d along with...
	(pass_data_ipa_inline): ...new pass_data instance and...
	(make_pass_ipa_inline): ...new function.
	* ipa-pure-const.c (pass_local_pure_const): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_local_pure_const): ...new pass_data instance and...
	(make_pass_local_pure_const): ...new function.
	(pass_ipa_pure_const): Convert from a global struct to a subclass of
	ipa_opt_pass_d along with...
	(pass_data_ipa_pure_const): ...new pass_data instance and...
	(make_pass_ipa_pure_const): ...new function.
	* ipa-reference.c (pass_ipa_reference): Convert from a global struct
	to a subclass of ipa_opt_pass_d along with...
	(pass_data_ipa_reference): ...new pass_data instance and...
	(make_pass_ipa_reference): ...new function.
	* ipa-split.c (pass_split_functions): Convert from a global struct to
	a subclass of gimple_opt_pass along with...
	(pass_data_split_functions): ...new pass_data instance and...
	(make_pass_split_functions): ...new function.
	(pass_feedback_split_functions): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_feedback_split_functions): ...new pass_data instance and...
	(make_pass_feedback_split_functions): ...new function.
	* ipa.c (pass_ipa_function_and_variable_visibility): Convert from a
	global struct to a subclass of simple_ipa_opt_pass along with...
	(pass_data_ipa_function_and_variable_visibility): ...new pass_data
	instance and...
	(make_pass_ipa_function_and_variable_visibility): ...new function.
	(pass_ipa_free_inline_summary): Convert from a global struct to a
	subclass of simple_ipa_opt_pass along with...
	(pass_data_ipa_free_inline_summary): ...new pass_data instance and...
	(make_pass_ipa_free_inline_summary): ...new function.
	(pass_ipa_whole_program_visibility): Convert from a global struct to a
	subclass of ipa_opt_pass_d along with...
	(pass_data_ipa_whole_program_visibility): ...new pass_data instance
	and...
	(make_pass_ipa_whole_program_visibility): ...new function.
	(pass_ipa_profile): Convert from a global struct to a subclass of
	ipa_opt_pass_d along with...
	(pass_data_ipa_profile): ...new pass_data instance and...
	(make_pass_ipa_profile): ...new function.
	(pass_ipa_cdtor_merge): Convert from a global struct to a subclass of
	ipa_opt_pass_d along with...
	(pass_data_ipa_cdtor_merge): ...new pass_data instance and...
	(make_pass_ipa_cdtor_merge): ...new function.
	* ira.c (pass_ira): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_ira): ...new pass_data instance and...
	(make_pass_ira): ...new function.
	(pass_reload): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_reload): ...new pass_data instance and...
	(make_pass_reload): ...new function.
	* jump.c (pass_cleanup_barriers): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_cleanup_barriers): ...new pass_data instance and...
	(make_pass_cleanup_barriers): ...new function.
	* loop-init.c (pass_loop2): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_loop2): ...new pass_data instance and...
	(make_pass_loop2): ...new function.
	(pass_rtl_loop_init): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_loop_init): ...new pass_data instance and...
	(make_pass_rtl_loop_init): ...new function.
	(pass_rtl_loop_done): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_loop_done): ...new pass_data instance and...
	(make_pass_rtl_loop_done): ...new function.
	(pass_rtl_move_loop_invariants): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_rtl_move_loop_invariants): ...new pass_data instance and...
	(make_pass_rtl_move_loop_invariants): ...new function.
	(pass_rtl_unswitch): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_unswitch): ...new pass_data instance and...
	(make_pass_rtl_unswitch): ...new function.
	(pass_rtl_unroll_and_peel_loops): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_rtl_unroll_and_peel_loops): ...new pass_data instance
	and...
	(make_pass_rtl_unroll_and_peel_loops): ...new function.
	(pass_rtl_doloop): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_rtl_doloop): ...new pass_data instance and...
	(make_pass_rtl_doloop): ...new function.
	* lower-subreg.c (pass_lower_subreg): Convert from a global struct to
	a subclass of rtl_opt_pass along with...
	(pass_data_lower_subreg): ...new pass_data instance and...
	(make_pass_lower_subreg): ...new function.
	(pass_lower_subreg2): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_lower_subreg2): ...new pass_data instance and...
	(make_pass_lower_subreg2): ...new function.
	* lto-streamer-out.c (pass_ipa_lto_gimple_out): Convert from a global
	struct to a subclass of ipa_opt_pass_d along with...
	(pass_data_ipa_lto_gimple_out): ...new pass_data instance and...
	(make_pass_ipa_lto_gimple_out): ...new function.
	(pass_ipa_lto_finish_out): Convert from a global struct to a subclass
	of ipa_opt_pass_d along with...
	(pass_data_ipa_lto_finish_out): ...new pass_data instance and...
	(make_pass_ipa_lto_finish_out): ...new function.
	* mode-switching.c (pass_mode_switching): Convert from a global struct
	to a subclass of rtl_opt_pass along with...
	(pass_data_mode_switching): ...new pass_data instance and...
	(make_pass_mode_switching): ...new function.
	* modulo-sched.c (pass_sms): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_sms): ...new pass_data instance and...
	(make_pass_sms): ...new function.
	* omp-low.c (pass_expand_omp): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_expand_omp): ...new pass_data instance and...
	(make_pass_expand_omp): ...new function.
	(pass_lower_omp): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_lower_omp): ...new pass_data instance and...
	(make_pass_lower_omp): ...new function.
	(pass_diagnose_omp_blocks): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_diagnose_omp_blocks): ...new pass_data instance and...
	(make_pass_diagnose_omp_blocks): ...new function.
	* passes.c (pass_early_local_passes): Convert from a global struct to
	a subclass of simple_ipa_opt_pass along with...
	(pass_data_early_local_passes): ...new pass_data instance and...
	(make_pass_early_local_passes): ...new function.
	(pass_all_early_optimizations): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_all_early_optimizations): ...new pass_data instance and...
	(make_pass_all_early_optimizations): ...new function.
	(pass_all_optimizations): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_all_optimizations): ...new pass_data instance and...
	(make_pass_all_optimizations): ...new function.
	(pass_all_optimizations_g): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_all_optimizations_g): ...new pass_data instance and...
	(make_pass_all_optimizations_g): ...new function.
	(pass_rest_of_compilation): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_rest_of_compilation): ...new pass_data instance and...
	(make_pass_rest_of_compilation): ...new function.
	(pass_postreload): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_postreload): ...new pass_data instance and...
	(make_pass_postreload): ...new function.
	* postreload-gcse.c (pass_gcse2): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_gcse2): ...new pass_data instance and...
	(make_pass_gcse2): ...new function.
	* postreload.c (pass_postreload_cse): Convert from a global struct to
	a subclass of rtl_opt_pass along with...
	(pass_data_postreload_cse): ...new pass_data instance and...
	(make_pass_postreload_cse): ...new function.
	* predict.c (pass_profile): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_profile): ...new pass_data instance and...
	(make_pass_profile): ...new function.
	(pass_strip_predict_hints): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_strip_predict_hints): ...new pass_data instance and...
	(make_pass_strip_predict_hints): ...new function.
	* recog.c (pass_peephole2): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_peephole2): ...new pass_data instance and...
	(make_pass_peephole2): ...new function.
	(pass_split_all_insns): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_split_all_insns): ...new pass_data instance and...
	(make_pass_split_all_insns): ...new function.
	(pass_split_after_reload): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_split_after_reload): ...new pass_data instance and...
	(make_pass_split_after_reload): ...new function.
	(pass_split_before_regstack): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_split_before_regstack): ...new pass_data instance and...
	(make_pass_split_before_regstack): ...new function.
	(pass_split_before_sched2): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_split_before_sched2): ...new pass_data instance and...
	(make_pass_split_before_sched2): ...new function.
	(pass_split_for_shorten_branches): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_split_for_shorten_branches): ...new pass_data instance
	and...
	(make_pass_split_for_shorten_branches): ...new function.
	* ree.c (pass_ree): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_ree): ...new pass_data instance and...
	(make_pass_ree): ...new function.
	* reg-stack.c (pass_stack_regs): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_stack_regs): ...new pass_data instance and...
	(make_pass_stack_regs): ...new function.
	(pass_stack_regs_run): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_stack_regs_run): ...new pass_data instance and...
	(make_pass_stack_regs_run): ...new function.
	* regcprop.c (pass_cprop_hardreg): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_cprop_hardreg): ...new pass_data instance and...
	(make_pass_cprop_hardreg): ...new function.
	* reginfo.c (pass_reginfo_init): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_reginfo_init): ...new pass_data instance and...
	(make_pass_reginfo_init): ...new function.
	* regmove.c (pass_regmove): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_regmove): ...new pass_data instance and...
	(make_pass_regmove): ...new function.
	* regrename.c (pass_regrename): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_regrename): ...new pass_data instance and...
	(make_pass_regrename): ...new function.
	* reorg.c (pass_delay_slots): Convert from a global struct to a
	subclass of rtl_opt_pass along with...
	(pass_data_delay_slots): ...new pass_data instance and...
	(make_pass_delay_slots): ...new function.
	(pass_machine_reorg): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_machine_reorg): ...new pass_data instance and...
	(make_pass_machine_reorg): ...new function.
	* sched-rgn.c (pass_sched): Convert from a global struct to a subclass
	of rtl_opt_pass along with...
	(pass_data_sched): ...new pass_data instance and...
	(make_pass_sched): ...new function.
	(pass_sched2): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_sched2): ...new pass_data instance and...
	(make_pass_sched2): ...new function.
	* stack-ptr-mod.c (pass_stack_ptr_mod): Convert from a global struct
	to a subclass of rtl_opt_pass along with...
	(pass_data_stack_ptr_mod): ...new pass_data instance and...
	(make_pass_stack_ptr_mod): ...new function.
	* store-motion.c (pass_rtl_store_motion): Convert from a global struct
	to a subclass of rtl_opt_pass along with...
	(pass_data_rtl_store_motion): ...new pass_data instance and...
	(make_pass_rtl_store_motion): ...new function.
	* tracer.c (pass_tracer): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_tracer): ...new pass_data instance and...
	(make_pass_tracer): ...new function.
	* trans-mem.c (pass_diagnose_tm_blocks): Convert from a global struct
	to a subclass of gimple_opt_pass along with...
	(pass_data_diagnose_tm_blocks): ...new pass_data instance and...
	(make_pass_diagnose_tm_blocks): ...new function.
	(pass_lower_tm): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_lower_tm): ...new pass_data instance and...
	(make_pass_lower_tm): ...new function.
	(pass_tm_init): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tm_init): ...new pass_data instance and...
	(make_pass_tm_init): ...new function.
	(pass_tm_mark): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tm_mark): ...new pass_data instance and...
	(make_pass_tm_mark): ...new function.
	(pass_tm_edges): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tm_edges): ...new pass_data instance and...
	(make_pass_tm_edges): ...new function.
	(pass_tm_memopt): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tm_memopt): ...new pass_data instance and...
	(make_pass_tm_memopt): ...new function.
	(pass_ipa_tm): Convert from a global struct to a subclass of
	simple_ipa_opt_pass along with...
	(pass_data_ipa_tm): ...new pass_data instance and...
	(make_pass_ipa_tm): ...new function.
	* tree-call-cdce.c (pass_call_cdce): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_call_cdce): ...new pass_data instance and...
	(make_pass_call_cdce): ...new function.
	* tree-cfg.c (pass_build_cfg): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_build_cfg): ...new pass_data instance and...
	(make_pass_build_cfg): ...new function.
	(pass_split_crit_edges): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_split_crit_edges): ...new pass_data instance and...
	(make_pass_split_crit_edges): ...new function.
	(pass_warn_function_return): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_warn_function_return): ...new pass_data instance and...
	(make_pass_warn_function_return): ...new function.
	(pass_warn_function_noreturn): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_warn_function_noreturn): ...new pass_data instance and...
	(make_pass_warn_function_noreturn): ...new function.
	(pass_warn_unused_result): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_warn_unused_result): ...new pass_data instance and...
	(make_pass_warn_unused_result): ...new function.
	* tree-cfgcleanup.c (pass_merge_phi): Convert from a global struct to
	a subclass of gimple_opt_pass along with...
	(pass_data_merge_phi): ...new pass_data instance and...
	(make_pass_merge_phi): ...new function.
	* tree-complex.c (pass_lower_complex): Convert from a global struct to
	a subclass of gimple_opt_pass along with...
	(pass_data_lower_complex): ...new pass_data instance and...
	(make_pass_lower_complex): ...new function.
	(pass_lower_complex_O0): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_lower_complex_O0): ...new pass_data instance and...
	(make_pass_lower_complex_O0): ...new function.
	* tree-eh.c (pass_lower_eh): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_lower_eh): ...new pass_data instance and...
	(make_pass_lower_eh): ...new function.
	(pass_refactor_eh): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_refactor_eh): ...new pass_data instance and...
	(make_pass_refactor_eh): ...new function.
	(pass_lower_resx): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_lower_resx): ...new pass_data instance and...
	(make_pass_lower_resx): ...new function.
	(pass_lower_eh_dispatch): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_lower_eh_dispatch): ...new pass_data instance and...
	(make_pass_lower_eh_dispatch): ...new function.
	(pass_cleanup_eh): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_cleanup_eh): ...new pass_data instance and...
	(make_pass_cleanup_eh): ...new function.
	* tree-emutls.c (pass_ipa_lower_emutls): Convert from a global struct
	to a subclass of simple_ipa_opt_pass along with...
	(pass_data_ipa_lower_emutls): ...new pass_data instance and...
	(make_pass_ipa_lower_emutls): ...new function.
	* tree-if-conv.c (pass_if_conversion): Convert from a global struct to
	a subclass of gimple_opt_pass along with...
	(pass_data_if_conversion): ...new pass_data instance and...
	(make_pass_if_conversion): ...new function.
	* tree-into-ssa.c (pass_build_ssa): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_build_ssa): ...new pass_data instance and...
	(make_pass_build_ssa): ...new function.
	* tree-loop-distribution.c (pass_loop_distribution): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_loop_distribution): ...new pass_data instance and...
	(make_pass_loop_distribution): ...new function.
	* tree-mudflap.c (pass_mudflap_1): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_mudflap_1): ...new pass_data instance and...
	(make_pass_mudflap_1): ...new function.
	(pass_mudflap_2): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_mudflap_2): ...new pass_data instance and...
	(make_pass_mudflap_2): ...new function.
	* tree-nomudflap.c (pass_mudflap_1): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_mudflap_1): ...new pass_data instance and...
	(make_pass_mudflap_1): ...new function.
	(pass_mudflap_2): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_mudflap_2): ...new pass_data instance and...
	(make_pass_mudflap_2): ...new function.
	* tree-nrv.c (pass_nrv): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_nrv): ...new pass_data instance and...
	(make_pass_nrv): ...new function.
	(pass_return_slot): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_return_slot): ...new pass_data instance and...
	(make_pass_return_slot): ...new function.
	* tree-object-size.c (pass_object_sizes): Convert from a global struct
	to a subclass of gimple_opt_pass along with...
	(pass_data_object_sizes): ...new pass_data instance and...
	(make_pass_object_sizes): ...new function.
	* tree-optimize.c (pass_cleanup_cfg_post_optimizing): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_cleanup_cfg_post_optimizing): ...new pass_data instance
	and...
	(make_pass_cleanup_cfg_post_optimizing): ...new function.
	(pass_fixup_cfg): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_fixup_cfg): ...new pass_data instance and...
	(make_pass_fixup_cfg): ...new function.
	* tree-pass.h (pass_mudflap_1): Replace declaration with that of...
	(make_pass_mudflap_1): ...new function.
	(pass_mudflap_2): Replace declaration with that of...
	(make_pass_mudflap_2): ...new function.
	(pass_asan): Replace declaration with that of...
	(make_pass_asan): ...new function.
	(pass_asan_O0): Replace declaration with that of...
	(make_pass_asan_O0): ...new function.
	(pass_tsan): Replace declaration with that of...
	(make_pass_tsan): ...new function.
	(pass_tsan_O0): Replace declaration with that of...
	(make_pass_tsan_O0): ...new function.
	(pass_lower_cf): Replace declaration with that of...
	(make_pass_lower_cf): ...new function.
	(pass_refactor_eh): Replace declaration with that of...
	(make_pass_refactor_eh): ...new function.
	(pass_lower_eh): Replace declaration with that of...
	(make_pass_lower_eh): ...new function.
	(pass_lower_eh_dispatch): Replace declaration with that of...
	(make_pass_lower_eh_dispatch): ...new function.
	(pass_lower_resx): Replace declaration with that of...
	(make_pass_lower_resx): ...new function.
	(pass_build_cfg): Replace declaration with that of...
	(make_pass_build_cfg): ...new function.
	(pass_early_tree_profile): Replace declaration with that of...
	(make_pass_early_tree_profile): ...new function.
	(pass_cleanup_eh): Replace declaration with that of...
	(make_pass_cleanup_eh): ...new function.
	(pass_sra): Replace declaration with that of...
	(make_pass_sra): ...new function.
	(pass_sra_early): Replace declaration with that of...
	(make_pass_sra_early): ...new function.
	(pass_early_ipa_sra): Replace declaration with that of...
	(make_pass_early_ipa_sra): ...new function.
	(pass_tail_recursion): Replace declaration with that of...
	(make_pass_tail_recursion): ...new function.
	(pass_tail_calls): Replace declaration with that of...
	(make_pass_tail_calls): ...new function.
	(pass_tree_loop): Replace declaration with that of...
	(make_pass_tree_loop): ...new function.
	(pass_tree_loop_init): Replace declaration with that of...
	(make_pass_tree_loop_init): ...new function.
	(pass_lim): Replace declaration with that of...
	(make_pass_lim): ...new function.
	(pass_tree_unswitch): Replace declaration with that of...
	(make_pass_tree_unswitch): ...new function.
	(pass_predcom): Replace declaration with that of...
	(make_pass_predcom): ...new function.
	(pass_iv_canon): Replace declaration with that of...
	(make_pass_iv_canon): ...new function.
	(pass_scev_cprop): Replace declaration with that of...
	(make_pass_scev_cprop): ...new function.
	(pass_empty_loop): Replace declaration with that of...
	(make_pass_empty_loop): ...new function.
	(pass_record_bounds): Replace declaration with that of...
	(make_pass_record_bounds): ...new function.
	(pass_graphite): Replace declaration with that of...
	(make_pass_graphite): ...new function.
	(pass_graphite_transforms): Replace declaration with that of...
	(make_pass_graphite_transforms): ...new function.
	(pass_if_conversion): Replace declaration with that of...
	(make_pass_if_conversion): ...new function.
	(pass_loop_distribution): Replace declaration with that of...
	(make_pass_loop_distribution): ...new function.
	(pass_vectorize): Replace declaration with that of...
	(make_pass_vectorize): ...new function.
	(pass_slp_vectorize): Replace declaration with that of...
	(make_pass_slp_vectorize): ...new function.
	(pass_complete_unroll): Replace declaration with that of...
	(make_pass_complete_unroll): ...new function.
	(pass_complete_unrolli): Replace declaration with that of...
	(make_pass_complete_unrolli): ...new function.
	(pass_parallelize_loops): Replace declaration with that of...
	(make_pass_parallelize_loops): ...new function.
	(pass_loop_prefetch): Replace declaration with that of...
	(make_pass_loop_prefetch): ...new function.
	(pass_iv_optimize): Replace declaration with that of...
	(make_pass_iv_optimize): ...new function.
	(pass_tree_loop_done): Replace declaration with that of...
	(make_pass_tree_loop_done): ...new function.
	(pass_ch): Replace declaration with that of...
	(make_pass_ch): ...new function.
	(pass_ccp): Replace declaration with that of...
	(make_pass_ccp): ...new function.
	(pass_phi_only_cprop): Replace declaration with that of...
	(make_pass_phi_only_cprop): ...new function.
	(pass_build_ssa): Replace declaration with that of...
	(make_pass_build_ssa): ...new function.
	(pass_build_alias): Replace declaration with that of...
	(make_pass_build_alias): ...new function.
	(pass_build_ealias): Replace declaration with that of...
	(make_pass_build_ealias): ...new function.
	(pass_dominator): Replace declaration with that of...
	(make_pass_dominator): ...new function.
	(pass_dce): Replace declaration with that of...
	(make_pass_dce): ...new function.
	(pass_dce_loop): Replace declaration with that of...
	(make_pass_dce_loop): ...new function.
	(pass_cd_dce): Replace declaration with that of...
	(make_pass_cd_dce): ...new function.
	(pass_call_cdce): Replace declaration with that of...
	(make_pass_call_cdce): ...new function.
	(pass_merge_phi): Replace declaration with that of...
	(make_pass_merge_phi): ...new function.
	(pass_split_crit_edges): Replace declaration with that of...
	(make_pass_split_crit_edges): ...new function.
	(pass_pre): Replace declaration with that of...
	(make_pass_pre): ...new function.
	(pass_profile): Replace declaration with that of...
	(make_pass_profile): ...new function.
	(pass_strip_predict_hints): Replace declaration with that of...
	(make_pass_strip_predict_hints): ...new function.
	(pass_lower_complex_O0): Replace declaration with that of...
	(make_pass_lower_complex_O0): ...new function.
	(pass_lower_complex): Replace declaration with that of...
	(make_pass_lower_complex): ...new function.
	(pass_lower_vector): Replace declaration with that of...
	(make_pass_lower_vector): ...new function.
	(pass_lower_vector_ssa): Replace declaration with that of...
	(make_pass_lower_vector_ssa): ...new function.
	(pass_lower_omp): Replace declaration with that of...
	(make_pass_lower_omp): ...new function.
	(pass_diagnose_omp_blocks): Replace declaration with that of...
	(make_pass_diagnose_omp_blocks): ...new function.
	(pass_expand_omp): Replace declaration with that of...
	(make_pass_expand_omp): ...new function.
	(pass_expand_omp_ssa): Replace declaration with that of...
	(make_pass_expand_omp_ssa): ...new function.
	(pass_object_sizes): Replace declaration with that of...
	(make_pass_object_sizes): ...new function.
	(pass_strlen): Replace declaration with that of...
	(make_pass_strlen): ...new function.
	(pass_fold_builtins): Replace declaration with that of...
	(make_pass_fold_builtins): ...new function.
	(pass_stdarg): Replace declaration with that of...
	(make_pass_stdarg): ...new function.
	(pass_early_warn_uninitialized): Replace declaration with that of...
	(make_pass_early_warn_uninitialized): ...new function.
	(pass_late_warn_uninitialized): Replace declaration with that of...
	(make_pass_late_warn_uninitialized): ...new function.
	(pass_cse_reciprocals): Replace declaration with that of...
	(make_pass_cse_reciprocals): ...new function.
	(pass_cse_sincos): Replace declaration with that of...
	(make_pass_cse_sincos): ...new function.
	(pass_optimize_bswap): Replace declaration with that of...
	(make_pass_optimize_bswap): ...new function.
	(pass_optimize_widening_mul): Replace declaration with that of...
	(make_pass_optimize_widening_mul): ...new function.
	(pass_warn_function_return): Replace declaration with that of...
	(make_pass_warn_function_return): ...new function.
	(pass_warn_function_noreturn): Replace declaration with that of...
	(make_pass_warn_function_noreturn): ...new function.
	(pass_cselim): Replace declaration with that of...
	(make_pass_cselim): ...new function.
	(pass_phiopt): Replace declaration with that of...
	(make_pass_phiopt): ...new function.
	(pass_forwprop): Replace declaration with that of...
	(make_pass_forwprop): ...new function.
	(pass_phiprop): Replace declaration with that of...
	(make_pass_phiprop): ...new function.
	(pass_tree_ifcombine): Replace declaration with that of...
	(make_pass_tree_ifcombine): ...new function.
	(pass_dse): Replace declaration with that of...
	(make_pass_dse): ...new function.
	(pass_nrv): Replace declaration with that of...
	(make_pass_nrv): ...new function.
	(pass_rename_ssa_copies): Replace declaration with that of...
	(make_pass_rename_ssa_copies): ...new function.
	(pass_sink_code): Replace declaration with that of...
	(make_pass_sink_code): ...new function.
	(pass_fre): Replace declaration with that of...
	(make_pass_fre): ...new function.
	(pass_check_data_deps): Replace declaration with that of...
	(make_pass_check_data_deps): ...new function.
	(pass_copy_prop): Replace declaration with that of...
	(make_pass_copy_prop): ...new function.
	(pass_vrp): Replace declaration with that of...
	(make_pass_vrp): ...new function.
	(pass_uncprop): Replace declaration with that of...
	(make_pass_uncprop): ...new function.
	(pass_return_slot): Replace declaration with that of...
	(make_pass_return_slot): ...new function.
	(pass_reassoc): Replace declaration with that of...
	(make_pass_reassoc): ...new function.
	(pass_rebuild_cgraph_edges): Replace declaration with that of...
	(make_pass_rebuild_cgraph_edges): ...new function.
	(pass_remove_cgraph_callee_edges): Replace declaration with that of...
	(make_pass_remove_cgraph_callee_edges): ...new function.
	(pass_build_cgraph_edges): Replace declaration with that of...
	(make_pass_build_cgraph_edges): ...new function.
	(pass_local_pure_const): Replace declaration with that of...
	(make_pass_local_pure_const): ...new function.
	(pass_tracer): Replace declaration with that of...
	(make_pass_tracer): ...new function.
	(pass_warn_unused_result): Replace declaration with that of...
	(make_pass_warn_unused_result): ...new function.
	(pass_diagnose_tm_blocks): Replace declaration with that of...
	(make_pass_diagnose_tm_blocks): ...new function.
	(pass_lower_tm): Replace declaration with that of...
	(make_pass_lower_tm): ...new function.
	(pass_tm_init): Replace declaration with that of...
	(make_pass_tm_init): ...new function.
	(pass_tm_mark): Replace declaration with that of...
	(make_pass_tm_mark): ...new function.
	(pass_tm_memopt): Replace declaration with that of...
	(make_pass_tm_memopt): ...new function.
	(pass_tm_edges): Replace declaration with that of...
	(make_pass_tm_edges): ...new function.
	(pass_split_functions): Replace declaration with that of...
	(make_pass_split_functions): ...new function.
	(pass_feedback_split_functions): Replace declaration with that of...
	(make_pass_feedback_split_functions): ...new function.
	(pass_strength_reduction): Replace declaration with that of...
	(make_pass_strength_reduction): ...new function.
	(pass_ipa_lower_emutls): Replace declaration with that of...
	(make_pass_ipa_lower_emutls): ...new function.
	(pass_ipa_function_and_variable_visibility): Replace declaration with
	that of...
	(make_pass_ipa_function_and_variable_visibility): ...new function.
	(pass_ipa_tree_profile): Replace declaration with that of...
	(make_pass_ipa_tree_profile): ...new function.
	(pass_early_local_passes): Replace declaration with that of...
	(make_pass_early_local_passes): ...new function.
	(pass_ipa_whole_program_visibility): Replace declaration with that
	of...
	(make_pass_ipa_whole_program_visibility): ...new function.
	(pass_ipa_lto_gimple_out): Replace declaration with that of...
	(make_pass_ipa_lto_gimple_out): ...new function.
	(pass_ipa_increase_alignment): Replace declaration with that of...
	(make_pass_ipa_increase_alignment): ...new function.
	(pass_ipa_inline): Replace declaration with that of...
	(make_pass_ipa_inline): ...new function.
	(pass_ipa_free_lang_data): Replace declaration with that of...
	(make_pass_ipa_free_lang_data): ...new function.
	(pass_ipa_free_inline_summary): Replace declaration with that of...
	(make_pass_ipa_free_inline_summary): ...new function.
	(pass_ipa_cp): Replace declaration with that of...
	(make_pass_ipa_cp): ...new function.
	(pass_ipa_reference): Replace declaration with that of...
	(make_pass_ipa_reference): ...new function.
	(pass_ipa_pure_const): Replace declaration with that of...
	(make_pass_ipa_pure_const): ...new function.
	(pass_ipa_pta): Replace declaration with that of...
	(make_pass_ipa_pta): ...new function.
	(pass_ipa_lto_finish_out): Replace declaration with that of...
	(make_pass_ipa_lto_finish_out): ...new function.
	(pass_ipa_tm): Replace declaration with that of...
	(make_pass_ipa_tm): ...new function.
	(pass_ipa_profile): Replace declaration with that of...
	(make_pass_ipa_profile): ...new function.
	(pass_ipa_cdtor_merge): Replace declaration with that of...
	(make_pass_ipa_cdtor_merge): ...new function.
	(pass_cleanup_cfg_post_optimizing): Replace declaration with that
	of...
	(make_pass_cleanup_cfg_post_optimizing): ...new function.
	(pass_init_datastructures): Replace declaration with that of...
	(make_pass_init_datastructures): ...new function.
	(pass_fixup_cfg): Replace declaration with that of...
	(make_pass_fixup_cfg): ...new function.
	(pass_expand): Replace declaration with that of...
	(make_pass_expand): ...new function.
	(pass_instantiate_virtual_regs): Replace declaration with that of...
	(make_pass_instantiate_virtual_regs): ...new function.
	(pass_rtl_fwprop): Replace declaration with that of...
	(make_pass_rtl_fwprop): ...new function.
	(pass_rtl_fwprop_addr): Replace declaration with that of...
	(make_pass_rtl_fwprop_addr): ...new function.
	(pass_jump): Replace declaration with that of...
	(make_pass_jump): ...new function.
	(pass_jump2): Replace declaration with that of...
	(make_pass_jump2): ...new function.
	(pass_lower_subreg): Replace declaration with that of...
	(make_pass_lower_subreg): ...new function.
	(pass_cse): Replace declaration with that of...
	(make_pass_cse): ...new function.
	(pass_fast_rtl_dce): Replace declaration with that of...
	(make_pass_fast_rtl_dce): ...new function.
	(pass_ud_rtl_dce): Replace declaration with that of...
	(make_pass_ud_rtl_dce): ...new function.
	(pass_rtl_dce): Replace declaration with that of...
	(make_pass_rtl_dce): ...new function.
	(pass_rtl_dse1): Replace declaration with that of...
	(make_pass_rtl_dse1): ...new function.
	(pass_rtl_dse2): Replace declaration with that of...
	(make_pass_rtl_dse2): ...new function.
	(pass_rtl_dse3): Replace declaration with that of...
	(make_pass_rtl_dse3): ...new function.
	(pass_rtl_cprop): Replace declaration with that of...
	(make_pass_rtl_cprop): ...new function.
	(pass_rtl_pre): Replace declaration with that of...
	(make_pass_rtl_pre): ...new function.
	(pass_rtl_hoist): Replace declaration with that of...
	(make_pass_rtl_hoist): ...new function.
	(pass_rtl_store_motion): Replace declaration with that of...
	(make_pass_rtl_store_motion): ...new function.
	(pass_cse_after_global_opts): Replace declaration with that of...
	(make_pass_cse_after_global_opts): ...new function.
	(pass_rtl_ifcvt): Replace declaration with that of...
	(make_pass_rtl_ifcvt): ...new function.
	(pass_into_cfg_layout_mode): Replace declaration with that of...
	(make_pass_into_cfg_layout_mode): ...new function.
	(pass_outof_cfg_layout_mode): Replace declaration with that of...
	(make_pass_outof_cfg_layout_mode): ...new function.
	(pass_loop2): Replace declaration with that of...
	(make_pass_loop2): ...new function.
	(pass_rtl_loop_init): Replace declaration with that of...
	(make_pass_rtl_loop_init): ...new function.
	(pass_rtl_move_loop_invariants): Replace declaration with that of...
	(make_pass_rtl_move_loop_invariants): ...new function.
	(pass_rtl_unswitch): Replace declaration with that of...
	(make_pass_rtl_unswitch): ...new function.
	(pass_rtl_unroll_and_peel_loops): Replace declaration with that of...
	(make_pass_rtl_unroll_and_peel_loops): ...new function.
	(pass_rtl_doloop): Replace declaration with that of...
	(make_pass_rtl_doloop): ...new function.
	(pass_rtl_loop_done): Replace declaration with that of...
	(make_pass_rtl_loop_done): ...new function.
	(pass_web): Replace declaration with that of...
	(make_pass_web): ...new function.
	(pass_cse2): Replace declaration with that of...
	(make_pass_cse2): ...new function.
	(pass_df_initialize_opt): Replace declaration with that of...
	(make_pass_df_initialize_opt): ...new function.
	(pass_df_initialize_no_opt): Replace declaration with that of...
	(make_pass_df_initialize_no_opt): ...new function.
	(pass_reginfo_init): Replace declaration with that of...
	(make_pass_reginfo_init): ...new function.
	(pass_inc_dec): Replace declaration with that of...
	(make_pass_inc_dec): ...new function.
	(pass_stack_ptr_mod): Replace declaration with that of...
	(make_pass_stack_ptr_mod): ...new function.
	(pass_initialize_regs): Replace declaration with that of...
	(make_pass_initialize_regs): ...new function.
	(pass_combine): Replace declaration with that of...
	(make_pass_combine): ...new function.
	(pass_if_after_combine): Replace declaration with that of...
	(make_pass_if_after_combine): ...new function.
	(pass_ree): Replace declaration with that of...
	(make_pass_ree): ...new function.
	(pass_partition_blocks): Replace declaration with that of...
	(make_pass_partition_blocks): ...new function.
	(pass_match_asm_constraints): Replace declaration with that of...
	(make_pass_match_asm_constraints): ...new function.
	(pass_regmove): Replace declaration with that of...
	(make_pass_regmove): ...new function.
	(pass_split_all_insns): Replace declaration with that of...
	(make_pass_split_all_insns): ...new function.
	(pass_fast_rtl_byte_dce): Replace declaration with that of...
	(make_pass_fast_rtl_byte_dce): ...new function.
	(pass_lower_subreg2): Replace declaration with that of...
	(make_pass_lower_subreg2): ...new function.
	(pass_mode_switching): Replace declaration with that of...
	(make_pass_mode_switching): ...new function.
	(pass_sms): Replace declaration with that of...
	(make_pass_sms): ...new function.
	(pass_sched): Replace declaration with that of...
	(make_pass_sched): ...new function.
	(pass_ira): Replace declaration with that of...
	(make_pass_ira): ...new function.
	(pass_reload): Replace declaration with that of...
	(make_pass_reload): ...new function.
	(pass_clean_state): Replace declaration with that of...
	(make_pass_clean_state): ...new function.
	(pass_branch_prob): Replace declaration with that of...
	(make_pass_branch_prob): ...new function.
	(pass_value_profile_transformations): Replace declaration with that
	of...
	(make_pass_value_profile_transformations): ...new function.
	(pass_postreload_cse): Replace declaration with that of...
	(make_pass_postreload_cse): ...new function.
	(pass_gcse2): Replace declaration with that of...
	(make_pass_gcse2): ...new function.
	(pass_split_after_reload): Replace declaration with that of...
	(make_pass_split_after_reload): ...new function.
	(pass_branch_target_load_optimize1): Replace declaration with that
	of...
	(make_pass_branch_target_load_optimize1): ...new function.
	(pass_thread_prologue_and_epilogue): Replace declaration with that
	of...
	(make_pass_thread_prologue_and_epilogue): ...new function.
	(pass_stack_adjustments): Replace declaration with that of...
	(make_pass_stack_adjustments): ...new function.
	(pass_peephole2): Replace declaration with that of...
	(make_pass_peephole2): ...new function.
	(pass_if_after_reload): Replace declaration with that of...
	(make_pass_if_after_reload): ...new function.
	(pass_regrename): Replace declaration with that of...
	(make_pass_regrename): ...new function.
	(pass_cprop_hardreg): Replace declaration with that of...
	(make_pass_cprop_hardreg): ...new function.
	(pass_reorder_blocks): Replace declaration with that of...
	(make_pass_reorder_blocks): ...new function.
	(pass_branch_target_load_optimize2): Replace declaration with that
	of...
	(make_pass_branch_target_load_optimize2): ...new function.
	(pass_leaf_regs): Replace declaration with that of...
	(make_pass_leaf_regs): ...new function.
	(pass_split_before_sched2): Replace declaration with that of...
	(make_pass_split_before_sched2): ...new function.
	(pass_compare_elim_after_reload): Replace declaration with that of...
	(make_pass_compare_elim_after_reload): ...new function.
	(pass_sched2): Replace declaration with that of...
	(make_pass_sched2): ...new function.
	(pass_stack_regs): Replace declaration with that of...
	(make_pass_stack_regs): ...new function.
	(pass_stack_regs_run): Replace declaration with that of...
	(make_pass_stack_regs_run): ...new function.
	(pass_df_finish): Replace declaration with that of...
	(make_pass_df_finish): ...new function.
	(pass_compute_alignments): Replace declaration with that of...
	(make_pass_compute_alignments): ...new function.
	(pass_duplicate_computed_gotos): Replace declaration with that of...
	(make_pass_duplicate_computed_gotos): ...new function.
	(pass_variable_tracking): Replace declaration with that of...
	(make_pass_variable_tracking): ...new function.
	(pass_free_cfg): Replace declaration with that of...
	(make_pass_free_cfg): ...new function.
	(pass_machine_reorg): Replace declaration with that of...
	(make_pass_machine_reorg): ...new function.
	(pass_cleanup_barriers): Replace declaration with that of...
	(make_pass_cleanup_barriers): ...new function.
	(pass_delay_slots): Replace declaration with that of...
	(make_pass_delay_slots): ...new function.
	(pass_split_for_shorten_branches): Replace declaration with that of...
	(make_pass_split_for_shorten_branches): ...new function.
	(pass_split_before_regstack): Replace declaration with that of...
	(make_pass_split_before_regstack): ...new function.
	(pass_convert_to_eh_region_ranges): Replace declaration with that
	of...
	(make_pass_convert_to_eh_region_ranges): ...new function.
	(pass_shorten_branches): Replace declaration with that of...
	(make_pass_shorten_branches): ...new function.
	(pass_set_nothrow_function_flags): Replace declaration with that of...
	(make_pass_set_nothrow_function_flags): ...new function.
	(pass_dwarf2_frame): Replace declaration with that of...
	(make_pass_dwarf2_frame): ...new function.
	(pass_final): Replace declaration with that of...
	(make_pass_final): ...new function.
	(pass_rtl_seqabstr): Replace declaration with that of...
	(make_pass_rtl_seqabstr): ...new function.
	(pass_release_ssa_names): Replace declaration with that of...
	(make_pass_release_ssa_names): ...new function.
	(pass_early_inline): Replace declaration with that of...
	(make_pass_early_inline): ...new function.
	(pass_inline_parameters): Replace declaration with that of...
	(make_pass_inline_parameters): ...new function.
	(pass_update_address_taken): Replace declaration with that of...
	(make_pass_update_address_taken): ...new function.
	(pass_convert_switch): Replace declaration with that of...
	(make_pass_convert_switch): ...new function.
	* tree-profile.c (pass_ipa_tree_profile): Convert from a global struct
	to a subclass of simple_ipa_opt_pass along with...
	(pass_data_ipa_tree_profile): ...new pass_data instance and...
	(make_pass_ipa_tree_profile): ...new function.
	* tree-sra.c (pass_sra_early): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_sra_early): ...new pass_data instance and...
	(make_pass_sra_early): ...new function.
	(pass_sra): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_sra): ...new pass_data instance and...
	(make_pass_sra): ...new function.
	(pass_early_ipa_sra): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_early_ipa_sra): ...new pass_data instance and...
	(make_pass_early_ipa_sra): ...new function.
	* tree-ssa-ccp.c (pass_ccp): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_ccp): ...new pass_data instance and...
	(make_pass_ccp): ...new function.
	(pass_fold_builtins): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_fold_builtins): ...new pass_data instance and...
	(make_pass_fold_builtins): ...new function.
	* tree-ssa-copy.c (pass_copy_prop): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_copy_prop): ...new pass_data instance and...
	(make_pass_copy_prop): ...new function.
	* tree-ssa-copyrename.c (pass_rename_ssa_copies): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_rename_ssa_copies): ...new pass_data instance and...
	(make_pass_rename_ssa_copies): ...new function.
	* tree-ssa-dce.c (pass_dce): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_dce): ...new pass_data instance and...
	(make_pass_dce): ...new function.
	(pass_dce_loop): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_dce_loop): ...new pass_data instance and...
	(make_pass_dce_loop): ...new function.
	(pass_cd_dce): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_cd_dce): ...new pass_data instance and...
	(make_pass_cd_dce): ...new function.
	* tree-ssa-dom.c (pass_dominator): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_dominator): ...new pass_data instance and...
	(make_pass_dominator): ...new function.
	(pass_phi_only_cprop): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_phi_only_cprop): ...new pass_data instance and...
	(make_pass_phi_only_cprop): ...new function.
	* tree-ssa-dse.c (pass_dse): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_dse): ...new pass_data instance and...
	(make_pass_dse): ...new function.
	* tree-ssa-forwprop.c (pass_forwprop): Convert from a global struct to
	a subclass of gimple_opt_pass along with...
	(pass_data_forwprop): ...new pass_data instance and...
	(make_pass_forwprop): ...new function.
	* tree-ssa-ifcombine.c (pass_tree_ifcombine): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_tree_ifcombine): ...new pass_data instance and...
	(make_pass_tree_ifcombine): ...new function.
	* tree-ssa-loop-ch.c (pass_ch): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_ch): ...new pass_data instance and...
	(make_pass_ch): ...new function.
	* tree-ssa-loop.c (pass_tree_loop): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_tree_loop): ...new pass_data instance and...
	(make_pass_tree_loop): ...new function.
	(pass_tree_loop_init): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tree_loop_init): ...new pass_data instance and...
	(make_pass_tree_loop_init): ...new function.
	(pass_lim): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_lim): ...new pass_data instance and...
	(make_pass_lim): ...new function.
	(pass_tree_unswitch): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tree_unswitch): ...new pass_data instance and...
	(make_pass_tree_unswitch): ...new function.
	(pass_predcom): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_predcom): ...new pass_data instance and...
	(make_pass_predcom): ...new function.
	(pass_vectorize): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_vectorize): ...new pass_data instance and...
	(make_pass_vectorize): ...new function.
	(pass_graphite): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_graphite): ...new pass_data instance and...
	(make_pass_graphite): ...new function.
	(pass_graphite_transforms): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_graphite_transforms): ...new pass_data instance and...
	(make_pass_graphite_transforms): ...new function.
	(pass_check_data_deps): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_check_data_deps): ...new pass_data instance and...
	(make_pass_check_data_deps): ...new function.
	(pass_iv_canon): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_iv_canon): ...new pass_data instance and...
	(make_pass_iv_canon): ...new function.
	(pass_scev_cprop): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_scev_cprop): ...new pass_data instance and...
	(make_pass_scev_cprop): ...new function.
	(pass_record_bounds): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_record_bounds): ...new pass_data instance and...
	(make_pass_record_bounds): ...new function.
	(pass_complete_unroll): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_complete_unroll): ...new pass_data instance and...
	(make_pass_complete_unroll): ...new function.
	(pass_complete_unrolli): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_complete_unrolli): ...new pass_data instance and...
	(make_pass_complete_unrolli): ...new function.
	(pass_parallelize_loops): Convert from a global struct to a subclass
	of gimple_opt_pass along with...
	(pass_data_parallelize_loops): ...new pass_data instance and...
	(make_pass_parallelize_loops): ...new function.
	(pass_loop_prefetch): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_loop_prefetch): ...new pass_data instance and...
	(make_pass_loop_prefetch): ...new function.
	(pass_iv_optimize): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_iv_optimize): ...new pass_data instance and...
	(make_pass_iv_optimize): ...new function.
	(pass_tree_loop_done): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tree_loop_done): ...new pass_data instance and...
	(make_pass_tree_loop_done): ...new function.
	* tree-ssa-math-opts.c (pass_cse_reciprocals): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_cse_reciprocals): ...new pass_data instance and...
	(make_pass_cse_reciprocals): ...new function.
	(pass_cse_sincos): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_cse_sincos): ...new pass_data instance and...
	(make_pass_cse_sincos): ...new function.
	(pass_optimize_bswap): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_optimize_bswap): ...new pass_data instance and...
	(make_pass_optimize_bswap): ...new function.
	(pass_optimize_widening_mul): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_optimize_widening_mul): ...new pass_data instance and...
	(make_pass_optimize_widening_mul): ...new function.
	* tree-ssa-phiopt.c (pass_phiopt): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_phiopt): ...new pass_data instance and...
	(make_pass_phiopt): ...new function.
	(pass_cselim): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_cselim): ...new pass_data instance and...
	(make_pass_cselim): ...new function.
	* tree-ssa-phiprop.c (pass_phiprop): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_phiprop): ...new pass_data instance and...
	(make_pass_phiprop): ...new function.
	* tree-ssa-pre.c (pass_pre): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_pre): ...new pass_data instance and...
	(make_pass_pre): ...new function.
	(pass_fre): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_fre): ...new pass_data instance and...
	(make_pass_fre): ...new function.
	* tree-ssa-reassoc.c (pass_reassoc): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_reassoc): ...new pass_data instance and...
	(make_pass_reassoc): ...new function.
	* tree-ssa-sink.c (pass_sink_code): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_sink_code): ...new pass_data instance and...
	(make_pass_sink_code): ...new function.
	* tree-ssa-strlen.c (pass_strlen): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_strlen): ...new pass_data instance and...
	(make_pass_strlen): ...new function.
	* tree-ssa-structalias.c (pass_build_alias): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_build_alias): ...new pass_data instance and...
	(make_pass_build_alias): ...new function.
	(pass_build_ealias): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_build_ealias): ...new pass_data instance and...
	(make_pass_build_ealias): ...new function.
	(pass_ipa_pta): Convert from a global struct to a subclass of
	simple_ipa_opt_pass along with...
	(pass_data_ipa_pta): ...new pass_data instance and...
	(make_pass_ipa_pta): ...new function.
	* tree-ssa-uncprop.c (pass_uncprop): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_uncprop): ...new pass_data instance and...
	(make_pass_uncprop): ...new function.
	* tree-ssa-uninit.c (pass_late_warn_uninitialized): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_late_warn_uninitialized): ...new pass_data instance and...
	(make_pass_late_warn_uninitialized): ...new function.
	* tree-ssa.c (pass_init_datastructures): Convert from a global struct
	to a subclass of gimple_opt_pass along with...
	(pass_data_init_datastructures): ...new pass_data instance and...
	(make_pass_init_datastructures): ...new function.
	(pass_early_warn_uninitialized): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_early_warn_uninitialized): ...new pass_data instance and...
	(make_pass_early_warn_uninitialized): ...new function.
	(pass_update_address_taken): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_update_address_taken): ...new pass_data instance and...
	(make_pass_update_address_taken): ...new function.
	* tree-ssanames.c (pass_release_ssa_names): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_release_ssa_names): ...new pass_data instance and...
	(make_pass_release_ssa_names): ...new function.
	* tree-stdarg.c (pass_stdarg): Convert from a global struct to a
	subclass of gimple_opt_pass along with...
	(pass_data_stdarg): ...new pass_data instance and...
	(make_pass_stdarg): ...new function.
	* tree-switch-conversion.c (pass_convert_switch): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_convert_switch): ...new pass_data instance and...
	(make_pass_convert_switch): ...new function.
	* tree-tailcall.c (pass_tail_recursion): Convert from a global struct
	to a subclass of gimple_opt_pass along with...
	(pass_data_tail_recursion): ...new pass_data instance and...
	(make_pass_tail_recursion): ...new function.
	(pass_tail_calls): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tail_calls): ...new pass_data instance and...
	(make_pass_tail_calls): ...new function.
	* tree-vect-generic.c (pass_lower_vector): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_lower_vector): ...new pass_data instance and...
	(make_pass_lower_vector): ...new function.
	(pass_lower_vector_ssa): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_lower_vector_ssa): ...new pass_data instance and...
	(make_pass_lower_vector_ssa): ...new function.
	* tree-vectorizer.c (pass_slp_vectorize): Convert from a global struct
	to a subclass of gimple_opt_pass along with...
	(pass_data_slp_vectorize): ...new pass_data instance and...
	(make_pass_slp_vectorize): ...new function.
	(pass_ipa_increase_alignment): Convert from a global struct to a
	subclass of simple_ipa_opt_pass along with...
	(pass_data_ipa_increase_alignment): ...new pass_data instance and...
	(make_pass_ipa_increase_alignment): ...new function.
	* tree-vrp.c (pass_vrp): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_vrp): ...new pass_data instance and...
	(make_pass_vrp): ...new function.
	* tree.c (pass_ipa_free_lang_data): Convert from a global struct to a
	subclass of simple_ipa_opt_pass along with...
	(pass_data_ipa_free_lang_data): ...new pass_data instance and...
	(make_pass_ipa_free_lang_data): ...new function.
	* tsan.c (pass_tsan): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tsan): ...new pass_data instance and...
	(make_pass_tsan): ...new function.
	(pass_tsan_O0): Convert from a global struct to a subclass of
	gimple_opt_pass along with...
	(pass_data_tsan_O0): ...new pass_data instance and...
	(make_pass_tsan_O0): ...new function.
	* var-tracking.c (pass_variable_tracking): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_variable_tracking): ...new pass_data instance and...
	(make_pass_variable_tracking): ...new function.
	* web.c (pass_web): Convert from a global struct to a subclass of
	rtl_opt_pass along with...
	(pass_data_web): ...new pass_data instance and...
	(make_pass_web): ...new function.
	* config/epiphany/epiphany.h (pass_mode_switch_use): Replace
	declaration with that of...
	(make_pass_mode_switch_use): ...new function.
	(pass_resolve_sw_modes): Replace declaration with that of...
	(make_pass_resolve_sw_modes): ...new function.
	* config/epiphany/mode-switch-use.c (pass_mode_switch_use): Convert
	from a global struct to a subclass of rtl_opt_pass along with...
	(pass_data_mode_switch_use): ...new pass_data instance and...
	(make_pass_mode_switch_use): ...new function.
	* config/epiphany/resolve-sw-modes.c (pass_resolve_sw_modes): Convert
	from a global struct to a subclass of rtl_opt_pass along with...
	(pass_data_resolve_sw_modes): ...new pass_data instance and...
	(make_pass_resolve_sw_modes): ...new function.
	* config/i386/i386.c (pass_insert_vzeroupper): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_insert_vzeroupper): ...new pass_data instance and...
	(make_pass_insert_vzeroupper): ...new function.
	* config/sparc/sparc.c (pass_work_around_errata): Convert from a
	global struct to a subclass of rtl_opt_pass along with...
	(pass_data_work_around_errata): ...new pass_data instance and...
	(make_pass_work_around_errata): ...new function.
	* config/mips/mips.c (pass_mips_machine_reorg2): Convert from a global
	struct to a subclass of rtl_opt_pass along with...
	(pass_data_mips_machine_reorg2): ...new pass_data instance and...
	(make_pass_mips_machine_reorg2): ...new function.

gcc/testsuite/

	Patch autogenerated by refactor_passes.py from
	https://github.com/davidmalcolm/gcc-refactoring-scripts
	revision 03fe39476a4c4ea450b49e087cfa817b5f92021e

	* gcc.dg/plugin/one_time_plugin.c (one_pass): Convert from a global
	struct to a subclass of gimple_opt_pass along with...
	(pass_data_one_pass): ...new pass_data instance and...
	(make_one_pass): ...new function.
	* gcc.dg/plugin/selfassign.c (pass_warn_self_assign): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_warn_self_assign): ...new pass_data instance and...
	(make_pass_warn_self_assign): ...new function.
	* g++.dg/plugin/dumb_plugin.c (pass_dumb_plugin_example): Convert from
	a global struct to a subclass of gimple_opt_pass along with...
	(pass_data_dumb_plugin_example): ...new pass_data instance and...
	(make_pass_dumb_plugin_example): ...new function.
	* g++.dg/plugin/selfassign.c (pass_warn_self_assign): Convert from a
	global struct to a subclass of gimple_opt_pass along with...
	(pass_data_warn_self_assign): ...new pass_data instance and...
	(make_pass_warn_self_assign): ...new function.

From-SVN: r201508
2013-08-05 20:16:05 +00:00
Jan Hubicka 12123452e4 cgraph.h (release_function_body): Declare.
* cgraph.h (release_function_body): Declare.
	* tree.c (free_lang_data_in_decl): Free, parameters and return values
	of unused delcarations.

From-SVN: r201413
2013-08-01 15:41:10 +00:00
Jan Hubicka d84db1ed8a gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Use types_same_for_odr.
* gimple-fold.c (gimple_extract_devirt_binfo_from_cst): Use
	types_same_for_odr.
	* tree.c (decls_same_for_odr): New function.
	(same_for_edr): New function.
	(types_same_for_odr): New function.
	(get_binfo_at_offset): Use it.
	* tree.h (types_same_for_odr): Declare.

From-SVN: r200288
2013-06-21 06:43:39 +00:00
Richard Biener ee03e71d47 lto-streamer.h (enum LTO_tags): Add LTO_tree_scc.
2013-06-17  Richard Biener  <rguenther@suse.de>

	* lto-streamer.h (enum LTO_tags): Add LTO_tree_scc.
	(lto_input_scc): Declare.
	(lto_input_tree_1): Likewise.
	(struct lto_stats_d): Add num_tree_bodies_output and
	num_pickle_refs_output.
	* lto-streamer-in.c (lto_read_body): Use streamer_tree_cache_get_tree.
	(lto_read_tree_1): Split out from ...
	(lto_read_tree): ... this.
	(lto_input_scc): New function.
	(lto_input_tree_1): Split out from ...
	(lto_input_tree): ... this.  Handle LTO_tree_scc.
	(lto_data_in_create): Create the streamer cache without hashes.
	* lto-streamer-out.c (create_output_block): Create the streamer
	cache with hashes when not doing WPA.
	(lto_write_tree_1): Split out from ...
	(lto_write_tree): ... this.
	(get_symbol_initial_value): New function.
	(lto_output_tree_1): Split out from ...
	(lto_output_tree): ... this.  Write trees as series of SCCs
	using a DFS walk via DFS_write_tree.
	(struct sccs, struct scc_entry): New types.
	(next_dfs_num, sccstack, sccstate, sccstate_obstack): New globals.
	(DFS_write_tree_body): New function.
	(DFS_write_tree): Likewise.
	(hash_tree): Likewise.
	(scc_entry_compare): Likewise.
	(hash_scc): Likewise.
	(tree_is_indexable): DEBUG_EXPR_DECLs are local entities.
	* tree-streamer-in.c (lto_input_ts_list_tree_pointers): Stream
	TREE_CHAIN as regular reference.
	(streamer_read_integer_cst): Remove.
	(streamer_get_pickled_tree): Adjust.
	* tree-streamer-out.c (streamer_write_chain): Disable streaming
	of DECL_EXTERNALs in BLOCK_VARS for now.
	(write_ts_list_tree_pointers): Stream TREE_CHAIN as regular
	reference.
	* tree-streamer.c (streamer_tree_cache_add_to_node_array):
	Add hash value argument and record that if hashes are recorded
	in the cache.
	(streamer_tree_cache_insert_1): Adjust.
	(streamer_tree_cache_insert): Likewise.
	(streamer_tree_cache_insert_at): Rename to ...
	(streamer_tree_cache_replace_tree): ... this and adjust.
	(streamer_tree_cache_append): Adjust.
	(record_common_node): Likewise.
	(streamer_tree_cache_create): Add argument whether to
	record hash values together with trees.
	(streamer_tree_cache_delete): Adjust.
	* tree-streamer.h (struct streamer_tree_cache_d): Add
	vector of hashes.
	(streamer_read_integer_cst): Remove.
	(streamer_tree_cache_insert): Adjust.
	(streamer_tree_cache_append): Likewise.
	(streamer_tree_cache_insert_at): Rename to ...
	(streamer_tree_cache_replace_tree): ... this and adjust.
	(streamer_tree_cache_create): Add argument whether to record hashes.
	(streamer_tree_cache_get): Rename to ...
	(streamer_tree_cache_get_tree): ... this.
	(streamer_tree_cache_get_hash): New function.
	* tree.c (cache_integer_cst): New function.
	* tree.h (cache_integer_cst): Declare.
	(ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move here from cp/cp-tree.h.
	* lto-symtab.c (lto_varpool_replace_node): Only release
	DECL_INITIAL of non-prevailing decls.
	* varpool.c (varpool_remove_initializer): Do not release
	DECL_INITIAL when we are still in CGRAPH_LTO_STREAMING.

	cp/
	* cp-tree.h (ANON_AGGRNAME_FORMAT, ANON_AGGRNAME_P): Move to tree.h.

	lto/
	* Make-lang.in (lto.o): Add $(DATA_STREAMER_H) dependency.
	* lto.c: Include data-streamer.h.
	(lto_read_in_decl_state): Use streamer_tree_cache_get_tree.
	(gimple_type_leader_entry_s, gimple_type_leader,
	gimple_lookup_type_leader): Remove.
	(gtc_visit): Simplify.
	(gimple_types_compatible_p): Likewise.
	(gimple_register_type_1): Likewise.  Merge into ...
	(gimple_register_type): ... this.  Keep it as legacy for
	statistics purposes for now.
	(fixup_integer_cst): Remove.
	(LTO_FIXUP_TREE, lto_fixup_types, lto_ft_*): Simplify and
	rename to ...
	(MAYBE_REMEMBER_WITH_VARS, maybe_remember_with_vars,
	maybe_remember_with_vars_*): ... these.
	(uniquify_nodes): Remove.
	(lto_fixup_prevailing_type): New function.
	(struct tree_scc, struct tree_scc_hasher): New type and hasher.
	(tree_scc_hash, tree_scc_hash_obstack): New globals.
	(num_merged_types, num_prevailing_types, num_not_merged_types,
	num_not_merged_types_in_same_scc, total_scc_size, num_sccs_read,
	total_scc_size_merged, num_sccs_merged, num_scc_compares,
	num_scc_compare_collisions): New global counters.
	(compare_tree_sccs_1): New function.
	(compare_tree_sccs): Likewise.
	(unify_scc): Likewise.
	(lto_read_decls): Stream in tree SCCs and unify them on the
	way in.  Finalize prevailing SCC tree members.
	(read_cgraph_and_symbols): Do not initialize or free gimple_type_leader.
	Allocate and free tree_scc_hash_obstack and tree_scc_hash, do not bother
	to ggc-collect during merging.
	(print_lto_report_1): Adjust for new merging code.

From-SVN: r200151
2013-06-17 15:08:24 +00:00
Marc Glisse 5d41848304 tree-ssa-forwprop.c (simplify_bitwise_binary, [...]): Generalize to complex and vector.
2013-06-13  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* tree-ssa-forwprop.c (simplify_bitwise_binary, associate_plusminus):
	Generalize to complex and vector.
	* tree.c (build_all_ones_cst): New function.
	* tree.h (build_all_ones_cst): Declare it.

gcc/testsuite/
	* gcc.dg/tree-ssa/forwprop-27.c: New testcase.

From-SVN: r200059
2013-06-13 08:21:01 +00:00
Martin Jambor 7d2fb5244b re PR middle-end/57347 (wrong code for bitfield on x86_64-linux at -Os and above)
2013-05-22  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/57347
	* tree.h (contains_bitfld_component_ref_p): Declare.
	* tree-sra.c (contains_bitfld_comp_ref_p): Move...
	* tree.c (contains_bitfld_component_ref_p): ...here.  Adjust its caller.
	* ipa-prop.c (determine_known_aggregate_parts): Check that LHS does
	not access a bit-field.  Assert all final offsets are byte-aligned.

testsuite/
	* gcc.dg/ipa/pr57347.c: New test.

From-SVN: r199252
2013-05-23 15:20:41 +02:00
Jakub Jelinek 2e55d06281 tree.c (warn_deprecated_use): Print file:line using locus color.
* tree.c (warn_deprecated_use): Print file:line using locus color.
	* diagnostic.c (diagnostic_report_current_module): Print file:line
	and file:line:column using locus color.

From-SVN: r198900
2013-05-14 21:41:13 +02:00
Marc Glisse 640bfeb25c tree-vect-generic.c (uniform_vector_p): Move ...
2013-05-13  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* tree-vect-generic.c (uniform_vector_p): Move ...
	* tree.c (uniform_vector_p): ... here.
	* tree.h (uniform_vector_p): Declare it.
	* fold-const.c (fold_binary_loc) <shift>: Turn the second argument
	into a scalar.

gcc/testsuite/
	* gcc.dg/vector-shift-2.c: New testcase.

From-SVN: r198819
2013-05-13 09:30:50 +00:00
Marc Glisse a5e0cd1d9b stor-layout.c (element_precision): New function.
2013-05-10  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* stor-layout.c (element_precision): New function.
	* machmode.h (element_precision): Declare it.
	* tree.c (build_minus_one_cst): New function.
	(element_precision): Likewise.
	* tree.h (build_minus_one_cst): Declare new function.
	(element_precision): Likewise.
	* fold-const.c (operand_equal_p): Use element_precision.
	(fold_binary_loc): Handle vector types.
	* convert.c (convert_to_integer): Use element_precision.
	* gimple.c (iterative_hash_canonical_type): Handle complex and vectors
	separately.

gcc/c-family/
	* c-common.c (vector_types_convertible_p): No TYPE_PRECISION for
	vectors.

gcc/testsuite/
	* gcc.dg/vector-shift.c: New testcase.

From-SVN: r198772
2013-05-10 11:15:14 +00:00
Jason Merrill a3409c0279 tree.c (build_constructor_va): New.
* tree.c (build_constructor_va): New.
	* tree.h: Declare it.

From-SVN: r198744
2013-05-09 12:43:27 -04:00
Marc Glisse 9a0ee7b028 tree.c (integer_all_onesp): Test that both components are all 1s.
2013-05-06  Marc Glisse  <marc.glisse@inria.fr>

	* tree.c (integer_all_onesp) <COMPLEX_CST>: Test that both
	components are all 1s.
	(integer_minus_onep): New function.
	* tree.h (integer_minus_onep): Declare it.
	* fold-const.c (fold_binary_loc) <MULT_EXPR>: Test
	integer_minus_onep instead of integer_all_onesp.

From-SVN: r198649
2013-05-06 21:14:59 +00:00
Eric Botcazou 966b587e0b stor-layout.c (skip_simple_constant_arithmetic): Move to...
* stor-layout.c (skip_simple_constant_arithmetic): Move to...
	* tree.c (skip_simple_constant_arithmetic): ...here and make public.
	(skip_simple_arithmetic): Tidy up.
	* tree.h (skip_simple_constant_arithmetic): Declare.
ada/
	* gcc-interface/decl.c (elaborate_expression_1): Skip only constant
	arithmetics when looking for a read-only variable in the expression.

From-SVN: r197815
2013-04-11 16:15:25 +00:00
Richard Biener bb313b932b passes.c (execute_todo): Do not call ggc_collect conditional here.
2013-04-10  Richard Biener  <rguenther@suse.de>

	* passes.c (execute_todo): Do not call ggc_collect conditional here.
	(execute_one_ipa_transform_pass): But unconditionally here.
	(execute_one_pass): And here.
	(init_optimization_passes): Remove reload pass.
	* tree-pass.h (TODO_ggc_collect): Remove.
	(pass_reload): Likewise.
	* ira.c (do_reload): Merge into ...
	(ira): ... this.
	(rest_of_handle_reload): Remove.
	(pass_reload): Likewise.
	* config/i386/i386.c (ix86_option_override): Refer to ira instead
	of reload for vzeroupper pass placement.
	* <everywhere>: Remove TODO_ggc_collect from todo_flags_start
	and todo_flags_finish of all passes.

	* g++.dg/pr55604.C: Use -fdump-rtl-ira.

From-SVN: r197671
2013-04-10 11:33:31 +00:00
Maxim Kuvyrkov 343881fd9e tree.c (type_hash_lookup, [...]): Make static.
* tree.c (type_hash_lookup, type_hash_add): Make static.
	* tree.h (type_hash_lookup, type_hash_add): Remove global declarations.

From-SVN: r197623
2013-04-09 09:47:33 +00:00
Richard Biener 839b422f08 tree.h (DECL_DEBUG_EXPR_IS_FROM): Rename to ...
2013-03-21  Richard Biener  <rguenther@suse.de>

	* tree.h (DECL_DEBUG_EXPR_IS_FROM): Rename to ...
	(DECL_HAS_DEBUG_EXPR_P): ... this.  Guard properly.
	* tree.c (copy_node_stat): Do not copy DECL_HAS_DEBUG_EXPR_P.
	* dwarf2out.c (add_var_loc_to_decl): Use DECL_HAS_DEBUG_EXPR_P
	instead of DECL_DEBUG_EXPR_IS_FROM.
	* gimplify.c (gimplify_modify_expr): Likewise.
	* tree-cfg.c (verify_expr_location_1): Likewise.
	* tree-complex.c (create_one_component_var): Likewise.
	* tree-sra.c (create_access_replacement): Likewise.
	* tree-ssa-live.c (clear_unused_block_pointer_1): Likewise.
	(clear_unused_block_pointer): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise.
	* tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.
	* var-tracking.c (var_debug_decl): Likewise.
	(track_expr_p): Likewise.
	* tree-inline.c (add_local_variables): Likewise.  Set
	DECL_HAS_DEBUG_EXPR_P after copying it.
	* tree-diagnostic.c (default_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
	instead of DECL_DEBUG_EXPR_IS_FROM.  Guard properly.

	c/
	* c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P
	instead of DECL_DEBUG_EXPR_IS_FROM.  Guard properly.

	cp/
	* error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of
	DECL_DEBUG_EXPR_IS_FROM.  Guard properly.

From-SVN: r196864
2013-03-21 11:53:39 +00:00
Jakub Jelinek 12d2dc5e67 re PR c/56566 (bogus "is narrower than values of its type" warning)
PR c/56566
	* tree.c (tree_int_cst_min_precision): For integer_zerop (value)
	return 1 even for !unsignedp.

	* c-c++-common/pr56566.c: New test.

From-SVN: r196767
2013-03-18 08:10:33 +01:00
Diego Novillo cd030c079e Remove zone allocator.
This patch removes the GC zone allocator.  It is not used and it
produces several regressions in the testsuite.  Furthermore, it
complicates things for the plan to implement manual GC markers
(http://gcc.gnu.org/wiki/cxx-conversion/gc-alternatives#Do_GC_marking_manually).

Tested on x86_64 with standard checking, --enable-checking=gc and
--enable-checking=release.

From-SVN: r195426
2013-01-24 10:13:46 -05:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Jason Merrill e78167f298 re PR c++/55804 (GCC omits required call to constructor)
PR c++/55804
	PR c++/55032
	PR c++/55245
	* tree.c (build_array_type_1): Revert earlier change.
	* cp/tree.c (build_cplus_array_type): Copy layout information
	to main variant if necessary.

From-SVN: r194811
2013-01-02 14:03:04 -05:00
Jason Merrill 0fe4913b32 re PR c++/55032 (Internal compiler error: in strip_typedefs, at cp/tree.c:1199)
PR c++/55032
	* tree.c (build_array_type_1): Re-layout if we found it in the
	hash table.

From-SVN: r194265
2012-12-06 15:20:34 -05:00
Eric Botcazou 67ae67ec94 fold-const.c (const_binop): Adjust comment.
* fold-const.c (const_binop): Adjust comment.
	(extract_muldiv_1): Likewise.
	(fold_comparison): Likewise.
	* stor-layout.c (place_field): Fix typo.
	* tree.c (double_int_fits_to_tree_p): Remove obsolete comment.
	(force_fit_type_double): Likewise.  Fix long line.

From-SVN: r193812
2012-11-26 12:01:07 +00:00
Diego Novillo 9771b26396 This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'.
This patch rewrites the old VEC macro-based interface into a new one
based on the template class 'vec'.  The user-visible changes are
described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec.

I have tested the patch pretty extensively:

- Regular bootstraps on x86_64, ppc, ia64, sparc and hppa.
- Bootstraps with --enable-checking=release
- Bootstraps with --enable-checking=gc,gcac
- Basic builds on all targets (using contrib/config-list.mk).

We no longer access the vectors via VEC_* macros.  The pattern is
"VEC_operation (T, A, V, args)" becomes "V.operation (args)".

The only thing I could not do is create proper ctors and dtors for the
vec class.  Since these vectors are stored in unions, we
have to keep them as PODs (C++03 does not allow non-PODs in unions).

This means that creation and destruction must be explicit.  There is a
new method vec<type, allocation, layout>::create() and another vec<type,
allocation, layout>::destroy() to allocate the internal vector.

For vectors that must be pointers, there is a family of free functions
that implement the operations that need to tolerate NULL vectors.
These functions all start with the prefix 'vec_safe_'.  See the wiki
page for details.

The gengtype change removes the special handling for VEC() that used
to exist in gengtype. Additionally, it allows gengtype to recognize
templates of more than one argument and introduces the concept of an
undefined type (useful for template arguments that may or may not be
types).

When a TYPE_UNDEFINED is reached, gengtype will ignore it if it
happens inside a type marked with GTY((user)).  Otherwise, it will
emit an error.

Finally, gengtype rejects root types marked GTY((user)) that are not
first class pointers.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* vec.c (register_overhead): Convert it into
	member function of vec_prefix.
	(release_overhead): Likewise.
	(calculate_allocation): Likewise.
	(vec_heap_free): Remove.
	(vec_gc_o_reserve_1): Remove.
	(vec_heap_o_reserve_1): Remove.
	(vec_stack_o_reserve_1): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(register_stack_vec): New.
	(stack_vec_register_index): New.
	(unregister_stack_vec): New.
	(vec_assert_fail): Remove.
	* vec.h: Conditionally include ggc.h.  Document conditional
	hackery.
	Update top-level documentation.
	(ALONE_VEC_CHECK_INFO): Remove.
	(VEC_CHECK_INFO): Remove.
	(ALONE_VEC_CHECK_DECL): Remove.
	(VEC_CHECK_DECL): Remove.
	(ALONE_VEC_CHECK_PASS): Remove.
	(VEC_CHECK_PASS): Remove.
	(VEC_ASSERT): Remove.
	(vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and
	va_stack.
	Mark fields alloc_ and num_ as protected.
	(struct vec_t): Remove.  Remove all function members.
	(struct vl_embed): Declare.
	(struct vl_ptr): Declare.
	(free): Remove.
	(reserve_exact): Remove.
	(reserve): Remove.
	(safe_splice): Remove.
	(safe_push): Remove.
	(safe_grow): Remove.
	(safe_grow_cleared): Remove.
	(safe_insert): Remove.
	(DEF_VEC_I): Remove.
	(DEF_VEC_ALLOC_I): Remove.
	(DEF_VEC_P): Remove.
	(DEF_VEC_ALLOC_P): Remove.
	(DEF_VEC_O): Remove.
	(DEF_VEC_ALLOC_O): Remove.
	(DEF_VEC_ALLOC_P_STACK): Remove.
	(DEF_VEC_ALLOC_O_STACK): Remove.
	(DEF_VEC_ALLOC_I_STACK): Remove.
	(DEF_VEC_A): Remove.
	(DEF_VEC_ALLOC_A): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(VEC_length): Remove.
	(VEC_empty): Remove.
	(VEC_address): Remove.
	(vec_address): Remove.
	(VEC_last): Remove.
	(VEC_index): Remove.
	(VEC_iterate): Remove.
	(VEC_embedded_size): Remove.
	(VEC_embedded_init): Remove.
	(VEC_free): Remove.
	(VEC_copy): Remove.
	(VEC_space): Remove.
	(VEC_reserve): Remove.
	(VEC_reserve_exact): Remove.
	(VEC_splice): Remove.
	(VEC_safe_splice): Remove.
	(VEC_quick_push): Remove.
	(VEC_safe_push): Remove.
	(VEC_pop): Remove.
	(VEC_truncate): Remove.
	(VEC_safe_grow): Remove.
	(VEC_replace): Remove.
	(VEC_quick_insert): Remove.
	(VEC_safe_insert): Remove.
	(VEC_ordered_remove): Remove.
	(VEC_unordered_remove): Remove.
	(VEC_block_remove): Remove.
	(VEC_lower_bound): Remove.
	(VEC_alloc): Remove.
	(VEC_qsort): Remove.

	(va_heap): Declare.
	(va_heap::default_layout): New typedef to vl_ptr.
	(va_heap::reserve): New.
	(va_heap::release): New.
	(va_gc): Declare.
	(va_gc::default_layout): New typedef to vl_embed.
	(va_gc::reserve): New.
	(va_gc::release): New.
	(va_gc_atomic): Declare.  Inherit from va_gc.
	(va_stack): Declare.
	(va_stack::default_layout): New typedef to vl_ptr.
	(va_stack::alloc): New.
	(va_stack::reserve): New.
	(va_stack::release): New.
	(register_stack_vec): Declare.
	(stack_vec_register_index): Declare.
	(unregister_stack_vec): Declare.

	(vec<T, A = va_heap, L = typename A::default_layout>): Declare
	empty vec template.
	(vec<T, A, vl_embed>): Partial specialization for embedded
	layout.
	(vec<T, A, vl_embed>::allocated): New.
	(vec<T, A, vl_embed>::length): New.
	(vec<T, A, vl_embed>::is_empty): New.
	(vec<T, A, vl_embed>::address): New.
	(vec<T, A, vl_embed>::operator[]): New.
	(vec<T, A, vl_embed>::last New.
	(vec<T, A, vl_embed>::space): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::iterate): New.
	(vec<T, A, vl_embed>::copy): New.
	(vec<T, A, vl_embed>::splice): New.
	(vec<T, A, vl_embed>::quick_push New.
	(vec<T, A, vl_embed>::pop New.
	(vec<T, A, vl_embed>::truncate): New.
	(vec<T, A, vl_embed>::quick_insert): New.
	(vec<T, A, vl_embed>::ordered_remove): New.
	(vec<T, A, vl_embed>::unordered_remove): New.
	(vec<T, A, vl_embed>::block_remove): New.
	(vec<T, A, vl_embed>::qsort): New.
	(vec<T, A, vl_embed>::lower_bound): New.
	(vec<T, A, vl_embed>::embedded_size): New.
	(vec<T, A, vl_embed>::embedded_init): New.
	(vec<T, A, vl_embed>::quick_grow): New.
	(vec<T, A, vl_embed>::quick_grow_cleared): New.
	(vec_safe_space): New.
	(vec_safe_length): New.
	(vec_safe_address): New.
	(vec_safe_is_empty): New.
	(vec_safe_reserve): New.
	(vec_safe_reserve_exact): New.
	(vec_alloc): New.
	(vec_free): New.
	(vec_safe_grow): New.
	(vec_safe_grow_cleared): New.
	(vec_safe_iterate): New.
	(vec_safe_push): New.
	(vec_safe_insert): New.
	(vec_safe_truncate): New.
	(vec_safe_copy): New.
	(vec_safe_splice): New.

	(vec<T, A, vl_ptr>): New partial specialization for the space
	efficient layout.
	(vec<T, A, vl_ptr>::exists): New.
	(vec<T, A, vl_ptr>::is_empty): New.
	(vec<T, A, vl_ptr>::length): New.
	(vec<T, A, vl_ptr>::address): New.
	(vec<T, A, vl_ptr>::operator[]): New.
	(vec<T, A, vl_ptr>::operator!=): New.
	(vec<T, A, vl_ptr>::operator==): New.
	(vec<T, A, vl_ptr>::last): New.
	(vec<T, A, vl_ptr>::space): New.
	(vec<T, A, vl_ptr>::iterate): New.
	(vec<T, A, vl_ptr>::copy): New.
	(vec<T, A, vl_ptr>::reserve): New.
	(vec<T, A, vl_ptr>::reserve_exact): New.
	(vec<T, A, vl_ptr>::splice): New.
	(vec<T, A, vl_ptr>::safe_splice): New.
	(vec<T, A, vl_ptr>::quick_push): New.
	(vec<T, A, vl_ptr>::safe_push): New.
	(vec<T, A, vl_ptr>::pop): New.
	(vec<T, A, vl_ptr>::truncate): New.
	(vec<T, A, vl_ptr>::safe_grow): New.
	(vec<T, A, vl_ptr>::safe_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_grow): New.
	(vec<T, A, vl_ptr>::quick_grow_cleared): New.
	(vec<T, A, vl_ptr>::quick_insert): New.
	(vec<T, A, vl_ptr>::safe_insert): New.
	(vec<T, A, vl_ptr>::ordered_remove): New.
	(vec<T, A, vl_ptr>::unordered_remove): New.
	(vec<T, A, vl_ptr>::block_remove): New.
	(vec<T, A, vl_ptr>::qsort): New.
	(vec<T, A, vl_ptr>::lower_bound): New.
	(vec_stack_alloc): Define.
	(FOR_EACH_VEC_SAFE_ELT): Define.
	* vecir.h: Remove.  Update all users.
	* vecprim.h: Remove.  Update all users.
	Move uchar to coretypes.h.

	* Makefile.in (VEC_H): Add $(GGC_H).
	Remove vecir.h and vecprim.h dependencies everywhere.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	* gengtype-lex.l (VEC): Remove.
	Add characters in the set [\!\>\.-].
	* gengtype-parse.c (token_names): Remove "VEC".
	(require_template_declaration): Remove handling of VEC_TOKEN.
	(type): Likewise.
	Call create_user_defined_type when parsing GTY((user)).
	* gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED.
	(write_state_undefined_type): New.
	(write_state_type): Call write_state_undefined_type for
	TYPE_UNDEFINED.
	(read_state_type): Call read_state_undefined_type for
	TYPE_UNDEFINED.
	* gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED.
	(create_user_defined_type): Make extern.
	(type_for_name): Factor out of resolve_typedef.
	(create_undefined_type): New
	(resolve_typedef): Call it when we cannot find a previous
	typedef and the type is not a template.
	(find_structure): Accept TYPE_UNDEFINED.
	(set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES,
	default to false.
	Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or
	ALLOWED_UNDEFINED_TYPES is set.
	Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT.
	(filter_type_name): Accept templates with more than one
	argument.
	(output_mangled_typename): Handle TYPE_UNDEFINED
	(walk_type): Likewise.
	(write_types_process_field): Likewise.
	(write_func_for_structure): If CHAIN_NEXT is set, ORIG_S
	should not be a user-defined type.
	(write_types_local_user_process_field): Handle TYPE_ARRAY,
	TYPE_NONE and TYPE_UNDEFINED.
	(write_types_local_process_field): Likewise.
	(contains_scalar_p): Return 0 for TYPE_USER_STRUCT.
	(write_root): Reject user-defined types that are not pointers.
	Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT
	and TYPE_PARAM_STRUCT.
	(output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and
	TYPE_ARRAY.
	(dump_typekind): Handle TYPE_UNDEFINED.
	* gengtype.h (enum typekind): Add TYPE_UNDEFINED.
	(create_user_defined_type): Declare.
	(enum gty_token): Remove VEC_TOKEN.

2012-11-16  Diego Novillo  <dnovillo@google.com>

	Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec)

	* coretypes.h (uchar): Define.
	* alias.c: Use new vec API in vec.h.
	* asan.c: Likewise.
	* attribs.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* builtins.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopanal.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphclones.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* compare-elim.c: Likewise.
	* coverage.c: Likewise.
	* cprop.c: Likewise.
	* data-streamer.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* domwalk.h: Likewise.
	* dse.c: Likewise.
	* dwarf2cfi.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarf2out.h: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genextract.c: Likewise.
	* genopinit.c: Likewise
	* ggc-common.c: Likewise.
	* ggc.h: Likewise.
	* gimple-low.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimple-streamer-in.c: Likewise.
	* gimple.c: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graph.c: Likewise.
	* graphds.c: Likewise.
	* graphds.h: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-optimize-isl.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-poly.h: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-scop-detection.h: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* godump.c: Likewise.
	* haifa-sched.c: Likewise.
	* hw-doloop.c: Likewise.
	* hw-doloop.h: Likewise.
	* ifcvt.c: Likewise.
	* insn-addr.h: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* ipa-inline-transform.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-inline.h: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-prop.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-ref.c: Likewise.
	* ipa-ref.h: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lra-lives.c: Likewise.
	* lra.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-section-out.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* mcf.c: Likewise.
	* modulo-sched.c: Likewise.
	* omp-low.c: Likewise.
	* opts-common.c: Likewise.
	* opts-global.c: Likewise.
	* opts.c: Likewise.
	* opts.h: Likewise.
	* passes.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* profile.h: Likewise.
	* read-rtl.c: Likewise.
	* ree.c: Likewise.
	* reg-stack.c: Likewise.
	* regrename.c: Likewise.
	* regrename.h: Likewise.
	* reload.c: Likewise.
	* reload.h: Likewise.
	* reload1.c: Likewise.
	* rtl.h: Likewise.
	* sched-deps.c: Likewise.
	* sched-int.h: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* statistics.h: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-browser.c: Likewise.
	* tree-call-cdce.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-chrec.h: Likewise.
	* tree-complex.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-data-ref.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-diagnostic.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-inline.h: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-iterator.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-dce.c: Likewise.
	* tree-ssa-dom.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-im.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-manip.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-operands.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-sccvn.h: Likewise.
	* tree-ssa-strlen.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-tail-merge.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.c: Likewise.
	* tree-stdarg.c: Likewise.
	* tree-streamer-in.c: Likewise.
	* tree-streamer-out.c: Likewise.
	* tree-streamer.c: Likewise.
	* tree-streamer.h: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-generic.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-slp.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* tree-vectorizer.h: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vmsdbgout.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/c6x/c6x.c: Likewise.
	* config/darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/spu/spu-c.c: Likewise.
	* config/vms/vms.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/epiphany/resolve-sw-modes.c: Likewise.

From-SVN: r193595
2012-11-17 21:54:30 -05:00
Jan Hubicka 229a6cdb5a tree.c (set_call_expr_flags): New function.
* tree.c (set_call_expr_flags): New function.
	(local_define_builtin): Use it.
	* tree.h (set_call_expr_flags): Declare.

From-SVN: r193506
2012-11-14 21:08:52 +00:00
Sharad Singhai 2b4e6bf1d5 invoke.texi: Update -fopt-info documentation.
2012-11-01  Sharad Singhai  <singhai@google.com>

    * doc/invoke.texi: Update -fopt-info documentation.
    * dumpfile.c: Move dump_flags here from passes.c.
    Rename opt_info_options to optinfo_verbosity_options.
    Add optgroup_options.
    (dump_files): Add field for optinfo_flags in the static initializer.
    (dump_register): Handle additional parameter for optgroup_flags.
    (opt_info_enable_passes): Renamed opt_info_enable_all. Handle
    optgroup_flags. Fix documentation.
    (opt_info_switch_p_1): Handle optgroup options.
    (opt_info_switch_p): Handle optgroup_flags. Warn on multiple files.
    * dumpfile.h (dump_register): Additional argument for optgroup_flags.
    All callers updated.
    (struct dump_file_info): Add field for optgroup_flags.
    Define OPTGROUP_* flags.
    * tree-pass.h (struct opt_pass): Add addtional field for optinfo_flags.
    All opt_pass static initializers updated.
    * opts-global.c (dump_remap_tree_vectorizer_verbose): Use 'all'
    instead of 'optall'.
    (handle_common_deferred_options): Fix typo in error message.
    * passes.c (register_one_dump_file): Add argument for optgroup_flags.
    Turn on OPTGROUP_IPA for IPA passes.
    Move dump_flags from here to dumpfile.c.
    * statistics.c (statistics_early_init): Use OPTGROUP_NONE in call to
    dump_register.

testsuite/ChangeLog

    * testsuite/gcc.dg/plugin/selfassign.c: Add opgtroup_flags initializer.
    * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise.
    * testsuite/g++.dg/plugin/selfassign.c: Likewise.
    * testsuite/g++.dg/plugin/dumb_plugin.c: Likewise.

From-SVN: r193061
2012-11-01 07:34:44 +00:00
Marc Glisse b72bdd9037 re PR middle-end/55027 (simplify vector multiplication by 1)
2012-10-29  Marc Glisse  <marc.glisse@inria.fr>

	PR middle-end/55027

gcc/
	* tree.c (real_zerop, real_onep, real_twop, real_minus_onep):
	Handle VECTOR_CST.

testsuite/
	* gcc.dg/pr55027.c: New testcase.

From-SVN: r192954
2012-10-29 17:16:51 +00:00
Marc Glisse 93100c6b5b re PR c++/54427 (Expose more vector extensions)
2012-10-25  Marc Glisse  <marc.glisse@inria.fr>

	PR c++/54427

gcc/
	* tree.c (signed_or_unsigned_type_for): Handle vectors.

gcc/cp/
	* typeck.c (build_x_conditional_expr): Handle VEC_COND_EXPR.
	* call.c (build_conditional_expr_1): Likewise.

gcc/c-family/
	* c-common.c (scalar_to_vector): Handle VEC_COND_EXPR.

gcc/testsuite/
	* g++.dg/ext/vector19.C: New testcase.

From-SVN: r192808
2012-10-25 13:02:42 +00:00
Jakub Jelinek 848be0946c re PR debug/54828 (ICE in based_loc_descr at dwarf2out.c:10560 with -g -O0)
PR debug/54828
	* gimple.h (is_gimple_sizepos): New inline function.
	* gimplify.c (gimplify_one_sizepos): Use it.  Remove useless
	final assignment to expr variable.
	* tree.c (RETURN_TRUE_IF_VAR): Return true also if
	!TYPE_SIZES_GIMPLIFIED (type) and _t is going to be gimplified
	into a local temporary.

	* g++.dg/debug/pr54828.C: New test.

From-SVN: r192759
2012-10-24 11:08:56 +02:00
Jan Hubicka b7442c2fe0 tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Add edge_to_cancel parameter and use it to estimate code optimized out in the...
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Add edge_to_cancel
	parameter and use it to estimate code optimized out in the final iteration.
	(loop_edge_to_cancel): New function.
	(try_unroll_loop_completely): New IRRED_IVALIDATED parameter;
	handle unrolling loops with bounds given via max_loop_iteratins;
	handle unrolling non-inner loops when code size shrinks;
	tidy dump output; when the last iteration loop still stays
	as loop in the CFG forcongly redirect the latch to
	__builtin_unreachable.
	(canonicalize_loop_induction_variables): Add irred_invlaidated
	parameter; record niter bound derrived; dump
	max_loop_iterations bounds; call try_unroll_loop_completely
	even if no niter bound is given.
	(canonicalize_induction_variables): Handle irred_invalidated.
	(tree_unroll_loops_completely): Handle non-innermost loops;
	handle irred_invalidated.
	* cfgloop.h (unlop): Declare.
	* cfgloopmanip.c (unloop): Export.
	* tree.c (build_common_builtin_nodes): Build BULTIN_UNREACHABLE.

	* gcc.target/i386/l_fma_float_?.c: Update.
	* gcc.target/i386/l_fma_double_?.c: Update.
	* gfortran.dg/do_1.f90: XFAIL
	* gcc.dg/tree-ssa/cunroll-1.c: New testcase.
	* gcc.dg/tree-ssa/cunroll-2.c: New testcase.
	* gcc.dg/tree-ssa/cunroll-3.c: New testcase.
	* gcc.dg/tree-ssa/cunroll-4.c: New testcase.
	* gcc.dg/tree-ssa/cunroll-5.c: New testcase.
	* gcc.dg/tree-ssa/ldist-17.c: Block cunroll to make testcase still
	valid.

From-SVN: r192538
2012-10-17 17:12:05 +00:00
Dodji Seketeli e28d52cffb PR c++/53528 C++11 attribute support
This patch implements the c++-11 generalized attributes, described in
the N2761 paper[1].

The idea is to modify the front-end to accept the new attribute syntax
(including alignas expressions) and to build an internal
representation similar to the one we already have for GNU attributes.

This lets us re-use our existing GNU attribute mechanisms to support
the generalized c++11 attributes.

The patch does change the existing internal representation to support
scoped attribute (aka attributes with namespaces), which is a concept
that doesn't exist in GNU attributes.  I have thus put all existing
GNU extension attributes into the "gnu" namespace.  For instance, in
C++-11, the "unused" attribute would be represented as
"[[gnu::unused]]".  Because there is no syntax for scoped attributes
in C, writting "__attribute__((unused))" unconditionnally refers to
the "unused" attribute in the "gnu" namespace.

Note that this patch follows a conservative understanding of the
specification by disallowing attributes appertaining to types, unless
they apply to a type definition.

Tested on x86_64-unknown-linux-gnu and powerpc64-unknown-linux-gnu.

[1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf

gcc/
	* plugin.h (register_scoped_attributes): Declare new function.
	* tree.h (enu attribute_flags::ATTR_FLAG_CXX_11): New flag.
	(lookup_scoped_attribute_spec, cxx_11_attribute_p)
	(get_attribute_name, get_attribute_namespace): Declare new functions.
	(struct attribute_spec): Remove const qualifier from the members.
	* tree.c (comp_type_attributes, private_lookup_attribute)
	(lookup_ident_attribute, remove_attribute, merge_attribute)
	(attribute_hash_list, attribute_list_contained): Use
	get_attribute_name.
	* attribs.c (decl_attributes): Don't crash on error_mark_node.
	Forbid c++11 attributes appertaining to type-specifiers.
	(attribute_hash): Remove global variable.
	(attributes_table): New global variable.
	(find_attribute_namespace, register_scoped_attribute): New static
	functions.
	(register_scoped_attributes, lookup_scoped_attribute_spec)
	(cxx11_attribute_p, get_attribute_name, get_attribute_namespace):
	New public functions.
	(init_attributes): Register all the GNU attributes into the "gnu"
	namespace.
	(register_attribute): Use register_scoped_attribute to register
	the attribute into the "gnu" namespace.
	(lookup_attribute_spec): Use lookup_scoped_attribute_spec to
	lookup the attribute in the "gnu" namespace.
	(decl_attributes): Use new get_attribute_namespace and
	lookup_scoped_attribute_spec to consider attribute namespaces when
	looking up attributes.  When operating in c++-11 mode, pass flag
	ATTR_FLAG_CXX11 to the spec handler.

gcc/c-family/

	* c-common.h (bitfield_p, cxx_fundamental_alignment_p): Declare
	new functions.
	* c-common.c (check_cxx_fundamental_alignment_constraints): New
	static function.
	(handle_aligned_attribute): In choose strictest alignment
	among many.  Use new check_cxx_fundamental_alignment_constraints.
	(handle_transparent_union_attribute): In c++11 attribute syntax,
	don't look through typedefs.

gcc/cp/

	* cp-tree.h (enum cpp0x_warn_str::CPP0X_ATTRIBUTES): New member.
	(enum cp_decl_spec::ds_std_attribute): New enumerator.
	(struct cp_decl_specifier_seq::std_attributes): New field.
	(cxx_alignas_expr, warn_misplaced_attr_for_class_type): Declare
	new functions.
	(check_tag_decl): Take an extra parameter for explicit
	instantiations.
	* decl.c (warn_misplaced_attr_for_class_type): Extract from ...
	(check_tag_decl): ... here.  Add check for c++11 attributes being
	applied to an explicit instantiation.  Take an extra parameter for
	explicit instantiations.
	(grokdeclarator): Make sure a c++11 attribute after an array
	declarator appertains to the array, an attribute after a function
	declarator appertains to the function type, an attribute after a
	declarator-id appertains to the entity being declared, and an
	attribute after a pointer declarator appertains to the pointer.
	* decl2.c (is_late_template_attribute): Use get_attribute_name.
	* error.c (maybe_warn_cpp0x): Support
	CPP0X_GENERALIZED_ATTRIBUTES.
	* parser.c (cp_next_tokens_can_be_attribute_p)
	(cp_next_tokens_can_be_gnu_attribute_p)
	(cp_next_tokens_can_be_std_attribute_p)
	(cp_nth_tokens_can_be_attribute_p)
	(cp_nth_tokens_can_be_gnu_attribute_p)
	(cp_nth_tokens_can_be_std_attribute_p)
	(cp_parser_gnu_attribute_list, cp_parser_std_attribute)
	(cp_parser_std_attribute_spec, cp_parser_std_attribute_spec_seq)
	(cp_parser_attributes_opt, cp_parser_std_attribute_list): New
	static functions.
	(cp_parser_gnu_attributes_opt): Replace cp_parser_attributes_opt.
	(cp_parser_gnu_attribute_list): Replace cp_parser_attribute_list.
	(cp_parser_postfix_expression): Disallow "[[" tokens here.
	(cp_parser_label_for_labeled_statement): Use take an extra
	parameter for attributes.
	(cp_parser_block_declaration): Use
	cp_nth_tokens_can_be_std_attribute_p here.
	(cp_parser_decl_specifier_seq): Likewise.  Store C++11 attributes
	that appears in in decl specifiers in cp_decl_specifier_seq::std_attributes.
	declaration.  Emit proper warning about misplaced c++11 attributes
	for class type.
	(cp_parser_explicit_instantiation): Adjust call to check_tag_decl.
	(cp_parser_init_declarator):  Parsing attributes here is no more a
	GNU extension in c++-11.
	(cp_parser_type_specifier_seq): Use
	cp_next_tokens_can_be_attribute_p.
	(cp_parser_direct_declarator): Likewise.  Hang c++11 attributes
	following the declarator to its syntactic construct.  It'll later
	be applied to the proper appertaining entity by grokdeclarator.
	(cp_parser_ptr_operator): Likewise.
	(make_declarator): Initialize cp_declarator::std_attribute.
	(make_pointer_declarator, make_reference_declarator)
	(make_ptrmem_declarator, cp_parser_make_indirect_declarator): Take
	attributes that appertain to the pointer/reference in argument.
	(cp_parser_ptr_operator): Take an out parameter for c++11
	attributes.  Update comments.
	(cp_parser_new_declarator_opt)
	(cp_parser_conversion_declarator_opt): Adjust.
	(cp_parser_declarator): Likewise.  Handle C++11 attributes.
	Rename attributes to gnu_attribute for better legibility.
	(cp_parser_simple_declaration): Update comment.
	(cp_parser_class_specifier_1): Parse GNU attributes specifically
	(cp_parser_enum_specifier): Accept only gnu attributes after the
	specifier.
	(cp_parser_member_declaration): Don't clear attributes -- intended
	for the entity being declared -- too early because check_tag_decl
	needs them.
	(cp_parser_statement): Update comment.  Parse optional c++11
	attributes at the beginning of the relevant kind of statements and
	ignore them, for now, unless when calling
	cp_parser_label_for_labeled_statement.
	(cp_parser_label_for_labeled_statement): Take c++11 attributes
	in parameter.
	* semantics.c (potential_constant_expression_1): Likewise.
	* typeck.c (fundamental_alignment_p, cxx_alignas_expr): New public
	functions.

gcc/testsuite/

	* g++.dg/cpp0x/gen-attrs-1.C: New test.
	* g++.dg/cpp0x/gen-attrs-2.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-2-1.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-3.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-4.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-5.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-6.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-7.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-8.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-9.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-10.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-11.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-12.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-13.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-14.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-15.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-16.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-17.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-18.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-19.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-20.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-21.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-22.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-23.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-24.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-25.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-26.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-27.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-28.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-29.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-30.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-31.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-32.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-33.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-34.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-35.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-36.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-36-1.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-37.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-38.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-39.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-39-1.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-40.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-41.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-42.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-43.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-44.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-45.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-46.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-47.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-47-1.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-48.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-49.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-50.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-51.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-52.C: Likewise.
	* g++.dg/cpp0x/gen-attrs-53.C: Likewise.

From-SVN: r192199
2012-10-08 11:29:05 +02:00
Marc Glisse ae22ac3c62 tree.c (truth_type_for): New function.
2012-09-29  Marc Glisse  <marc.glisse@inria.fr>

	* tree.c (truth_type_for): New function.
	* tree.h (truth_type_for): Declare.
	* gimple-fold.c (and_comparisons_1): Call it.
	(or_comparisons_1): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_into_cond): Don't use
	boolean_type_node for vectors.

From-SVN: r191848
2012-09-29 08:23:23 +00:00
Dehao Chen 5368224f42 Integrate lexical block into source_location.
gcc:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* toplev.c (general_init): Init block_locations.
	* tree.c (tree_set_block): New.
	(tree_block): Change to use LOCATION_BLOCK.
	* tree.h (TREE_SET_BLOCK): New.
	* final.c (reemit_insn_block_notes): Change to use LOCATION_BLOCK.
	(final_start_function): Likewise.
	* input.c (expand_location_1): Likewise.
	* input.h (LOCATION_LOCUS): New.
	(LOCATION_BLOCK): New.
	(IS_UNKNOWN_LOCATION): New.
	* fold-const.c (expr_location_or): Change to use new location.
	* reorg.c (emit_delay_sequence): Likewise.
	(try_merge_delay_insns): Likewise.
	* modulo-sched.c (dump_insn_location): Likewise.
	* lto-streamer-out.c (lto_output_location_bitpack): Likewise.
	* lto-cgraph.c (output_node_opt_summary): Likewise.
	* jump.c (rtx_renumbered_equal_p): Likewise.
	* ifcvt.c (noce_try_move): Likewise.
	(noce_try_store_flag): Likewise.
	(noce_try_store_flag_constants): Likewise.
	(noce_try_addcc): Likewise.
	(noce_try_store_flag_mask): Likewise.
	(noce_try_cmove): Likewise.
	(noce_try_cmove_arith): Likewise.
	(noce_try_minmax): Likewise.
	(noce_try_abs): Likewise.
	(noce_try_sign_mask): Likewise.
	(noce_try_bitop): Likewise.
	(noce_process_if_block): Likewise.
	(cond_move_process_if_block): Likewise.
	(find_cond_trap): Likewise.
	* ipa-prop.c (ipa_set_jf_constant): Likewise.
	(ipa_write_jump_function): Likewise.
	* dwarf2out.c (add_src_coords_attributes): Likewise.
	* expr.c (expand_expr_real): Likewise.
	* tree-parloops.c (create_loop_fn): Likewise.
	* recog.c (peep2_attempt): Likewise.
	* function.c (free_after_compilation): Likewise.
	(expand_function_end): Likewise.
	(set_insn_locations): Likewise.
	(thread_prologue_and_epilogue_insns): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* profile.c (branch_prob): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_block): Likewise.
	* gimplify.c (gimplify_call_expr): Likewise.
	* except.c (duplicate_eh_regions_1): Likewise.
	* emit-rtl.c (try_split): Likewise.
	(make_insn_raw): Likewise.
	(make_debug_insn_raw): Likewise.
	(make_jump_insn_raw): Likewise.
	(make_call_insn_raw): Likewise.
	(emit_pattern_after_setloc): Likewise.
	(emit_pattern_after): Likewise.
	(emit_debug_insn_after): Likewise.
	(emit_pattern_before): Likewise.
	(emit_insn_before_setloc): Likewise.
	(emit_jump_insn_before): Likewise.
	(emit_call_insn_before_setloc): Likewise.
	(emit_call_insn_before): Likeise.
	(emit_debug_insn_before_setloc): Likewise.
	(emit_copy_of_insn_after): Likewise.
	(insn_locators_alloc): Remove.
	(insn_locators_finalize): Remove.
	(insn_locators_free): Remove.
	(set_curr_insn_source_location): Remove.
	(get_curr_insn_source_location): Remove.
	(set_curr_insn_block): Remove.
	(get_curr_insn_block): Remove.
	(locator_scope): Remove.
	(insn_scope): Change to use new location.
	(locator_location): Remove.
	(insn_line): Change to use new location.
	(locator_file): Remove.
	(insn_file): Change to use new location.
	(locator_eq): Remove.
	(insn_locations_init): New.
	(insn_locations_finalize): New.
	(set_curr_insn_location): New.
	(curr_insn_location): New.
	* cfgexpand.c (gimple_assign_rhs_to_tree): Change to use new location.
	(expand_gimple_cond): Likewise.
	(expand_call_stmt): Likewise.
	(expand_gimple_stmt_1): Likewise.
	(expand_gimple_basic_block): Likewise.
	(construct_exit_block): Likewise.
	(gimple_expand_cfg): Likewise.
	* cfgcleanup.c (try_forward_edges): Likewise.
	* tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
	(dump_scope_block): Likewise.
	(remove_unused_locals): Likewise.
	* rtl.c (rtx_equal_p_cb): Likewise.
	(rtx_equal_p): Likewise.
	* rtl.h (XUINT): New.
	(INSN_LOCATOR): Remove.
	(CURR_INSN_LOCATION): Remove.
	(INSN_LOCATION): New.
	(INSN_HAS_LOCATION): New.
	* tree-inline.c (remap_gimple_op_r): Change to use new location.
	(copy_tree_body_r): Likewise.
	(copy_phis_for_bb): Likewise.
	(expand_call_inline): Likewise.
	* tree-streamer-in.c (lto_input_ts_exp_tree_pointers): Likewise.
	* tree-streamer-out.c (write_ts_decl_minimal_tree_pointers): Likewise.
	* gimple-streamer-out.c (output_gimple_stmt): Likewise.
	* combine.c (try_combine): Likewise.
	* tree-outof-ssa.c (set_location_for_edge): Likewise.
	(insert_partition_copy_on_edge): Likewise.
	(insert_value_copy_on_edge): Likewise.
	(insert_rtx_to_part_on_edge): Likewise.
	(insert_part_to_rtx_on_edge): Likewise.
	* basic-block.h (edge_def): Remove field.
	* gimple.h (gimple_statement_base): Remove field.
	(gimple_bb): Change to use new location.
	(gimple_set_block): Likewise.
	(gimple_has_location): Likewise.
	* tree-cfg.c (make_cond_expr_edges): Likewise.
	(make_goto_expr_edges): Likewise.
	(gimple_can_merge_blocks_p): Likewise.
	(move_stmt_op): Likewise.
	(move_block_to_fn): Likewise.
	* config/alpha/alpha.c (alpha_output_mi_thunk_osf): Likewise.
	* config/sparc/sparc.c (sparc_output_mi_thunk): Likewise.
	* config/i386/i386.c (x86_output_mi_thunk): Likewise.
	* config/tilegx/tilegx.c (tilegx_output_mi_thunk): Likewise.
	* config/sh/sh.c (sh_output_mi_thunk): Likewise.
	* config/ia64/ia64.c (ia64_output_mi_thunk): Likewise.
	* config/rs6000/rs6000.c (rs6000_output_mi_thunk): Likewise.
	* config/score/score.c (score_output_mi_thunk): Likewise.
	* config/tilepro/tilepro.c (tilepro_asm_output_mi_thunk): Likewise.
	* config/mips/mips.c (mips_output_mi_thunk): Likewise.
	* cfgrtl.c (unique_locus_on_edge_between_p): Likewise.
	(unique_locus_on_edge_between_p): Likewise.
	(emit_nop_for_unique_locus_between): Likewise.
	(force_nonfallthru_and_redirect): Likewise.
	(fixup_reorder_chain): Likewise.
	(cfg_layout_merge_blocks): Likewise.
	* stmt.c (emit_case_nodes): Likewise.

gcc/lto:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* lto/lto.c (lto_fixup_prevailing_decls): Remove tree.exp.block field.

libcpp:
	2012-09-19  Dehao Chen  <dehao@google.com>

	* include/line-map.h (MAX_SOURCE_LOCATION): New value.
	(location_adhoc_data_fini): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_map): New.
	(COMBINE_LOCATION_DATA): New.
	(IS_ADHOC_LOC): New.
	(expanded_location): New field.
	(line_maps): New field.
	* line-map.c (location_adhoc_data): New.
	(location_adhoc_data_hash): New.
	(location_adhoc_data_eq): New.
	(location_adhoc_data_update): New.
	(get_combined_adhoc_loc): New.
	(get_data_from_adhoc_loc): New.
	(get_location_from_adhoc_loc): New.
	(location_adhoc_data_init): New.
	(location_adhoc_data_fini): New.
	(linemap_init): Initialize location_adhoc_data.
	(linemap_lookup): Change to use new location.
	(linemap_ordinary_map_lookup): Likewise.
	(linemap_macro_map_lookup): Likewise.
	(linemap_macro_map_loc_to_def_point): Likewise.
	(linemap_macro_map_loc_unwind_toward_spel): Likewise.
	(linemap_get_expansion_line): Likewise.
	(linemap_get_expansion_filename): Likewise.
	(linemap_location_in_system_header_p): Likewise.
	(linemap_location_from_macro_expansion_p): Likewise.
	(linemap_macro_loc_to_spelling_point): Likewise.
	(linemap_macro_loc_to_def_point): Likewise.
	(linemap_macro_loc_to_exp_point): Likewise.
	(linemap_resolve_location): Likewise.
	(linemap_unwind_toward_expansion): Likewise.
	(linemap_unwind_to_first_non_reserved_loc): Likewise.
	(linemap_expand_location): Likewise.
	(linemap_dump_location): Likewise.
	(linemap_line_start): Likewise.

From-SVN: r191494
2012-09-19 19:56:42 +00:00
Diego Novillo f32682ca25 Remove unnecessary VEC function overloads.
Several VEC member functions that accept an element 'T' used to have
two overloads: one taking 'T', the second taking 'T *'.

This used to be needed because of the interface dichotomy between
vectors of objects and vectors of pointers.  In the past, vectors of
pointers would use pass-by-value semantics, but vectors of objects
would use pass-by-reference semantics.  This is no longer necessary,
but the distinction had remained.

The main side-effect of this change is some code reduction in code
that manipulates vectors of objects.  For instance,

-  struct iterator_use *iuse;
-
-  iuse = VEC_safe_push (iterator_use, heap, iterator_uses, NULL);
-  iuse->iterator = iterator;
-  iuse->ptr = ptr;
+  struct iterator_use iuse = {iterator, ptr};
+  VEC_safe_push (iterator_use, heap, iterator_uses, iuse);

Compile time performance was not affected.

Tested on x86_64 and ppc64.

Also built all-gcc on all targets using VEC routines: arm, bfin, c6x,
epiphany, ia64, mips, sh, spu, and vms.

2012-09-10  Diego Novillo  <dnovillo@google.com>

	* vec.h (vec_t::quick_push): Remove overload that accepts 'T *'.
	Update all users.
	(vec_t::safe_push): Likewise.
	(vec_t::quick_insert): Likewise.
	(vec_t::lower_bound): Likewise.
	(vec_t::safe_insert): Likewise.
	(vec_t::replace): Change second argument to 'T &'.

From-SVN: r191165
2012-09-10 20:04:13 -04:00
Lawrence Crowl 27bcd47cfa Modify gcc/*.[hc] double_int call sites to use the new interface.
This change entailed adding a few new methods to double_int.

The change results in a 0.163% time improvement with a 70% confidence.

Tested on x86_64.


Index: gcc/ChangeLog

2012-09-06  Lawrence Crowl  <crowl@google.com>

	* double-int.h (double_int::operator &=): New.
	(double_int::operator ^=): New.
	(double_int::operator |=): New.
	(double_int::mul_with_sign): Modify overflow parameter to bool*.
	(double_int::add_with_sign): New.
	(double_int::ule): New.
	(double_int::sle): New.
	(binary double_int::operator *): Remove parameter name.
	(binary double_int::operator +): Likewise.
	(binary double_int::operator -): Likewise.
	(binary double_int::operator &): Likewise.
	(double_int::operator |): Likewise.
	(double_int::operator ^): Likewise.
	(double_int::and_not): Likewise.
	(double_int::from_shwi): Tidy formatting.
	(double_int::from_uhwi): Likewise.
	(double_int::from_uhwi): Likewise.
	* double-int.c (double_int::mul_with_sign): Modify overflow parameter
	to bool*.
	(double_int::add_with_sign): New.
	(double_int::ule): New.
	(double_int::sle): New.
	* builtins.c: Modify to use the new double_int interface.
	* cgraph.c: Likewise.
	* combine.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* gimplify-rtx.c: Likewise.
	* ipa-prop.c: Likewise.
	* loop-iv.c: Likewise.
	* optabs.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-object-size.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-address.c: Likewise.
	* tree-ssa-alias.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-forwprop.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-phiopt.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-sccvn: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.h: Likewise.
	* tree.c: Likewise.
	* varasm.c: Likewise.

From-SVN: r191047
2012-09-07 00:06:35 +00:00
Jakub Jelinek b6b27e9830 tree.c (copy_node_stat): Clear DECL_STRUCT_FUNCTION.
* tree.c (copy_node_stat): Clear DECL_STRUCT_FUNCTION.
fortran/
	* trans-decl.c (trans_function_start, generate_coarray_init,
	create_main_function, gfc_generate_constructors): Call
	allocate_struct_function instead of init_function_start.

From-SVN: r190619
2012-08-23 12:02:40 +02:00
Diego Novillo 0823efedd0 backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).

As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.

Other than the bootstrap change, the patch makes no functional changes to the
compiler.  Everything should build as it does now in trunk.  The main
changes in this patch are:

1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
   user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
   called from gdb.

As discussed before, several of these changes do not fully change
the call sites to use the new APIs.

The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus).  Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.

ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.

	* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
	POSTSTAGE1_CONFIGURE_FLAGS.
	* Makefile.in: Regenerate.
	* configure.ac (ENABLE_BUILD_WITH_CXX): Remove.  Update all users.
	Force C++ when bootstrapping.
	* configure: Regenerate.


libcpp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure.ac: Likewise.
	* configure: Regenerate.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  New C++ hash table.

	* include/symtab.h (typedef struct ht hash_table): Change the typedef
	name to cpp_hash_table.  Update all users of the typedef.

gcc/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* configure.ac (CXX_FOR_BUILD): Define and substitute.
	(BUILD_CXXFLAGS): Define.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	Force all build to be with C++.
	* Makefile.in (BUILD_CXXFLAGS): Use it.
	Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* configure: Regenerate.
	* config.in: Regenerate.
	* doc/install.texi: Remove documentation for --enable-build-with-cxx
	and --enable-build-poststage1-with-cxx.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-implement VEC in C++.

	* vec.c (vec_heap_free): Convert into a template function.
	(vec_gc_o_reserve_1): Make extern.
	(vec_gc_p_reserve): Remove.
	(vec_gc_p_reserve_exact): Remove.
	(vec_gc_o_reserve): Remove.
	(vec_gc_o_reserve_exact): Remove.
	(vec_heap_o_reserve_1): Make extern.
	(vec_heap_p_reserve): Remove.
	(vec_heap_p_reserve_exact): Remove.
	(vec_heap_o_reserve): Remove.
	(vec_heap_o_reserve_exact): Remove.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
	VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
	in the file.
	(VEC): Define to vec_t<T>.
	(vec_allocation_t): Define.
	(struct vec_prefix): Move earlier in the file.
	(vec_t<T>): New template.
	(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
	DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
	DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
	DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
	(DEF_VEC_A): Provide template instantiations for
	GC/PCH markers that do not traverse the vector.
	(vec_stack_p_reserve): Remove.
	(vec_stack_p_reserve_exact): Remove.
	(vec_stack_p_reserve_exact_1): Remove.
	(vec_stack_o_reserve): Remove.
	(vec_stack_o_reserve_exact): Remove.
	(vec_stack_free): Re-write as a template function.
	(vec_reserve): New template function.
	(vec_reserve_exact): New template function.
	(vec_heap_free): New template function if GATHER_STATISTICS is
	defined.  Otherwise, macro that expands to free().
	(VEC_length_1): New template function.
	(VEC_length): Call it.
	(VEC_empty_1): New template function.
	(VEC_empty): Call it.
	(VEC_address_1): New template function.
	(VEC_address): Call it.
	(VEC_last_1): New template function.
	(VEC_last): Call it.  Change return type to T&.
	Change all users that used VEC_Os.
	(VEC_index_1): New template function.
	(VEC_index): Call it.  Return a T& instead of a T*.
	Update all callers that were using VEC_O before.
	(VEC_iterate_1): New template function.
	(VEC_iterate): Call it.
	(VEC_embedded_size_1): New template function.
	(VEC_embedded_size): Call it.
	(VEC_embedded_init_1): New template function.
	(VEC_embedded_init): Call it.
	(VEC_alloc_1): New template function.
	(VEC_alloc): Call it.  If A is 'stack', call XALLOCAVAR to
	do the allocation.
	(VEC_free_1): New template function.
	(VEC_free): Call it.
	(VEC_copy_1): New template function.
	(VEC_copy): Call it.
	(VEC_space_1): New template function
	(VEC_space): Call it.
	(VEC_reserve_1): New template function.
	(VEC_reserve): Call it.
	(VEC_reserve_exact_1): New template function.
	(VEC_reserve_exact): Call it.
	(VEC_splice_1): New template function.
	(VEC_splice): Call it.
	(VEC_safe_splice_1): New template function.
	(VEC_safe_splice): Call it.
	(VEC_quick_push_1): New template function.  Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_quick_push): Call it.
	(VEC_safe_push_1): New template function. Create two overloads, one
	accepting T, the other accepting T *.  Update all callers
	where T and T * are ambiguous.
	(VEC_safe_push): Call it.
	(VEC_pop_1): New template function.
	(VEC_pop): Call it.
	(VEC_truncate_1): New template function.
	(VEC_truncate): Call it.
	(VEC_safe_grow_1): New template function.
	(VEC_safe_grow): Call it.
	(VEC_safe_grow_cleared_1): New template function.
	(VEC_safe_grow_cleared): Call it.
	(VEC_replace_1): New template function.
	(VEC_replace): Call it.  Always accept T instead of T*.
	Update all callers that used VEC_Os.
	(VEC_quick_insert_1): New template function.
	(VEC_quick_insert): Call it.
	(VEC_safe_insert_1): New template function.
	(VEC_safe_insert): Call it.
	(VEC_ordered_remove_1): New template function.
	(VEC_ordered_remove): Call it.
	(VEC_unordered_remove_1): New template function.
	(VEC_unordered_remove): Call it.
	(VEC_block_remove_1): New template function.
	(VEC_block_remove): Call it.
	(VEC_lower_bound_1): New template function.
	(VEC_lower_bound): Call it.
	(VEC_OP): Remove.
	(DEF_VEC_FUNC_P): Remove.
	(DEF_VEC_ALLOC_FUNC_P): Remove.
	(DEF_VEC_NONALLOC_FUNCS_P): Remove.
	(DEF_VEC_FUNC_O): Remove.
	(DEF_VEC_ALLOC_FUNC_O): Remove.
	(DEF_VEC_NONALLOC_FUNCS_O): Remove.
	(DEF_VEC_ALLOC_FUNC_I): Remove.
	(DEF_VEC_NONALLOC_FUNCS_I): Remove.
	(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
	(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
	(vec_reserve_exact): New template function.

	* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
	* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
	(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
	(def_vec_alloc): Remove.  Update all callers.
	* gengtype.c (filter_type_name): New.
	(output_mangled_typename): Call it.
	(write_func_for_structure): Likewise.
	(write_types): Likewise.
	(write_root): Likewise.
	(write_typed_alloc_def): Likewise.
	(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
	(note_def_vec_alloc): Remove.
	* gengtype.h (note_def_vec_alloc): Remove.
	(DEFVEC_ALLOC): Remove token code.

	* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
	inside the insn traversal loop.
	* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
	* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
	* reg-stack.c (stack): Rename to STACK_PTR.  Update all users.
	* tree-vrp.c (stack): Rename to EQUIV_STACK.  Update all users.

	* config/bfin/bfin.c (hwloop_optimize): Update some calls to
	VEC_* for vectors of non-pointers.
	* config/c6x/c6x.c (try_rename_operands): Likewise.
	(reshuffle_units): Likewise.
	* config/mips/mips.c (mips_multi_start): Likewise.
	(mips_multi_add): Likewise.
	(mips_multi_copy_insn): Likewise.
	(mips_multi_set_operand): Likewise.
	* hw-doloop.c (discover_loop): Likewise.
	(discover_loops): Likewise.
	(reorg_loops): Likewise.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  C++ support in gengtype.

	* coretypes.h (gt_pointer_operator): Move from ...
	* ggc.h: ... here.
	* doc/gty.texi: Document support for C++ templates and
	user-provided markers.
	* gcc/gengtype-lex.l: Update copyright year.
	Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
	DEFVEC_I.
	* gengtype-parse.c: Update copyright year.
	(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
	(require_template_declaration): New.
	(typedef_name): Call it.
	(type): Replace IS_UNION with KIND. Replace all users.
	(def_vec): Remove.  Update all users.
	* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
	(write_state_user_struct_type): New.
	(write_state_type): Call it.
	(read_state_user_struct_type): New.
	(read_state_type): Call it.
	* gengtype.c: Update copyright year.
	(dump_pair): Move declaration to the top.
	(dump_type): Likewise.
	(dump_type_list): Likewise.
	(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
	(create_user_defined_type): New.
	(resolve_typedef): Call it.
	(new_structure): Replace argument ISUNION with KIND.
	Change users to refer to KIND directly.
	Update all callers.
	(find_structure): Likewise.
	(set_gc_used_type): Handle TYPE_USER_STRUCT.
	(create_file): Update HDR to include new copyright year.
	(struct walk_type_data): Add field IN_PTR_FIELD.
	(output_mangled_typename): Handle TYPE_USER_STRUCT.
	(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
	Clear it afterwards.
	Handle TYPE_USER_STRUCT.
	(write_types_process_field): Handle TYPE_USER_STRUCT.
	(get_type_specifier): Move earlier in the file.
	(write_type_decl): New.
	(write_marker_function_name): New.
	(write_user_func_for_structure_ptr): New.
	(write_user_func_for_structure_body): New.
	(write_user_marking_functions): New.
	(write_func_for_structure): Call write_marker_function_name
	and write_type_decl.
	Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
	function directly.
	Call write_user_marking_functions on TYPE_USER_STRUCTs.
	(write_types_local_user_process_field): New.
	(write_pch_user_walking_for_structure_body): New.
	(write_pch_user_walking_functions): New.
	(write_types_local_process_field): Handle TYPE_USER_STRUCT.
	(write_local_func_for_structure): Do not call walk_type for
	TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
	Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
	(write_root): Handle TYPE_USER_STRUCT.
	(vec_prefix_type): Remove.  Update all users.
	(note_def_vec): Remove.  Update all users.
	(dump_typekind): Handle TYPE_USER_STRUCT.
	(dump_type): Initialize SEEN_TYPES, if needed.
	Handle TYPE_USER_STRUCT.
	(dump_everything): Do not initialize SEEN_TYPES.
	* gengtype.h: Update copyright year.
	(enum typekind): Add TYPE_USER_STRUCT.
	(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
	Convert into function.
	Add an overload taking const_type_p.
	Update all callers.
	(new_structure): Change second field to type enum typekind.
	Update all users.
	(find_structure): Likewise.
	(note_def_vec): Remove.
	(DEFVEC_OP): Remove.
	(DEFVEC_I): Remove.
	* ggc-page.c (gt_ggc_mx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	* ggc-zone.c (gt_ggc_mx): Add entry points for marking
	'const char *&' and 'unsigned char *&'.
	* stringpool.c (gt_pch_nx): Add entry points for marking
	'const char *&', 'unsigned char *&' and 'unsigned char&'.
	Add an entry point for the overload taking arguments 'unsigned char
	*', 'gt_pointer_operator' and 'void *'.
	* vec.h (struct vec_prefix): Remove GTY marker.
	(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
	(gt_ggc_mx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T> *)): New template function.
	(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
	function.
	(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
	function.

	* basic-block.h (struct edge_def): Mark GTY((user)).
	Remove all GTY markers from fields.
	(gt_ggc_mx): Declare.
	(gt_pch_nx): Declare.
	* tree-cfg.c (gt_ggc_mx): New.
	(gt_pch_nx): New.

	* gengtype-lex.l (USER_GTY): Add pattern for "user".
	* gengtype-parse.c (option): Handle USER_GTY.
	(opts_have): New.
	(type): Call it.
	If the keyword 'user' is used, do not walk the fields
	of the structure.
	* gengtype.h (USER_GTY): Add.
	* doc/gty.texi: Update.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Implement C++ hash table.

	* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
	* hash-table.c: Likewise.
	* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
	(static htab_t same_succ_htab): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(same_succ_print_traverse): Make extern ssa_.... Change callers.
	Remove void* casting.
	(same_succ_hash): Likewise.
	(same_succ_equal): Likewise.
	(same_succ_delete): Likewise.
	* tree-ssa-threadupdate.c: Include hash-table.h.
	(struct local_info): Rename to ssa_local_info_t to avoid overloading
	the type name local_info with the variable name local_info.
	(static htab_t redirection_data): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(redirection_data_hash): Make extern ssa_.... Change callers.
	Remove void* casting.
	(redirection_data_eq): Likewise.
	(fix_duplicate_block_edges): Likewise.
	(create_duplicates): Likewise.
	(fixup_template_block): Likewise.
	(redirect_edges): Likewise.
	(lookup_redirection_data): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	* tree-ssa-ccp.c: Include hash-table.h.
	(typedef gimple_htab): New.  Uses hash_table.  Replace specific uses
	of htab_t with gimple_htab.  Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
	(hash_ssa_name_by_var): Make extern. Remove void* casting.
	(eq_ssa_name_by_var): Likewise.
	(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
	to hash_table. Change users to invoke member functions.
	Move specification of helper functions from create call to declaration.
	* coverage.c: Include hash-table.h instead of hashtab.h.
	(static htab_t counts_hash): Change type to hash_table;
	move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
	of htab_... Remove void* casting.
	(htab_counts_entry_eq): Likewise.
	(htab_counts_entry_del): Likewise.
	* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
	(static htab_t expression_to_id): Change type to hash_table.
	Move specification of helper functions from create call to declaration.
	Change users to invoke member functions.
	(static htab_t phi_translate_table): Likewise.
	(pre_expr_eq): Make extern ssa_.... Change callers.
	Remove void* casting.
	(pre_expr_hash): Likewise.
	(expr_pred_trans_hash): Likewise.
	(expr_pred_trans_eq): Likewise.
	(alloc_expression_id): Change types associated with the hash table
	from void* to their actual type. Remove unnecessary casts.
	(lookup_expression_id): Likewise.
	(phi_trans_lookup): Likewise.
	(phi_trans_add): Likewise.
	* stringpool.c: Rename uses of libcpp typedef hash_table to
	cpp_hash_table.
	* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
	Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge from cxx-conversion branch.  Re-write double_int in C++.

	* hash-table.h
	(typedef double_int): Change to struct (POD).
	(double_int::make): New overloads for int to double-int conversion.
	(double_int::mask): New.
	(double_int::max_value): New.
	(double_int::min_value): New.
	(double_int::operator ++): New.
	(double_int::operator --): New.
	(double_int::operator *=): New.
	(double_int::operator +=): New.
	(double_int::operator -=): New.
	(double_int::to_signed): New.
	(double_int::to_unsigned): New.
	(double_int::fits_unsigned): New.
	(double_int::fits_signed): New.
	(double_int::fits): New.
	(double_int::trailing_zeros): New.
	(double_int::popcount): New.
	(double_int::multiple_of): New.
	(double_int::set_bit): New.
	(double_int::mul_with_sign): New.
	(double_int::operator * (binary)): New.
	(double_int::operator + (binary)): New.
	(double_int::operator - (binary)): New.
	(double_int::operator - (unary)): New.
	(double_int::operator ~ (unary)): New.
	(double_int::operator & (binary)): New.
	(double_int::operator | (binary)): New.
	(double_int::operator ^ (binary)): New.
	(double_int::and_not): New.
	(double_int::lshift): New.
	(double_int::rshift): New.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::lrotate): New.
	(double_int::rrotate): New.
	(double_int::div): New.
	(double_int::sdiv): New.
	(double_int::udiv): New.
	(double_int::mod): New.
	(double_int::smod): New.
	(double_int::umod): New.
	(double_int::divmod): New.
	(double_int::sdivmod): New.
	(double_int::udivmod): New.
	(double_int::ext): New.
	(double_int::zext): New.
	(double_int::sext): New.
	(double_int::is_zero): New.
	(double_int::is_one): New.
	(double_int::is_minus_one): New.
	(double_int::is_negative): New.
	(double_int::cmp): New.
	(double_int::ucmp): New.
	(double_int::scmp): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int::max): New.
	(double_int::smax): New.
	(double_int::umax): New.
	(double_int::min): New.
	(double_int::smin): New.
	(double_int::umin): New.
	(double_int::operator ==): New.
	(double_int::operator !=): New.
	(shwi_to_double_int): Change implementation to use member function.
	(double_int_minus_one): Likewise.
	(double_int_zero): Likewise.
	(double_int_one): Likewise.
	(double_int_two): Likewise.
	(double_int_ten): Likewise.
	(uhwi_to_double_int): Likewise.
	(double_int_to_shwi): Likewise.
	(double_int_to_uhwi): Likewise.
	(double_int_fits_in_uhwi_p): Likewise.
	(double_int_fits_in_shwi_p): Likewise.
	(double_int_fits_in_hwi_p): Likewise.
	(double_int_mul): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_setbit): Likewise.
	(double_int_ctz): Likewise.
	(double_int_not): Likewise.
	(double_int_ior): Likewise.
	(double_int_and): Likewise.
	(double_int_and_not): Likewise.
	(double_int_xor): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_ext): Likewise.
	(double_int_sext): Likewise.
	(double_int_zext): Likewise.
	(double_int_mask): Likewise.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_zero_p): Likewise.
	(double_int_one_p): Likewise.
	(double_int_minus_one_p): Likewise.
	(double_int_equal_p): Likewise.
	(double_int_popcount): Likewise.
	* hash-table.c
	(double_int_mask): Reuse implementation for double_int::mask.
	(double_int_max_value): Likewise.
	(double_int_min_value): Likewise.
	(double_int_ext): Likewise.
	(double_int_zext): Likewise.
	(double_int_sext): Likewise.
	(double_int_mul_with_sign): Likewise.
	(double_int_divmod): Likewise.
	(double_int_sdivmod): Likewise.
	(double_int_udivmod): Likewise.
	(double_int_div): Likewise.
	(double_int_sdiv): Likewise.
	(double_int_udiv): Likewise.
	(double_int_mod): Likewise.
	(double_int_smod): Likewise.
	(double_int_umod): Likewise.
	(double_int_multiple_of): Likewise.
	(double_int_lshift): Likewise.
	(double_int_rshift): Likewise.
	(double_int_lrotate): Likewise.
	(double_int_rrotate): Likewise.
	(double_int_cmp): Likewise.
	(double_int_ucmp): Likewise.
	(double_int_scmp): Likewise.
	(double_int_max): Likewise.
	(double_int_smax): Likewise.
	(double_int_umax): Likewise.
	(double_int_min): Likewise.
	(double_int_smin): Likewise.
	(double_int_umin): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int_min): Likewise.
	(double_int::alshift): New.
	(double_int::arshift): New.
	(double_int::llshift): New.
	(double_int::lrshift): New.
	(double_int::ult): New.
	(double_int::ugt): New.
	(double_int::slt): New.
	(double_int::sgt): New.
	(double_int_setbit): Reuse implementation for double_int::set_bit,
	which avoids a name conflict with a macro.
	(double_int_double_int_ctz): Reuse implementation for
	double_int::trailing_zeros.
	(double_int_fits_in_shwi_p): Reuse implementation for
	double_int::fits_signed.
	(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
	(double_int_mul): Reuse implementation for binary
	double_int::operator *.
	(double_int_add): Likewise.
	(double_int_sub): Likewise.
	(double_int_neg): Reuse implementation for unary
	double_int::operator -.
	(double_int_max_value): Likewise.
	* fixed-value.c: Change to use member functions introduced above.

2012-08-14   Lawrence Crowl  <crowl@google.com>

	Merge cxx-conversion branch.  Support tree macro calling
	from gdb.

	* tree.h (tree_check): New.
	(TREE_CHECK): Use inline function above instead of __extension__.
	(tree_not_check): New.
	(TREE_NOT_CHECK): Use inline function above instead of __extension__.
	(tree_check2): New.
	(TREE_CHECK2): Use inline function above instead of __extension__.
	(tree_not_check2): New.
	(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
	(tree_check3): New.
	(TREE_CHECK3): Use inline function above instead of __extension__.
	(tree_not_check3): New.
	(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
	(tree_check4): New.
	(TREE_CHECK4): Use inline function above instead of __extension__.
	(tree_not_check4): New.
	(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
	(tree_check5): New.
	(TREE_CHECK5): Use inline function above instead of __extension__.
	(tree_not_check5): New.
	(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
	(contains_struct_check): New.
	(CONTAINS_STRUCT_CHECK): Use inline function above instead of
	__extension__.
	(tree_class_check): New.
	(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
	(tree_range_check): New.
	(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
	(omp_clause_subcode_check): New.
	(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_range_check): New.
	(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
	__extension__.
	(expr_check): New.
	(EXPR_CHECK): Use inline function above instead of __extension__.
	(non_type_check): New.
	(NON_TYPE_CHECK): Use inline function above instead of __extension__.
	(tree_vec_elt_check): New.
	(TREE_VEC_ELT_CHECK): Use inline function above instead of
	__extension__.
	(omp_clause_elt_check): New.
	(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check): New.
	(TREE_OPERAND_CHECK): Use inline function above instead of
	__extension__.
	(tree_operand_check_code): New.
	(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
	__extension__.
	(TREE_CHAIN): Simplify implementation.
	(TREE_TYPE): Simplify implementation.
	(tree_operand_length): Move for compilation dependences.
	* gdbinit.in: (macro define __FILE__): New.
	(macro define __LINE__): New.
	(skip "tree.h"): New.

gcc/cp/ChangeLog
2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Re-write VEC in C++.

	* call.c (add_function_candidate): Remove const qualifier
	from call to VEC_index.

2012-08-14   Diego Novillo  <dnovillo@google.com>

	Merge from cxx-conversion branch.  Configury.

	* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
	* go-gcc.cc: Likewise.
	* go-system.h: Likewise.

From-SVN: r190402
2012-08-14 21:56:07 -04:00
Jakub Jelinek eb87c7c489 re PR c/53968 (integer undefined behaviors in GCC)
PR c/53968
	* tree.c (integer_pow2p): Avoid undefined signed overflows.
	* simplify-rtx.c (neg_const_int): Likewise.
	* expr.c (fixup_args_size_notes): Likewise.
	* stor-layout.c (set_min_and_max_values_for_integral_type): Likewise.
	* double-int.c (mul_double_wide_with_sign): Likewise.
	(double_int_mask): Likewise.
	* tree-ssa-loop-ivopts.c (get_address_cost): Likewise.

From-SVN: r190342
2012-08-13 14:39:54 +02:00
Richard Guenther 70b5e7dc73 tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var.
2012-08-10  Richard Guenther  <rguenther@suse.de>

	* tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE
	is recorded as var.
	(SSA_NAME_IDENTIFIER): Return the IDENTIFIER_NODE of the SSA_NAME
	or its SSA_NAME_VAR.
	(SET_SSA_NAME_VAR_OR_IDENTIFIER): New setter.
	* tree-ssanames.c (make_ssa_name_fn): Handle creating anonymous
	SSA names by passing a type instead of a variable decl.
	(release_ssa_name): Use SET_SSA_NAME_VAR_OR_IDENTIFIER.
	(copy_ssa_name_fn): Handle anonymous SSA names.
	(replace_ssa_name_symbol): Use SET_SSA_NAME_VAR_OR_IDENTIFIER.
	* tree-flow-inline.h (make_temp_ssa_name): New inline function.
	* tree-pretty-print.c (dump_generic_node): Use SSA_NAME_IDENTIFIER,
	dump SSA names without a name as <anon>.
	* cfgexpand.c (expand_used_vars): Assing anonymous SSA names we are
	going to expand a decl.
	(gimple_expand_cfg): Assign all SSA names of a partition the
	decl we created for its leader.
	* tree-ssa.c (target_for_debug_bind): Handle SSA_NAMEs.
	(verify_ssa_name): Handle anonymous SSA names.
	(verify_def): Likewise.
	* tree-predcom.c (eliminate_temp_copies): Likewise.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise.
	* tree-ssa-live.c (var_map_base_init): Compute conflicts for
	anonymous SSA names with the same type.
	(mark_all_vars_used_1): Handle anonymous SSA names.
	(verify_live_on_entry): Likewise.
	* tree-ssa-coalesce.c (abnormal_corrupt): Remove.
	(create_outofssa_var_map): Adjust with respect to conflicts we
	compute for anonymous SSA names.  Do not restrict abnormal
	coalescing.
	(coalesce_partitions): Do not restrict abnormal coalescing.
	Assert we only ever coalesce variables we computed conflicts for.
	* tree-ssa-ter.c (process_replaceable): Do not restrict TER
	of anonymous names.
	* expr.c (expand_expr_real_1): Handle anonymous SSA names
	expanded from IVOPTs by creating a raw REG here.
	* tree-cfg.c (replace_ssa_name): Handle anonymous SSA names.
	(dump_function_to_file): Dump anonymous SSA names alongside
	with their types in the variable list.
	(verify_gimple_return): Guard use of SSA_NAME_VAR.
	* tree-into-ssa.c (mark_for_renaming): Handle a NULL symbol.
	(rewrite_into_ssa): Make SSA names anonymous.
	* tree-ssa-structalias.c (alias_get_name): Rewrite.
	* tree-ssa-uninit.c (ssa_undefined_value_p): Handle anonymous
	SSA names.
	(warn_uninitialized_phi): Likewise.
	* tree-ssa-loop-ivopts.c (prepare_decl_rtl): Defer expanding
	anonymous SSA names to the expander.
	(determine_iv_cost): Anonymous SSA names are artificial.
	* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop):
	Handle anonymous SSA names.
	* lto-streamer-out.c (output_ssa_names): Stream SSA_NAME_VAR
	or if NULL, the type of the SSA name.
	* tree-inline.c (remap_ssa_name): Handle anonymous SSA names,
	remap names as anonymous where appropriate.
	(insert_init_stmt): Pass SSA names down to insert_init_debug_bind.
	* tree-ssa-uncprop.c (uncprop_into_successor_phis): Adjust
	according to what we create conflicts for in out-of-SSA
	coalescing.
	* tree-parloops.c (separate_decls_in_region_name): Handle
	anonymous SSA names.
	(add_field_for_name): Likewise.
	* tree.c (get_name): Handle SSA names.
	* tree-ssa-loop-im.c (gen_lsm_tmp_name): Defer to get_name for
	SSA_NAMEs.
	* tree-vect-loop-manip.c (adjust_debug_stmts): Use
	virtual_operand_p.
	* tree-sra.c (create_access_replacement): Give up generating
	a DECL_DEBUG_EXPR for SSA names in the memory reference.
	(replace_removed_params_ssa_names): Guard use of SSA_NAME_VAR.
	* tree-complex.c (get_component_ssa_name): Handle anonymous
	SSA names.
	(set_component_ssa_name): Likewise.
	* tree-ssa-sccvn.c (visit_reference_op_load): Likewise.
	* tree-object-size.c (collect_object_sizes_for): Handle
	uninitialized SSA names properly.
	* ipa-inline-analysis.c (eliminated_by_inlining_prob): Guard use of
	SSA_NAME_VAR.
	* ipa-split.c (test_nonssa_use): Likewise.
	(consider_split): Likewise.
	(mark_nonssa_use): Likewise.

	c-family/
	* c-pretty-print.c (pp_c_expression): Handle anonymous SSA names.

	cp/
	* error.c (dump_expr): Likewise.

	* g++.dg/plugin/selfassign.c: Adjust.
	* gcc.dg/plugin/selfassign.c: Likewise.
	* gcc.dg/strlenopt-11.c: Likewise.
	* gcc.dg/strlenopt-13.c: Likewise.
	* gcc.dg/no-strict-overflow-4.c: Likewise.
	* gcc.dg/strict-overflow-4.c: Likewise.
	* gcc.dg/tree-ssa/alias-11.c: Likewise.
	* gcc.dg/tree-ssa/alias-6.c: Likewise.
	* gcc.dg/tree-ssa/asm-3.c: Likewise.
	* gcc.dg/tree-ssa/pr18908.c: Likewise.
	* gcc.dg/tree-ssa/pr19431.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-21.c: Likewise.
	* gcc.dg/tree-ssa/phi-opt-10.c: Likewise.
	* gcc.dg/tree-ssa/phi-opt-7.c: Likewise.
	* gcc.dg/tree-ssa/slsr-27.c: Likewise.
	* gcc.dg/tree-ssa/slsr-28.c: Likewise.
	* gcc.dg/tree-ssa/slsr-29.c: Likewise.
	* gcc.dg/pr46309.c: Likewise.
	* gcc.dg/tree-ssa/loop-5.c: Likewise.

From-SVN: r190284
2012-08-10 08:29:29 +00:00
Richard Guenther 6b4a85ad6f tree-call-cdce.c (check_pow): Simplify.
2012-08-08  Richard Guenther  <rguenther@suse.de>

	* tree-call-cdce.c (check_pow): Simplify.
	(gen_conditions_for_pow_int_base): Likewise.
	* tree-ssa-dom.c (propagate_rhs_into_lhs): Do not handle
	virtual operands here.
	* tree-ssa-operands.c (get_name_decl): Remove unused function.
	* gimplify.c (gimple_regimplify_operands): Remove dead code.
	* tree-vrp.c (get_value_range): Move SSA_NAME_VAR access.
	* tree-parloops.c (create_phi_for_local_result): Use copy_ssa_name.
	* value-prof.c (gimple_ic): Use duplicate_ssa_name.
	(gimple_stringop_fixed_value): Likewise.
	* tree.c (needs_to_live_in_memory): Remove SSA name handling.
	* tree-stdarg.c (find_va_list_reference): Store SSA_NAME_VERSIONs
	in the bitmap alongside shifted DECL_UIDs.
	(va_list_counter_struct_op): Likewise.
	(va_list_ptr_read): Likewise.
	(va_list_ptr_write): Likewise.
	(check_va_list_escapes): Likewise.
	(check_all_va_list_escapes): Likewise.
	(execute_optimize_stdarg): Likewise.
	* tree-outof-ssa.c (insert_backedge_copies): Use copy_ssa_name.

From-SVN: r190229
2012-08-08 14:40:30 +00:00
Michael Matz 5f564b8f56 tree-complex.c (init_parameter_lattice_values): Don't call var_ann.
* tree-complex.c (init_parameter_lattice_values): Don't call var_ann.
	* tree-dfa.c (struct dfa_stats_d): Remove num_var_anns member.
	(dump_dfa_stats): Don't dump stats about var anns.
	(collect_dfa_stats): Don't collect them.
	(add_referenced_var_1): Don't set var annotation pointers.
	(remove_referenced_var): Ditto, and only remove it it's in the
	hash table.

	* tree-flow-inline.h (var_ann): Remove.
	* tree-flow.h (struct var_ann_d, var_ann_t): Remove.

	* tree-inline.c (remapped_type): Remove.
	(can_be_nonlocal): Most variable will be considered live here,
	return false earlier.
	(remap_decls): Don't call var_ann, all variables will be considered
	referenced here.
	(copy_debug_stmt): Ditto, and use is_global_var.

	* tree-into-ssa.c (rewrite_debug_stmt_uses): Use get_current_def to
	determine if a variable was referred to, not var_ann.
	* tree-ssa-live.c (remove_unused_scope_block_p): Don't check var_ann.
	(remove_unused_locals): Ditto.
	* tree-ssa.c (delete_tree_ssa): Don't free/clear var ann pointers.
	* tree-tailcall.c (arg_needs_copy_p): Don't check var_ann.
	* tree.c (copy_node_stat): Don't clear var ann pointer.
	* tree.h (tree_result_decl, tree_parm_decl, tree_var_decl): Remove
	ann member.
	(DECL_VAR_ANN_PTR): Remove.

	* tree-flow.h (struct var_ann_d): Rename used member.
	(set_is_used): Don't declare.
	* tree-flow-inline.h (clear_is_used): Remove.
	(set_is_used, is_used_p): Move to ...
	* tree-ssa-live.c (set_is_used, is_used_p): ... here, and use
	on the side bitmap.
	(usedvars): New bitmap.
	(dump_scope_block): Don't dump unusedness.
	(remove_unused_locals): Allocate and free usedvars.
	* tree-nrv.c (tree_nrv): Don't clear used flags here.

	* tree-flow.h (struct var_ann_d): Remove base_var_processed and
	base_index members.
	* tree-ssa-live.h (struct _var_map): Remove basevars member.
	(VAR_ANN_BASE_INDEX): Remove.
	* tree-ssa-live.c (var_map_base_init): Use a hash table instead
	of var annotation to compress index space.  Don't deal with above
	removed members.
	(var_map_base_fini): Don't free basevars.
	(init_var_map): Don't clear basevars.

From-SVN: r190039
2012-08-01 14:58:38 +00:00
Eric Botcazou ea814c6675 expr.c (expand_expr_real_1): Do not expand operand #1 and #2 of BIT_FIELD_REF for ignored results.
* expr.c (expand_expr_real_1): Do not expand operand #1 and #2
	of BIT_FIELD_REF for ignored results.
	* fold-const.c (fold_ternary_loc) <BIT_FIELD_REF>: Check that the
	CONSTRUCTOR has vector type before using vector accessors on it.
	* gimplify.c (gimplify_compound_lval): Do not gimplify operand #1 and
	#2 of BIT_FIELD_REF.
	(gimplify_expr) <BIT_FIELD_REF>: Likewise.
	* tree-nested.c (convert_nonlocal_reference_op) <BIT_FIELD_REF>: Do
	not process operand #1 and #2.
	(convert_local_reference_op): Likewise.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Remove superfluous
	breaks throughout.
	<BIT_FIELD_REF>: Reuse operand #1 and #2 directly.
	* tree.c (stabilize_reference) <BIT_FIELD_REF>: Do not stabilize
	operand #1 and #2.
	(UPDATE_FLAGS): Do not consider operand #2 of BIT_FIELD_REF.
	(build6_stat): Delete.
	* tree.h (build6_stat, build6, build6_stat_loc, build6_loc): Likewise.
ada/
	* gcc-interface/utils2.c (gnat_stabilize_reference) <BIT_FIELD_REF>: Do
	not stabilize operand #1 and #2.

From-SVN: r189864
2012-07-25 19:43:15 +00:00
Steven Bosscher 7aa6d18a7c sbitmap.h (SBITMAP_ELT_BITS): Use "1u" trick as for BITMAP_WORD_BITS.
gcc/
	* sbitmap.h (SBITMAP_ELT_BITS): Use "1u" trick as for BITMAP_WORD_BITS.
	Move test to check that there is a popcount function for the the number
	of bits in SBITMAP_ELT_BITS to sbitmap.c.
	* sbitmap.c: Test SBITMAP_ELT_BITS, not HOST_BITS_PER_WIDEST_FAST_INT.
	MEM_STAT_INFO): Define in terms of their ALONE counterparts.

	* configure.ac (GATHER_STATISTICS): Always define, non-zero if enabled.
	* configure: Regenerate.
	* statistics.h (GATHER_STATISTICS): Error out if it is not defined.
	(GCC_MEM_STAT_ARGUMENTS): New define.
	(ALONE_MEM_STAT_DECL): Define in terms of GCC_MEM_STAT_ARGUMENTS.
	(ALONE_FINAL_MEM_STAT_DECL, ALONE_FINAL_PASS_MEM_STAT): New defines.
	(MEM_STAT_DECL, FINAL_MEM_STAT_DECL, PASS_MEM_STAT, FINAL_PASS_MEM_STAT,
	* ggc-internal.h (ggc_record_overhead): Use FINAL_MEM_STAT_DECL.
	* ggc.h (ggc_record_overhead, ggc_free_overhead,
	ggc_prune_overhead_list): Remove internal prototypes, they are defined
	already in ggc-internal.h.
	* ggc-common.c (struct loc_descriptor): Remove #ifdef GATHER_STATISTICS
	wrappers.
	(add_statistics): Likewise.
	(dump_ggc_loc_statistics): Likewise. Return if GATHER_STATISTICS is 0. 
	* ggc-zone.c (struct page_entry): Remove #ifdef GATHER_STATISTICS
	wrappers around "survived" and "stats" members.
	(alloc_large_page): Always initialize survived.
	(ggc_internal_alloc_zone_stat): Likewise.
	Remove #ifdef GATHER_STATISTICS wrappers.  Record overhead if
	GATHER_STATISTICS is non-0.
	(ggc_free): Convert #ifdef GATHER_STATISTICS to if-code.
	(sweep_pages): Always increase survived.
	(ggc_collect_1): Convert #ifdef GATHER_STATISTICS to if-code.
	(calculate_average_page_survival): Always define.
	(ggc_collect): Convert #ifdef GATHER_STATISTICS to if-code.
	(ggc_print_statistics): Likewise.
	(ggc_pch_read): Likewise.
	* ggc-page.c (struct globals): Always define "stats" member.
	(ggc_internal_alloc_stat): Convert #ifdef GATHER_STATISTICS to if-code.
	(ggc_free): Likewise.
	(ggc_collec): Likewise.
	(ggc_print_statistics): Likewise.
	* bitmap.h (struct bitmap_head_def): Always define "desc" member.
	(bitmap_initialize_stat): Convert #ifdef GATHER_STATISTICS to if-code.
	* gimple.h (enum gimple_alloc_kind): Always define.
	(gimple_alloc_kind): Likewise.
	* tree-flow.h (phinodes_print_statistics): Always define.
	(ssanames_print_statistics): Likewise.
	* vec.h (vec_heap_free): Always define.
	(VEC_stack_alloc): Define if GATHER_STATISTICS is non-0.
	* alloc-pool.c (alloc_pool_descriptor): Always define.
	(create_alloc_pool): Convert #ifdef GATHER_STATISTICS to if-code.
	(empty_alloc_pool): Likewise.
	(pool_alloc): Likewise.
	(pool_free): Likewise.
	(dump_alloc_pool_statistics): Likewise.
	(print_statistics): Always define.
	* bitmap.c (struct bitmap_descriptor): Always define.
	(bitmap_register): Pass ALONE_FINAL_PASS_MEM_STAT.
	(register_overhead): Always define.
	(bitmap_element_free): Convert #ifdef GATHER_STATISTICS to if-code.
	(bitmap_element_allocate): Likewise.
	(bitmap_elt_clear_from): Likewise.
	(bitmap_obstack_alloc_stat): Likewise.
	(bitmap_gc_alloc_stat): Likewise.
	(bitmap_obstack_free): Likewise.
	(bitmap_find_bit): Likewise.
	(bitmap_ior_and_into):  Likewise.
	(bitmap_print): Likewise.
	(dump_bitmap_statistics): Likewise. Return if GATHER_STATISTICS is 0.
	* gimple.c (gimple_alloc_counts, gimple_alloc_sizes): Always define.
	(gimple_alloc_kind_names): Likewise.
	(gimple_alloc_stat): Convert #ifdef GATHER_STATISTICS to if-code.
	(dump_gimple_statistics): Likewise. Return if GATHER_STATISTICS is 0.
	* rtl.c (rtx_alloc_counts, rtx_alloc_sizes, rtvec_alloc_counts,
	rtvec_alloc_sizes): Always define.
	(rvec_alloc): Convert #ifdef GATHER_STATISTICS to if-code.
	(rtx_alloc_stat): Likewise.
	(dump_rtx_statistics): Likewise. Return if GATHER_STATISTICS is 0.
	* tree.c (_obstack_allocated_p, tree_code_counts, tree_node_counts,
	tree_node_sizes, tree_node_kind_names): Always define.
	(record_node_allocation_statistics): Convert #ifdef GATHER_STATISTICS
	to if-code.
	(type_hash_canon): Likewise.
	(dump_tree_statistics): Likewise.
	* tree-ssanames.c (ssa_name_nodes_reused, ssa_name_nodes_created):
	Always define.
	(ssanames_print_statistics): Likewise.
	(make_ssa_name_fn): Convert #ifdef GATHER_STATISTICS to if-code.
	* tree-phinodes.c (phi_nodes_reused, phi_nodes_created): Always define.
	(phinodes_print_statistics): Likewise.
	(allocate_phi_node): Convert #ifdef GATHER_STATISTICS to if-code.
	* vec.c (struct vec_descriptor): Always define.
	(hash_descriptor, eq_descriptor, ptr_hash_entry, hash_ptr, eq_ptr,
	vec_descriptor, rester_overhead, free_overhead): Likewise.
	(cmp_statistic): Likewise.
	(vec_heap_free): Convert #ifdef GATHER_STATISTICS to if-code.
	(vec_heap_o_reserve_1): Likewise.
	(dump_vec_loc_statistics): Likewise.

cp/
	* cp/class.c (n_vtables, n_vtable_entries, n_vtable_searches,
	n_vtable_elems, n_convert_harshness, n_compute_conversion_costs,
	n_inner_fields_searched): Always define.
	(build_primary_vtable): Convert #ifdef GATHER_STATISTICS to if-code.
	(print_class_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
	* cp/tree.c (depth_reached): Always define global.
	(cxx_print_statistics): Convert #ifdef GATHER_STATISTICS to if-code.
	* cp/pt.c (depth_reached): Always define.
	(push_tinst_level): Convert #ifdef GATHER_STATISTICS to if-code.
	* cp/search.c (n_fields_searched, n_calls_lookup_field,
	n_calls_lookup_field_1, n_calls_lookup_fnfields,
	n_calls_lookup_fnfields_1, n_calls_get_base_type,
	n_outer_fields_searched, n_contexts_saved): Always define.
	(lookup_field_1): Convert #ifdef GATHER_STATISTICS to if-code.
	(lookup_member): Likewise.
	(lookup_fnfields_idx_nolazy): Likewise.
	(print_search_statistics): Likewise.
	(reinit_search_statistics): Unconditionally re-set counters.
	* cp/lex.c (retrofit_lang_decl): Convert #ifdef GATHER_STATISTICS
	to if-code.
	(cxx_dup_lang_specific_decl): Likewise.
	(copy_lang_type): Likewise.
	(cxx_make_type): Likewise.

From-SVN: r189803
2012-07-24 09:49:56 +00:00
Steven Bosscher 7ee2468b92 system.h (dump_file): Do not define.
gcc/
	* system.h (dump_file): Do not define.
	* tree-pass.h: Include dumpfile.h, which is a new file containing...
	(enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p,
	dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p,
	dump_flag_name, dump_file, dump_flags, dump_file_name,
	get_dump_file_info, struct dump_file_info): all of this, moved to...
	* dumpfile.h: Here, new file.
	* tree-dump.h: Include dumpfile.h, but not tree-pass.h.
	(dump_stmt): Remove prototype for C++ specific function.
	(dump_enumerated_decls): Move prototype from here...
	* tree-flow.h (dump_enumerated_decls): ... to here.
	(get_ref_base_and_extent) Move prototype from here ...
	* tree.h (get_ref_base_and_extent) ... to here.
	* tree-ssa-live.c: Do not inclde tree-pretty-print.h, because
	gimple-pretty-print.h is enough.  Do not include tree-dump.h,
	include timevar.h and dumpfile.h instead.
	(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls): Move from here ...
	* tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid,
	dump_enumerated_decls_push, dump_enumerated_decls):... to here.
	Do not include timevar.h.
	* tree.c: Do not include timevar.h.
	* tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and
	timevar.h.
	(dump_cfg_stats): Use current_function_name.
	(gimple_cfg2vcg): Likewise.
	(dump_function_to_file): Likewise.
	* df-scan.c: Do not include tree-pass.h and timevar.h.
	Include dumpfile.h.
	(df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not
	use print_current_pass.
	* df-problems.c: Include dumpfile.h.
	Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it
	leads to errors in the code not selected.
	(df_note_compute): Do not print_rtl_with_bb here.  Fix compilation
	bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here.
	* lcm.c: Include dumpfile.h.
	Remove obsolete include of insn-attr.h.
	* dojump.c (do_compare_rtx_and_jump): Remove failure printing for
	missing probability notes.
	* stmt.c: Include dumpfile.h.
	(emit_case_decision_tree): Re-enable printing expand details only
	if TDF_DETAILS.
	* alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, 
	cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, 
	cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, 
	coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, 
	dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, 
	function.c, fwprop.c, gcse.c, gimple-fold.c, 
	gimple-pretty-print.c, gimple-ssa-strength-reduction.c, 
	gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, 
	graphite-dependences.c, graphite-interchange.c, 
	graphite-optimize-isl.c, graphite-poly.c, 
	graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, 
	ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, 
	ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, 
	ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, 
	jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, 
	loop-unroll.c, loop-unswitch.c, lower-subreg.c, 
	lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, 
	mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, 
	plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, 
	print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, 
	regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, 
	sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, 
	store-motion.c, tracer.c, trans-mem.c, tree-affine.c, 
	tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, 
	tree-data-ref.c, tree-diagnostic.c, tree-dump.c,
	tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, 
	tree-mudflap.c, tree-nrv.c, tree-object-size.c, 
	tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, 
	tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, 
	tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, 
	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, 
	tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, 
	tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, 
	tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, 
	tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, 
	tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, 
	tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, 
	tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, 
	tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, 
	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, 
	tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, 
	tree-ssa-threadedge.c, tree-ssa-threadupdate.c, 
	tree-ssa-uncprop.c, tree-ssa-uninit.c, 
	tree-switch-conversion.c, tree-tailcall.c, 
	tree-vect-data-refs.c, tree-vect-loop.c, 
	tree-vect-loop-manip.c, tree-vectorizer.c, 
	tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, 
	tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h
	only if needed.  If tree-pass.h is included, do not include timevar.h
	and dumpfile.h.  If tree-pass.h is not included but dump_file, or
	dump_flags, or the TDF_* flags are used, include dumpfile.h.
	If gimple-pretty-print.h is included, don't include tree-pretty-print.h.
	Remove assorted unnecessary includes.

	* config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c,
	config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
	config/spu/spu.c, config/mep/mep.c, config/i386/i386.c:
	Include dumpfile.h.
	* config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h.
	* arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep,
	spu/t-spu-elf: Fix dependencies.

c-family/
	* c-gimplify.c: Include dumpfile.h instead of tree-dump.h.
	* c-ada-spec.c: Likewise.
	* c-dump.c (dump_stmt): Move to cp/dump.c, the only user.

c/
	* c-decl.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

cp/
	* dump.c (dump_stmt): Moved here from c-dump.c.
	* optimize.c: Include dumpfile.h instead of tree-dump.h.
	* class.c: Likewise.
	* decl2.c: Likewise.
	* Make-lang.in: Fix dependencies.

fortran/
	* f95-lang.c: Include dumpfile.h instead of tree-dump.h.
	* Make-lang.in: Fix dependencies.

java/
	* java-gimplify.c Include dumpfile.h instead of tree-dump.h
	* Make-lang.in: Fix dependencies.

lto/
	* lto.c: Do not include timevar.h.
	* Make-lang.in: Fix dependencies.

ada/
	* gcc-interface/utils.c: Include timevar.h.
	* Make-lang.in: Fix dependencies.

From-SVN: r189519
2012-07-16 11:32:42 +00:00
Richard Henderson 3f30a9a6aa Add VEC_WIDEN_MULT_EVEN/ODD_EXPR
* tree.def (VEC_WIDEN_MULT_EVEN_EXPR, VEC_WIDEN_MULT_ODD_EXPR): New.
        * cfgexpand.c (expand_debug_expr): Handle them.
        * expr.c (expand_expr_real_2): Likewise.
        * fold-const.c (fold_binary_loc): Likewise.
        * gimple-pretty-print.c (dump_binary_rhs): Likewise.
        * optabs.c (optab_for_tree_code): Likewise.
        * tree-cfg.c (verify_gimple_assign_binary): Likewise.
        * tree-inline.c (estimate_operator_cost): Likewise.
        * tree-pretty-print.c (dump_generic_node): Likewise.
        * tree.c (commutative_tree_code): Likewise.
        * tree-vect-generic.c (expand_vector_operations_1): Likewise.
        Handle type change before looking up optab.
        * optabs.h (OTI_vec_widen_umult_even, OTI_vec_widen_umult_odd): New.
        (OTI_vec_widen_smult_even, OTI_vec_widen_smult_odd): New.
        (vec_widen_umult_even_optab, vec_widen_umult_odd_optab): New.
        (vec_widen_smult_even_optab, vec_widen_smult_odd_optab): New.
        * genopinit.c (optabs): Initialize them.
        * doc/md.texi: Document them.

From-SVN: r189403
2012-07-10 01:23:39 -07:00
Jason Merrill 06e3e32bcd re PR c++/53882 (ICE in type_contains_placeholder_1, at tree.c:3015)
PR c++/53882
	* tree.c (type_contains_placeholder_1): Handle NULLPTR_TYPE.
	(type_hash_eq): Likewise.

From-SVN: r189386
2012-07-09 10:11:01 -04:00
Richard Guenther cef8c10098 tree.c (find_decls_types_r): Handle TYPE_CONTEXT the same as in free_lang_data_in_type.
2012-07-04  Richard Guenther  <rguenther@suse.de>

	* tree.c (find_decls_types_r): Handle TYPE_CONTEXT the same
	as in free_lang_data_in_type.

From-SVN: r189252
2012-07-04 10:36:07 +00:00
Jason Merrill f5d306802c re PR c++/53826 ([alpha]: ICE in fold_convert_loc, at fold-const.c:2008)
PR c++/53826
	* tree.c (build_zero_cst): Handle NULLPTR_TYPE.

From-SVN: r189238
2012-07-03 14:10:39 -04:00
Nathan Sidwell cb686b9933 coverage.c (bbg_file_stamp): New.
* coverage.c (bbg_file_stamp): New.
	(read_counts_file): Merge incoming stamp with bbg_file_stamp.
	(build_info): Write bbg_file_stamp.
	(coverage_init): Initialize bbg_file_stamp.  Read counts file
	before writing graph header.
	(coverage_finish): Don't unlink the data file if we can generate a
	unique file stamp.
	* tree.h (crc32_unsigned): Declare.
	* tree.c (crc32_unsigned_bits): New, broken out of ...
	(crc32_byte): ... here.  Use it.
	(crc32_unsigned): New.

From-SVN: r189095
2012-06-30 11:42:52 +00:00
Richard Henderson 98449720f7 Add MULT_HIGHPART_EXPR
* tree.def (MULT_HIGHPART_EXPR): New.
        * cfgexpand.c (expand_debug_expr): Ignore it.
        * expr.c (expand_expr_real_2): Handle it.
        * fold-const.c (int_const_binop_1): Likewise.
        * optabs.c (optab_for_tree_code): Likewise.
        * tree-cfg.c (verify_gimple_assign_binary): Likewise.
        * tree-inline.c (estimate_operator_cost): Likewise.
        * tree-pretty-print.c (dump_generic_node): Likewise.
        (op_code_prio, op_symbol_code): Likewise.
        * tree.c (commutative_tree_code): Likewise.  Also handle
        WIDEN_MULT_EXPR, VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR.

From-SVN: r189027
2012-06-27 14:30:51 -07:00
Richard Guenther e3b127e818 re PR debug/53470 (ICE when linking with -g in splice_child_die, at dwarf2out.c:4264)
2012-06-11  Richard Guenther  <rguenther@suse.de>

	PR middle-end/53470
	* tree.c (free_lang_data_in_type): Do not clear TYPE_CONTEXT but
	replace it with the first non-BLOCK context.

	* g++.dg/lto/pr53470_0.C: New testcase.
	* gcc.dg/lto/pr53470_0.c: Likewise.

From-SVN: r188387
2012-06-11 14:14:09 +00:00
Kenneth Zadeck 49ab6098ee 2012-06-2 Kenneth Zadeck <zadeck@naturalbridge.com>
* expmed.c (expand_mult, choose_multiplier): Change "2 *
	HOST_BITS_PER_WIDE_INT" to "HOST_BITS_PER_DOUBLE_INT".
	* expr.c (convert_modes): Likewise.
	* explow.c (plus_constant): Likewise.
	* fixed-value.c (fixed_saturate1, fixed_saturate2)
	(do_fixed_add, do_fixed_multiply, do_fixed_multiply)
	(do_fixed_multiply, do_fixed_multiply, do_fixed_divide)
	(do_fixed_divide, do_fixed_divide, do_fixed_divide)
	(do_fixed_divide, do_fixed_divide, do_fixed_shift, do_fixed_shift)
	(do_fixed_shift, fixed_convert, fixed_convert)
	(fixed_convert_from_int, fixed_convert_from_int)
	(fixed_convert_from_real): Likewise.
	* fold-const.c (fold_convert_const_int_from_fixed, sign_bit_p)
	(native_interpret_int, fold_binary_loc, fold_ternary_loc): Likewise.
	* varasm.c (output_constructor_bitfield): Likewise.
	* tree-vrp.c (register_edge_assert_for_2): Likewise.
	* double-int.c (rshift_double, lshift_double): Likewise.
	* double-int.h (double_int_fits_in_uhwi_p, double_int, double_int): Likewise.
	* simplify-rtx.c (mode_signbit_p)
	(simplify_const_unary_operation, simplify_binary_operation_1)
	(simplify_immed_subreg): Likewise.
	* builtins.c (c_readstr, fold_builtin_bitop): Likewise.
	* tree-vect-generic.c (build_replicated_const): Likewise.
	* dbxout.c (stabstr_O): Likewise.
	* emit-rtl.c (immed_double_int_const, immed_double_const)
	(gen_lowpart_common, init_emit_once): Likewise.
	* tree.c (integer_pow2p, tree_log2, tree_floor_log2)
	(widest_int_cst_value, upper_bound_in_type): Likewise.
	* stor-layout.c (initialize_sizetypes, fixup_signed_type)
	(fixup_unsigned_type): Likewise.
	* real.c (real_to_integer2, real_from_integer): Likewise.
	* dwarf2out.c (size_of_loc_descr, size_of_die, output_die)
	(clz_loc_descriptor, mem_loc_descriptor): Likewise.

From-SVN: r188139
2012-06-02 16:08:39 +00:00
Joseph Myers 073a899888 LANGUAGES: Fix typos.
* LANGUAGES: Fix typos.
	* Makefile.in: Fix typos.
	* alias.c: Fix typos.
	* auto-inc-dec.c: Fix typos.
	* bb-reorder.c: Fix typos.
	* cfgcleanup.c: Fix typos.
	* cgraph.c: Fix typos.
	* cgraph.h: Fix typos.
	* cgraphunit.c: Fix typos.
	* collect2-aix.h: Fix typos.
	* collect2.c: Fix typos.
	* compare-elim.c: Fix typos.
	* config/alpha/vms.h: Fix typos.
	* config/arm/README-interworking: Fix typos.
	* config/arm/arm.c: Fix typos.
	* config/arm/iterators.md: Fix typos.
	* config/arm/vxworks.h: Fix typos.
	* config/avr/avr.c: Fix typos.
	* config/avr/avr.h: Fix typos.
	* config/avr/avr.md: Fix typos.
	* config/avr/builtins.def: Fix typos.
	* config/c6x/c6x.c: Fix typos.
	* config/cr16/cr16.c: Fix typos.
	* config/cr16/cr16.md: Fix typos.
	* config/cris/cris.md: Fix typos.
	* config/darwin.c: Fix typos.
	* config/darwin.opt: Fix typos.
	* config/i386/i386-c.c: Fix typos.
	* config/i386/i386.c: Fix typos.
	* config/ia64/ia64.c: Fix typos.
	* config/m68k/cf.md: Fix typos.
	* config/mep/mep.c: Fix typos.
	* config/microblaze/microblaze.c: Fix typos.
	* config/microblaze/microblaze.h: Fix typos.
	* config/mn10300/mn10300.c: Fix typos.
	* config/mn10300/mn10300.md: Fix typos.
	* config/pa/pa.c: Fix typos.
	* config/picochip/picochip.h: Fix typos.
	* config/rs6000/a2.md: Fix typos.
	* config/rs6000/rs6000.c: Fix typos.
	* config/rs6000/vector.md: Fix typos.
	* config/rx/rx.md: Fix typos.
	* config/rx/rx.opt: Fix typos.
	* config/s390/2097.md: Fix typos.
	* config/s390/s390.c: Fix typos.
	* config/s390/s390.h: Fix typos.
	* config/sh/sh.c: Fix typos.
	* config/sh/sh.md: Fix typos.
	* config/sparc/sync.md: Fix typos.
	* config/spu/spu.c: Fix typos.
	* config/spu/spu.md: Fix typos.
	* config/vms/vms.c: Fix typos.
	* config/vxworks-dummy.h: Fix typos.
	* config/vxworks.h: Fix typos.
	* cselib.c: Fix typos.
	* df-scan.c: Fix typos.
	* df.h: Fix typos.
	* doc/extend.texi: Fix typos.
	* doc/install.texi: Fix typos.
	* doc/invoke.texi: Fix typos.
	* doc/md.texi: Fix typos.
	* doc/plugins.texi: Fix typos.
	* doc/rtl.texi: Fix typos.
	* dse.c: Fix typos.
	* dwarf2asm.c: Fix typos.
	* dwarf2out.c: Fix typos.
	* except.h: Fix typos.
	* expr.c: Fix typos.
	* fold-const.c: Fix typos.
	* gcc.c: Fix typos.
	* gcse.c: Fix typos.
	* genautomata.c: Fix typos.
	* gengtype-state.c: Fix typos.
	* gengtype.c: Fix typos.
	* genhooks.c: Fix typos.
	* gimple-fold.c: Fix typos.
	* gimple-pretty-print.c: Fix typos.
	* gimple.c: Fix typos.
	* gimple.h: Fix typos.
	* gimplify.c: Fix typos.
	* graphite-interchange.c: Fix typos.
	* graphite-sese-to-poly.c: Fix typos.
	* ifcvt.c: Fix typos.
	* input.c: Fix typos.
	* ipa-cp.c: Fix typos.
	* ipa-inline-analysis.c: Fix typos.
	* ipa-inline-transform.c: Fix typos.
	* ipa-inline.c: Fix typos.
	* ipa-pure-const.c: Fix typos.
	* ipa-ref.h: Fix typos.
	* ipa-reference.c: Fix typos.
	* ipa-utils.c: Fix typos.
	* ipa.c: Fix typos.
	* ira-emit.c: Fix typos.
	* ira-lives.c: Fix typos.
	* lto-streamer.c: Fix typos.
	* lto-streamer.h: Fix typos.
	* lto-wrapper.c: Fix typos.
	* mcf.c: Fix typos.
	* mode-switching.c: Fix typos.
	* modulo-sched.c: Fix typos.
	* plugin.c: Fix typos.
	* postreload.c: Fix typos.
	* sched-deps.c: Fix typos.
	* sel-sched-ir.c: Fix typos.
	* sel-sched-ir.h: Fix typos.
	* sel-sched.c: Fix typos.
	* sese.c: Fix typos.
	* stor-layout.c: Fix typos.
	* target-hooks-macros.h: Fix typos.
	* target.def: Fix typos.
	* trans-mem.c: Fix typos.
	* tree-eh.c: Fix typos.
	* tree-predcom.c: Fix typos.
	* tree-sra.c: Fix typos.
	* tree-ssa-address.c: Fix typos.
	* tree-ssa-loop-ivopts.c: Fix typos.
	* tree-ssa-loop-niter.c: Fix typos.
	* tree-ssa-math-opts.c: Fix typos.
	* tree-ssa-pre.c: Fix typos.
	* tree-ssa-propagate.c: Fix typos.
	* tree-ssa-reassoc.c: Fix typos.
	* tree-ssa-sccvn.c: Fix typos.
	* tree-ssa-ter.c: Fix typos.
	* tree-ssa-uninit.c: Fix typos.
	* tree-ssanames.c: Fix typos.
	* tree-vect-generic.c: Fix typos.
	* tree-vect-slp.c: Fix typos.
	* tree.c: Fix typos.
	* tree.h: Fix typos.
	* varasm.c: Fix typos.
	* varpool.c: Fix typos.

From-SVN: r187959
2012-05-29 15:14:06 +01:00
Nathan Sidwell 253cbc5f37 tree.c (build_constructor): Propagate TREE_SIDE_EFFECTS.
* tree.c (build_constructor): Propagate TREE_SIDE_EFFECTS.
testsuite/
	* gcc.dg/stmt-expr-4.c: New.

From-SVN: r187923
2012-05-27 16:25:58 +00:00
Eric Botcazou 37c59e691e re PR lto/52178 (Ada bootstrap failure in LTO mode)
PR lto/52178
	* tree-inline.c (remap_gimple_op_r): Fix handling of FIELD_DECL.
	* tree.c (RETURN_TRUE_IF_VAR): Do not return true for PLACEHOLDER_EXPR.

From-SVN: r187892
2012-05-25 20:26:11 +00:00
Richard Guenther 56099f00a5 tree.c (valid_constant_size_p): New function.
2012-05-02  Richard Guenther  <rguenther@suse.de>

	* tree.c (valid_constant_size_p): New function.
	* tree.h (valid_constant_size_p): Declare.
	* cfgexpand.c (expand_one_var): Adjust check for too large
	variables by using valid_constant_size_p.
	* varasm.c (assemble_variable): Likewise.

	c/
	* c-decl.c (grokdeclarator): Properly check for sizes that
	cover more than half of the address-space.

	cp/
	* decl.c (grokdeclarator): Properly check for sizes that
	cover more than half of the address-space.

2012-05-02  Richard Guenther  <rguenther@suse.de>

	* fold-const.c (div_if_zero_remainder): sizetypes no longer
	sign-extend.
	(int_const_binop_1): New worker for int_const_binop with
	overflowable parameter.  Pass it through
	to force_fit_type_double.
	(int_const_binop): Wrap around int_const_binop_1 with overflowable
	equal to one.
	(size_binop_loc): Call int_const_binop_1 with overflowable equal
	to minus one, forcing overflow detection for even unsigned types.
	(extract_muldiv_1): Remove bogus TYPE_IS_SIZETYPE special-casing.
	(fold_binary_loc): Call try_move_mult_to_index with signed offset.
	* stor-layout.c (initialize_sizetypes): sizetypes no longer
	sign-extend.
	(layout_type): For zero-sized arrays ignore overflow on the
	size calculations.
	* tree-ssa-ccp.c (bit_value_unop_1): Likewise.
	(bit_value_binop_1): Likewise.
	* tree.c (double_int_to_tree): Likewise.
	(double_int_fits_to_tree_p): Likewise.
	(force_fit_type_double): Likewise.
	(host_integerp): Likewise.
	(int_fits_type_p): Likewise.
	* varasm.c (output_constructor_regular_field): Sign-extend the
	field-offset to cater for negative offsets produced by the Ada frontend.
	* omp-low.c (extract_omp_for_data): Convert the loop step to
	signed for pointer adjustments.

	* g++.dg/tree-ssa/pr19807.C: Adjust.

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

From-SVN: r186832
2012-04-25 16:31:42 +00:00
Manuel López-Ibáñez 21e417158c tree-pretty-print.h (default_tree_printer): Do not declare.
2012-04-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>

gcc/
	* tree-pretty-print.h (default_tree_printer): Do not declare.
	* tree-diagnostic.c: Include tree-pretty-print.h, tree-pass.h and
	intl.h.
	(default_tree_diagnostic_starter): Make static.
	(default_tree_printer): Move to here. Make static.
	(tree_diagnostics_defaults): New.
	* tree-diagnostic.h (default_tree_diagnostic_starter): Do not declare.
	* tree.c (free_lang_data): Use tree_diagnostics_defaults.
	* toplev.c: Do not include tree-pass.h.
	(default_tree_printer): Move from here.
	(general_init): Use tree_diagnostics_defaults.

From-SVN: r186780
2012-04-24 19:21:21 +00:00
Michael Matz 314b662a3a re PR c/52977 (internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option)
PR middle-end/52977
	* tree.h (VECTOR_CST_NELTS): Use part number of types again.
	(struct tree_vector): Adjust GTY length.
	* tree.c (make_vector_stat): Don't set VECTOR_CST_NELTS.

	* gengtype.c (struct walk_type_data): Add in_record_p and loopcounter
	members.
	(walk_type, <TYPE_POINTER, TYPE_ARRAY>): Handle case where our
	caller emitted the length calulation already.
	(walk_type, <TYPE_UNION, TYPE_STRUCT>): Emit length calculations

From-SVN: r186593
2012-04-19 13:29:29 +00:00
Richard Guenther ac9a074c72 re PR c/52977 (internal compiler error: Segmentation fault with `-x c-header' or `-x cxx-header' option)
2012-04-16  Richard Guenther  <rguenther@suse.de>

	PR middle-end/52977
	* tree.h (VECTOR_CST_NELTS): Adjust.
	(struct tree_vector): Add explicit length field.
	(make_vector_stat): Declare.
	(make_vector): Define.
	* tree.c (make_vector_stat): New function.
	(build_vector_stat): Use it.
	* tree-streamer-in.c (streamer_alloc_tree): Likewise.

From-SVN: r186494
2012-04-16 13:21:30 +00:00
Jan Hubicka 65c70e6b03 cgraph.h (FOR_EACH_VARIABLE, [...]): New macros.
* cgraph.h (FOR_EACH_VARIABLE, FOR_EACH_VARIABLE, FOR_EACH_FUNCTION):
	New macros.
	* lto-symtab.c (lto_symtab_merge_cgraph_nodes): Use FOR_EACH
	walkers to walk cgraph and varpool.
	* cgraph.c (cgraph_node_for_asm): Likewise.
	(dump_cgraph): Likewise.
	* value-prof.c (init_node_map): Likewise.
	* tree.c (free_lang_data_in_cgraph): Likewise.
	* tree-emutls.c: (ipa_lower_emutls): Likewise.
	* ipa-reference.c (generate_summary, propagate): Likewise.
	* cgraphunit.c (verify_cgraph, cgraph_process_same_body_aliases,
	cgraph_mark_functions_to_output, cgraph_output_in_order,
	output_weakrefs, cgraph_materialize_all_clones,
	cgraph_optimize): Likewise.
	* lto-cgraph.c (merge_profile_summaries): Likewise.
	(input_cgraph): Likewise.
	* ipa-pure-const.c (generate_summary): Likewise.
	(propagate): Likwise.
	* ipa-utils.c (ipa_reduced_postorder): Likewise.
	(ipa_free_postorder_info): Likewise.
	(ipa_reverse_postorder): Likewise.
	* ipa-inline.c (ipa_inline): Likewise.
	* matrix-reorg.c (find_matrices_decl): Likewise.
	(matrix_reorg): Likewise.
	* tree-vectorizer.c (increase_alignment): Likewise.
	* ipa.c (cgraph_remove_unreachable_nodes): Likewise.
	(function_and_variable_visibility): Likewise.
	(whole_program_function_and_variable_visibility): Likewise.
	(ipa_cdtor_merge): Likewise.
	* trans-mem.c (ipa_tm_execute): Likewise.
	* ipa-inline-analysis.c (dump_inline_summaries): Likewise.
	* ipa-prop.c (ipa_print_all_jump_functions): Likewise.
	(ipa_print_all_params): Likewise.
	(ipa_update_after_lto_read): Likewise.
	* tree-profie.c (tree_profiling): Likewise.
	* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
	* passes.c (dump_passes): Likewise.
	(do_per_function): Likewise.
	(ipa_write_summaries): Likewise.
	* varpool.c (dump_varpool): Likewise.
	(varpool_node_for_asm): Likewise.
	(varpool_assemble_pending_decls): Likewise.


	* decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
        walkers to walk cgraph and varpool.

	* lto.c (read_cgraph_and_symbols): Use FOR_EACH
        walkers to walk cgraph and varpool.
	(materialize_cgraph): Likewise.
	* lto-partition.c (lto_1_to_1_map): Likewise.
	(lto_balanced_map): Likewise.
	(lto_promote_cross_file_statics): Likewise.

From-SVN: r186492
2012-04-16 12:04:17 +00:00
Jan Hubicka 960bfb6929 cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
	(symtab_node): Turn to union typedef.
	(symtab_node_base): New structure.
	(symtab_type): Add SYMTAB_SYMBOL tag.
	* cgraph.c: Update references to fields
	(cgraph_hash, assembler_name_hash): Turn into symtab_node.
	(cgraph_local_info): Remove lto_file_data
	and externally_visible.
	(cgraph_node): Remove decl; same_comdat_group list;
	aux; ref_list; order; address_taken; reachable_from_other_parittion,
	in_other_partition; resolution.
	(varpool_node): Remove decl; same_comdat_group;
	ref_list; lto_file_data; aux; order; resolution; externally_visible;
	used_from_other_partition; in_other_partition.
	(symtab_node_def); New union.
	(cgraph, varpool): Update.
	(varpool_first_static_initializer, varpool_next_static_initializer,
	cgraph_only_called_directly_or_aliased_p,
	varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
	varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
	varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
	field references.
	* cgraph.c: Likewise.
	* cgraphbuild.c: Likewise.
	* lto-symtab.c: Likewise.
	* c-gimplify.c: Likewise.
	* value-prof.c: Likewise.
	* tree.c: Likewise.
	* ipa-cp.c: Likewise.
	* tree-emutls.c: Likewise.
	* ipa-inline-transform.c: Likwise.
	* ipa-reference.c: Likewise.
	* cgraphunit.c: Likewise.
	* ipa-ref.c: Likewise.
	* lto-cgraph.c: Likewise.
	* ipa-ref-inline.h: Likewise.
	* ipa-pure-const.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-inline.c: Likewise.
	* matrix-reorg.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-vectorizer.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa.c: Likewise.
	* trans-mem.c: Likewise.
	* ipa-inline-analysis.c: Likewise.
	* gimplify.c: Likewise.
	* cfgexpand.c: Likewise.
	* tree-sra.c: Likewise.
	* ipa-prop.c: Likewise.
	* varasm.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* passes.c: Likewise.
	* varpool.c: Likewise.

	* tree.c: Update field referenced for new cgraph/varpool layout.
	* decl2.c: Likewise.

	* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
	cgraph/varpool layout.

	* lto.c: Update field referenced for new cgraph/varpool layout.
	* lto-partition.c: Likewise.

From-SVN: r186450
2012-04-14 10:24:59 +00:00
Eric Botcazou ac868f29d7 re PR target/52624 (missing __builtin_bswap16)
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
2012-04-11 11:13:39 +00:00
Eric Botcazou 2defb110db * tree.c (tree_size) <VECTOR_CST>: New case.
From-SVN: r185930
2012-03-28 21:59:23 +00:00
Richard Guenther 50a763ab47 tree-vect-loop.c (get_initial_def_for_induction): Use build_constructor directly.
2012-03-16  Richard Guenther  <rguenther@suse.de>

	* tree-vect-loop.c (get_initial_def_for_induction): Use
	build_constructor directly.
	* tree-vect-stmts.c (vect_get_vec_def_for_operand): Use
	build_vector_from_val.
	* tree.c (build_vector_from_val): Avoid creating a constructor
	first when we want a constant vector.

From-SVN: r185461
2012-03-16 09:54:36 +00:00
Richard Guenther d2a12ae77f tree.h (TREE_VECTOR_CST_ELTS): Remove.
2012-03-16  Richard Guenther  <rguenther@suse.de>

	* tree.h (TREE_VECTOR_CST_ELTS): Remove.
	(VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines.
	(struct tree_vector): Remove elements member, add variable size
	elts array member.
	(build_vector_stat): Declare.
	(build_vector): Define in terms of build_vector_stat.
	* tree.c (build_vector): Rename to ...
	(build_vector_stat): ... this.  Take array of trees as parameter.
	(build_vector_from_ctor): Adjust.
	(integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr,
	initializer_zerop): Adjust.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* expr.c (categorize_ctor_elements_1, expand_expr_real_1,
	const_vector_from_tree): Likewise.
	* fold-const.c (const_binop, operand_equal_p, native_encode_vector,
	native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array,
	fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise.
	* tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR.
	(lto_input_ts_vector_tree_pointers): Adjust.
	* tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR.
	(write_ts_vector_tree_pointers): Adjust.
	* varasm.c (const_hash_1, compare_constant, copy_constant,
	output_constant): Adjust.
	* gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust.
	* print-tree.c (print_node): Adjust.
	* tree-pretty-print.c (dump_generic_node): Adjust.
	* tree-vect-generic.c (uniform_vector_p, vector_element,
	lower_vec_perm): Adjust.
	* tree-vect-loop.c (get_initial_def_for_reduction): Adjust.
	* tree-vect-slp.c (vect_get_constant_vectors,
	vect_transform_slp_perm_load): Adjust.
	* tree-vect-stmts.c (vect_gen_perm_mask): Adjust.
	* expmed.c (make_tree): Adjust.

	* config/i386/i386.c (ix86_expand_builtin): Adjust.
	* config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface
	and implementation.
	(sparc_fold_builtin): Adjust.

	c-family/
	* c-pretty-print.c (pp_c_initializer_list): Adjust.

From-SVN: r185458
2012-03-16 09:47:09 +00:00
Richard Guenther 26c71b9368 re PR target/52080 (Stores to bitfields introduce a store-data-race on adjacent data)
2012-03-14  Richard Guenther  <rguenther@suse.de>

	* tree.h (DECL_BIT_FIELD_REPRESENTATIVE): New define.
	* stor-layout.c (start_bitfield_representative): New function.
	(finish_bitfield_representative): Likewise.
	(finish_bitfield_layout): Likewise.
	(finish_record_layout): Call finish_bitfield_layout.
	* tree.c (free_lang_data_in_decl): Only free DECL_QUALIFIER
	for QUAL_UNION_TYPE fields.
	* tree-streamer-in.c (lto_input_ts_field_decl_tree_pointers):
	Stream DECL_BIT_FIELD_REPRESENTATIVE.
	* tree-streamer-out.c (write_ts_field_decl_tree_pointers): Likewise.

	PR middle-end/52080
	PR middle-end/52097
	PR middle-end/48124
	* expr.c (get_bit_range): Unconditionally extract bitrange
	from DECL_BIT_FIELD_REPRESENTATIVE.
	(expand_assignment): Adjust call to get_bit_range.

	* gcc.dg/torture/pr48124-1.c: New testcase.
	* gcc.dg/torture/pr48124-2.c: Likewise.
	* gcc.dg/torture/pr48124-3.c: Likewise.
	* gcc.dg/torture/pr48124-4.c: Likewise.

From-SVN: r185379
2012-03-14 10:55:09 +00:00
Richard Guenther 7ee6fd6836 tree.c (signed_or_unsigned_type_for): Use build_nonstandard_integer_type.
2012-03-12  Richard Guenther  <rguenther@suse.de>

	* tree.c (signed_or_unsigned_type_for): Use
	build_nonstandard_integer_type.
	(signed_type_for): Adjust documentation.
	(unsigned_type_for): Likewise.
	* tree-pretty-print.c (dump_generic_node): Use standard names
	for non-standard integer types if available.

From-SVN: r185226
2012-03-12 13:04:43 +00:00
Richard Guenther 73ddd02d12 convert.c (strip_float_extensions): Move ...
2012-03-07  Richard Guenther  <rguenther@suse.de>

	* convert.c (strip_float_extensions): Move ...
	* tree.c (strip_float_extensions): ... here.

From-SVN: r185046
2012-03-07 14:30:01 +00:00
Richard Guenther 45c0175b88 tree.c (integer_zerop): Handle VECTOR_CSTs.
2012-03-05  Richard Guenther  <rguenther@suse.de>

	* tree.c (integer_zerop): Handle VECTOR_CSTs.
	(integer_onep): Likewise.
	(integer_all_onesp): Likewise.

From-SVN: r184923
2012-03-05 11:30:40 +00:00
Richard Guenther 837487be7b re PR lto/52178 (Ada bootstrap failure in LTO mode)
2012-02-14  Richard Guenther  <rguenther@suse.de>

	PR lto/52178
	* tree-streamer-in.c (lto_input_ts_field_decl_tree_pointers):
	Do not stream DECL_QUALIFIER.
	* tree-streamer-out.c (write_ts_field_decl_tree_pointers): Likewise.
	* tree.c (free_lang_data_in_decl): Free DECL_QUALIFIER.
	(find_decls_types_r): Do not walk DECL_QUALIFIER.

From-SVN: r184200
2012-02-14 08:39:55 +00:00
Ian Lance Taylor 183dd1301c compiler: Use new __builtin_init_heap_trampoline.
PR go/47656
	* builtins.def (BUILT_IN_INIT_HEAP_TRAMPOLINE): Define.
	* builtins.c (expand_builtin_init_trampoline): Add onstack
	parameter.  Change caller.
	(expand_builtin): Handle BUILT_IN_INIT_HEAP_TRAMPOLINE.
	* tree.c (build_common_builtin_nodes): Declare
	__builtin_init_heap_trampoline.

From-SVN: r183650
2012-01-27 22:25:02 +00:00
Jason Merrill b3310d4901 re PR c++/51992 (internal compiler error: tree code ‘target_expr’ is not supported in LTO streams)
PR c++/51992
	* tree.c (find_decls_types_in_node): Walk gimple_call_fntype.

From-SVN: r183527
2012-01-25 12:16:28 -05:00
Eric Botcazou 1a2c27e964 tree.h (build_function_decl_skip_args): Add boolean parameter.
* tree.h (build_function_decl_skip_args): Add boolean parameter.
	(build_function_type_skip_args): Delete.
	* tree.c (build_function_type_skip_args): Make static and add
	SKIP_RETURN parameter.  Fix thinko in the handling of variants.
	(build_function_decl_skip_args): Add SKIP_RETURN parameter and
	pass it to build_function_type_skip_args.
	* cgraph.h (cgraph_function_versioning): Add boolean parameter.
	(tree_function_versioning): Likewise.
	* cgraph.c (cgraph_create_virtual_clone): Adjust call to
	build_function_decl_skip_args.
	* cgraphunit.c (cgraph_function_versioning): Add SKIP_RETURN parameter
	and pass it to build_function_decl_skip_args/tree_function_versioning.
	(cgraph_materialize_clone): Adjust call to tree_function_versioning.
	* ipa-inline-transform.c (save_inline_function_body): Likewise.
	* trans-mem.c (ipa_tm_create_version): Likewise.
	* tree-sra.c (modify_function): Ditto for cgraph_function_versioning.
	* tree-inline.c (declare_return_variable): Remove always-true test.
	(tree_function_versioning): Add SKIP_RETURN parameter.  If the function
	returns non-void and SKIP_RETURN, create a void-typed RESULT_DECL.
	* ipa-split.c (split_function): Skip the return value for the split
	part if it doesn't return.

From-SVN: r183102
2012-01-11 18:47:28 +00:00
Richard Guenther f5a3d840b6 re PR middle-end/51750 (FAIL: 25_algorithms/heap/moveable*.cc execution test)
2012-01-04  Richard Guenther  <rguenther@suse.de>

	PR middle-end/51750
	* tree.c (size_low_cst): New function.
	* tree.h (size_low_cst): Declare.
	* fold-const.c (fold_comparison): Use it to extract the low
	part of the POINTER_PLUS_EXPR offset.

From-SVN: r182872
2012-01-04 13:25:28 +00:00
Richard Guenther 4acd1c8460 re PR bootstrap/51572 (LTO bootstrap failed with bootstrap-profiled)
2011-12-19  Richard Guenther  <rguenther@suse.de>

	PR lto/51572
	* tree.c (free_lang_data_in_type): Do not unlink TYPE_DECL
	from TYPE_FIELDS.
	(find_decls_types_r): Walk TYPE_DECLs in TYPE_FIELDS.
	* tree-streamer-out.c (write_ts_field_decl_tree_pointers): Do
	not stream TREE_CHAIN.
	(write_ts_type_non_common_tree_pointers): Stream TYPE_FIELDS
	using streamer_write_chain.
	* tree-streamer-in.c (lto_input_ts_field_decl_tree_pointers):
	Do not stream TREE_CHAIN.
	(lto_input_ts_type_non_common_tree_pointers): Stream TYPE_FIELDS
	using streamer_read_chain.
	* gimple-streamer-in.c (input_gimple_stmt): Skip non-FIELD_DECLs.
	* gimple.c (gimple_canonical_types_compatible_p): Properly
	handle trailing non-FIELD_DECLs in TYPE_FIELDS.

	* g++.dg/lto/pr51572-2_0.C: New testcase.

From-SVN: r182479
2011-12-19 13:37:06 +00:00
Richard Guenther ef61eb6071 tree.c (free_lang_data_in_type): Do not clear fields dependent on debuginfo level setting.
2011-12-14  Richard Guenther  <rguenther@suse.de>

	* tree.c (free_lang_data_in_type): Do not clear fields
	dependent on debuginfo level setting.
	(find_decls_types_r): Use TYPE_STUB_DECL rathern than TREE_CHAIN.
	* tree.h (TYPE_STUB_DECL): Properly check that we access
	a type.

From-SVN: r182329
2011-12-14 11:26:13 +00:00
Richard Guenther ea973bad53 re PR debug/48354 (internal compiler error: in splice_child_die, at dwarf2out.c:8064)
2011-12-13  Richard Guenther  <rguenther@suse.de>

	PR lto/48354
	* tree.c (find_decls_types_r): Also walk DECL_ORIGINAL_TYPE.
	* tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
	Stream DECL_ORIGINAL_TYPE.
	* tree-streamer-out.c (write_ts_decl_non_common_tree_pointers):
	Likewise.

	lto/
	* lto.c (lto_ft_decl_non_common): When we merged DECL_ORIGINAL_TYPE
	with the type of the TYPE_DECL clear DECL_ORIGINAL_TYPE.

	* g++.dg/lto/pr48354-1_0.C: New testcase.

From-SVN: r182286
2011-12-13 14:43:44 +00:00
Aldy Hernandez 67fafdd15a tree.c (build_common_builtin_nodes): Do not use TM_PURE attribute unless language has support for TM.
PR/51291
        * tree.c (build_common_builtin_nodes): Do not use TM_PURE
        attribute unless language has support for TM.
        * config/i386/i386.c (ix86_init_tm_builtins): Exit gracefully in
        the absence of TM builtins.

From-SVN: r182179
2011-12-09 22:05:26 +00:00
Richard Guenther 4a33ac4a77 re PR lto/48042 (lto segfaults while building Qt 4.7.2 with -g -flto -fwhole-program)
2011-12-09  Richard Guenther  <rguenther@suse.de>

	PR lto/48042
	* tree.c (free_lang_data_in_decl): Remove freeing conditional
	on debuginfo level.

	* g++.dg/lto/pr48042_0.C: New testcase.

From-SVN: r182163
2011-12-09 13:49:22 +00:00
Andrew Pinski fdb415fe09 re PR lto/51198 ([c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers)
2011-12-01  Andrew Pinski  <apinski@cavium.com>

	PR lto/51198
	* tree.c (free_lang_data_in_decl): Clear FIELD_DECL's
	DECL_INITIAL also.

2011-12-01  Andrew Pinski  <apinski@cavium.com>

	PR lto/51198
	* g++.dg/torture/pr51198.C: New testcase.

From-SVN: r181886
2011-12-01 09:13:05 -08:00
Michael Matz 018076e705 re PR c++/51264 (O0 Bootstrap failure: control reaches end of non-void function)
PR c++/51264
	* tree.c (iterative_hash_expr): Remove break after return.

From-SVN: r181615
2011-11-22 13:32:15 +00:00
Aldy Hernandez 0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00
Jason Merrill 1ca3916f56 build_string comments
From-SVN: r180537
2011-10-26 15:31:16 -04:00
Michael Meissner e79983f458 Convert standard builtin functions from being arrays to using a functional interface
From-SVN: r179820
2011-10-11 19:55:09 +00:00
Tom de Vries 13e49da934 re PR middle-end/50527 (inconsistent vla align)
2011-10-07  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/50527
	* tree.c (build_common_builtin_nodes): Add local_define_builtin for
	BUILT_IN_ALLOCA_WITH_ALIGN.  Mark that BUILT_IN_ALLOCA_WITH_ALIGN can
	throw.
	* builtins.c (expand_builtin_alloca): Handle BUILT_IN_ALLOCA_WITH_ALIGN
	arglist.  Set align for	BUILT_IN_ALLOCA_WITH_ALIGN.
	(expand_builtin): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	(is_inexpensive_builtin): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	* tree-ssa-ccp.c (evaluate_stmt): Set align for
	BUILT_IN_ALLOCA_WITH_ALIGN.
	(fold_builtin_alloca_for_var): Rename to ...
	(fold_builtin_alloca_with_align): Set DECL_ALIGN from 2nd
	BUILT_IN_ALLOCA_WITH_ALIGN argument.
	(ccp_fold_stmt): Try folding BUILT_IN_ALLOCA_WITH_ALIGN using
	fold_builtin_alloca_with_align.
	(optimize_stack_restore): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	* builtins.def (BUILT_IN_ALLOCA_WITH_ALIGN): Declare using
	DEF_BUILTIN_STUB.
	* ipa-pure-const.c (special_builtin_state): Handle
	BUILT_IN_ALLOCA_WITH_ALIGN.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1)
	(call_may_clobber_ref_p_1): Same.
	* function.c (gimplify_parameters): Lower vla to
	BUILT_IN_ALLOCA_WITH_ALIGN.
	* gimplify.c (gimplify_vla_decl): Same.
	* cfgexpand.c (expand_call_stmt): Handle BUILT_IN_ALLOCA_WITH_ALIGN.
	* tree-mudflap.c (mf_xform_statements): Same.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary)
	(mark_all_reaching_defs_necessary_1, propagate_necessity): Same.
	* varasm.c (incorporeal_function_p): Same.
	* tree-object-size.c (alloc_object_size): Same.
	* gimple.c (gimple_build_call_from_tree): Same.

From-SVN: r179655
2011-10-07 12:49:49 +00:00
Andi Kleen dde8b3609b Change random seeds to 64bit and drop re-crcing
I had some trouble with random build failures in a large LTO project
and it turned out to be random seed collisions in a highly parallel build
(thanks to Honza for suggesting that)

There were multiple problems:
- The way to generate the random seed is not very random (milliseconds time plus pid)
and prone to collisions on highly parallel builds
- It's only 32bit
- Several users take the existing ascii seed and re-CRC32 it again, which
doesn't exactly improve it.

This patch changes that to:
- Always use 64bit seeds as numbers (no re-crcing)
- Change all users to use HOST_WIDE_INT
- When the user specifies a random seed it's still crc32ed, but only in
this case.

Passes bootstrap + testsuite on x86_64-linux.

gcc/cp:

2011-09-26   Andi Kleen <ak@linux.intel.com>

	* repo.c (finish_repo): Use HOST_WIDE_INT_PRINT_HEX_PURE.

gcc/:

2011-09-26   Andi Kleen <ak@linux.intel.com>

	* hwint.h (HOST_WIDE_INT_PRINT_HEX_PURE): Add.
	* lto-streamer.c (lto_get_section_name): Remove crc32_string.
 	Handle numerical random seed.
	* lto-streamer.h (lto_file_decl_data): Change id to unsigned HOST_WIDE_INT.
	* toplev.c (random_seed): Add.
	(init_random_seed): Change for numerical random seed.
	(get_random_seed): Return as HOST_WIDE_INT.
	(set_random_seed): Crc32 existing string.
	* toplev.h (get_random_seed): Change to numercal return.
	* tree.c (get_file_function_name): Remove CRC. Handle numerical random seed.

gcc/lto/:

2011-09-26   Andi Kleen <ak@linux.intel.com>

	* lto.c (lto_resolution_read): Remove id dumping.
	(lto_section_with_id): Turn id HOST_WIDE_ID.
	(create_subid_section_table): Dito.

From-SVN: r179347
2011-09-29 13:14:51 +00:00
Richard Guenther 7c99ecef0b tree.c (build_opaque_vector_type): Make opaque vectors variant types of the corresponding non-opaque type.
2011-09-29  Richard Guenther  <rguenther@suse.de>

	* tree.c (build_opaque_vector_type): Make opaque vectors
	variant types of the corresponding non-opaque type.  Make
	sure to share opaque vector types properly.

From-SVN: r179341
2011-09-29 11:26:46 +00:00
Martin Jambor 81fa35bd59 cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta.
2011-09-02  Martin Jambor  <mjambor@suse.cz>

	* cgraph.h (cgraph_indirect_call_info): Removed field thunk_delta.
	* gimple-fold.c (gimple_get_virt_method_for_binfo): Rewritten to use
	BINFO_VTABLE.  Parameter delta removed, all callers updated.
	* tree.c (free_lang_data_in_binfo): Clear BINFO_VIRTUALs instead
	BINFO_VTABLE.
	* cgraph.c (cgraph_make_edge_direct): Removed parameter delta, updated
	all calls.
	* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Removed
	handling of thunk_delta.
	* ipa-cp.c (get_indirect_edge_target): Removed parameter delta.
	(devirtualization_time_bonus): Do not handle thunk deltas.
	(ipcp_discover_new_direct_edges): Likewise.
	* ipa-prop.c (ipa_make_edge_direct_to_target): Likewise.
	(try_make_edge_direct_simple_call): Likewise.
	(try_make_edge_direct_virtual_call): Likewise.
	* lto-cgraph.c (output_cgraph_opt_summary_p): Likewise.  Mark
	parameter set as unused.
	(output_edge_opt_summary): Likewise.  Mark both parameters as unused.
	* lto-cgraph.c (output_cgraph_opt_summary_p): Likewise.  Mark
	parameter set as unused.
	(output_edge_opt_summary): Likewise.  Mark both parameters as unused.
	(input_edge_opt_summary): Likewise.
	* lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not stream
	BINFO_VIRTUALS at all.
	* lto-streamer-in.c (lto_input_ts_binfo_tree_pointers): Likewise.

	* testsuite/g++.dg/ipa/devirt-3.C: Added a distraction method.
	* testsuite/g++.dg/ipa/ivinline-7.C: Added a test for direct call
	discovery, xfailed test for inlining.
	* testsuite/g++.dg/ipa/ivinline-9.C: Likewise.

From-SVN: r178472
2011-09-02 15:26:30 +02:00
Richard Guenther 6b8045e1bb tree.h (tree_int_cst_msb): Remove.
2011-08-18  Richard Guenther  <rguenther@suse.de>

	* tree.h (tree_int_cst_msb): Remove.
	* tree.c (tree_int_cst_msb): Likewise.
	(tree_int_cst_sign_bit): Move from ...
	* tree-ssa-loop-ivopts.c (tree_int_cst_sign_bit): ... here.

From-SVN: r177853
2011-08-18 12:42:22 +00:00
Richard Guenther 370f475983 tree.h (ptrofftype_p): New helper function.
2011-08-16  Richard Guenther  <rguenther@suse.de>

	* tree.h (ptrofftype_p): New helper function.
	* tree-cfg.c (verify_expr): Use ptrofftype_p for POINTER_PLUS_EXPR
	offset verification.
	(verify_gimple_assign_binary): Likewise.
	* tree.c (build2_stat): Likewise.
	* tree-chrec.c (chrec_fold_plus_poly_poly): Likewise.
	(reset_evolution_in_loop): Likewise.
	* tree-chrec.h (build_polynomial_chrec): Likewise.

From-SVN: r177784
2011-08-16 13:55:30 +00:00
Jakub Jelinek 20906c66f2 backport: re PR fortran/46752 (OpenMP - Seg fault for unallocated allocatable array in firstprivate clause)
Merge from gomp-3_1-branch branch:

2011-08-02  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* c-parser.c (enum c_parser_prec): New enum, moved from within
	c_parser_binary_expression.
	(c_parser_binary_expression): Add PREC argument.  Stop parsing
	if operator has lower or equal precedence than PREC.
	(c_parser_conditional_expression, c_parser_omp_for_loop): Adjust
	callers.
	(c_parser_omp_atomic): Handle parsing OpenMP 3.1 atomics.
	Adjust c_finish_omp_atomic caller.
	(c_parser_omp_taskyield): New function.
	(c_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
	(c_parser_omp_clause_name): Handle final and mergeable clauses.
	(c_parser_omp_clause_final, c_parser_omp_clause_mergeable): New
	functions.
	(c_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
	and PRAGMA_OMP_CLAUSE_MERGEABLE.
	(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
	(c_parser_omp_clause_reduction): Handle min and max.
	* c-typeck.c (c_finish_omp_clauses): Don't complain about
	const qualified predetermined vars in firstprivate clause.
	andle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
	Handle MIN_EXPR and MAX_EXPR.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_FINAL
	and OMP_CLAUSE_MERGEABLE.
	(dump_generic_node): Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD
	and OMP_ATOMIC_CAPTURE_NEW.
	* tree.c (omp_clause_num_ops): Add OMP_CLAUSE_FINAL and
	OMP_CLAUSE_MERGEABLE.
	(omp_clause_code_name): Likewise.
	(walk_tree_1): Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
	* tree.h (enum omp_clause_code): Add OMP_CLAUSE_FINAL
	and OMP_CLAUSE_MERGEABLE.
	(OMP_CLAUSE_FINAL_EXPR): Define.
	* omp-low.c (scan_sharing_clauses): Handle OMP_CLAUSE_FINAL and
	OMP_CLAUSE_MERGEABLE.
	(expand_task_call): Likewise.
	(expand_omp_atomic_load, expand_omp_atomic_store): New functions.
	(expand_omp_atomic_fetch_op): Handle cases where old or new
	value is needed afterwards.
	(expand_omp_atomic): Call expand_omp_atomic_load resp.
	expand_omp_atomic_store.
	* gimplify.c (gimplify_omp_atomic, gimplify_expr): Handle
	OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and OMP_ATOMIC_CAPTURE_NEW.
	(gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses): Handle
	OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
	* tree-nested.c (convert_nonlocal_omp_clauses,
	convert_local_omp_clauses): Likewise.
	* tree.def (OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD,
	OMP_ATOMIC_CAPTURE_NEW): New.
	* gimple.h (GF_OMP_ATOMIC_NEED_VALUE): New.
	(gimple_omp_atomic_need_value_p, gimple_omp_atomic_set_need_value):
	New inlines.
	* omp-builtins.def (BUILT_IN_GOMP_TASKYIELD): New builtin.
	* doc/generic.texi: Mention OMP_CLAUSE_COLLAPSE,
	OMP_CLAUSE_UNTIED, OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE.
gcc/c-family/
	* c-common.h (c_finish_omp_atomic): Adjust prototype.
	(c_finish_omp_taskyield): New prototype.
	* c-omp.c (c_finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
	arguments. Handle OMP_ATOMIC_READ, OMP_ATOMIC_CAPTURE_OLD and
	OMP_ATOMIC_CAPTURE_NEW in addition to OMP_ATOMIC.  If LHS1
	or RHS1 have side-effects, evaluate those too in the right spot,
	if it is a decl and LHS is also a decl, error out if they
	aren't the same.
	(c_finish_omp_taskyield): New function.
	* c-cppbuiltin.c (c_cpp_builtins): Change _OPENMP to 201107.
	* c-pragma.c (omp_pragmas): Add taskyield.
	* c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_TASKYIELD.
	(enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_FINAL and
	PRAGMA_OMP_CLAUSE_MERGEABLE.
gcc/cp/
	* cp-tree.h (finish_omp_atomic): Adjust prototype.
	(cxx_omp_const_qual_no_mutable): New prototype.
	(finish_omp_taskyield): New prototype.
	* parser.c (cp_parser_omp_atomic): (cp_parser_omp_atomic): Handle
	parsing OpenMP 3.1 atomics.  Adjust finish_omp_atomic caller.
	(cp_parser_omp_clause_name): Handle final and mergeable clauses.
	(cp_parser_omp_clause_final, cp_parser_omp_clause_mergeable): New
	functions.
	(cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_FINAL
	and PRAGMA_OMP_CLAUSE_MERGEABLE.
	(OMP_TASK_CLAUSE_MASK): Allow final and mergeable clauses.
	(cp_parser_omp_taskyield): New function.
	(cp_parser_pragma): Handle PRAGMA_OMP_TASKYIELD.
	(cp_parser_omp_clause_reduction): Handle min and max.
	* pt.c (tsubst_expr) <case OMP_ATOMIC>: Handle OpenMP 3.1 atomics.
	(tsubst_omp_clauses): Handle OMP_CLAUSE_FINAL and
	OMP_CLAUSE_MERGEABLE.
	* semantics.c (finish_omp_atomic): Add OPCODE, V, LHS1 and RHS1
	arguments.  Handle OpenMP 3.1 atomics.  Adjust c_finish_omp_atomic
	caller.
	(finish_omp_clauses): Don't complain about const qualified
	predetermined vars and static data members in firstprivate clause.
	Handle OMP_CLAUSE_FINAL and OMP_CLAUSE_MERGEABLE. Handle MIN_EXPR
	and MAX_EXPR.
	(finish_omp_taskyield): New function.
	* cp-gimplify.c (cxx_omp_const_qual_no_mutable): New function.
	(cxx_omp_predetermined_sharing): Use it.
gcc/fortran/
	PR fortran/46752
	* cpp.c (cpp_define_builtins): Change _OPENMP to 201107.
	* openmp.c (gfc_free_omp_clauses): Free also final_expr.
	(OMP_CLAUSE_FINAL, OMP_CLAUSE_MERGEABLE): Define.
	(gfc_match_omp_clauses): Handle parsing final and mergeable
	clauses.
	(OMP_TASK_CLAUSES): Allow final and mergeable clauses.
	(gfc_match_omp_taskyield): New function.
	(resolve_omp_clauses): Resolve final clause.  Allow POINTERs and
	Cray pointers in clauses other than REDUCTION.
	(gfc_match_omp_atomic): Match optional
	read/write/update/capture keywords after !$omp atomic.
	(resolve_omp_atomic): Handle all OpenMP 3.1 atomic forms.
	* dump-parse-tree.c (show_omp_node): Handle EXEC_OMP_TASKYIELD,
	print final and mergeable clauses.
	(show_code_node): Handle EXEC_OMP_TASKYIELD.
	* trans-openmp.c (gfc_trans_omp_clauses): Handle final and
	mergeable clauses.
	(gfc_trans_omp_taskyield): New function.
	(gfc_trans_omp_directive): Handle EXEC_OMP_TASKYIELD.
	(gfc_trans_omp_atomic): Handle all OpenMP 3.1 atomic forms.
	(gfc_omp_clause_copy_ctor): Handle non-allocated allocatable.
	(gfc_omp_predetermined_sharing): Adjust comment.
	* gfortran.h (gfc_statement): Add ST_OMP_TASKYIELD and
	ST_OMP_END_ATOMIC.
	(gfc_omp_clauses): Add final_expr and mergeable fields.
	(gfc_exec_op): Add EXEC_OMP_TASKYIELD.
	(gfc_omp_atomic_op): New enum typedef.
	(struct gfc_code): Add ext.omp_atomic.
	* trans.c (trans_code): Handle EXEC_OMP_TASKYIELD.
	* frontend-passes.c (gfc_code_walker): Also walk final_expr.
	* resolve.c (gfc_resolve_blocks, resolve_code): Handle
	EXEC_OMP_TASKYIELD.
	* st.c (gfc_free_statement): Likewise.
	* match.h (gfc_match_omp_taskyield): New prototype.
	* parse.c (decode_omp_directive): Handle taskyield directive.
	Handle !$omp end atomic.
	(case_executable): Add ST_OMP_TASKYIELD case.
	(gfc_ascii_statement): Handle ST_OMP_TASKYIELD.
	(parse_omp_atomic): Return gfc_statement instead of void.
	For !$omp atomic capture parse two assignments instead of
	just one and require !$omp end atomic afterwards, for
	other !$omp atomic forms just allow !$omp end atomic at the
	end.
	(parse_omp_structured_block, parse_executable): Adjust
	parse_omp_atomic callers.

2011-08-02  Tobias Burnus  <burnus@net-b.de>

	* intrinsic.c (OMP_LIB): Updated openmp_version's
	value to 201107.
	* gfortran.texi (OpenMP): Update ref to OpenMP 3.1.
	* intrinsic.texi (OpenMP Modules): Update ref to OpenMP 3.1;
	remove deleted omp_integer_kind and omp_logical_kind constants.
gcc/testsuite/
	PR fortran/46752
	* gcc.dg/gomp/atomic-5.c: Adjust expected diagnostics.
	* gcc.dg/gomp/atomic-15.c: New test.
	* g++.dg/gomp/atomic-5.C: Adjust expected diagnostics.
	* g++.dg/gomp/atomic-15.C: New test.
	* g++.dg/gomp/private-1.C: New test.
	* g++.dg/gomp/sharing-2.C: New test.
	* gfortran.dg/gomp/crayptr1.f90: Don't expect error
	about Cray pointer in FIRSTPRIVATE/LASTPRIVATE.
	* gfortran.dg/gomp/omp_atomic2.f90: New test.
libgomp/
	PR fortran/42041
	PR fortran/46752
	* omp.h.in (omp_in_final): New prototype.
	* omp_lib.f90.in (omp_in_final): New interface.
	(omp_integer_kind, omp_logical_kind): Remove
	and replace all its uses in the module with 4.
	(openmp_version): Change to 201107.
	* omp_lib.h.in (omp_sched_static, omp_sched_dynamic,
	omp_sched_guided, omp_sched_auto): Use omp_sched_kind
	kind for the parameters.
	(omp_in_final): New external.
	(openmp_version): Change to 201107.
	* task.c (omp_in_final): New function.
	(gomp_init_task): Initialize final_task.
	(GOMP_task): Remove unused attribute from flags.  Handle final
	tasks.
	(GOMP_taskyield): New function.
	(omp_in_final): Return true if if (false) or final (true) task
	or descendant of final (true).
	* fortran.c (omp_in_final_): New function.
	* libgomp.map (OMP_3.1): Export omp_in_final and omp_in_final_.
	(GOMP_3.0): Export GOMP_taskyield.
	* env.c (gomp_nthreads_var_list, gomp_nthreads_var_list_len): New
	variables.
	(parse_unsigned_long_list): New function.
	(initialize_env): Use it for OMP_NUM_THREADS.  Call parse_boolean
	with "OMP_PROC_BIND".  If OMP_PROC_BIND=true, call gomp_init_affinity
	even if parse_affinity returned false.
	* config/linux/affinity.c (gomp_init_affinity): Handle
	gomp_cpu_affinity_len == 0.
	* libgomp_g.h (GOMP_taskyield): New prototype.
	* libgomp.h (struct gomp_task): Add final_task field.
	(gomp_nthreads_var_list, gomp_nthreads_var_list_len): New externs.
	* team.c (gomp_team_start): Override new task's nthreads_var icv
	if list form OMP_NUM_THREADS has been used and it has value for
	the new nesting level.

	* 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/reduction-6.c: New test.
	* testsuite/libgomp.c/task-5.c: New test.
	* testsuite/libgomp.c++/atomic-2.C: New test.
	* testsuite/libgomp.c++/atomic-3.C: New test.
	* testsuite/libgomp.c++/atomic-4.C: New test.
	* testsuite/libgomp.c++/atomic-5.C: New test.
	* testsuite/libgomp.c++/atomic-6.C: New test.
	* testsuite/libgomp.c++/atomic-7.C: New test.
	* testsuite/libgomp.c++/atomic-8.C: New test.
	* testsuite/libgomp.c++/atomic-9.C: New test.
	* testsuite/libgomp.c++/task-8.C: New test.
	* testsuite/libgomp.c++/reduction-4.C: New test.
	* testsuite/libgomp.fortran/allocatable7.f90: New test.
	* testsuite/libgomp.fortran/allocatable8.f90: New test.
	* testsuite/libgomp.fortran/crayptr3.f90: New test.
	* testsuite/libgomp.fortran/omp_atomic3.f90: New test.
	* testsuite/libgomp.fortran/omp_atomic4.f90: New test.
	* testsuite/libgomp.fortran/pointer1.f90: New test.
	* testsuite/libgomp.fortran/pointer2.f90: New test.
	* testsuite/libgomp.fortran/task4.f90: New test.

2011-08-02  Tobias Burnus  <burnus@net-b.de>

	* libgomp.texi: Update OpenMP spec references to 3.1.
	(omp_in_final,OMP_PROC_BIND): New sections.
	(OMP_NUM_THREADS): Document that the value can be now a list.
	(GOMP_STACKSIZE,GOMP_CPU_AFFINITY): Update @ref.

From-SVN: r177194
2011-08-02 18:13:29 +02:00
Richard Henderson b87ac61522 Handle SIZE_TYPE being unsigned short.
From-SVN: r176995
2011-07-31 18:11:04 -07:00
Richard Biener c56db10056 re PR middle-end/18908 (Missed folding opportunities with bools)
2011-07-20  Richard Guenther  <rguenther@suse.de>

	PR middle-end/18908
	* tree.c (integer_all_onesp): Use TYPE_PRECISION, not mode precision.
	* tree-ssa-forwprop.c (simplify_bitwise_binary): Remove bogus
	ADDR_EXPR folding.  Canonicalize X ^ ~0 as ~X.

	* gcc.dg/tree-ssa/pr18908.c: New testcase.
	* gcc.dg/tree-ssa/bitwise-sink.c: Adjust.

From-SVN: r176510
2011-07-20 13:36:30 +00:00
Jakub Jelinek 8b316874a1 re PR middle-end/49675 (ICE (segfault) with -finstrument-functions)
PR middle-end/49675
	* tree.c (build_common_builtin_nodes): Register
	__builtin_return_address, __cyg_profile_func_enter
	and __cyg_profile_func_exit.

	* gfortran.dg/pr49675.f90: New test.

From-SVN: r176417
2011-07-18 21:41:45 +02:00
Eric Botcazou 1ff2474966 re PR middle-end/49732 (crash on terminal_interface-curses-menus.adb from ncurses with -gnato)
PR middle-end/49732
	* tree.c (walk_tree_1) <DECL_EXPR>: Do not walk a pointed-to type.

From-SVN: r176371
2011-07-17 15:06:36 +00:00
Eric Botcazou e84a58ffbe cse.c (insert_with_costs): Put semi-colon after empty loop body on the next line.
* cse.c (insert_with_costs): Put semi-colon after empty loop body
	on the next line.
	* emit-rtl.c (push_to_sequence): Likewise.
	* haifa-sched.c (max_issue): Likewise.
	* matrix-reorg.c (add_allocation_site): Likewise.
	* postreload-gcse.c (eliminate_partially_redundant_load): Likewise.
	* reload.c (alternative_allows_const_pool_ref): Likewise.
	* sched-rgn.c (rgn_add_block): Likewise.
	(rgn_fix_recovery_cfg): Likewise.
	* tree.c (attribute_list_contained): Likewise.
c-family/
	* c-ada-spec.c (dump_nested_types): Put semi-colon after empty loop
	body on the next line.

From-SVN: r176216
2011-07-12 20:07:09 +00:00
Richard Guenther 1a07229414 tree.c (build_common_tree_nodes_2): Merge with build_common_tree_nodes.
2011-07-06  Richard Guenther  <rguenther@suse.de>

	* tree.c (build_common_tree_nodes_2): Merge with
	build_common_tree_nodes.
	* tree.h (build_common_tree_nodes): Adjust prototype.
	(build_common_tree_nodes_2): Remove.
	* doc/tm.texi.in (lang_hooks.builtin_function): Adjust.
	* doc/tm.texi (lang_hooks.builtin_function): Regenerate.

	c-family/
	* c-common.c (c_common_nodes_and_builtins):
	Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.

	fortran/
	* f95-lang.c (gfc_init_decl_processing):
	Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.

	go/
	* go-lang.c (go_langhook_init):
	Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.

	java/
	* decl.c (java_init_decl_processing):
	Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.

	lto/
	* lto-lang.c (lto_init):
	Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.

	ada/
	* gcc-interface/misc.c (gnat_init):
	Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.
	Re-initialize boolean_false_node.

From-SVN: r175906
2011-07-06 10:03:05 +00:00
Jakub Jelinek ddb555ed51 re PR debug/47858 (IPA-SRA decreases quality of debug info)
PR debug/47858
	* gimple.h (enum gimple_debug_subcode): Add GIMPLE_DEBUG_SOURCE_BIND.
	(gimple_build_debug_source_bind_stat): New prototype.
	(gimple_build_debug_source_bind): Define.
	(gimple_debug_source_bind_p, gimple_debug_source_bind_get_var,
	gimple_debug_source_bind_get_value,
	gimple_debug_source_bind_get_value_ptr,
	gimple_debug_source_bind_set_var,
	gimple_debug_source_bind_set_value): New inlines.
	* gimple.c (gimple_build_debug_source_bind_stat): New function.
	* gimple-pretty-print.c (dump_gimple_debug): Handle
	GIMPLE_DEBUG_SOURCE_BIND.
	* sese.c (rename_uses): Handle gimple_debug_source_bind_p.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	* tree-parloops.c (eliminate_local_variables,
	separate_decls_in_region): Likewise.
	(separate_decls_in_region_debug): Renamed from
	separate_decls_in_region_debug_bind.  Handle
	gimple_debug_source_bind_p.
	* tree.h (decl_debug_args_lookup, decl_debug_args_insert): New
	prototypes.
	(DECL_HAS_DEBUG_ARGS_P): Define.
	(struct tree_function_decl): Add has_debug_args_flag field.
	* tree.c (debug_args_for_decl): New variable.
	(decl_debug_args_lookup, decl_debug_args_insert): New functions.
	* tree-into-ssa.c (mark_def_sites): Handle uses in debug stmts.
	(rewrite_debug_stmt_uses): New function.
	(rewrite_stmt): Use it to rewrite debug stmt uses.
	* rtl.def (DEBUG_PARAMETER_REF): New.
	* rtl.h (DEBUG_PARAMETER_REF_DECL): Define.
	* cselib.c (rtx_equal_for_cselib_1, cselib_hash_rtx): Handle
	DEBUG_PARAMETER_REF.
	* rtl.c (rtx_equal_p_cb, rtx_equal_p, iterative_hash_rtx): Likewise.
	* print-rtl.c (print_rtx): Likewise.
	* tree-sra.c (sra_ipa_reset_debug_stmts): Prefer replacing of
	SSA_NAMEs with DEBUG_EXPR_DECLs initialized in source bind
	debug stmts in the first bb.
	* tree-inline.c (remap_ssa_name): If remapping default def
	of a PARM_DECL fails, map to a DEBUG_EXPR_DECL set in
	a source bind debug stmt.
	(remap_gimple_stmt): Handle gimple_debug_source_bind_p.
	(maybe_move_debug_stmts_to_successors): Likewise.
	(copy_debug_stmt): Likewise.  Avoid shadowing a variable.
	(tree_function_versioning): If DECL_HAS_DEBUG_ARGS_P, copy
	debug args vector from old_decl to new_decl.
	* ipa-prop.c (ipa_modify_call_arguments): For optimized away
	or modified parameters, add debug bind stmts before call
	setting DEBUG_EXPR_DECL which is remembered in debug args
	vector.
	* cfgexpand.c (expand_call_stmt): Call expand_debug_expr
	on DECL_DEBUG_EXPRs from debug args vector.
	(expand_debug_source_expr): New function.
	(expand_debug_locations): Use it for source bind insns.
	(expand_gimple_basic_block): Handle gimple_debug_source_bind_p.
	* var-tracking.c (prepare_call_arguments): Add debug args
	to call_arguments if any.
	* dwarf2out.c (dwarf_stack_op_name, size_of_loc_descr,
	output_loc_operands, output_loc_operands_raw,
	resolve_addr_in_expr, compare_loc_operands): Handle
	DW_OP_GNU_parameter_ref.
	(get_ref_die_offset, parameter_ref_descriptor): New functions.
	(mem_loc_descriptor): Handle DEBUG_PARAMETER_REF.
	(gen_subprogram_die): Handle parameters identified by
	DEBUG_PARAMETER_REF.

	* dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref.

From-SVN: r175288
2011-06-22 12:41:58 +02:00
Nicola Pero 70e41a6a27 In gcc/: 2011-06-21 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2011-06-21  Nicola Pero  <nicola.pero@meta-innovation.com>

	* attribs.c (register_attribute): Added assert to check that all
	attribute specs are registered with a name that is not empty and
	does not start with '_'.
	(decl_attributes): Avoid the lookup of the "naked" attribute spec
	if the function has no attributes.
	* tree.c (is_attribute_with_length_p): Removed.
	(is_attribute_p): Removed.
	(private_is_attribute_p): New.  
	(private_lookup_attribute): New.
	(lookup_attribute): Removed.
	(lookup_ident_attribute): New.
	(remove_attribute): Require the first argument to be in the form
	'text', not '__text__'.  Updated asserts.
	(merge_attributes): Use lookup_ident_attributes instead of
	lookup_attribute.
	(merge_dllimport_decl_attributes): Use remove_attribute.
	(attribute_list_contained): Likewise.
	(attribute_list_equal): Immediately return 1 if the arguments are
	identical pointers.
	* tree.h (is_attribute_p): Made inline.  Return a 'bool', not an
	'int'.  Require the first argument to be in the form 'text', not
	'__text__'.  Require the second argument to be an identifier.
	(lookup_attribute): Made inline.  Require the first argument to be
	in the form 'text', not '__text__'.
	(private_is_attribute_p, private_lookup_attribute): New.
	Updated comments.

From-SVN: r175286
2011-06-22 09:52:55 +00:00
Joseph Myers 677f3fa815 target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to common/common-target-def.h.
* target-def.h (TARGET_HAVE_NAMED_SECTIONS): Move to
	common/common-target-def.h.
	* target.def (default_target_flags, handle_option,
	supports_split_stack, optimization_table, init_struct,
	except_unwind_info, unwind_tables_default, have_named_sections):
	Move to common/common-target.def.
	* target.h (enum opt_levels, struct default_options): Move to
	common/common-target.h.
	* targhooks.c (default_except_unwind_info,
	dwarf2_except_unwind_info, sjlj_except_unwind_info,
	default_target_handle_option, empty_optimization_table): Move to
	common/common-targhooks.c.
	* targhooks.h (default_except_unwind_info,
	dwarf2_except_unwind_info, sjlj_except_unwind_info,
	default_target_handle_option, empty_optimization_table): Move to
	common/common-targhooks.h.
	* common/common-target-def.h: Include common/common-targhooks.h.
	(TARGET_HAVE_NAMED_SECTIONS): Define if TARGET_ASM_NAMED_SECTION
	defined.
	* common/common-target.def (handle_option, option_init_struct,
	option_optimization_table, default_target_flags,
	except_unwind_info, supports_split_stack, unwind_tables_default,
	have_named_sections): Move from target.def.
	(HOOK_PREFIX): Undefine at end of file.
	* common/common-target.h: Include input.h.
	(enum opt_levels, struct default_options): Move from target.h.
	* common/common-targhooks.c, common/common-targhooks.h: New.
	* config.gcc (target_has_targetm_common): Default to yes.
	(moxie*): Set target_has_targetm_common=no.
	(hppa*-*-*): Don't set target_has_targetm_common=yes.
	* doc/tm.texi: Regenerate.
	* Makefile.in (COMMON_TARGET_H): Add $(INPUT_H).
	(C_TARGET_DEF_H): Add common/common-targhooks.h.
	(GCC_OBJS): Remove vec.o.
	(OBJS): Remove hooks.o and vec.o.
	(OBJS-libcommon-target): Add vec.o, hooks.o and
	common/common-targhooks.o.
	(c-family/c-common.o, c-family/c-cppbuiltin.o, lto-opts.o, tree.o,
	tree-tailcall.o, opts.o, toplev.o, varasm.o, function.o, except.o,
	expr.o, explow.o, dbxout.o, dwarf2out.o, cfgrtl.o, haifa-sched.o,
	cfglayout.o, $(out_object_file), $(common_out_object_file)):
	Update dependencies.
	(common/common-targhooks.o): New.
	* common/config/default-common.c: Include tm.h.  Add FIXME
	comment.
	* common/config/pa/pa-common.c: Include more headers.  Take
	copyright dates from pa.c.
	(pa_option_optimization_table, pa_handle_option,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_HANDLE_OPTION): Move from pa.c.
	* common/config/alpha/alpha-common.c,
	common/config/arm/arm-common.c, common/config/avr/avr-common.c,
	common/config/bfin/bfin-common.c,
	common/config/cris/cris-common.c,
	common/config/fr30/fr30-common.c, common/config/frv/frv-common.c,
	common/config/h8300/h8300-common.c,
	common/config/i386/i386-common.c,
	common/config/ia64/ia64-common.c,
	common/config/iq2000/iq2000-common.c,
	common/config/lm32/lm32-common.c,
	common/config/m32c/m32c-common.c,
	common/config/m32r/m32r-common.c,
	common/config/m68k/m68k-common.c,
	common/config/mcore/mcore-common.c,
	common/config/mep/mep-common.c,
	common/config/microblaze/microblaze-common.c,
	common/config/mips/mips-common.c,
	common/config/mmix/mmix-common.c,
	common/config/mn10300/mn10300-common.c,
	common/config/pdp11/pdp11-common.c,
	common/config/picochip/picochip-common.c,
	common/config/rs6000/rs6000-common.c,
	common/config/rx/rx-common.c, common/config/s390/s390-common.c,
	common/config/score/score-common.c, common/config/sh/sh-common.c,
	common/config/sparc/sparc-common.c,
	common/config/spu/spu-common.c, common/config/v850/v850-common.c,
	common/config/vax/vax-common.c,
	common/config/xstormy16/xstormy16-common.c,
	common/config/xtensa/xtensa-common.c: New.
	* config/alpha/alpha.c: Include common/common-target.h.
	(alpha_option_optimization_table, alpha_handle_option,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE): Move to alpha-common.c.
	* config/arm/arm-protos.h (arm_except_unwind_info): Declare.
	* config/arm/arm.c (arm_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_EXCEPT_UNWIND_INFO, arm_except_unwind_info): Move to
	arm-common.c.
	* config/avr/avr.c (avr_option_optimization_table,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move
	to avr-common.c.
	* config/bfin/bfin.c (struct bfin_cpu): Move to bfin.h.
	(bfin_cpus, bfin_handle_option, TARGET_HANDLE_OPTION,
	TARGET_DEFAULT_TARGET_FLAGS): Move to bfin-common.c.
	* config/bfin/bfin.h struct bfin_cpu): Move from bfin.c.
	* config/cris/cris.c (cris_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE, cris_handle_option): Move to
	cris-common.c.
	* config/fr30/fr30.c (fr30_option_optimization_table,
	TARGET_EXCEPT_UNWIND_INFO, TARGET_OPTION_OPTIMIZATION_TABLE): Move
	to fr30-common.c.
	* config/frv/frv.c (frv_option_optimization_table,
	MASK_DEFAULT_ALLOC_CC, TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_OPTION_OPTIMIZATION_TABLE): Move to frv-common.c.
	* config/h8300/h8300.c (h8300_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_EXCEPT_UNWIND_INFO): Move to h8300-common.c.
	* config/i386/i386-protos.h (ix86_handle_option): Declare.
	* config/i386/i386.c: Include common/common-target.h.
	(OPTION_MASK_ISA_MMX_SET, OPTION_MASK_ISA_3DNOW_SET,
	OPTION_MASK_ISA_SSE_SET, OPTION_MASK_ISA_SSE2_SET,
	OPTION_MASK_ISA_SSE3_SET, OPTION_MASK_ISA_SSSE3_SET,
	OPTION_MASK_ISA_SSE4_1_SET, OPTION_MASK_ISA_SSE4_2_SET,
	OPTION_MASK_ISA_AVX_SET, OPTION_MASK_ISA_FMA_SET,
	OPTION_MASK_ISA_SSE4_SET, OPTION_MASK_ISA_SSE4A_SET,
	OPTION_MASK_ISA_FMA4_SET, OPTION_MASK_ISA_XOP_SET,
	OPTION_MASK_ISA_LWP_SET, OPTION_MASK_ISA_AES_SET,
	OPTION_MASK_ISA_PCLMUL_SET, OPTION_MASK_ISA_ABM_SET,
	OPTION_MASK_ISA_BMI_SET, OPTION_MASK_ISA_TBM_SET,
	OPTION_MASK_ISA_POPCNT_SET, OPTION_MASK_ISA_CX16_SET,
	OPTION_MASK_ISA_SAHF_SET, OPTION_MASK_ISA_MOVBE_SET,
	OPTION_MASK_ISA_CRC32_SET, OPTION_MASK_ISA_FSGSBASE_SET,
	OPTION_MASK_ISA_RDRND_SET, OPTION_MASK_ISA_F16C_SET,
	OPTION_MASK_ISA_MMX_UNSET, OPTION_MASK_ISA_3DNOW_UNSET,
	OPTION_MASK_ISA_3DNOW_A_UNSET, OPTION_MASK_ISA_SSE_UNSET,
	OPTION_MASK_ISA_SSE2_UNSET, OPTION_MASK_ISA_SSE3_UNSET,
	OPTION_MASK_ISA_SSSE3_UNSET, OPTION_MASK_ISA_SSE4_1_UNSET,
	OPTION_MASK_ISA_SSE4_2_UNSET, OPTION_MASK_ISA_AVX_UNSET,
	OPTION_MASK_ISA_FMA_UNSET, OPTION_MASK_ISA_SSE4_UNSET,
	OPTION_MASK_ISA_SSE4A_UNSET, OPTION_MASK_ISA_FMA4_UNSET,
	OPTION_MASK_ISA_XOP_UNSET, OPTION_MASK_ISA_LWP_UNSET,
	OPTION_MASK_ISA_AES_UNSET, OPTION_MASK_ISA_PCLMUL_UNSET,
	OPTION_MASK_ISA_ABM_UNSET, OPTION_MASK_ISA_BMI_UNSET,
	OPTION_MASK_ISA_TBM_UNSET, OPTION_MASK_ISA_POPCNT_UNSET,
	OPTION_MASK_ISA_CX16_UNSET, OPTION_MASK_ISA_SAHF_UNSET,
	OPTION_MASK_ISA_MOVBE_UNSET, OPTION_MASK_ISA_CRC32_UNSET,
	OPTION_MASK_ISA_FSGSBASE_UNSET, OPTION_MASK_ISA_RDRND_UNSET,
	OPTION_MASK_ISA_F16C_UNSET, ix86_handle_option,
	ix86_option_optimization_table, ix86_option_init_struct,
	ix86_supports_split_stack, TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_OPTION_INIT_STRUCT, TARGET_SUPPORTS_SPLIT_STACK): Move to
	i386-common.c.
	* config/i386/t-i386 (i386.o): Update dependencies.
	* config/ia64/ia64-protos.h (ia64_except_unwind_info): Declare.
	* config/ia64/ia64.c (ia64_option_optimization_table,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	ia64_handle_option): Move to ia64-common.c.
	* config/iq2000/iq2000.c (iq2000_option_optimization_table,
	TARGET_OPTION_OPTIMIZATION_TABLE): Move to iq2000-common.c.
	* config/lm32/lm32.c (lm32_option_optimization_table,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO): Move
	to lm32-common.c.
	* config/m32c/m32c.c (TARGET_HAVE_NAMED_SECTIONS): Move to
	m32c-common.c.
	* config/m32r/m32r.c (m32r_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_EXCEPT_UNWIND_INFO,
	m32r_handle_option): Move to m32r-common.c.
	(m32r_memory_move_cost): Remove comment referring to
	TARGET_HANDLE_OPTION.
	* config/m68k/m68k.c (TARGET_HANDLE_OPTION, m68k_handle_option):
	Move to m68k-common.c.
	* config/mcore/mcore.c (mcore_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_EXCEPT_UNWIND_INFO): Move to mcore-common.c.
	* config/mep/mep.c (mep_option_optimization_table,
	mep_handle_option, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_DEFAULT_TARGET_FLAGS):
	Move to mep-common.c.
	* config/microblaze/microblaze.c
	(microblaze_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_EXCEPT_UNWIND_INFO): Move to microblaze-common.c.
	* config/mips/mips.c (mips_handle_option,
	mips_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Move to
	mips-common.c.
	* config/mmix/mmix.c (mmix_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE):
	Move to mmix-common.c.
	* config/mn10300/mn10300.c (mn10300_option_optimization_table,
	mn10300_handle_option, TARGET_EXCEPT_UNWIND_INFO,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE): Move to mn10300-common.c.
	* config/pa/pa.c: Include common/common-target.h.
	(pa_option_optimization_table, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	pa_handle_option): Move to pa-common.c.
	(pa_option_override): Use targetm_common.except_unwind_info.
	(pa_asm_output_mi_thunk, pa_function_section): Use
	targetm_common.have_named_sections.
	* config/pdp11/pdp11.c (pdp11_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT,
	pdp11_handle_option, pdp11_option_init_struct): Move to
	pdp11-common.c.
	* config/picochip/picochip.c (picochip_option_optimization_table,
	TARGET_HAVE_NAMED_SECTIONS, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_EXCEPT_UNWIND_INFO): Move to picochip-common.c.
	* config/rs6000/rs6000.c: Include common/common-target.h.
	(rs6000_option_optimization_table, TARGET_HANDLE_OPTION,
	TARGET_OPTION_INIT_STRUCT, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_DEFAULT_TARGET_FLAGS, rs6000_option_init_struct,
	rs6000_handle_option): Move to rs6000-common.c.
	* config/rs6000/t-rs6000 (rs6000.o): Update dependencies.
	* config/rx/rx.c (rx_handle_option, rx_option_optimization_table,
	TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_EXCEPT_UNWIND_INFO): Move to rx-common.c.
	* config/s390/s390.c (processor_flags_table,
	s390_option_optimization_table, s390_option_init_struct,
	s390_handle_option, TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE,
	TARGET_OPTION_INIT_STRUCT): Move to s390-common.c.
	* config/s390/s390.h (processor_flags_table): Declare.
	* config/score/score.c (score_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	TARGET_OPTION_OPTIMIZATION_TABLE, MASK_ALL_CPU_BITS,
	score_handle_option): Move to score-common.c.
	* config/sh/sh.c (sh_option_optimization_table,
	TARGET_OPTION_OPTIMIZATION_TABLE, TARGET_OPTION_INIT_STRUCT,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION,
	sh_handle_option, sh_option_init_struct): Move to sh-common.c.
	* config/sparc/sparc.c: Include common/common-target.h.
	(sparc_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_OPTION_OPTIMIZATION_TABLE): Move to sparc-common.c.
	* config/spu/spu.c (TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_OPTION_INIT_STRUCT, TARGET_EXCEPT_UNWIND_INFO,
	spu_option_init_struct): Move to spu-common.c.
	* config/stormy16/stormy16.c (xstorym16_option_optimization_table,
	TARGET_OPTION_OPTIMIZATION_TABLE): Move to xstormy16-common.c.
	* config/v850/v850.c (small_memory_physical_max,
	v850_handle_memory_optionn v850_handle_option,
	v850_option_optimization_table, TARGET_DEFAULT_TARGET_FLAGS,
	TARGET_HANDLE_OPTION, TARGET_OPTION_OPTIMIZATION_TABLE): Move to
	v850-common.c.
	* config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Move to
	vax-common.c.
	* config/xtensa/xtensa.c (xtensa_option_optimization_table,
	TARGET_DEFAULT_TARGET_FLAGS, TARGET_OPTION_OPTIMIZATION_TABLE):
	Move to xtensa-common.c.
	* cfglayout.c: Include common/common-target.h.
	(fixup_reorder_chain): Use targetm_common.have_named_sections.
	* cfgrtl.c: Include common/common-target.h.
	(force_nonfallthru_and_redirect, commit_one_edge_insertion): Use
	targetm_common.have_named_sections.
	* dbxout.c: Include common/common-target.h.
	(dbxout_function_end): Use targetm_common.have_named_sections.
	* defaults.h (STACK_OLD_CHECK_PROTECT, STACK_CHECK_PROTECT): Use
	targetm_common.except_unwind_info.
	* dwarf2out.c: Include common/common-target.h.
	(dwarf2out_do_frame, dwarf2out_do_cfi_asm,
	dwarf2out_begin_prologue, dwarf2out_frame_init,
	dwarf2out_frame_finish, dwarf2out_assembly_start): Use
	targetm_common.except_unwind_info.
	* except.c: Include common/common-target.h.
	(init_eh, finish_eh_generation,
	output_one_function_exception_table): Use
	targetm_common.except_unwind_info.
	(switch_to_exception_section): Use
	targetm_common.have_named_sections.
	* explow.c: Include common/common-target.h.
	* expr.c: Include common/common-target.h.
	(build_personality_function): Use
	targetm_common.except_unwind_info.
	* function.c: Include common/common-target.h.
	(expand_function_end): Use targetm_common.except_unwind_info.
	* haifa-sched.c: Include common/common-target.h.
	(sched_create_recovery_edges): Use
	targetm_common.have_named_sections.
	* lto-opts.c: Include common/common-target.h instead of target.h.
	(lto_reissue_options): Use targetm_common.handle_option.
	* opts.c: Include common/common-target.h.
	(target_handle_option): Use targetm_common.handle_option.
	(init_options_struct): Update comment referring to
	targetm.target_option.optimization.  Use
	targetm_common.default_target_flags,
	targetm_common.unwind_tables_default and
	targetm_common.option_init_struct.
	(default_options_optimization): Use
	targetm_common.option_optimization_table.
	(finish_options): Use targetm_common.except_unwind_info,
	targetm_common.unwind_tables_default,
	targetm_common.have_named_sections and
	targetm_common.supports_split_stack.
	* toplev.c: Include common/common-target.h.
	(process_options): Use targetm_common.have_named_sections.
	* tree-tailcall.c: Include common/common-target.h.
	(suitable_for_tail_call_opt_p): Use
	targetm_common.except_unwind_info.
	* tree.c: Include common/common-target.h.
	(build_common_builtin_nodes): Use
	targetm_common.except_unwind_info.
	* varasm.c: Include common/common-target.h.
	(resolve_unique_section, hot_function_section,
	default_function_section): Use targetm_common.have_named_sections.

ada:
	* gcc-interface/Make-lang.in (gnatbind$(exeext)): Use ggc-none.o.
	(ada/utils.o): Update dependencies.
	* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Add
	../../../libcpp/libcpp.a.
	* gcc-interface/utils.c: Include common/common-target.h.
	(process_attributes): Use targetm_common.have_named_sections.

c-family:
	* c-common.c: Include common/common-target.h.
	(handle_section_attribute): Use
	targetm_common.have_named_sections.
	* c-cppbuiltin.c: Include common/common-target.h.
	(c_cpp_builtins): Use targetm_common.except_unwind_info.

cp:
	* Make-lang.in (cp/method.o): Update dependencies.
	* method.c: Include common/common-target.h.
	(use_thunk): Use targetm_common.have_named_sections.

go:
	* Make-lang.in (go/go-lang.o, go/go-backend.o): Update
	dependencies.
	* go-backend.c: Include common/common-target.h.
	(go_write_export_data): Use targetm_common.have_named_sections.
	* go-lang.c: Include common/common-target.h.
	(go_langhook_init_options_struct): Use
	targetm_common.supports_split_stack.

po:
	* exgettext: Handle common/ directory and subdirectories.

From-SVN: r175064
2011-06-15 00:11:35 +01:00
Richard Guenther 67b884536d stor-layout.c (initialize_sizetypes): Initialize all sizetypes based on target definitions.
2011-06-07  Richard Guenther  <rguenther@suse.de>

	* stor-layout.c (initialize_sizetypes): Initialize all
	sizetypes based on target definitions.
	(set_sizetype): Remove.
	* tree.c (build_common_tree_nodes): Do not call set_sizetype.
	* tree.h (set_sizetype): Remove.

From-SVN: r174748
2011-06-07 14:37:39 +00:00
Richard Guenther 009db07487 tree.c (build_common_tree_nodes): Also initialize size_type_node.
2011-06-07  Richard Guenther  <rguenther@suse.de>

	* tree.c (build_common_tree_nodes): Also initialize size_type_node.
	Call set_sizetype from here.

	c-family/
	* c-common.c (c_common_nodes_and_builtins): Do not set
	size_type_node or call set_sizetype.

	go/
	* go-lang.c (go_langhook_init): Do not set
	size_type_node or call set_sizetype.

	fortran/
	* f95-lang.c (gfc_init_decl_processing): Do not set
	size_type_node or call set_sizetype.

	java/
	* decl.c (java_init_decl_processing): Properly initialize
	size_type_node.

	lto/
	* lto-lang.c (lto_init): Do not set
	size_type_node or call set_sizetype.

	ada/
	* gcc-interface/misc.c (gnat_init): Do not set
	size_type_node or call set_sizetype.

From-SVN: r174743
2011-06-07 13:01:27 +00:00
Richard Guenther 6807da97b7 tree.c (free_lang_data): Do not reset boolean_type_node nor char_type_node.
2011-06-01  Richard Guenther  <rguenther@suse.de>

	* tree.c (free_lang_data): Do not reset boolean_type_node nor
	char_type_node.
	* lto-streamer.c (lto_record_common_node): Take node pointer,
	do not register types.
	(lto_preload_common_nodes): Explicitly skip preloading nodes
	that differ between frontends.

	lto/
	* lto-lang.c (lto_register_canonical_types): New function.
	(lto_init): Register common nodes with the canonical type machinery.
	Do not play tricks with char_type_node.

From-SVN: r174519
2011-06-01 08:52:33 +00:00
Nathan Froyd 4f60111fd4 re PR c/4910 (imacat <imacat@mail.imacat.idv.tw>)
fix PR bootstrap/4910
gcc/
	PR bootstrap/49190

	Revert:
	2011-05-26  Nathan Froyd  <froydnj@codesourcery.com>

	* tree.h (struct tree_identifier): Inherit from tree_typed, not
	tree_common.
	(HT_IDENT_TO_GCC_IDENT): Adjust for said change.
	* tree.c (initialize_tree_contains_struct): Mark TS_IDENTIFIER as
	TS_BASE instead of TS_COMMON.
	* varasm.c (assemble_name): Remove assert.

gcc/c-family/
	PR bootstrap/49190

	Revert:
	2011-05-26  Nathan Froyd  <froydnj@codesourcery.com>

	* c-common.h (struct c_common_identifier): Inherit from tree_typed,
	not tree_common.

From-SVN: r174445
2011-05-30 16:42:05 +00:00
Nathan Froyd 38e01f9ec9 move TS_STATEMENT_LIST to be a substructure of TS_TYPED
move TS_STATEMENT_LIST to be a substructure of TS_TYPED
gcc/
	* c-decl.c (c_push_function_context): Copy the current statement
	list stack.
	(add_stmt): Check building_stmt_list_p and push_stmt if necessary.
	(finish_struct): Call building_stmt_list_p instead of checking
	cur_stmt_list.
	* c-parser.c (c_parser_postfix_expression): Likewise.
	* c-typeck.c (c_end_compound_stmt): Likewise.
	* print-tree.c (print_node) [STATEMENT_LIST]: Don't print TREE_CHAIN.
	* tree-iterator.c (stmt_list_cache): Change to a VEC.
	(alloc_stmt_list): Adjust for stmt_list_cache's new type.
	(free_stmt_list): Likewise.
	* tree.h (struct tree_statement_list): Include typed_tree instead
	of tree_common.
	* tree.c (initialize_tree_contains_struct): Mark TS_STATEMENT_LIST
	as TS_TYPED instead of TS_COMMON.

gcc/c-family/
	* c-common.h (struct stmt_tree_s) [x_cur_stmt_list]: Change to a VEC.
	(stmt_list_stack): Define.
	(cur_stmt_list): Adjust for new type of x_cur_stmt_list.
	* c-semantics.c (push_stmt_list, pop_stmt_list): Likewise.

gcc/cp/
	* cp-tree.h (building_stmt_tree): Delete.
	* decl.c (save_function_data): Tweak initializer for x_cur_stmt_list.
	(build_aggr_init_full_exprs): Call building_stmt_list_p
	instead of building_stmt_tree.
	(initialize_local_var): Likewise.
	(finish_function): Likewise.
	* decl2.c (finish_anon_union): Likewise.
	* init.c (begin_init_stmts): Likewise.
	(finish_init_stmts): Likewise.
	(expand_aggr_init_1): Likewise.
	* name-lookup.c (do_local_using_decl): Likewise.
	(do_namespace_alias): Likewise.
	(do_using_directive): Likewise.
	(cp_emit_debug_info_for_using): Likewise.
	* semantics.c (add_stmt): Assert that stmt_list_stack is non-empty.

From-SVN: r174343
2011-05-27 17:43:44 +00:00
Nathan Froyd 92e948a836 make TS_BLOCK a substructure of TS_BASE
make TS_BLOCK a substructure of TS_BASE
gcc/
	* tree.c (initialize_tree_contains_struct): Mark TS_BLOCK as
	TS_BASE instead of TS_COMMON.
	(find_decls_types_r): Check for TS_TYPED structure before looking at
	TREE_TYPE.
	* tree.h (struct tree_block): Inherit from tree_base, not tree_common.
	Add chain field.
	(BLOCK_CHAIN): Use new chain field.

gcc/c-family/
	* c-common.c (warning_candidate_p): Check for BLOCKs.

gcc/java/
	* decl.c (poplevel): Don't access TREE_TYPE of BLOCKs.
	* expr.c (build_jni_stub): Likewise.

From-SVN: r174300
2011-05-26 17:38:51 +00:00
Nathan Froyd a2fc3e63a7 make TS_IDENTIFIER be a substructure of TS_TYPED
make TS_IDENTIFIER be a substructure of TS_TYPED
gcc/
	* tree.h (struct tree_identifier): Inherit from tree_typed, not
	tree_common.
	(HT_IDENT_TO_GCC_IDENT): Adjust for said change.
	* tree.c (initialize_tree_contains_struct): Mark TS_IDENTIFIER as
	TS_BASE instead of TS_COMMON.
	* varasm.c (assemble_name): Remove assert.

gcc/c-family/
	* c-common.h (struct c_common_identifier): Inherit from tree_typed,
	not tree_common.

From-SVN: r174286
2011-05-26 13:29:42 +00:00
Nathan Froyd d9f8303fb6 move TS_EXP to be a substructure of TS_TYPED
move TS_EXP to be a substructure of TS_TYPED
gcc/
	* tree.h (struct tree_exp): Inherit from struct tree_typed.
	* tree.c (initialize_tree_contains_struct): Mark TS_EXP as TS_TYPED
	instead of TS_COMMON.

gcc/lto/
	* lto.c (lto_ft_typed): New function.
	(lto_ft_common): Call it.
	(lto_ft_constructor): Likewise.
	(lto_ft_expr): Likewise.
	(lto_fixup_prevailing_decls): Check for TS_COMMON before accessing
	TREE_CHAIN.

From-SVN: r174192
2011-05-25 12:52:10 +00:00
Bernd Schmidt cdbf45414a libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined.
gcc/
	* libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if
	LIBGCC2_GNU_PREFIX is defined.
	(__N): New macro.
	(__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2,
	__mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3,
	__divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack,
	__clz_tab): Define using __N.
	(__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if
	COMPAT_SIMODE_TRAPPING_ARITHMETIC.
	* target.def (libfunc_gnu_prefix): New hook.
	* doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document.
	(TARGET_LIBFUNC_GNU_PREFIX): Add hook.
	* doc/tm.texi: Regenerate.
	* system.h (LIBGCC2_GNU_PREFIX): Poison.
	* optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into
	account.
	(gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise.
	(init_optabs): Likewise for the bswap libfuncs.
	* tree.c (build_common_builtin_nodes): Likewise for complex multiply
	and divide.
	* config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir).
	* config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise.
	* libgcc-std.ver: Remove.
	* Makefile.in (srcdirify): Handle $$(libgcc_objdir).
	* config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for
	libgcc-std.ver.
	* config/i386/t-linux (SHLIB_MAPFILES): Likewise.
	* config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise.
	* config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise.
	* config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise.
	* config/sparc/t-linux (SHLIB_MAPFILES): Likewise.
	* config/i386/t-linux (SHLIB_MAPFILES): Likewise.
	* config/i386/t-linux (SHLIB_MAPFILES): Likewise.
	* config/fixed-bit.h (FIXED_OP): Define differently depending on
	LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores.
	(FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise.

	libgcc/
	* libgcc-std.ver.in: New file.
	* Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New
	variables.
	(libgcc-std.ver): New rule.
	* config/t-gnu-prefix: New file.

From-SVN: r174187
2011-05-25 12:11:42 +00:00
Jason Merrill 57421f45e8 * tree.c (type_hash_canon): Use struct tree_type_non_common.
From-SVN: r173692
2011-05-11 21:36:38 -04:00
Nathan Froyd 515456820e split tree_type
split tree_type
gcc/ada/
	* gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE): Use TYPE_MINVAL.
	(TYPE_GCC_MIN_VALUE): Use TYPE_MINVAL.
	(TYPE_GCC_MAX_VALUE): Use TYPE_MAXVAL.

gcc/cp/
	* cp-tree.h (TYPENAME_TYPE_FULLNAME, TYPEOF_TYPE_EXPR): Use
	TYPE_VALUES_RAW.
	(UNDERLYING_TYPE_TYPE, DECLTYPE_TYPE_EXPR): Likewise.
	(DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): Likewise.
	(TEMPLATE_TYPE_PARM_INDEX): Likewise.

gcc/
	* ggc-page.c (extra_order_size_table): Use struct
	tree_type_non_common.
	* lto-streamer-in.c (unpack_ts_type_value_fields): Rename to...
	(unpack_ts_type_common_value_fields): ...this.  Update comment.
	(unpack_value_fields): Adjust for renaming.
	(lto_input_ts_type_tree_pointers): Split into...
	(lto_input_ts_type_common_tree_pointer): ...this and...
	(lto_input_ts_type_non_common_tree_pointers): ...this.
	(lto_input_tree_pointers): Adjust for above split.
	* lto-streamer-out.c (pack_ts_type_value_fields): Rename to...
	(pack_ts_type_common_value_fields): ...this.  Update comment.
	(lto_output_ts_type_tree_pointers): Split into...
	(lto_output_ts_type_common_tree_pointers): ...this and...
	(lto_output_ts_type_non_common_tree_pointers): ...this.
	(lto_output_tree_pointers): Adjust for above split.
	* lto-streamer.c (check_handled_ts_structures): Mark TS_TYPE_COMMON,
	TS_TYPE_WITH_LANG_SPECIFIC, and TS_TYPE_NON_COMMON as handled.
	* stor-layout.c (vector_type_mode): Adjust location of mode field.
	* tree.h (MARK_TS_TYPE_COMMON, MARK_TS_TYPE_WITH_LANG_SPECIFIC):
	Define.
	(struct tree_type): Split into...
	(struct tree_type_common: ...this and...
	(struct tree_type_with_lang_specific): ...this and...
	(struct tree_type_non_common): ...this.  Adjust accessor macros
	accordingly.
	(TYPE_VALUES_RAW): Define.
	(union tree_node): Update for above changes.
	* tree.c (tree_node_structure_for_code) [tcc_type]: Return
	TS_TYPE_NON_COMMON.
	(initialize_tree_contains_struct) [TS_TYPE]: Use TS_TYPE_COMMON.
	Add TS_TYPE_WITH_LANG_SPECIFIC and TS_TYPE_NON_COMMON.
	(tree_code_size) [tcc_type]: Use struct tree_type_non_common.
	* treestructu.def (TS_TYPE): Remove.
	(TS_TYPE_COMMON, TS_TYPE_WITH_LANG_SPECIFIC, TS_TYPE_NON_COMMON):
	Define.

gcc/java/
	* java-tree.h (TYPE_ARGUMENT_SIGNATURE): Use TYPE_MINVAL.

gcc/lto/
	* lto.c (lto_ft_type): Use TYPE_MINVAL and TYPE_MAXVAL.  Adjust
	location of binfo field.
	(lto_fixup_prevailing_decls): Likewise.

gcc/objc/
	* objc-act.h (CLASS_NAME, CLASS_SUPER_NAME): Use proper accessors.
	(CLASS_NST_METHODS, CLASS_CLS_METHODS): Likewise.
	(PROTOCOL_NAME, PROTOCOL_NST_METHODS, PROTOCOL_CLS_METHODS): Likewise.

From-SVN: r173658
2011-05-11 13:48:55 +00:00
Nathan Froyd 3d528853ba generalize build_case_label to the rest of the compiler
generalize build_case_label to the rest of the compiler
gcc/ada/
	* gcc-interface/trans.c (Case_Statement_to_gnu): Call
	build_case_label.

gcc/
	* except.c (sjlj_emit_dispatch_table): Call build_case_label.
	* gimplify.c (gimplify_switch_expr): Likewise.
	* omp-low.c (expand_omp_sections): Likewise.
	* tree-eh.c (lower_try_finally_switch): Likewise.
	(lower_eh_dispatch): Likewise.
	* tree.h (build_case_label): Declare.
	* tree.c (build_case_label): Define.

gcc/c-family/
	* c-common.c (c_add_case_label): Omit the loc argument to
	build_case_label.
	* c-common.h (build_case_label): Remove.
	* c-semantics.c (build_case_label): Remove.

gcc/cp/
	* decl.c (finish_case_label): Omit the loc argument to
	build_case_label.

gcc/fortran/
	* trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label.
	* trans-io.c (add_case): Likewise.
	* trans-stmt.c (gfc_trans_integer_select): Likewise.
	(gfc_trans_character_select): Likewise.

gcc/go/
	* go-gcc.cc (Gcc_backend::switch_statement): Call build_case_label.

gcc/java/
	* expr.c (expand_java_switch): Call build_case_label.
	(expand_java_add_case): Likewise.

From-SVN: r173467
2011-05-06 03:47:57 +00:00
Nathan Froyd 6c32445bf5 tree.h (build_function_type_array): Declare.
gcc/
	* tree.h (build_function_type_array): Declare.
	(build_varargs_function_type_array): Declare.
	(build_function_type_vec, build_varargs_function_type_vec): Define.
	* tree.c (build_function_type_array_1): New function.
	(build_function_type_array): New function.
	(build_varargs_function_type_array): New function.

gcc/fortran/
	* trans-decl.c (build_library_function_decl_1): Call
	build_function_type_vec.  Adjust argument list building accordingly.
	* trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Likewise.
	* trans-types.c (gfc_get_function_type): Likewise.

From-SVN: r173375
2011-05-04 13:44:48 +00:00
Richard Sandiford 272c6793a0 md.texi (vec_load_lanes, [...]): Document.
gcc/
	* doc/md.texi (vec_load_lanes, vec_store_lanes): Document.
	* optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New
	convert_optab_index values.
	(vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs.
	* genopinit.c (optabs): Initialize the new optabs.
	* internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions.
	* internal-fn.c (get_multi_vector_move, expand_LOAD_LANES)
	(expand_STORE_LANES): New functions.
	* tree.h (build_array_type_nelts): Declare.
	* tree.c (build_array_type_nelts): New function.
	* tree-vectorizer.h (vect_model_store_cost): Add a bool argument.
	(vect_model_load_cost): Likewise.
	(vect_store_lanes_supported, vect_load_lanes_supported)
	(vect_record_strided_load_vectors): Declare.
	* tree-vect-data-refs.c (vect_lanes_optab_supported_p)
	(vect_store_lanes_supported, vect_load_lanes_supported): New functions.
	(vect_transform_strided_load): Split out statement recording into...
	(vect_record_strided_load_vectors): ...this new function.
	* tree-vect-stmts.c (create_vector_array, read_vector_array)
	(write_vector_array, create_array_ref): New functions.
	(vect_model_store_cost): Add store_lanes_p argument.
	(vect_model_load_cost): Add load_lanes_p argument.
	(vectorizable_store): Try to use store-lanes functions for
	interleaved stores.
	(vectorizable_load): Likewise load-lanes and loads.
	* tree-vect-slp.c (vect_get_and_check_slp_defs): Update call
	to vect_model_store_cost.
	(vect_build_slp_tree): Likewise vect_model_load_cost.

From-SVN: r173291
2011-05-03 07:46:54 +00:00
Richard Guenther f070a9d108 tree.c (tree_code_counts): New global array.
2011-05-02  Richard Guenther  <rguenther@suse.de>

	* tree.c (tree_code_counts): New global array.
	(record_node_allocation_statistics): Count individual tree codes.
	(dump_tree_statistics): Dump individual code stats.

From-SVN: r173244
2011-05-02 11:12:26 +00:00
Xinliang David Li 10adac5108 split checksum into cfg checksum and line checksum
From-SVN: r173147
2011-04-29 00:19:35 +00:00
Richard Guenther 7d6e252187 Makefile.in (tree-ssa-structalias.o): Remove gt-tree-ssa-structalias.h dependency.
2011-04-27  Richard Guenther  <rguenther@suse.de>

	* Makefile.in (tree-ssa-structalias.o): Remove
	gt-tree-ssa-structalias.h dependency.
	(GTFILES): Remove tree-ssa-structalias.c.
	* tree.c (allocate_decl_uid): New function.
	(make_node_stat): Use it.
	(copy_node_stat): Likewise.
	* tree.h (allocate_decl_uid): Declare.
	* tree-ssa-alias.h (delete_alias_heapvars): Remove.
	* tree-ssa.c (delete_tree_ssa): Do not call delete_alias_heapvars.
	* tree-flow.h (struct var_ann_d): Remove is_heapvar flag.
	* tree-ssa-live.c (remove_unused_locals): Do not check is_heapvar
	flag.
	* tree-ssa-structalias.c (heapvar_for_stmt): Remove.
	(struct heapvar_map): Likewise.
	(heapvar_map_eq, heapvar_map_hash, heapvar_lookup,
	heapvar_insert): Likewise.
	(make_heapvar_for): Rename to ...
	(make_heapvar): ... this.  Simplify.
	(fake_var_decl_obstack): New global var.
	(build_fake_var_decl): New function.
	(make_constraint_from_heapvar): Adjust.
	(handle_lhs_call): Likewise.
	(create_function_info_for): Likewise.
	(intra_create_variable_infos): Likewise.
	(init_alias_vars): Allocate fake_var_decl_obstack.
	(init_alias_heapvars, delete_alias_heapvars): Remove.
	(compute_points_to_sets): Do not call init_alias_heapvars.
	(ipa_pta_execute): Likewise.
	(delete_points_to_sets): Free fake_var_decl_obstack.

	* gcc.dg/tree-ssa/pr23382.c: Remove.

From-SVN: r173030
2011-04-27 14:16:49 +00:00
Richard Guenther 1df5b0db1c tree.c (build_int_cst): Properly create canonicalized integer constants.
2011-04-22  Richard Guenther  <rguenther@suse.de>

	* tree.c (build_int_cst): Properly create canonicalized integer
	constants.
	(build_int_cst_type): Remove scary comments.

From-SVN: r172871
2011-04-22 19:29:54 +00:00
Richard Guenther aa2a43d2e8 re PR debug/48703 (segfault in canonicalize_for_substitution)
2011-04-21  Richard Guenther  <rguenther@suse.de>

	PR lto/48703
	* tree.c (free_lang_data_in_decl): Do not zero TREE_TYPE of
	DECL_NAME.

	* g++.dg/lto/pr48207-2_0.C: New testcase.
	* g++.dg/lto/pr48207-3_0.C: Likewise.

From-SVN: r172830
2011-04-21 14:35:43 +00:00
Richard Sandiford 267d3070f7 Revert last patch.
From-SVN: r172763
2011-04-20 09:25:42 +00:00
Richard Sandiford c2d7ab2aea md.texi (vec_load_lanes, [...]): Document.
gcc/
	* doc/md.texi (vec_load_lanes, vec_store_lanes): Document.
	* optabs.h (COI_vec_load_lanes, COI_vec_store_lanes): New
	convert_optab_index values.
	(vec_load_lanes_optab, vec_store_lanes_optab): New convert optabs.
	* genopinit.c (optabs): Initialize the new optabs.
	* internal-fn.def (LOAD_LANES, STORE_LANES): New internal functions.
	* internal-fn.c (get_multi_vector_move, expand_LOAD_LANES)
	(expand_STORE_LANES): New functions.
	* tree.h (build_array_type_nelts): Declare.
	* tree.c (build_array_type_nelts): New function.
	* tree-vectorizer.h (vect_model_store_cost): Add a bool argument.
	(vect_model_load_cost): Likewise.
	(vect_store_lanes_supported, vect_load_lanes_supported)
	(vect_record_strided_load_vectors): Declare.
	* tree-vect-data-refs.c (vect_lanes_optab_supported_p)
	(vect_store_lanes_supported, vect_load_lanes_supported): New functions.
	(vect_transform_strided_load): Split out statement recording into...
	(vect_record_strided_load_vectors): ...this new function.
	* tree-vect-stmts.c (create_vector_array, read_vector_array)
	(write_vector_array, create_array_ref): New functions.
	(vect_model_store_cost): Add store_lanes_p argument.
	(vect_model_load_cost): Add load_lanes_p argument.
	(vectorizable_store): Try to use store-lanes functions for
	interleaved stores.
	(vectorizable_load): Likewise load-lanes and loads.
	* tree-vect-slp.c (vect_get_and_check_slp_defs)
	(vect_build_slp_tree):

From-SVN: r172760
2011-04-20 09:10:36 +00:00
Richard Guenther d39132ea9b re PR debug/48207 (ICE in lhd_set_decl_assembler_name, at langhooks.c:158)
2011-04-19  Richard Guenther  <rguenther@suse.de>

	PR lto/48207
	* tree.c (free_lang_data): Do not reset the decl-assembler-name
	langhook.

	* g++.dg/lto/pr48207_0.C: New testcase.

From-SVN: r172708
2011-04-19 13:04:57 +00:00
Richard Guenther 75e802cc5f tree.c (upper_bound_in_type): Build properly canonicalized INTEGER_CSTs.
2011-04-18  Richard Guenther  <rguenther@suse.de>

	* tree.c (upper_bound_in_type): Build properly canonicalized
	INTEGER_CSTs.
	(lower_bound_in_type): Likewise.

From-SVN: r172645
2011-04-18 13:58:47 +00:00
Richard Guenther d25a79eae6 re PR c/48650 (valgrind: Invalid write of size 8 in build_string (tree.c:1524))
2011-04-18  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48650
	* tree.c (build_string): STRING_CST is now derived from tree_typed.

From-SVN: r172642
2011-04-18 11:18:01 +00:00
Nathan Froyd 94bd182513 tree.h (struct tree_constructor): Include tree_typed instead of tree_common.
* tree.h (struct tree_constructor): Include tree_typed instead of
	tree_common.
	* tree.c (initialize_tree_contains_struct): Mark TS_CONSTRUCTOR as
	TS_TYPED instead of TS_COMMON.

From-SVN: r172409
2011-04-14 01:38:07 +00:00
Nathan Froyd 4b1a46942e tree-flow.h (struct gimple_df): Make free_ssanames a VEC.
* tree-flow.h (struct gimple_df): Make free_ssanames a VEC.
	* tree-ssanames.c (fini_ssanames): VEC_free it.
	(make_ssa_name_fn): Update for VECness of free_ssanames.
	(release_ssa_name, release_dead_ssa_names): Likewise.
	* tree.h (struct tree_ssa_name): Include tree_typed instead of
	tree_common.
	* tree.c (initialize_tree_contains_struct): Mark TS_SSA_NAME as
	TS_TYPED instead of TS_COMMON.

From-SVN: r172393
2011-04-13 20:32:30 +00:00
Nathan Froyd 9698252f89 tree.h (struct tree_int_cst, [...]): Include tree_typed instead of tree_common.
* tree.h (struct tree_int_cst, struct real_value): Include tree_typed
	instead of tree_common.
	(struct tree_fixed_cst, struct tree_string, struct tree_complex):
	Likewise.
	* tree.c (initialize_tree_contains_struct): Mark such nodes as being
	TS_TYPED rather than TS_COMMON.
	* print-tree.c (print_node) [STRING_CST]: Don't print TREE_CHAIN.

From-SVN: r172386
2011-04-13 17:04:36 +00:00
Nathan Froyd 81f653d624 ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN.
gcc/ada/
	* gcc-interface/ada-tree.h (union lang_tree_node): Check for
	TS_COMMON before calling TREE_CHAIN.
	* gcc-interface/misc.c (gnat_init_ts): New function.
	(LANG_HOOKS_INIT_TS): Define.

gcc/
	* c-decl.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.
	* print-tree.c (print_node): Likewise.
	* tree-inline.c (copy_tree_r): Likewise.
	* c-lang.c (LANG_HOOKS_INIT_TS): Define.
	* lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED
	instead of TS_COMMON.
	* lto-streamer-out.c (lto_output_tree_pointers): Likewise.
	* tree.c (initialize_tree_contains_struct): Handle TS_TYPED.
	(copy_node_stat): Zero TREE_CHAIN only if necessary.
	(MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these...
	(MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL):
	...and these...
	(MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these...
	* tree.h: ...here.
	(TREE_CHAIN): Check for a TS_COMMON structure.
	(TREE_TYPE): Check for a TS_TYPED structure.

gcc/c-family/
	* c-common.h (c_common_init_ts): Declare.
	* c-common.c (c_common_init_ts): Define.

gcc/cp/
	* cp-lang.c (cp_init_ts): Call cp_common_init_ts.  Move
	tree_contains_struct initialization to...
	* cp-objcp-common.c (cp_common_init_ts): ...here.  Use MARK_*
	macros.
	* cp-objcp-common.h (cp_common_init_ts): Declare.
	* cp-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/fortran/
	* f95-lang.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/go/
	* go-lang.c (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/java/
	* java-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.

gcc/lto/
	* lto-tree.h (union lang_tree_node): Check for TS_COMMON before
	calling TREE_CHAIN.
	* lto.c (lto_fixup_common): Likewise.

gcc/objc/
	* objc-lang.c (objc_init_ts): Move code for this function...
	* objc-act.c (objc_common_init_ts): ...here. Define.
	* objc-act.h (objc_common_init_ts): Declare.

gcc/objcp/
	* objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and
	cp_common_init_ts.

From-SVN: r172359
2011-04-13 03:09:53 +00:00
Nathan Froyd 648a616b30 tree.h (struct typed_tree): New.
* tree.h (struct typed_tree): New.
	(struct tree_common): Include it instead of tree_base.
	(TREE_TYPE): Update for new location of type field.
	(TYPE_USER_ALIGN, TYPE_PACKED): Refer to base field directly.
	(DECL_USER_ALIGN, DECL_PACKED): Likewise.
	(union tree_node): Add typed field.
	* treestruct.def (TS_TYPED): New.
	* lto-streamer.c (check_handled_ts_structures): Handle it.
	* tree.c (MARK_TS_TYPED): New macro.
	(MARK_TS_COMMON): Call it instead of MARK_TS_BASE.

From-SVN: r172295
2011-04-12 02:18:41 +00:00
Duncan Sands b365495ab5 Bail out rather than crashing in array_type_nelts if TYPE_MAX_VALUE is null.
From-SVN: r172227
2011-04-09 16:18:01 +00:00
Nathan Froyd 2c081cafc8 tree.h (struct tree_const_decl): Inherit from tree_decl_common.
* tree.h (struct tree_const_decl): Inherit from tree_decl_common.
	* tree.c (initialize_tree_contains_struct): Adjust accordingly.

From-SVN: r171923
2011-04-04 01:40:17 +00:00
Michael Matz ac6a641b41 tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not an integer.
* tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not
	an integer.
	* tree.h (tree_decl_non_common.vindex): Adjust comment.

From-SVN: r171904
2011-04-03 11:14:14 +00:00
Michael Matz 91f2fae8cc tree.c (decl_init_priority_insert): Don't create entry for default priority.
* tree.c (decl_init_priority_insert): Don't create entry for
	default priority.
	(decl_fini_priority_insert): Ditto.
	(fields_compatible_p, find_compatible_field): Remove.
	* tree.h (fields_compatible_p, find_compatible_field): Remove.
	* gimple.c (gimple_compare_field_offset): Adjust block comment.

From-SVN: r171902
2011-04-03 11:11:25 +00:00
Kai Tietz ba78087b6c Changelog c-family/
2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* c-ada-spec.c (compare_comment): Use filename_cmp
	instead of strcmp for filename.


Changelog fortran/

2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* scanner.c (preprocessor_line): Use filename_cmp
	instead of strcmp.

Changelog gcc/

2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* collect2.c (write_c_file_stat): Handle backslash
	as right-hand directory separator.
	(resolve_lib_name): Use IS_DIR_SEPARATOR instead of
	checking just for slash.
	* coverage.c (coverage_init): Use IS_ABSOLUTE_PATH
	instead of checking for trailing slash.
	* gcc.c (record_temp_file): Use filename_cmp instead
	of strcmp.
	(do_spec_1): Likewise.
	(replace_outfile_spec_function): Likewise.
	(is_directory): Use filename_ncmp instead of strncmp.
	(print_multilib_info): Likewise.
	* gcov.c (find_source): Use filename_cmp instead
	instead of strcmp.
	(make_gcov_file_name): Fix order of slash/backslash
	checks.
	* incpath.c (DIRS_EQ): Use filename_cmp instead of strcmp.
	(add_standard_paths): Likewise.
	* mips-tfile.c (saber_stop): Handle backslash.
	* prefix.c (update_path): Use filename_ncmp instead of
	strncmp.
	* profile.c (output_location): Use filename_cmp instead
	of strcmp.
	* read-md.c (handle_toplevel_file): Handle backslash.
	* tlink.c (frob_extension):  Likewise.
	* tree-cfg.c (same_line_p): Use filename_cmp instead of
	strcmp.
	* tree-dump.c (dequeue_and_dump): Handle backslash.
	* tree.c (get_file_function_name): Likewise.
	* gengtype.c (read_input_list): Likewise.
	(get_file_realbasename): Likewise.
	(get_output_file_with_visibility): Use filename_cmp
	instead of strcmp.

ChangeLog java/

2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* jcf-parse.c (java_read_sourcefilenames): Use filename_cmp
	instead of strcmp.
	(set_source_filename): Likewise.
	* win32-host.c (jcf_open_exact_case): Likewise.

ChangeLog lto/

2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* lto.c (lto_resolution_read): Use filename_cmp instead
	of strcmp.
	(lto_read_section_data): Likewise.


ChangeLog cp/

2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* lex.c (interface_strcmp): Handle dos-paths.
	(handle_pragma_implementation): Use filename_cmp instead of
	strcmp.
	(in_main_input_context): Likewise.

From-SVN: r171522
2011-03-25 20:20:52 +01:00
Kai Tietz ac9a30aeb2 ChangeLog gcc/
2011-03-25  Kai Tietz  <ktietz@redhat.com>

	* c-typeck.c (comptypes_internal): Replace target
	hook call of comp_type_attributes by version in tree.c file.
	* gimple.c (gimple_types_compatible_p_1): Likewise.
	* tree-ssa.c (useless_type_conversion_p): Likewise.
	* tree.c (build_type_attribute_qual_variant): Likewise.
	(attribute_value_equal): New static helper function.
	(comp_type_attributes): New function.
	(merge_attributes): Use attribute_value_equal for comparison.
	(attribute_list_contained): Likewise.
	* tree.h (comp_type_attributes): New prototype.

ChangeLog cp/
2011-03-25  Kai Tietz  <ktietz@redhat.com>

        * decl.c (decls_match): Replace target hook
        call of comp_type_attributes by version in tree.c file.
        * search.c (check_final_overrider): Likewise.
        * typeck.c (structural_comptypes): Likewise.

From-SVN: r171445
2011-03-25 11:28:12 +01:00
Nathan Froyd 63ee8641f8 tree.c (record_node_allocation_statistics): New function.
* tree.c (record_node_allocation_statistics): New function.
	(make_node_stat, copy_node_stat, build_string): Call it.
	(make_tree_binfo_stat, make_tree_vec_stat, tree_cons_stat): Likewise.
	(build1_stat, build_omp_clause): Likewise.

From-SVN: r171399
2011-03-24 15:23:23 +00:00
Richard Guenther cfef45c809 re PR tree-optimization/46562 (CCP currently needs iteration for &a[i])
2011-03-24  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46562
	* tree.c (build_invariant_address): New function.
	* tree.h (build_invariant_address): Declare.
	* tree-dfa.c (get_addr_base_and_unit_offset): Wrap around
	a renamed function moved ...
	* tree-flow-inline.h (get_addr_base_and_unit_offset_1): ... here.
	Take valueization callback parameter.
	* tree-flow.h (gimple_fold_stmt_to_constant): Declare.
	* gimple-fold.h: New file.
	* tree-ssa-ccp.c (ccp_fold): Use gimple_fold_stmt_to_constant_1.
	(ccp_fold, fold_const_aggregate_ref,
	fold_ctor_reference, fold_nonarray_ctor_reference,
	fold_array_ctor_reference, fold_string_cst_ctor_reference,
	get_base_constructor): Move ...
	* gimple-fold.c: ... here.
	(gimple_fold_stmt_to_constant_1): New function
	split out from ccp_fold.  Take a valueization callback parameter.
	Valueize all operands.
	(gimple_fold_stmt_to_constant): New wrapper function.
	(fold_const_aggregate_ref_1): New function split out from
	fold_const_aggregate_ref.  Take a valueization callback parameter.
	(fold_const_aggregate_ref): Wrap fold_const_aggregate_ref_1.
	* tree-ssa-sccvn.c (simplify_binary_expression): Simplify
	invariant POINTER_PLUS_EXPRs to invariant form.
	(vn_valueize): New function.
	(try_to_simplify): Simplify by using gimple_fold_stmt_to_constant.
	* tree-vrp.c (vrp_valueize): New function.
	(vrp_visit_assignment_or_call): Use gimple_fold_stmt_to_constant
	to fold statements to constants.
	* tree-ssa-pre.c (eliminate): Properly guard propagation of
	function declarations.
	* Makefile.in (tree-ssa-sccvn.o, tree-vrp.o, gimple-fold.o,
	tree-ssa-ccp.o): Add gimple-fold.h dependencies.

	* c-c++-common/pr46562-2.c: New testcase.
	* c-c++-common/pr46562.c: Likewise.

From-SVN: r171386
2011-03-24 11:23:29 +00:00
Nathan Froyd 009d3fcf71 tree.c (build_call_1): New function.
* tree.c (build_call_1): New function.
	(build_call_valist, build_call_array_loc, build_call_vec): Call it.

From-SVN: r171288
2011-03-22 12:55:47 +00:00
Richard Guenther 7f4d6e1beb re PR tree-optimization/48098 (internal compiler error: in build_vector_from_val, at tree.c:1380)
2011-03-14  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48098
	* tree.c (build_vector_from_val): Adjust assert to requirements
	and reality.

	* gcc.dg/torture/pr48098.c: New testcase.

From-SVN: r170934
2011-03-14 12:20:48 +00:00
Richard Guenther 5f11a50a53 re PR c++/48073 (ICE with -flto in templated C++ code)
2011-03-11  Richard Guenther  <rguenther@suse.de>

	PR lto/48073
	* tree.c (find_decls_types_r): Do not walk types only reachable
	from IDENTIFIER_NODEs.

	* g++.dg/lto/20110311-1_0.C: New testcase.

From-SVN: r170875
2011-03-11 15:59:42 +00:00
Jason Merrill 30f7cdcde6 re PR c++/48069 (FAIL: g++.old-deja/g++.pt/spec26.C)
PR c++/48069
	* tree.c (type_hash_eq): Use COMPLETE_TYPE_P, not
	COMPLETE_OR_UNBOUND_ARRAY_TYPE_P.

From-SVN: r170872
2011-03-11 09:44:49 -05:00
Jason Merrill 18d920539d re PR c++/48029 (ICE in finish_member_declaration() with --param ggc-min-expand=0 --param ggc-min-heapsize=0)
PR c++/48029
	* stor-layout.c (layout_type): Don't set structural equality
	on arrays of incomplete type.
	* tree.c (type_hash_eq): Handle comparing them properly.
	* cp/pt.c (iterative_hash_template_arg): Remove special case for
	ARRAY_TYPE.

From-SVN: r170853
2011-03-10 17:37:22 -05:00
Richard Guenther 77f846e9e2 re PR target/47822 (Multiple test suite failures due to revision 170321)
2011-02-20  Richard Guenther  <rguenther@suse.de>

	PR lto/47822
	* tree.c (free_lang_data_in_decl): Clean builtins from
	the TU decl BLOCK_VARS.

From-SVN: r170339
2011-02-20 17:15:53 +00:00
Dave Korn 47ea1edfbc c.opt (-fkeep-inline-dllexport): New switch.
gcc/c-family/ChangeLog:

	* c.opt (-fkeep-inline-dllexport): New switch.

gcc/ChangeLog:

	* tree.c (handle_dll_attribute): Handle it.
	* doc/extend.texi (@item dllexport): Mention it.
	* doc/invoke.texi (@item -fno-keep-inline-dllexport): Document it.

gcc/cp/ChangeLog:

	* semantics.c (expand_or_defer_fn_1): Handle it.
	* decl2.c (decl_needed_p): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/dll-9a.c: New test file.
	* gcc.dg/dll-11.c: Likewise.
	* gcc.dg/dll-12.c: Likewise.
	* gcc.dg/dll-12a.c: Likewise.
	* gcc.dg/dll-11a.c: Likewise.
	* gcc.dg/dll-9.c: Likewise.
	* gcc.dg/dll-10.c: Likewise.
	* gcc.dg/dll-10a.c: Likewise.
	* g++.dg/ext/dllexport4a.cc: Likewise.
	* g++.dg/ext/dllexport4.C: Likewise.
	* g++.dg/ext/dllexport5.C: Likewise.
	* g++.dg/ext/dllexport5a.cc: Likewise.

From-SVN: r169268
2011-01-26 01:41:23 +00:00