Commit Graph

753 Commits

Author SHA1 Message Date
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
Andrew MacLeod 45b0be94be gimple-expr.h (create_tmp_var_name, [...]): Relocate prototypes from gimple.h.
2013-11-12  Andrew MacLeod  <amacleod@redhat.com>

	* gimple-expr.h (create_tmp_var_name, create_tmp_var_raw,
	create_tmp_var, create_tmp_reg, mark_addressable, is_gimple_reg_rhs):
	Relocate prototypes from gimple.h.
	* gimplify.h: New File.  Relocate some prototypes from gimple.h here.
	(gimple_predicate, enum fallback, enum gimplify_status): Relocate
	from gimple.h.
	* gimple.h: Move some prototypes to gimplify.h.
	(gimple_predicate, enum fallback, enum gimplify_status): Move to
	gimplify.h.
	(gimple_do_not_emit_location_p, gimple_set_do_not_emit_location):
	Relocate from gimpify.c.
	* gimple-expr.c (remove_suffix, tmp_var_id_num, create_tmp_var_name,
	create_tmp_var_raw, create_tmp_var, create_tmp_reg, mark_addressable,
	is_gimple_reg_rhs) Relocate from gimplify.c.
	* gimplify.c (mark_addressable): Move to gimple-expr.c.
	(gimple_seq_add_stmt_without_update): Move to gimple.c.
	(remove_suffix, tmp_var_id_num, create_tmp_var_name, create_tmp_var_raw,
	create_tmp_var, create_tmp_reg, is_gimple_reg_rhs): Move to 
	gimple-expr.c.
	(should_carry_location_p): Move to gimple.c.
	(gimple_do_not_emit_location_p, gimple_set_do_not_emit_location): Move
	to gimple.h.
	(annotate_one_with_location, annotate_all_with_location_after,
	annotate_all_with_location): Move to gimple.c.
	(compare_case_labels, sort_case_labels,
	preprocess_case_label_vec_for_gimple): Move to gimple.c.
	(rhs_predicate_for): Make static.
	(gimplify_assign): Relocate from gimple.c.
	* gimple.c (gimplify_assign): Move to gimplify.c.
	(gimple_seq_add_stmt_without_update, should_carry_location_p,
	annotate_one_with_location, annotate_all_with_location_after,
	annotate_all_with_location, compare_case_labels, sort_case_labels,
	preprocess_case_label_vec_for_gimple): Relocate from gimplify.c.
	* tree.h (unshare_expr, unshare_expr_without_location,
	mark_addressable): Move prototypes to gimplify.h.
	* Makefile.in (GTFILES): gimple-expr.c now has the GTY tag for
	tmp_var_id_num
	* asan.c: Include gimplify.h rather than gimple.h.
	* cfgloopmanip.c: Likewise.
	* cgraphunit.c: Likewise.
	* cilk-common.c: Likewise.
	* dwarf2out.c: Dont include gimple.h.
	* fold-const.c: Include gimplify.h rather than gimple.h.
	* function.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.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: Dont include gimple.h.
	* loop-init.c: Include gimplify.h rather than gimple.h.
	* 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-iterator.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-conversio: Likewise.n.c
	* 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.
	* tsan.c: Likewise.
	* value-prof.c: Likewise.
	* config/aarch64/aarch64.c: Include gimplify.h instead of gimple.h.
	* 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.

	* ada/gcc-interface/trans.c: Include gimplify.h.

	* c/c-typeck.c: Include gimplify.h.

	* c-family/c-common.c: Include gimplify.h.
	* c-family/c-gimplify.c: Likewise.
	* c-family/cilk.c: Likewise.
	* c-family/c-omp.c: Include gimple-expr.h instead of gimple.h.
	* c-family/c-ubsan.c: Don't include gimple.h.

	* cp/class.c: Include gimplify.h.
	* 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.
	* cp/decl2.c: Don't include gimple.h.
	* cp/except.c: Likewise.
	* cp/method.c: Include pointer-set.h instead of gimple.h.

	* fortran/f95-lang.c: Don't include gimple.h.
	* fortran/trans-array.c: Include gimple-expr.h instead of gimple.h.
	* fortran/trans.c: Likewise.
	* fortran/trans-decl.c: Likewise.
	* fortran/trans-expr.c: Include gimplify.h.
	* fortran/trans-openmp.c: Likewise.

	* go/go-lang.c: Include gimplify.h.

	* java/java-gimplify.c: Include gimplify.h.

	* objc/objc-act.c: Include gimplify.h.

From-SVN: r204717
2013-11-12 20:26:43 +00:00
Eric Botcazou d368135f69 gimplify.c (gimplify_init_constructor): Do not clear the object when the constructor is incomplete and...
* gimplify.c (gimplify_init_constructor): Do not clear the object when
	the constructor is incomplete and CONSTRUCTOR_NO_CLEARING is set.

From-SVN: r204678
2013-11-11 16:59:23 +00:00
Aldy Hernandez b3b6e1f280 gimplify.c (gimple_regimplify_operands): Do not set SSA_NAME_DEF_STMT.
* gimplify.c (gimple_regimplify_operands): Do not set
	SSA_NAME_DEF_STMT.
	* graphite-sese-to-poly.c (remove_simple_copy_phi): Same.
	(rewrite_close_phi_out_of_ssa): Same.
	(rewrite_phi_out_of_ssa): Same.
	(rewrite_degenerate_phi): Same.
	(handle_scalar_deps_crossing_scop_limits): Same.
	* tree-if-conv.c (predicate_scalar_phi): Same.
	* tree-parloops.c (create_loads_for_reductions): Same.
	(create_final_loads_for_reduction): Same.
	(create_loads_and_stores_for_name): Same.
	(transform_to_exit_first_loop): Same.
	(create_parallel_loop): Same.
	* tree-ssa-loop-im.c
	(move_computations_dom_walker::before_dom_children): Same.
	* tree-ssa-loop-manip.c (rewrite_phi_with_iv): Same.
	* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
	Same.
	* tree-ssa-propagate.c (substitute_and_fold): Same.
	* tree-vect-loop.c (vect_finalize_reduction): Same.
	* tree-vect-stmts.c (vectorizable_call): Same.

From-SVN: r204541
2013-11-07 20:20:48 +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
Trevor Saunders 07687835be Replace some heap vectors with stack vectors.
From http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02735.html

This patch is pretty dull, it just replaces a bunch of things of the
form
vec<T> x;
x.create (N); // N is a constant
blah blah
x.release ();
by
stack_vec<T, N> x;
blah blah

2013-11-01  Trevor Saunders  <tsaunders@mozilla.com>

gcc/
	* function.c (reorder_blocks): Convert block_stack to a stack_vec.
	* gimplify.c (gimplify_compound_lval): Likewise.
	* graphite-clast-to-gimple.c (gloog): Likewise.
	* graphite-dependences.c (loop_is_parallel_p): Likewise.
	* graphite-scop-detection.c (scopdet_basic_block_info): Likewise.
	(limit_scop); Likewise.
	(build_scops): Likewise.
	(dot_scop): Likewise.
	* graphite-sese-to-poly.c (sese_dom_walker): Likewise.
	(build_scop_drs): Likewise.
	(insert_stmts): Likewise.
	(insert_out_of_ssa_copy): Likewise.
	(remove_phi): Likewise.
	(rewrite_commutative_reductions_out_of_ssa_close_phi): Likewise.
	* hw-doloop.c (discover_loop): Likewise.
	* tree-call-cdce.c (shrink_wrap_one_built_in_call): Likewise.
	* tree-dfa.c (dump_enumerated_decls): Likewise.
	* tree-if-conv.c (if_convertable_loop_p): Likewise.
	* tree-inline.c (tree_function_versioning): Likewise.
	* tree-loop-distribution.c (build_rdg): Likewise.
	(rdg_flag_vertex_and_dependent): Likewise.
	(distribute_loop): Likewise.
	* tree-parloops.c (loop_parallel_p): Likewise.
	(eliminate_local_variables): Likewise.
	(separate_decls_in_region): Likewise.
	* tree-predcom.c (tree_predictive_commoning_loop): Likewise.
	* tree-ssa-phiopt.c (cond_if_else_store_replacement): Likewise.
	* tree-ssa-uncprop.c (uncprop_dom_walker): Likewise.
	* tree-vect-loop.c (vect_analyze_scaler_cycles_1): Likewise.
	* tree-vect-patterns.c (vect_pattern_recog): Likewise.
	* tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise.
	(vectorizable_condition): Likewise.

gcc/cp/
	* semantics.c (build_anon_member_initialization): Convert fields to be
        a stack_vec.

From-SVN: r204301
2013-11-01 16:31:32 -04:00
Ilya Enkovich 0038da6695 ipa.c (cgraph_build_static_cdtor_1): Support contructors with "chkp ctor" and "bnd_legacy" attributes.
* 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.

From-SVN: r204198
2013-10-30 09:08:14 +00:00
Balaji V. Iyer 939b37da6d Added _Cilk_spawn and _Cilk_sync (2 cilk keywords) for C.
gcc/ChangeLog:
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* builtins.c (is_builtin_name): Added a check for __cilkrts_detach and
	__cilkrts_pop_frame.  If matched, then return true for built-in
	function name.
	(expand_builtin): Added BUILT_IN_CILK_DETACH and
	BUILT_IN_CILK_POP_FRAME case.
	* langhooks-def.h (lhd_install_body_with_frame_cleanup): New prototype.
	(lhs_cilk_detect_spawn): Likewise.
	(LANG_HOOKS_DECLS): Added LANG_HOOKS_CILKPLUS.
	(LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): New #define.
	(LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
	(LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): Likewise.
	(LANG_HOOKS_CILKPLUS): Likewise.
	* tree.h (CILK_SPAWN_FN): Likewise.
	* builtin.def (DEF_CILK_BUILTIN_STUB): Likewise.
	* Makefile.in (C_COMMON_OBJS): Added c-family/cilk.o.
	(OBJS): Added cilk-common.o.
	(CILK_H): Added a new define.
	(gimplify.o): Added CILK_H into dependency list.
	(builtins.o): Likewise.
	(ipa-inline.o): Likewise.
	(ipa-inline-analysis.o): Likewise.
	(BUILTINS_DEF): Added cilk-builtins.def.
	* langhooks.c (lhd_install_body_with_frame_cleanup): New function.
	(lhd_cilk_detect_spawn): Likewise.
	* langhooks.h (lang_hooks_for_cilkplus): New struct.
	(struct lang_hooks): Added new field called "cilkplus."
	* cilk-common.c: New file.
	* cilk.h: Likewise.
	* cilk-builtins.def: Likewise.
	* cppbuiltin.c (define_builtin_macros_for_compilation_flags): Added
	"__cilk" macro and set it to 200.
	* function.h (struct function::cilk_frame_decl): New field.
	(struct function::is_cilk_function): Likewise.
	(struct function::calls_cilk_spawn): Likewise.
	* gimplify.c (gimplify_call_expr): Added a check if the function call
	being gimplified is a spawn detach point.  If so, then add pop_frame
	and detach function calls.
	(gimplify_expr): Added a CILK_SPAWN_STMT and CILK_SYNC_STMT case
	for gimplifying _Cilk_spawn and _Cilk_sync statements.
	(gimplify_return_expr): Added a check for _Cilk_spawn usage in
	function.  If so, added a _Cilk_sync and gimplified it.
	(gimplify_modify_expr): Added a check for _Cilk_spawn in MODIFY and
	INIT_EXPRs.  If so, then call gimplify_cilk_spawn.
	* ipa-inline-analysis (initialize_inline_failed): Prevent inlining of
	spawner function.
	(can_inline_edge_p): Prevent inling of spawnee function.
	* ira.c (ira_setup_eliminable_regset): Force usage of frame pointer
	for functions that use Cilk keywords.
	* tree-inline.h (struct copy_body_data::remap_var_for_cilk): New field.
	* tree-pretty-print.c (dump_generic_node): Added CILK_SPAWN_STMT and
	CILK_SYNC_STMT cases.
	* tree.def (DEFTREECODE): Added CILK_SPAWN_STMT and CILK_SYNC_STMT
	trees.
	* generic.texi (CILK_SPAWN_STMT): Added documentation for _Cilk_spawn.
	(CILK_SYNC_STMT): Added documentation for _Cilk_sync.
	* passes.texi (Cilk Keywords): New section that describes the compiler
	code changes for handling Cilk Keywords.

gcc/c/ChangeLog:
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-decl.c (finish_function): Added a call for insert_cilk_frame when
	a spawning function is found.
	* c-objc-common.h (LANG_HOOKS_CILKPLUS_GIMPLIFY_SPAWN): New #define.
	(LANG_HOOKS_CILKPLUS_FRAME_CLEANUP): Likewise.
	(LANG_HOOKS_CILKPLUS_DETECT_SPAWN_AND_UNWRAP): Likewise.
	* c-parser.c (c_parser_statement_after_labels): Added RID_CILK_SYNC
	case.
	(c_parser_postfix_expression): Added RID_CILK_SPAWN case.
	* c-typeck.c (build_compound_expr): Reject _Cilk_spawn in a comma
	expr.
	(c_finish_return): Added a check to reject _Cilk_spawn in return
	expression.
	(build_cilk_spawn): New function.
	(build_cilk_sync): Likewise.
	* Makefile.in (c-decl.o): Added cilk.h in dependency list.

gcc/c-family/ChangeLog
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-common.c (c_common_reswords[]): Added _Cilk_spawn and _Cilk_sync
	fields.
	(c_define_builtins): Called cilk_init_builtins if Cilk Plus is
	enabled.
	* c-common.h (enum rid): Added RID_CILK_SPAWN and RID_CILK_SYNC.
	(insert_cilk_frame): New prototype.
	(cilk_init_builtins): Likewise.
	(gimplify_cilk_spawn): Likewise.
	(c_cilk_install_body_w_frame_cleanup): Likewise.
	(cilk_detect_spawn_and_unwrap): Likewise.
	(cilk_set_spawn_marker): Likewise.
	(build_cilk_sync): Likewise.
	(build_cilk_spawn): Likewise.
	* cilk.c: New file.

gcc/lto/ChangeLog
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* Make-lang.in (lto/lto-lang.o): Added cilk.h in dependency list.
	* lto-lang.c (lto_init): Added a call to cilk_init_builtins if Cilk
	Plus is enabled.

gcc/testsuite/ChangeLog
2013-10-29  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-c++-common/cilk-plus/CK/compound_cilk_spawn.c: New test.
	* c-c++-common/cilk-plus/CK/concec_cilk_spawn.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib.c: Likewise.
	* c-c++-common/cilk-plus/CK/no_args_error.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawnee_inline.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawner_inline.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawning_arg.c: Likewise.
	* c-c++-common/cilk-plus/CK/steal_check.c: Likewise.
	* c-c++-common/cilk-plus/CK/test__cilk.c: Likewise.
	* c-c++-common/cilk-plus/CK/varargs_test.c: Likewise.
	* c-c++-common/cilk-plus/CK/sync_wo_spawn.c: Likewise.
	* c-c++-common/cilk-plus/CK/invalid_spawn.c: Likewise.
	* c-c++-common/cilk-plus/CK/spawn_in_return.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib_init_expr_xy.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib_no_sync.c: Likewise.
	* c-c++-common/cilk-plus/CK/fib_no_return.c: Likewise.
	* gcc.dg/cilk-plus/cilk-plus.exp: Added support to run Cilk Keywords
	test stored in c-c++-common.  Also, added the Cilk runtime's library
	to the ld_library_path.

From-SVN: r204172
2013-10-29 11:36:31 -07: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
Jeff Law 98906124e3 Makefile.def (target_modules): Remove libmudflap
* Makefile.def (target_modules): Remove libmudflap
	(languages): Remove check-target-libmudflap).
	* Makefile.in: Rebuilt.
	* Makefile.tpl (check-target-libmudflap-c++): Remove.
	* configure.ac (target_libraries): Remove target-libmudflap.
	Remove checks which disabled libmudflap on some systems.
	* configure: Rebuilt.
	* libmudflap: Directory removed.

	* Makefile.in (C_COMMON_OBJS): Remove tree-mudflap.
	(OBJS): Remove tree-nomudflap.o
	(GTFILES): Remove tree-mudflap.c
	* builtins.c (expand_builtin_alloc): Remove mudflap support.
	* gcc.c (MFWRAP_SPEC, MFLIB_SPEC): Likewise.
	(mfwrap_spec, mflib_spec): Likewise.
	(cpp_unique_options, cc1_options, static_specs): Likewise.
	* gimplify (gimplify_vla_decl, build_va_arg_indirect_ref): Likewise.
	* passes.def: Likewise.
	* toplev.c (compile_file, process_options): Likewise.
	* tree-inline.c (copy_tree_r): Likewise.
	* tree-pass.,h (make_pass_mudflap_1, make_pass_mudflap_2): Likewise.
	* varasm.c (make_decl_rtl, make_decl_rtl_for_debug): Likewise.
	(build_constant_desc, output_constant_def_contents): Likewise.
	(categorize_decl_for_section): Likewise.
	* tree-mudflap.c: Removed.
	* tree-mudflap.h: Removed.
	* tree-nomudflap.c: Removed.
	* bfin/uclinux.h (MFWRAP_SPEC): Remove.
	* moxie/uclinux.h (MFWRAP_SPEC): Likewise.
	* rs6000/aix.h (MFWRAP_SPEC, MFLIB_SPEC): Likewise.
	* config/sol2.h (MFLIB_SPEC): Likewise.
	* doc/install.texi: Remove mudflap references.
	* doc/passes.texi: Similarly.
	* doc/sourcebuild.texi: Similarly.
	* doc/invoke.texi: Remove mudlfap related options.

	* c-family/c-common.c (c_define_builtins): Remove mudflap support.
	* c-family/c.opt: Ignore and warn for mudflap options.

	* g++.dg/torture/pr49309.C: Removed.
	* gcc.dg/dfp/pr35739.c: Removed.

From-SVN: r204090
2013-10-26 04:14:34 -06:00
Andrew MacLeod 4a7cb16f83 builtins.c (dummy_object, [...]): Move to gimplify.c.
* builtins.c (dummy_object, gimplify_va_arg_expr): Move to gimplify.c.
	* gimplify.c (build_va_arg_indirect_ref, std_gimplify_va_arg_expr):
	Move to targhooks.c.
	(dummy_object, gimplify_va_arg_expr): Relocate from builtins.c.
	* targhooks.c (build_va_arg_indirect_ref, std_gimplify_va_arg_expr):
	Relocate from gimplify.c.
	* targhooks.h: Add 2 prototypes.
	* tree.h. Delete 2 prototypes.

From-SVN: r204032
2013-10-24 19:02:44 +00:00
Tobias Burnus 8170608bfc re PR other/33426 (Support of #pragma ivdep)
2013-08-24  Tobias Burnus  <burnus@net-b.de>

        PR other/33426
        * c-pragma.c (init_pragma) Add #pragma ivdep handling.
        * c-pragma.h (pragma_kind): Add PRAGMA_IVDEP.

        PR other/33426
        * c-parser.c (c_parser_pragma, c_parser_for_statement):
        Handle PRAGMA_IVDEP.
        (c_parser_statement_after_labels): Update call.

        PR other/33426
        * tree-cfg.c (replace_loop_annotate): New function.
        (execute_build_cfg): Call it.
        * gimplify.c (gimple_boolify, gimplify_expr): Handle
        * ANNOTATE_EXPR.
        * internal-fn.c (expand_ANNOTATE): New function.
        * internal-fn.def (ANNOTATE): Define as new internal function.
        * tree-core.h (tree_node_kind): Add annot_expr_ivdep_kind.
        * tree-pretty-print.c (dump_generic_node): Handle ANNOTATE_EXPR.
        * tree.def (ANNOTATE_EXPR): New DEFTREECODE.
        * doc/extend.texi (Pragmas): Document #pragma ivdep.
        * doc/generic.texi (Expressions): Document ANNOTATE_EXPR.

        PR other/33426
        * testsuite/gcc.dg/ivdep.c: New.
        * testsuite/gcc.dg/vect/vect-ivdep-1.c: New.

From-SVN: r204021
2013-10-24 18:25:44 +02: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
Andrew MacLeod 4484a35a86 tree-ssa.h: Don't include gimple-low.h...
* tree-ssa.h: Don't include gimple-low.h, tree-ssa-address.h, sbitmap.h,
	tree-ssa-threadedge.h, tree-ssa-dom.h, and tree-cfgcleanup.h.
	* gimple-low.c (gimple_check_call_arg,
	gimple_check_call_matching_types): Move to cgraph.c.
	* gimple-low.h: Remove prototype.
	* cgraph.c: (gimple_check_call_arg, gimple_check_call_matching_types):
	Relocate from gimple-low.c.
	* cgraph.h: Add prototype.  Don't include basic-block.h.
	* gimplify.c: Add gimple-low to include list.
	* omp-low.c: Add gimple-low and tree-cfgcleanup.h to include list.
	* tree-eh.c: Add gimple-low to include list.
	* tree-nested.c: Likewise.
	* cfgexpand.c: Add tree-ssa-address.h to include list.
	* expr.c: Likewise.
	* gimple-fold.c: Likewise.
	* gimple-ssa-strength-reduction.c: Likewise.
	* trans-mem.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-ssa-dom.c: Include tree-ssa-threadedge.h and tree-ssa-dom.h.
	(degenerate_phi_result): Move to tree-phinodes.c.
	* tree-ssa-loop-ch.c: Include tree-ssa-threadedge.h.
	* tree-ssa-threadedge.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree-phinodes.c (degenerate_phi_result): Relocate here.
	* tree-ssa-dom.h (degenerate_phi_result): Remove Prototype.
	* tree-phinodes.h (degenerate_phi_result): Add prototype.
	* tree-ssa-copy.c: Include tree-ssa-dom.h.
	* tree-ssa-forwprop.c: Likewise.
	* tree-cfgcleanup.c (execute_cleanup_cfg_post_optimizing,
	pass_data_cleanup_cfg_post_optimizing,
	make_pass_cleanup_cfg_post_optimizing): Relocate from tree-optimize.c.
	* tree-optimize.c: Delete File.
	* graphite.c: Include tree-cfgcleanup.h.
	* passes.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-dse.c: Likewise.
	* tree-ssa-loop-ivcanon.c: Likewise.
	* tree-switch-conversion.c: Don't include tree-ssa-operands.h.
	* tree-outof-ssa.c: Include sbitmap.h.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-propagate.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-stdarg.c: Likewise.
	* Makefile.in (OBJS): Delete tree-optimize.o.
	* basic-block.h (gcov_type, gcov_type_unsigned): Move to coretypes.h.
	* coretypes.h (gcov_type, gcov_type_unsigned): Relocate here.
	* varasm.c: Include basic-block.h.
	* cfgloop.h: Include function.h instead of basic-block.h
	(bb_loop_depth): Move to cfgloop.c.
	* cfgloop.c (bb_loop_depth): Relocate from cfgloop.h.

From-SVN: r203833
2013-10-18 19:35:40 +00:00
Andrew MacLeod 0645c1a22d tree-flow.h (struct omp_region): Move to omp-low.c.
* tree-flow.h (struct omp_region): Move to omp-low.c.
	Remove omp_ prototypes and variables.
	* gimple.h (omp_reduction_init): Move prototype to omp-low.h.
	(copy_var_decl): Relocate prototype from tree-flow.h.
	* gimple.c (copy_var_decl): Relocate from omp-low.c.
	* tree.h: Move prototype to omp-low.h.
	* omp-low.h: New File.  Relocate prototypes here.
	* omp-low.c (struct omp_region): Make local here.
	(root_omp_region): Make static.
	(copy_var_decl) Move to gimple.c.
	(new_omp_region): Make static.
	(make_gimple_omp_edges): New.  Refactored from tree-cfg.c make_edges.
	* tree-cfg.c: Include omp-low.h.
	(make_edges): Factor out OMP specific bits to make_gimple_omp_edges.
	* gimplify.c: Include omp-low.h.
	* tree-parloops.c: Likewise.

	c
	* c-parser.c: Include omp-low.h.
	* c-typeck.c: Likewise.

	cp
	* parser.c: Include omp-low.h.
	* semantics.c: Likewise.

	fortran
	* trans-openmp.c: Include omp-low.h.

From-SVN: r203786
2013-10-17 17:41:07 +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 de6a560804 Index...
Index: gimplify.c
===================================================================
*** gimplify.c	(revision 203357)
--- gimplify.c	(working copy)
*************** along with GCC; see the file COPYING3.
*** 46,51 ****
--- 46,53 ----
  #include "langhooks-def.h"	/* FIXME: for lhd_set_decl_assembler_name */
  #include "tree-pass.h"		/* FIXME: only for PROP_gimple_any */
  #include "tree-mudflap.h"
+ #include "expr.h"
+ #include "tm_p.h"
  
  enum gimplify_omp_var_data
  {

From-SVN: r203373
2013-10-10 13:08:50 +00:00
Andrew MacLeod b184c8f138 tree-flow.h: Move some prototypes to gimple.h.
2013-10-10  Andrew MacLeod  <amacleod@redhat.com>

	* tree-flow.h: Move some prototypes to gimple.h.
	(gimple_fold_indirect_ref): Move prototype to gimple-fold.h.
	* gimple.h: Relocate some prototypes from tree-flow.h
	* builtins.c (std_gimplify_va_arg_expr, build_va_arg_indirect_ref):
	Move to gimplify.c.
	* gimplify.c (gimple_fold_indirect_ref): Move to gimple-fold.c.
	(build_va_arg_indirect_ref): Relocate and make static.
	(std_gimplify_va_arg_expr): Relocate here.
	* gimple-fold.c (gimple_fold_indirect_ref): Relocate here.
	* gimple-fold.h (gimple_fold_indirect_ref): Add prototype.

From-SVN: r203357
2013-10-10 12:16:24 +00:00
Eric Botcazou ca081cc8da gimplify.c (gimplify_asm_expr): Reset the TREE_CHAIN of clobbers to NULL_TREE before pushing them onto the vector.
* gimplify.c (gimplify_asm_expr): Reset the TREE_CHAIN of clobbers to
	NULL_TREE before pushing them onto the vector.  Likewise for labels.

From-SVN: r202819
2013-09-22 21:57:39 +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
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
Marek Polacek 9b6e6981e1 Don't include gimple.h twice.
From-SVN: r201131
2013-07-22 13:48:04 +00:00
Jason Merrill 0138d6b24f N3639 C++1y VLA support
gcc/
	* gimplify.c (gimplify_vla_decl): Don't touch an existing
	DECL_VALUE_EXPR.
gcc/cp/
	* decl.c (compute_array_index_type): Allow VLAs in C++1y mode.
	(check_array_initializer): Allow VLA init.
	(reshape_init_array_1): Adjust.
	(cp_finish_decl): Check for invalid VLA length.
	* typeck2.c (process_init_constructor_array): Adjust.
	(store_init_value): Use build_vec_init for VLAs.
	* semantics.c (add_capture): Capture VLA as ptr+len.
	(vla_capture_type): New.
	(build_capture_proxy): Rebuild the VLA.
	* typeck.c (build_simple_component_ref): Split out from...
	(build_ptrmemfunc_access_expr): ...here.
	* tree.c (array_of_runtime_bound_p): New.
	* init.c (throw_bad_array_length): New.
	(build_vec_init): Use it.
	* parser.c (cp_convert_range_for): When iterating over a VLA,
	use it directly rather than bind a reference.
	* cp-tree.h: Declare new functions.
libstdc++-v3/
	* libsupc++/new: Add std::bad_array_length.
	* libsupc++/bad_array_length.cc: New.
	* libsupc++/eh_aux_runtime.cc: Add __cxa_bad_array_length.
	* libsupc++/Makefile.in: Build them.
	* config/abi/pre/gnu.ver: Add new symbols.
	* config/abi/pre/gnu-versioned-namespace.ver: Add new symbols.

From-SVN: r198745
2013-05-09 12:43:36 -04:00
Lawrence Crowl 4a8fb1a1de This patch is the main part of a consolodation of the hash_table patches to the...
This patch is the main part of a consolodation of the hash_table
patches to the cxx-conversion branch for files not under gcc/config.

Update various hash tables from htab_t to hash_table.
Modify types and calls to match.

* tree-parloops.c'reduction
* tree-parloops.c'name_to_copy

Fold reduction_info_hash and reduction_info_eq into new struct
reduction_hasher.  Fold name_to_copy_elt_eq and name_to_copy_elt_hash
into new struct name_to_copy_hasher.

* trans-mem.c'tm_log

Fold tm_log_hash, tm_log_eq, tm_log_free into new struct log_entry_hasher.

* trans-mem.c'tm_memopt_value_numbers

Fold tm_memop_hash, tm_memop_eq into new struct tm_memop_hasher.

* tree-ssa-strlen.c'decl_to_stridxlist_htab

Fold decl_to_stridxlist_hash into new struct stridxlist_hasher.

* tree-ssa-loop-ivopts.c'ivopts_data::inv_expr_tab

Fold htab_inv_expr_hash and htab_inv_expr_eq into new struct
iv_inv_expr_hasher.

* tree-ssa-uncprop.c'equiv

Equiv renamed to val_ssa_equiv because of name ambiguity with local variables.

Fold equiv_hash, equiv_eq and equiv_free into new struct val_ssa_equiv_hasher.

Renamed variables equiv_hash_elt to an_equiv_elt because of name ambiguity
with struct type.  Changed equiv_hash_elt_p to an_equiv_elt_p to match.

* tree-ssa-phiopt.c'seen_ssa_names

Fold name_to_bb_hash and name_to_bb_eq into new struct ssa_names_hasher.

* tree-ssa-structalias.c'pointer_equiv_class_table
* tree-ssa-structalias.c'location_equiv_class_table

Fold equiv_class_label_hash and equiv_class_label_eq into new
struct equiv_class_hasher.

* tree-ssa-structalias.c'shared_bitmap_table

Fold shared_bitmap_hash and shared_bitmap_eq into new struct
shared_bitmap_hasher.

* tree-ssa-live.c'var_map_base_init::tree_to_index

New struct tree_int_map_hasher.

* tree-sra.c'candidates

Fold uid_decl_map_hash and uid_decl_map_eq into new struct
uid_decl_hasher.  This change moves the definitions from tree-ssa.c
into tree-sra.c and removes the declarations from tree-flow.h

tree-browser.c

Remove stale declaration of removed TB_parent_eq.
Fix template parameter for base class to match value_type.

gimple.h

Use gimplify_hasher::hash rather than gimple_tree_hash in the
  assertion check.
Change return values to match return type. (I.e. no conversions.)

* graphite-clast-to-gimple.c'ivs_params::newivs_index
* graphite-clast-to-gimple.c'ivs_params::params_index
* graphite-clast-to-gimple.c'print_generated_program::params_index
* graphite-clast-to-gimple.c'gloog::newivs_index
* graphite-clast-to-gimple.c'gloog::params_index
* graphite.c graphite_transform_loops::bb_pbb_mapping
* sese.c copy_bb_and_scalar_dependences::rename_map

Move hash table declarations to a new graphite-htab.h, because they
are used in few places.

Remove unused:

htab_t scop::original_pddrs
SCOP_ORIGINAL_PDDRS

Remove unused:

insert_loop_close_phis
insert_guard_phis
debug_ivtype_map
ivtype_map_elt_info
new_ivtype_map_elt

* gimplify.c'gimplify_ctx::temp_htab

Move struct gimple_temp_hash_elt and struct gimplify_ctx to a new
gimplify-ctx.h, because they are used few places.

* cselib.c'cselib_hash_table
* gcse.c'pre_ldst_table
* gimple-ssa-strength-reduction.c'base_cand_map
* haifa-sched.c'delay_htab
* haifa-sched.c'delay_htab_i2
* ira-color.c'allocno_hard_regs_htab
* ira-costs.c'cost_classes_htab
* loop-invariant.c'merge_identical_invariants::eq
* loop-iv.c'bivs
* loop-unroll.c'opt_info::insns_to_split
* loop-unroll.c'opt_info::insns_with_var_to_expand
* passes.c'name_to_pass_map
* plugin.c'event_tab
* postreload-gcse.c'expr_table
* store-motion.c'store_motion_mems_table
* tree-cfg.c'discriminator_per_locus
* tree-scalar-evolution.c'resolve_mixers::cache
* tree-ssa-dom.c'avail_exprs

Remove unused:
dse.c bitmap clear_alias_sets
dse.c bitmap disqualified_clear_alias_sets
dse.c alloc_pool clear_alias_mode_pool
dse.c dse_step2_spill
dse.c dse_step5_spill
graphds.h htab_t graph::indices

* attribs.c'scoped_attributes::attribute_hash
* bitmap.c'bitmap_desc_hash
* dwarf2cfi.c'trace_index
* dwarf2out.c'break_out_includes::cu_hash_table
* dwarf2out.c'copy_decls_for_unworthy_types::decl_table
* dwarf2out.c'optimize_external_refs::map
* dwarf2out.c'output_comp_unit::extern_map
* dwarf2out.c'output_comdat_type_unit::extern_map
* dwarf2out.c'output_macinfo::macinfo_htab
* dwarf2out.c'optimize_location_lists::htab
* dwarf2out.c'dwarf2out_finish::comdat_type_table
* except.c'ehspec_hash_type
* except.c'assign_filter_values::ttypes
* except.c'assign_filter_values::ehspec
* except.c'sjlj_assign_call_site_values::ar_hash
* except.c'convert_to_eh_region_ranges::ar_hash
* trans-mem.c'tm_new_mem_hash
* tree-browser.c'TB_up_ht
* tree-eh.c'finally_tree

Move the declaration of hash_table <alloc_pool_hasher> alloc_pool_hash
in alloc-pool.c to after the method definitions for its parameter
class.

* ggc-common.c'loc_hash
* ggc-common.c'ptr_hash

Add a new hash_table method elements_with_deleted to meet the needs of
gcc-common.c.

Correct many methods with parameter types compare_type to the correct
value_type.  (Correct code was unlikely to notice the change, but
incorrect code will.)

* tree-complex.c'complex_variable_components
* tree-parloops.c'eliminate_local_variables_stmt::decl_address
* tree-parloops.c'separate_decls_in_region::decl_copies

Move hash table declarations to a new tree-hasher.h, to resolve
compilation dependences and because they are used in few places.

* lto-streamer.h'output_block::string_hash_table
* lto-streamer-in.c'file_name_hash_table
* lto-streamer.c'tree_htab

The struct string_slot moves from data-streamer.h to lto-streamer.h to
resolve compilation dependences.

Tested on x86_64.


Index: gcc/ChangeLog

2013-04-25  Lawrence Crowl  <crowl@google.com>

	* Makefile.in: Update as needed below.

	* alloc-pool.c (static hash_table <alloc_pool_hasher> alloc_pool_hash):
	Move declaration to after the type's method definitons.

	* attribs.c (htab_t scoped_attributes::attribute_hash):
	Change type to hash_table.  Update dependent calls and types.

	* bitmap.c (htab_t bitmap_desc_hash):
	Change type to hash_table.  Update dependent calls and types.

	* cselib.c (htab_t cselib_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* data-streamer.h (struct string_slot): Move to lto-streamer.h.
	(hash_string_slot_node): Move implementation into lto-streamer.h
	struct string_slot_hasher.
	(eq_string_slot_node): Likewise.

	* data-streamer-out.c: Update output_block::string_hash_table
	dependent calls and types.

	* dwarf2cfi.c (htab_t trace_index):
	Change type to hash_table.  Update dependent calls and types.

	* dwarf2out.c (htab_t break_out_includes::cu_hash_table):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t copy_decls_for_unworthy_types::decl_table): Likewise.
	(htab_t optimize_external_refs::map): Likewise.
	(htab_t output_comp_unit::extern_map): Likewise.
	(htab_t output_comdat_type_unit::extern_map): Likewise.
	(htab_t output_macinfo::macinfo_htab): Likewise.
	(htab_t optimize_location_lists::htab): Likewise.
	(htab_t dwarf2out_finish::comdat_type_table): Likewise.

	* except.c (htab_t ehspec_hash_type):
	Change type to hash_table.  Update dependent calls and types.
	(assign_filter_values::ttypes): Likewise.
	(assign_filter_values::ehspec): Likewise.
	(sjlj_assign_call_site_values::ar_hash): Likewise.
	(convert_to_eh_region_ranges::ar_hash): Likewise.

	* gcse.c (htab_t pre_ldst_table):
	Change type to hash_table.  Update dependent calls and types.

	* ggc-common.c (htab_t saving_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t loc_hash): Likewise.
	(htab_t ptr_hash): Likewise.
	(call_count): Rename ggc_call_count.
	(call_alloc): Rename ggc_call_alloc.
	(loc_descriptor): Rename make_loc_descriptor.
	(add_statistics): Rename ggc_add_statistics.

	* ggc-common.c (saving_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple.h (struct gimplify_ctx): Move to gimplify-ctx.h.
	(push_gimplify_context): Likewise.
	(pop_gimplify_context): Likewise.
	(struct gimple_temp_hash_elt): Added.
	(struct gimplify_hasher): Likewise.
	(struct gimplify_ctx.temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* gimple-fold.c: Include gimplify-ctx.h.

	* gimple-ssa-strength-reduction.c (htab_t base_cand_map):
	Change type to hash_table.  Update dependent calls and types.
	(base_cand_dump_callback): Rename to ssa_base_cand_dump_callback to
	avoid potential global name collision.

	* gimplify.c: Include gimplify-ctx.h.
	(struct gimple_temp_hash_elt): Move to gimplify-ctx.h.
	(htab_t gimplify_ctx::temp_htab):
	Update dependent calls and types for new type hash_table.
	(gimple_tree_hash): Move into gimplify_hasher in gimplify-ctx.h.
	(gimple_tree_eq): Move into gimplify_hasher in gimplify-ctx.h.

	* gimplify-ctx.h: New.
	(struct gimple_temp_hash_elt): Move from gimplify.c.
	(class gimplify_hasher): New.
	(struct gimplify_ctx): Move from gimple.h.
	(htab_t gimplify_ctx::temp_htab):
	Change type to hash_table.  Update dependent calls and types.

	* graphite-clast-to-gimple.c: Include graphite-htab.h.
	(htab_t ivs_params::newivs_index):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t ivs_params::params_index): Likewise.
	(htab_t print_generated_program::params_index): Likewise.
	(htab_t gloog::newivs_index): Likewise.
	(htab_t gloog::params_index): Likewise.

	* graphite.c: Include graphite-htab.h.
	4htab_t graphite_transform_loops::bb_pbb_mapping):
	Change type to hash_table.  Update dependent calls and types.

	* graphite-clast-to-gimple.h: (extern gloog) Move to graphite-htab.h.
	(bb_pbb_map_hash): Fold into bb_pbb_htab_type in graphite-htab.h.
	(eq_bb_pbb_map): Fold into bb_pbb_htab_type in graphite-htab.h.

	* graphite-dependences.c: Include graphite-htab.h.
	(loop_is_parallel_p): Change hash table type of parameter.

	* graphite-htab.h: New.
	(typedef hash_table <bb_pbb_hasher> bb_pbb_htab_type): New.
	(extern find_pbb_via_hash): Move from graphite-poly.h.
	(extern loop_is_parallel_p): Move from graphite-poly.h.
	(extern get_loop_body_pbbs): Move from graphite-poly.h.

	* graphite-poly.h (extern find_pbb_via_hash): Move to graphite-htab.h.
	(extern loop_is_parallel_p): Move to graphite-htab.h.
	(extern get_loop_body_pbbs): Move to graphite-htab.h.

	* haifa-sched.c (htab_t delay_htab):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t delay_htab_i2): Likewise.

	* ira-color.c (htab_t allocno_hard_regs_htab):
	Change type to hash_table.  Update dependent calls and types.

	* ira-costs.c (htab_t cost_classes_htab):
	Change type to hash_table.  Update dependent calls and types.

	* loop-invariant.c (htab_t merge_identical_invariants::eq):
	Change type to hash_table.  Update dependent calls and types.

	* loop-iv.c (htab_t bivs):
	Change type to hash_table.  Update dependent calls and types.

	* loop-unroll.c (htab_t opt_info::insns_to_split):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t opt_info::insns_with_var_to_expand): Likewise.

	* lto-streamer.h (struct string_slot): Move from data-streamer.h
	(struct string_slot_hasher): New.
	(htab_t output_block::string_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-in.c (freeing_string_slot_hasher): New.
	(htab_t file_name_hash_table):
	Change type to hash_table.  Update dependent calls and types.

	* lto-streamer-out.c: Update output_block::string_hash_table dependent
	calls and types.

	* lto-streamer.c (htab_t tree_htab):
	Change type to hash_table.  Update dependent calls and types.

	* omp-low.c: Include gimplify-ctx.h.

	* passes.c (htab_t name_to_pass_map):
	Change type to hash_table.  Update dependent calls and types.
	(pass_traverse): Rename to passes_pass_traverse.

	* plugin.c (htab_t event_tab):
	Change type to hash_table.  Update dependent calls and types.

	* postreload-gcse.c (htab_t expr_table):
	Change type to hash_table.  Update dependent calls and types.
	(dump_hash_table_entry): Rename dump_expr_hash_table_entry.

	* sese.c (debug_rename_map_1): Make extern.
	(htab_t copy_bb_and_scalar_dependences::rename_map):
	Change type to hash_table.  Update dependent calls and types.

	* sese.h (extern debug_rename_map): Move to .c file.

	* store-motion.c (htab_t store_motion_mems_table):
	Change type to hash_table.  Update dependent calls and types.

	* trans-mem.c (htab_t tm_new_mem_hash):
	Change type to hash_table.  Update dependent calls and types.

	* tree-browser.c (htab_t TB_up_ht):
	Change type to hash_table.  Update dependent calls and types.

	* tree-cfg.c (htab_t discriminator_per_locus):
	Change type to hash_table.  Update dependent calls and types.

	* tree-complex.c: Include tree-hasher.h
	(htab_t complex_variable_components):
	Change type to hash_table.  Update dependent calls and types.

	* tree-eh.c (htab_t finally_tree):
	Change type to hash_table.  Update dependent calls and types.

	* tree-flow.h (extern int_tree_map_hash): Moved into tree-hasher
	struct int_tree_hasher.
	(extern int_tree_map_eq): Likewise.
	(uid_decl_map_hash): Removed.
	(extern decl_tree_map_eq): Likewise.

	* tree-hasher.h: New.
	(struct int_tree_hasher): New.
	(typedef int_tree_htab_type): New.

	* tree-inline.c: Include gimplify-ctx.h.

	* tree-mudflap.c: Include gimplify-ctx.h.

	* tree-parloops.c: Include tree-hasher.h.
	(htab_t eliminate_local_variables_stmt::decl_address):
	Change type to hash_table.  Update dependent calls and types.
	(htab_t separate_decls_in_region::decl_copies): Likewise.

	* tree-scalar-evolution.c (htab_t resolve_mixers::cache):
	Change type to hash_table.  Update dependent calls and types.

	* tree-sra.c (candidates):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa.c (int_tree_map_eq): Moved into struct int_tree_hasher
	in tree-flow.h.
	(int_tree_map_hash): Likewise.

	* tree-ssa-dom.c (htab_t avail_exprs):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-live.c (var_map_base_init::tree_to_index):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-loop-ivopts.c (struct ivopts_data.inv_expr_tab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-phiopt.c (seen_ssa_names):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-strlen.c (decl_to_stridxlist_htab):
	Change type to hash_table.  Update dependent calls and types.

	* tree-ssa-uncprop.c (equiv):
	Change type to hash_table.  Update dependent calls and types.

From-SVN: r198329
2013-04-26 00:28:35 +00:00
Richard Biener f6b64c3501 re PR tree-optimization/56982 (Bad optimization with setjmp())
2013-04-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56982
	* builtins.def (BUILT_IN_LONGJMP): longjmp is not a leaf
	function.
	* gimplify.c (gimplify_call_expr): Notice special calls.
	(gimplify_modify_expr): Likewise.
	* tree-cfg.c (make_abnormal_goto_edges): Handle setjmp-like
	abnormal control flow receivers.
	(call_can_make_abnormal_goto): Handle cfun->calls_setjmp
	in the same way as cfun->has_nonlocal_labels.
	(gimple_purge_dead_abnormal_call_edges): Likewise.
	(stmt_starts_bb_p): Make setjmp-like abnormal control flow
	receivers start a basic-block.

	* gcc.c-torture/execute/pr56982.c: New testcase.

From-SVN: r198096
2013-04-19 13:39:16 +00:00
Jakub Jelinek 5d751b0c97 re PR c++/34949 (Dead code in empty destructors.)
PR c++/34949
	* tree-cfg.c (verify_gimple_assign_single): Allow lhs
	of gimple_clobber_p to be MEM_REF.
	* gimplify.c (gimplify_modify_expr): Gimplify *to_p of
	an assignment from TREE_CLOBBER_P.  Allow it to be MEM_REF
	after gimplification.
	* asan.c (get_mem_ref_of_assignment): Don't instrument
	gimple_clobber_p stmts.
	* tree-ssa-dse.c (dse_optimize_stmt): Allow DSE of
	gimple_clobber_p stmt if they have MEM_REF lhs and
	are dead because of another gimple_clobber_p stmt.
	* tree-ssa-live.c (clear_unused_block_pointer): Treat
	gimple_clobber_p stmts like debug stmts.
	(remove_unused_locals): Remove clobbers with MEM_REF lhs
	that refer to unused VAR_DECLs or uninitialized values.
	* tree-sra.c (sra_ipa_reset_debug_stmts): Also remove
	gimple_clobber_p stmts if they refer to removed parameters.
	(get_repl_default_def_ssa_name, sra_ipa_modify_expr): Fix up
	formatting.

From-SVN: r197369
2013-04-02 20:25:36 +02: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 aa710d2595 re PR tree-optimization/56094 (Invalid line number info generated with tree-level ivopts)
PR tree-optimization/56094
	* gimplify.c (force_gimple_operand_1): Temporarily set input_location
	to UNKNOWN_LOCATION while gimplifying expr.

	* gcc.dg/pr56094.c: New test.

From-SVN: r195504
2013-01-28 15:05:40 +01:00
Richard Sandiford d1e082c2c2 Update copyright years in gcc/
From-SVN: r195098
2013-01-10 20:38:27 +00:00
Jakub Jelinek d97c9b2248 re PR middle-end/55750 (-( in expand_expr_addr_expr_1, at expr.c:7646)
PR middle-end/55750
	* gimplify.c (gimplify_self_mod_expr): Don't force lvalue to
	pass is_gimple_min_lval.

	* gcc.c-torture/execute/pr55750.c: New test.

From-SVN: r194647
2012-12-20 19:13:56 +01:00
Richard Biener d1f985421f re PR lto/55736 (lto ICE: tree code ''junl is not supported in LTO streams)
2012-12-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/55736
	PR tree-optimization/55703
	* gimplify.c (prune_expr_location): New function.
	(unshare_expr_without_location): Likewise.
	* tree.h (unshare_expr_without_location): Declare.
	* ipa-prop.c (prune_expression_for_jf): Remove.
	(prune_expression_for_jf_1): Likewise.
	(ipa_set_jf_constant): Use unshare_expr_without_location.
	(ipa_set_jf_arith_pass_through): Likewise.
	(determine_known_aggregate_parts): Likewise.
	* tree-switch-conversion.c (build_constructors): Use
	unshare_expr_without_location on all constructor elements.

	* gcc.dg/lto/pr55703_0.c: New testcase.

From-SVN: r194609
2012-12-19 13:53:18 +00:00
Richard Biener cc3c4f62f3 re PR c/35634 (operand of pre-/postin-/decrement not promoted)
2012-11-28  Richard Biener  <rguenther@suse.de>

	PR c/35634
	* gimple.h (gimplify_self_mod_expr): Declare.
	* gimplify.c (gimplify_self_mod_expr): Export.  Take a different
	type for performing the arithmetic in.
	(gimplify_expr): Adjust.
	* tree-vect-loop-manip.c (vect_can_advance_ivs_p): Strip
	sign conversions we can re-apply after adjusting the IV.

	c-family/
	* c-gimplify.c (c_gimplify_expr): Gimplify self-modify expressions
	here and use a type with proper overflow behavior for types that would
	need to be promoted for the arithmetic.

	* gcc.dg/torture/pr35634.c: New testcase.
	* g++.dg/torture/pr35634.C: Likewise.
	* gcc.dg/vect/pr18536.c: Mark worker function noinline.

From-SVN: r193882
2012-11-28 09:27:10 +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
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
Eric Botcazou 88d8330d67 re PR rtl-optimization/54870 (gfortran.dg/array_constructor_4.f90 FAILs)
PR rtl-optimization/54870
	* tree.h (TREE_ADDRESSABLE): Document special usage on SSA_NAME.
	* cfgexpand.c (update_alias_info_with_stack_vars ): Set it on the
	SSA_NAME pointer that points to a partition if there is at least
	one variable with it set in the partition.
	* dse.c (local_variable_can_escape): New predicate.
	(can_escape): Call it.
	* gimplify.c (mark_addressable): If this is a partitioned decl, also
	mark the SSA_NAME pointer that points to a partition.

From-SVN: r192517
2012-10-16 22:49:07 +00:00
Marc Glisse e6ed43b0bc optabs.c (vector_compare_rtx): Change prototype.
2012-10-12  Marc Glisse  <marc.glisse@inria.fr>

	* optabs.c (vector_compare_rtx): Change prototype.
	(expand_vec_cond_expr): Handle VEC_COND_EXPR whose first operand
	is not a comparison.
	* gimplify.c (gimplify_expr): Handle VEC_COND_EXPR.

From-SVN: r192393
2012-10-12 09:20:00 +00:00
Dehao Chen e368f44fef tree-eh.c (lower_try_finally_onedest): Set correct location for deallocator.
gcc:
	2012-10-10  Dehao Chen  <dehao@google.com>

	* tree-eh.c (lower_try_finally_onedest): Set correct location for
	deallocator.
	* gimplify.c (gimplify_expr): Set correct location for TRY stmt.

gcc/cp:
	2012-10-10  Dehao Chen  <dehao@google.com>

	* cp-gimplify.c (cp_genericize_r): Set location for TRY expr.

testsuite:
	2012-10-10  Dehao Chen  <dehao@google.com>

	* g++.dg/debug/dwarf2/deallocator.C: Cover more deallocator cases.

From-SVN: r192285
2012-10-10 01:26:30 +00:00
Martin Jambor af16bc762a function.c (push_cfun): Check old current_function_decl matches old cfun...
2012-09-20  Martin Jambor  <mjambor@suse.cz>

	* function.c (push_cfun): Check old current_function_decl matches
	old cfun, set new current_function_decl to the decl of the new
	cfun.
	(push_struct_function): Likewise.
	(pop_cfun): Likewise.
	(allocate_struct_function): Move call to
	invoke_set_current_function_hook to the end of the function.
	* cfgexpand.c (estimated_stack_frame_size): Do not set and restore
	current_function_decl.
	* cgraph.c (cgraph_release_function_body): Likewise.
	* cgraphunit.c (cgraph_process_new_functions): Likewise.
	(cgraph_add_new_function): Likewise.
	(cgraph_analyze_function): Likewise.
	(assemble_thunk): Set cfun to NULL at the end.
	(expand_function): Move call to set_cfun downwards.
	* gimple-low.c (record_vars_into): Only check current_function_decl
	before possibly doing push_cfun.
	* gimplify.c (gimplify_function_tree): Do not set and restore
	current_function_decl.
	* ipa-inline-analysis.c (compute_inline_parameters): Likewise.
	(inline_analyze_function): Likewise.
	* ipa-prop.c (ipa_analyze_node): Likewise.
	* ipa-pure-const.c (analyze_function): Likewise.
	* lto-streamer-in.c (lto_input_function_body): Do not set
	current_function_decl.
	* lto-streamer-out.c (output_function): Do not set and restore
	current_function_decl.
	* omp-low.c (finalize_task_copyfn): Likewise.
	(expand_omp_taskreg): Likewise.
	(create_task_copyfn): Likewise, move push_cfun up quite a bit.
	* passes.c (dump_passes): Do not set and restore current_function_decl.
	(do_per_function): Likewise.
	(do_per_function_toporder): Likewise.
	* trans-mem.c (ipa_tm_scan_irr_function): Likewise.
	(ipa_tm_transform_transaction): Likewise.
	(ipa_tm_transform_clone): Likewise.
	(ipa_tm_execute): Likewise.
	* tree-emutls.c (lower_emutls_function_body): Likewise.
	* tree-inline.c (initialize_cfun): Do not call pop_cfun.
	(tree_function_versioning): Do not call push_cfun, do not set and
	restore current_function_decl.  Remove assert checking consistency of
	cfun and current_function_decl.
	* tree-profile.c (tree_profiling): Do not set and restore
	current_function_decl.
	* tree-sra.c (convert_callers_for_node): Do not set
	current_function_decl.
	(convert_callers): Do not restore current_function_decl.
	(modify_function): Do not set current_function_decl.
	* tree-ssa-structalias.c (ipa_pta_execute): Do not set and restore
	current_function_decl.

fortran/
	* trans-decl.c (gfc_get_extern_function_decl): Push NULL cfun.  Do not
	set and restore current_function_decl.
	(gfc_init_coarray_decl): Do not set and restore current_function_decl.

lto/
	* lto.c (lto_materialize_function): Call push_struct_function and
	pop_cfun.

From-SVN: r191577
2012-09-20 18:35:40 +02: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
Dehao Chen 820055a0ac tree-eh.c (goto_queue_node): New field.
gcc:
	* tree-eh.c (goto_queue_node): New field.
	(record_in_goto_queue): New parameter.
	(record_in_goto_queue_label): New parameter.
	(lower_try_finally_dup_block): New parameter.
	(maybe_record_in_goto_queue): Update source location.
	(lower_try_finally_copy): Likewise.
	(honor_protect_cleanup_actions): Likewise.
	* gimplify.c (gimplify_expr): Reset the location to unknown.

testsuite:
	* g++.dg/debug/dwarf2/deallocator.C: New test.

libjava:
	* testsuite/libjava.lang/sourcelocation.java: New cases.
	* testsuite/libjava.lang/sourcelocation.out: New cases.

From-SVN: r191338
2012-09-15 00:41:53 +00:00
Richard Guenther 3537a0cdbb builtin-types.def (BT_FN_CONST_STRING): Add.
2012-09-14  Richard Guenther  <rguenther@suse.de>

	* builtin-types.def (BT_FN_CONST_STRING): Add.
	* builtins.def (BUILT_IN_FILE, BUILT_IN_FUNCTION,
	BUILT_IN_LINE): New builtins.
	* gimplify.c (gimplify_call_expr): Expand them.
	* doc/extend.texi (__builtin_LINE, __builtin_FUNCTION,
	__builtin_FILE): Document.

	* g++.dg/torture/builtin-location.C: New testcase.

From-SVN: r191290
2012-09-14 08:50:01 +00:00
Steven Bosscher fd8d363e25 gimple.h (gimple_build_switch): Remove.
* gimple.h (gimple_build_switch): Remove.
	(gimple_build_switch_vec): Promote to the new gimple_build_switch.
	(gimple_switch_default_label): Assert the default case label is
	really a default case label.
	(gimple_switch_set_default_label): Likewise.
	* gimple.c (gimple_build_switch_nlabels): Make sure a default label
	is passed in, and simplify accordingly.
	(gimple_build_switch): Removed.
	(gimple_build_switch_vec): Rename to gimple_build_switch.
	* gimplify.c (gimplify_switch_expr): Update gimple_build_switch use.
	* gimple-pretty-print.c (dump_gimple_switch): Do not accept a NULL
	case label.
	* stmt.c (expand_case): Simplify using the fact that every GIMPLE
	switch must have a default case.
	* tree-cfg.c (group_case_labels_stmt): Likewise.
	(verify_gimple_switch): Use gimple_switch_label in verifier to get
	the label at index 0, and verify that it is a valid default case.
	* except.c (sjlj_emit_dispatch_table): Rewrite construction of the
	switch for dispatching.
	* tree-eh.c (lower_try_finally_switch): Update gimple_build_switch use.
	(lower_eh_dispatch): Likewise.
	* tree-vrp.c (execute_vrp): Use gimple_switch_label to get the case
	label at index 0 before turning it into a default case label.
	* omp-low.c (expand_omp_sections): Update gimple_build_switch use.
	* tree-switch-conversion.c (emit_case_bit_tests): Get the default case
	label using gimple_switch_default_label.
	(collect_switch_conv_info): Likewise.
	(process_switch): Likewise.
	* doc/gimple.texi: Update documentation of gimple_build_switch.

From-SVN: r190925
2012-09-04 13:03:02 +00:00
Jakub Jelinek 6f8f67e97d re PR c/54363 (ICE when compiling malformed struct initializers)
PR c/54363
	* gimplify.c (optimize_compound_literals_in_ctor): Only recurse
	if init is a CONSTRUCTOR.

	* gcc.dg/pr54363.c: New test.

From-SVN: r190657
2012-08-24 23:46:17 +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
Richard Guenther 2ad728d272 gimplify.c (create_tmp_from_val): Mark temporary with DECL_GIMPLE_REG_P here ...
2012-08-14  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (create_tmp_from_val): Mark temporary with
	DECL_GIMPLE_REG_P here ...
	(internal_get_tmp_var): ... instead of here.  If we go into
	SSA create an SSA name instead of a VAR_DECL.
	(gimplify_modify_expr): Do not create SSA names here, assert
	we already got them.
	(force_gimple_operand_1): Create an SSA name if we go into SSA.
	* sese.c (rename_uses): Simplify.

From-SVN: r190381
2012-08-14 11:22:23 +00:00
Steven Bosscher 07c5a154bb re PR middle-end/54146 (Very slow compile with attribute((flatten)))
PR middle-end/54146
	* gimpify.c (gimplify_body): Only verify_gimple_in_seq with
	checking enabled.
	* tree-ssa-loop-manip.c (add_exit_phis_var): Assert that var is
	a gimple_reg if checking is enabled.
	(find_uses_to_rename_stmt): Only look at non-virtual USE operands.
	* tree-into-ssa (compute_global_livein): Change the worklist
	type from an array to a VEC.

From-SVN: r190235
2012-08-08 17:39:46 +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
Richard Guenther 46eb666a79 tree-dfa.c (referenced_var_lookup): Remove.
2012-08-02  Richard Guenther  <rguenther@suse.de>

	* tree-dfa.c (referenced_var_lookup): Remove.
	(find_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	(make_rename_temp): Do not add referenced vars.
	(dump_referenced_vars): Remove.
	(debug_referenced_vars): Likewise.
	(dump_dfa_stats): Do not dump referenced var stats.
	(find_vars_r): Remove.
	(find_referenced_vars_in): Likewise.
	(referenced_var_check_and_insert): Likewise.
	(add_referenced_var_1): Likewise.
	(remove_referenced_var): Likewise.
	* tree-flow.h (referenced_var_lookup): Likewise.
	(struct gimple_df): Remove referenced_vars member.
	(typedef referenced_var_iterator): Remove.
	(FOR_EACH_REFERENCED_VAR): Likewise.
	(num_referenced_vars): Likewise.
	(debug_referenced_vars, dump_referenced_vars): Likewise.
	(add_referenced_var_1, add_referenced_var): Likewise.
	(remove_referenced_var): Likewise.
	(find_referenced_vars_in): Likewise.
	* tree-flow-inline.h (gimple_referenced_vars): Remove.
	(first_referenced_var): Likewise.
	(end_referenced_vars_p): Likewise.
	(next_referenced_var): Likewise.
	* cfgexpand.c (update_alias_info_with_stack_vars): Remove assert.
	* gimple-pretty-print.c (pp_points_to_solution): Dump UIDs
	unconditionally.
	* tree-into-ssa.c (dump_decl_set): Likewise.
	(pass_build_ssa): Do not require PROP_referenced_vars.
	* tree-ssa.c (target_for_debug_bind): Virtual operands are
	not suitable, but all register type vars are.
	(init_tree_ssa): Do not allocate referenced vars.
	(delete_tree_ssa): Do not free referenced vars.
	* cgraphunit.c (init_lowered_empty_function): Do not set
	PROP_referenced_vars.
	(assemble_thunk): Do not add referenced vars.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	(gimplify_and_update_call_from_tree): Likewise.
	* gimple-streamer-in.c (input_bb): Likewise.
	* passes.c (init_optimization_passes): Do not run
	pass_referenced_vars.
	(dump_properties): Do not dump PROP_referenced_vars.
	* tree-inline.c (remap_decl): Do not add referenced vars.
	(remap_gimple_op_r): Likewise.
	(copy_tree_body_r): Likewise.
	(copy_bb): Likewise.
	(setup_one_parameter): Likewise.
	(declare_return_variable): Likewise.
	(copy_decl_for_dup_finish): Likewise.
	(copy_arguments_for_versioning): Likewise.
	(tree_function_versioning): Likewise.
	* tree-pass.h (PROP_referenced_vars): Remove.
	(pass_referenced_vars): Likewise.
	* tree-profile.c (gimple_gen_edge_profiler): Do not add referenced vars.
	(gimple_gen_interval_profiler): Likewise.
	(gimple_gen_pow2_profiler): Likewise.
	(gimple_gen_one_value_profiler): Likewise.
	(gimple_gen_ic_profiler): Likewise.
	(gimple_gen_average_profiler): Likewise.
	(gimple_gen_ior_profiler): Likewise.
	* tree-ssa-live.c (remove_unused_locals): Do not touch referenced vars.
	* tree-cfg.c (replace_ssa_name): Do not add referenced vars.
	(move_stmt_op): Likewise.
	* tree-ssa-operands.c (create_vop_var): Likewise.
	* gimple-low.c (record_vars_into): Likewise.
	* gimplify.c (gimple_regimplify_operands): Likewise.
	(force_gimple_operand_1): Likewise.
	* omp-low.c (expand_omp_for_generic): Likewise.
	(expand_omp_for_static_chunk): Likewise.
	(expand_omp_atomic_pipeline): Likewise.
	* graphite-clast-to-gimple.c (graphite_create_new_loop): Likewise.
	(translate_clast_assignment): Likewise.
	* graphite-sese-to-poly.c (create_zero_dim_array): Likewise.
	(handle_scalar_deps_crossing_scop_limits): Likewise.
	* ipa-prop.c (ipa_modify_formal_parameters): Likewise.
	* ipa-split.c (split_function): Likewise.
	* matrix-reorg.c (transform_access_sites): Likewise.
	* trans-mem.c (tm_log_add): Likewise.
	(ipa_tm_insert_gettmclone_call): Likewise.
	* tree-complex.c (create_one_component_var): Likewise.
	* tree-if-conv.c (ifc_temp_var): Likewise.
	* tree-parloops.c (take_address_of): Likewise.
	(initialize_reductions): Likewise.
	(separate_decls_in_region_name): Likewise.
	(create_call_for_reduction_1): Likewise.
	(separate_decls_in_region): Likewise.
	* tree-predcom.c (predcom_tmp_var): Likewise.
	(reassociate_to_the_same_stmt): Likewise.
	* tree-sra.c (build_ref_for_offset): Likewise.
	(create_access_replacement): Likewise.
	(get_replaced_param_substitute): Likewise.
	(sra_ipa_reset_debug_stmts): Likewise.
	* tree-ssa-loop-im.c (rewrite_reciprocal): Likewise.
	(rewrite_bittest): Likewise.
	* tree-ssa-loop-ivopts.c (create_new_iv): Likewise.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	(tree_transform_and_unroll_loop): Likewise.
	* tree-ssa-math-opts.c (powi_as_mults): Likewise.
	(build_and_insert_call): Likewise.
	(gimple_expand_builtin_cabs): Likewise.
	(execute_optimize_bswap): Likewise.
	* tree-ssa-phiopt.c (conditional_replacement): Likewise.
	(abs_replacement): Likewise.
	(cond_store_replacement): Likewise.
	(cond_if_else_store_replacement_1): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-pre.c (get_representative_for): Likewise.
	(create_expression_by_pieces): Likewise.
	(insert_into_preds_of_block): Likewise.
	* tree-ssa-propagate.c (update_call_from_tree): Likewise.
	* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
	(eliminate_redundant_comparison): Likewise.
	(rewrite_expr_tree_parallel): Likewise.
	(get_reassoc_pow_ssa_name): Likewise.
	* tree-ssa-strlen.c (get_string_length): Likewise.
	* tree-switch-conversion.c (emit_case_bit_tests): Likewise.
	(build_arrays): Likewise.
	* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
	(create_tailcall_accumulator): Likewise.
	* tree-vect-data-refs.c (vect_get_new_vect_var): Likewise.
	(vect_create_addr_base_for_vector_ref): Likewise.
	(vect_permute_store_chain): Likewise.
	(vect_permute_load_chain): Likewise.
	* tree-vect-generic.c (expand_vector_divmod): Likewise.
	* tree-vect-loop-manip.c (set_prologue_iterations): Likewise.
	(vect_build_loop_niters): Likewise.
	(vect_generate_tmps_on_preheader): Likewise.
	(vect_update_ivs_after_vectorizer): Likewise.
	(vect_gen_niters_for_prolog_loop): Likewise.
	(vect_do_peeling_for_alignment): Likewise.
	(vect_create_cond_for_align_checks): Likewise.
	* tree-vect-patterns.c (vect_recog_temp_ssa_var): Likewise.
	(vect_handle_widen_op_by_const): Likewise.
	(vect_operation_fits_smaller_type): Likewise.
	(vect_recog_over_widening_pattern): Likewise.
	* tree-vect-stmts.c (vect_init_vector): Likewise.

	* gcc.dg/torture/pta-callused-1.c: Adjust.
	* gcc.dg/torture/pta-ptrarith-3.c: Likewise.
	* gcc.dg/torture/ssa-pta-fn-1.c: Likewise.
	* gcc.dg/tree-ssa/alias-19.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-2.c: Likewise.
	* gcc.dg/tree-ssa/pta-escape-3.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.

From-SVN: r190067
2012-08-02 08:14:54 +00:00
Richard Guenther 1371431060 tree-flow.h (struct gimple_df): Remove syms_to_rename member, add ssa_renaming_needed and rename_vops flags.
2012-08-01  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (struct gimple_df): Remove syms_to_rename member,
	add ssa_renaming_needed and rename_vops flags.
	(SYMS_TO_RENAME): Remove.
	(symbol_marked_for_renaming): Likewise.
	(mark_virtual_ops_for_renaming): Likewise.
	* tree-into-ssa.c (symbols_to_rename_set, symbols_to_rename):
	New globals.
	(mark_for_renaming, marked_for_renaming): New functions.
	(symbol_marked_for_renaming): Remove.
	(dump_currdefs): Adjust.
	(maybe_replace_use): Likewise.
	(maybe_replace_use_in_debug_stmt): Likewise.
	(maybe_register_def): Likewise.
	(rewrite_update_phi_arguments): Likewise.
	(rewrite_update_enter_block): Likewise.
	(fini_ssa_renamer): Clear update SSA status here ...
	(delete_update_ssa): ... not here.  Free rename set.
	(prepare_block_for_update): Compute which decls need renaming.
	(dump_update_ssa): Adjust.
	(mark_sym_for_renaming): Adjust update SSA status for virtuals.
	(need_ssa_update_p): Adjust.
	(insert_updated_phi_nodes_for): Likewise.
	(update_ssa): Likewise.
	* tree-ssa-operands.c (finalize_ssa_defs): Adjust update SSA status
	for virtual and real operands.
	(finalize_ssa_uses): Likewise.
	* tree-ssanames.c (init_ssanames): Adjust.
	* tree-ssa.c (maybe_rewrite_mem_ref_base, maybe_optimize_var,
	execute_update_addresses_taken): Add bitmap to keep track of which
	candidates are suitable for rewriting and later renaming by SSA
	update.
	* matrix-reorg.c (transform_access_sites): Do not rename all defs.
	* tree-dfa.c (make_rename_temp): Do not mark real operands for renaming.
	* cgraphunit.c (assemble_thunk): Likewise.
	* gimplify.c (gimple_regimplify_operands): Likewise.
	(force_gimple_operand_1): Likewise.
	* ipa-prop.c (ipa_modify_formal_parameters): Likewise.
	* tree-inline.c (declare_return_variable): Likewise.
	* tree-parloops.c (separate_decls_in_region_stmt): Do not call
	mark_virtual_ops_for_renaming.
	(create_stores_for_reduction): Likewise.
	(create_loads_and_stores_for_name): Likewise.
	* tree-predcom.c (mark_virtual_ops_for_renaming): Remove.
	(initialize_root_vars_lm): Do not call mark_virtual_ops_for_renaming.
	(execute_load_motion): Likewise.
	(remove_stmt): Likewise.
	(execute_pred_commoning_chain): Likewise.
	* tree-sra.c (create_access_replacement): Do not rename real
	operands.
	(get_unrenamed_access_replacement): Unify with ...
	(get_access_replacement): ... this.
	(get_repl_default_def_ssa_name): Adjust.
	* tree-ssa-loop-im.c (move_computations_stmt): Manually update
	virtual SSA form.
	(rewrite_mem_ref_loc): Do not call mark_virtual_ops_for_renaming.
	* tree-ssa-loop-prefetch.c (emit_mfence_after_loop): Likewise.

From-SVN: r190033
2012-08-01 11:48:04 +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 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
Steven Bosscher 6bdf351944 expr.h (can_move_by_pieces): Move prototype from here ...
gcc/
	* expr.h (can_move_by_pieces): Move prototype from here ...
	* tree.h (can_move_by_pieces): ... to here.
	* optabs.h (set_widening_optab_handler): Use XCNEW.
	* gimplify.c: Do not include expr.h.

	* toplev.c: Do not include dwarf2out.h.
	* config/ia64/ia64.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/sparc/t-sparc (sparc.o): Fix dependencies.

	* Makefile.in (toplev.o): Fix dependencies
	(c-family/c-gimplify.o): Likewise.
	(c-family/c-common.o): Likewise.

c-family/
	* c-gimplify.c: Do not include basic-block.h.
	* c-common.c: Do not include linfuncs.h.

cp/
	* method.c: Do not include tree-pass.h.

fortran/
	* trans.c: Do not include defaults.h.
	* trans-intrinsic.c: Likewise.

java/
	* decl.c: Do not include libfuncs.h.
	* class.c: Do not include defaults.h.
	* jvgenmain.c: Likewise.
	* magnle.c: Likewise.
	* Make-lang.in (decl.o): Fix dependencies.

From-SVN: r189425
2012-07-11 08:58:58 +00:00
Xinliang David Li 87e2a8fd39 Implement -freuse-stack= option
From-SVN: r189413
2012-07-10 20:26:38 +00:00
Michael Matz 4c53d18336 gimplify.c (gimplify_compound_literal_expr): Take gimple_test_f argument...
* gimplify.c (gimplify_compound_literal_expr): Take gimple_test_f
	argument, don't emit assign statement if value is directly usable.
	(gimplify_expr): Adjust.

testsuite/
	* gcc.dg/tree-ssa/vector-4.c: New test.

From-SVN: r188665
2012-06-15 14:46:36 +00:00
Michael Matz 6da8be895c gimplify.c (gimplify_modify_expr): Fold generated statements.
* gimplify.c (gimplify_modify_expr): Fold generated statements.
	* gimple-fold.c (can_refer_decl_in_current_unit_p): Check flag_ltrans.

testsuite/
	* gcc.dg/debug/dwarf2/inline3.c: Adjust.
	* gcc.dg/tree-ssa/foldstring-1.c: Adjust.

From-SVN: r188664
2012-06-15 14:40:38 +00:00
Steven Bosscher a4b7d13c17 output.h (merge_weak, [...]): Move protos from here...
* output.h (merge_weak, assemble_alias,
	initializer_constant_valid_p,
	initializer_constant_valid_for_bitfield_p): Move protos from here...
	* tree.h: ... to here.

	* cgraphclones.c: Do not include output.h.
	* gimplify.c: Likewise.
	* reload.c: Likewise.
	* recog.c: Likewise.
	* tree-ssa-loop-ivopts.c: Likewise.
	* tree-switch-conversion.c: Likewise.
	* c-parser.c: Likewise.
	* c-typeck.c: Likewise.

	* Makefile.in: Fix dependencies.

c-family/
	* c-common.c: Do not include output.h.
	* c-pragma.c: Likewise.

cp/
	* semantics.c: Do not include output.h.
	* decl2.c: Likewise.
	* friend.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.
	* Make-lang.in: Fix dependencies.

ada/
	* gcc-interface/utils2.c: Do not include output.h.
	* gcc-interface/Make-lang.in: Fix dependencies.

From-SVN: r188178
2012-06-04 11:17:58 +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
Eric Botcazou f301837ea3 gimplify.c (gimplify_init_constructor): Do a block move for very small objects as well.
* gimplify.c (gimplify_init_constructor): Do a block move for very
	small objects as well.

From-SVN: r187498
2012-05-15 07:21:37 +00:00
Richard Guenther 097dcc6683 gimplify.c (gimple_regimplify_operands): Only mark the LHS of statements for renaming.
2012-05-14  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimple_regimplify_operands): Only mark the LHS
	of statements for renaming.
	(force_gimple_operand_1): Likewise, consistently for both
	calls to force_gimple_operand and force_gimple_operand_gsi.

From-SVN: r187468
2012-05-14 15:05:21 +00:00
Richard Guenther 412a1d9e4a gimplify.c (gimplify_expr): Remove odd code.
2012-05-14  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimplify_expr): Remove odd code.

From-SVN: r187453
2012-05-14 10:44:44 +00:00
Eric Botcazou d400d17ef0 gimplify.c (gimplify_decl_expr): For a TYPE_DECL, also gimplify the DECL_ORIGINAL_TYPE if it is present.
* gimplify.c (gimplify_decl_expr): For a TYPE_DECL, also gimplify the
	DECL_ORIGINAL_TYPE if it is present.

From-SVN: r187369
2012-05-10 14:57:48 +00:00
Richard Guenther 3ac8781c36 cuintp.c (UI_From_gnu): Remove TYPE_IS_SIZETYPE use.
2012-05-10  Richard Guenther  <rguenther@suse.de>

	ada/
	* gcc-interface/cuintp.c (UI_From_gnu): Remove TYPE_IS_SIZETYPE use.

	c-family/
	* c-common.c (c_sizeof_or_alignof_type): Remove assert and
	adjust commentary about TYPE_IS_SIZETYPE types.

	* tree.h (TYPE_IS_SIZETYPE): Remove.
	* fold-const.c (int_const_binop_1): Remove TYPE_IS_SIZETYPE use.
	(extract_muldiv_1): Likewise.
	* gimple.c (gtc_visit): Likewise.
	(gimple_types_compatible_p): Likewise.
	(iterative_hash_canonical_type): Likewise.
	(gimple_canonical_types_compatible_p): Likewise.
	* gimplify.c (gimplify_one_sizepos): Likewise.
	* print-tree.c (print_node): Likewise.
	* stor-layout.c (initialize_sizetypes): Do not set TYPE_IS_SIZETYPE.

From-SVN: r187363
2012-05-10 07:58:27 +00:00
Steven Bosscher 5be1632b7d re PR middle-end/53245 (ice in expand_case)
PR middle-end/53245
	* gimplify.c (preprocess_case_label_vec_for_gimple): If low or high
	is folded to a type boundary value, verify that the resulting case
	label is still a care range.

From-SVN: r187248
2012-05-07 14:40:33 +00:00
Michael Matz 355a767352 coretypes.h (gimple_seq, [...]): Typedef as gimple.
* coretypes.h (gimple_seq, const_gimple_seq): Typedef as gimple.
	* gimple.h (struct gimple_seq_node_d, struct gimple_seq_d): Remove.
	(const_gimple_seq_node): Remove.
	(gimple_seq_node): Typedef as gimple.
	(struct gimple_statement_base): Add next and prev members,
	adjust all WORD markers in using structs.
	(union gimple_statement_d): Link via gsbase.next field for GC and PCH.
	(gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
	gimple_seq_last_stmt): Adjust as gimple_seq, gimple_seq_node and
	gimple are the same.
	(gimple_seq_set_last, gimple_seq_set_first): Don't allocate
	gimple_seq, adjust.
	(gimple_init_singleton): New function.
	(gsi_start_1, gsi_last_1, gsi_end_p, gsi_one_before_end_p): Adjust.
	(gsi_next, gsi_prev): Adjust, handle prev cyclic list correctly.
	(gsi_stmt): Adjust.
	(gsi_stmt_ptr): Remove.
	(enum gimple_alloc_kind): Remove gimple_alloc_kind_seq member.

	* gimple-iterator.c (update_bb_for_stmts): Take last parameter
	again, adjust for above changes.
	(update_call_edge_frequencies): Adjust for above changes.
	(gsi_insert_seq_nodes_before): Rewrite for new data structure.
	(gsi_insert_seq_nodes_after): Ditto.
	(gsi_split_seq_after): Ditto.
	(gsi_set_stmt): Ditto.
	(gsi_split_seq_before): Ditto.
	(gsi_remove): Ditto.
	(gsi_insert_seq_before_without_update): Don't free sequence.
	(gsi_insert_seq_after_without_update): Ditto.
	(gsi_replace): Assert some more invariants.
	(gsi_insert_before_without_update, gsi_insert_after_without_update):
	Tidy.
	(gsi_for_stmt): Don't search for stmt.
	(gsi_insert_on_edge_immediate): Tidy.

	* gimple.c (gimple_alloc_k): Remove "sequences".
	(gimple_seq_cache): Remove.
	(gimple_alloc_stat): Make stmt a singleton sequence.
	(gimple_seq_alloc, gimple_seq_free): Remove.
	(gimple_assign_set_rhs_with_ops_1): Ensure new stmt is a singleton.
	(gimple_copy): Ditto.
	* gimplify.c (gimplify_cleanup_point_expr): Use gsi_set_stmt,
	create iterator from correct sequence.
	* tree-phinodes.c (make_phi_node): Make stmt a singleton.


	* gimple.h (gimple_stmt_iterator <seq>): Make it be pointer to
	gimple_seq.
	(gimple_seq_set_last, gimple_seq_set_first): Take pointer to
	sequence, lazily allocate it.
	(bb_seq_addr): New function.
	(gsi_start_1): Rename from gsi_start, but take pointer to sequence.
	(gsi_start): Macro to wrap gsi_start_1 taking pointer of argument.
	(gsi_none): New function.
	(gsi_start_bb): Adjust.
	(gsi_last_1): Rename from gsi_last, but take pointer to sequence.
	(gsi_last): Macro to wrap gsi_last_1 taking pointer of argument.
	(gsi_last_bb): Adjust.
	(gsi_seq): Adjust.
	* tree-flow-inline.h (phi_nodes_ptr): New function.

	* gimple-iterator.c (gsi_insert_seq_nodes_before): Adjust to 
	datastructure and interface change.
	(gsi_insert_seq_before_without_update): Ditto.
	(gsi_insert_seq_nodes_after): Ditto.
	(gsi_insert_seq_after_without_update): Ditto.
	(gsi_split_seq_after): Ditto, don't use gimple_seq_alloc.
	(gsi_split_seq_before): Ditto.
	(gsi_start_phis): Adjust.
	* tree-vect-loop.c (vect_determine_vectorization_factor): Use
	gsi_none.
	(vect_transform_loop): Ditto.
	* gimple.c (gimple_seq_add_stmt, gimple_seq_add_seq,
	gimple_seq_copy): Don't use gimple_seq_alloc.
	* gimplify.c (gimple_seq_add_stmt_without_update): Ditto.
	(gimplify_seq_add_seq): Ditto.
	* lto-streamer-in.c (make_new_block): Ditto.
	* tree-cfg.c (create_bb): Ditto.
	* tree-sra.c (initialize_parameter_reductions): Ditto.


	* gimple.h (gimple_seq_first, gimple_seq_first_stmt, gimple_seq_last,
	gimple_seq_last_stmt, gimple_seq_set_last, gimple_seq_set_first,
	gimple_seq_empty_p, gimple_seq_alloc_with_stmt, bb_seq,
	set_bb_seq): Move down to after gimple_statement_d definition.


	* gimple-fold.c (gimplify_and_update_call_from_tree): Use
	gsi_replace_with_seq, instead of inserting itself.
	* gimple-iterator.c (gsi_replace_with_seq): New function.
	* tree-ssa-forwprop.c (forward_propagate_comparison): Take
	iterator instead of statement, advance it.
	(ssa_forward_propagate_and_combine): Adjust call to above.


	* tree-phinodes.c (add_phi_node_to_bb): Tidy, don't use
	gimple_seq_alloc.
	* omp-low.c (finalize_task_copyfn): Don't use gimple_seq_alloc.
	* tree-nested.c (walk_gimple_omp_for): Ditto.
	* trans-mem.c (lower_transaction): Ditto.
	* tree-eh.c (do_return_redirection): Ditto.
	(do_goto_redirection): Ditto.
	(lower_try_finally_switch): Ditto.
	* gimplify.c (gimplify_stmt): Ditto.
	(gimplify_scan_omp_clauses): Ditto.
	(gimplify_omp_for): Ditto.
	(gimplify_function_tree): Ditto.
	* gimple-fold.c (gimplify_and_update_call_from_tree): Ditto.
	* tree-mudflap.c (mf_decl_cache_locals): Ditto.
	(mf_build_check_statement_for): Ditto.
	(mx_register_decls): Ditto.
	* graphite-sese-to-poly.c (remove_invariant_phi): Ditto,
	and don't use itertors to append.
	(insert_stmts): Ditto.
	(insert_out_of_ssa_copy): Ditto.
	(insert_out_of_ssa_copy_on_edge): Ditto.


	* gimple.h (gimple_bind_body_ptr): New function.
	(gimple_bind_body): Use it.
	(gimple_catch_handler): Use gimple_catch_handler_ptr.
	(gimple_eh_filter_failure_ptr): New function.
	(gimple_eh_filter_failure): Use it.
	(gimple_eh_else_n_body_ptr): New function.
	(gimple_eh_else_n_body): Use it.
	(gimple_eh_else_e_body_ptr): New function.
	(gimple_eh_else_e_body): Use it.
	(gimple_try_eval_ptr): New function.
	(gimple_try_eval): Use it.
	(gimple_try_cleanup_ptr): New function.
	(gimple_try_cleanup): Use it.
	(gimple_wce_cleanup_ptr): New function.
	(gimple_wce_cleanup): Use it.
	(gimple_omp_body_ptr): New function.
	(gimple_omp_body): Use it.
	(gimple_omp_for_pre_body_ptr): New function.
	(gimple_omp_for_pre_body): Use it.
	(gimple_transaction_body_ptr): New function.
	(gimple_transaction_body): Use it.
	(gsi_split_seq_before): Adjust to return nothing and take pointer
	to sequence.
	(gsi_set_stmt): Declare.
	(gsi_replace_with_seq): Declare.
	(walk_gimple_seq_mod): Declare.
	* function.h (struct function <gimple_body>): Use typedef gimple_seq.

	* gimple-iterator.c (gsi_set_stmt): New function.
	(gsi_split_seq_before): Return new sequence via pointer argument.
	(gsi_replace): Use gsi_set_stmt.

	* tree-ssa-loop-im.c (move_computations_stmt): First remove
	then insert stmt.
	* tree-complex.c (update_complex_components_on_edge): Don't
	copy gsi.
	* tree-phinodes.c (resize_phi_node): Don't resize stmt in-place,
	return new stmt.
	(reserve_phi_args_for_new_edge): Change call to above,
	use gsi_set_stmt.

	* omp-low.c (lower_omp): Change prototype to take pointer to
	sequence.
	(lower_rec_input_clauses): Use gimple_seq_add_seq instead of
	iterators.  Adjust call to lower_omp.
	(lower_lastprivate_clauses): Adjust call to lower_omp.
	(lower_reduction_clauses): Ditto.
	(expand_omp_taskreg): Nullify non-cfg body of child_fn.
	(lower_omp_sections): Don't explicitely count sequence length,
	nullify lowered bodies earlier, ensure stmts are part of only
	one sequence, adjust call to lower_omp.
	(lower_omp_single): Ensure stmts are part of only one sequence,
	adjust call to lower_omp.
	(lower_omp_master): Ditto.
	(lower_omp_ordered): Ditto.
	(lower_omp_critical): Ditto.
	(lower_omp_for): Ditto.
	(lower_omp_taskreg): Ditto, tidy.
	(lower_omp_1): Adjust calls to lower_omp.
	(execute_lower_omp): Ditto.
	(lower_omp): Adjust to take pointer to sequence.
	(diagnose_sb_2): Use walk_gimple_seq_mod.
	(diagnose_omp_structured_block_errors): Ditto and set possibly
	changed function body.
	* gimple-low.c (lower_function_body): Set function body after
	it stabilizes.
	(lower_sequence): Adjust to take pointer to sequence.
	(lower_omp_directive): Ensure stmt isn't put twice into the
	sequence, adjust call to lower_sequence.
	(lower_stmt): Adjust calls to lower_sequence.
	(lower_gimple_bind): Ditto.
	(gimple_try_catch_may_fallthru): Call gsi_start with lvalue.
	* tree-nested.c (walk_body): Take pointer to sequence, use
	walk_gimple_seq_mod.
	(walk_function): Adjust call to walk_body, set possibly changed
	body.
	(walk_gimple_omp_for): Adjust calls to walk_body.
	(convert_nonlocal_omp_clauses): Ditto.
	(convert_nonlocal_reference_stmt): Ditto.
	(convert_local_omp_clauses): Ditto.
	(convert_local_reference_stmt): Ditto.
	(convert_tramp_reference_stmt): Ditto.
	(convert_gimple_call): Ditto.
	(convert_nl_goto_reference): Use local iterator copy.
	* gimple.c (walk_gimple_seq_mod): Renamed from walk_gimple_seq,
	but taking pointer to sequence, ensure gsi_start is called with
	callers lvalue.
	(walk_gimple_seq): New wrapper around walk_gimple_seq_mod,
	asserting that the sequence head didn't change.
	(walk_gimple_stmt): Replace all calls to walk_gimple_seq with
	walk_gimple_seq_mod.
	* trans-mem.c (lower_transaction): Use walk_gimple_seq_mod.
	(execute_lower_tm): Ditto, and set possibly changed body.
	* tree-eh.c (lower_eh_constructs_1): Take pointer to sequence,
	call gsi_start with that lvalue.
	(replace_goto_queue_stmt_list): Ditto.
	(replace_goto_queue_1): Adjust calls to replace_goto_queue_stmt_list.
	(replace_goto_queue): Ditto.
	(lower_try_finally_nofallthru): Adjust calls to lower_eh_constructs_1.
	(lower_try_finally_onedest): Ditto.
	(lower_try_finally_copy): Ditto.
	(lower_try_finally_switch): Ditto.
	(lower_try_finally): Ditto.
	(lower_eh_filter): Ditto.
	(lower_eh_must_not_throw): Ditto.
	(lower_cleanup): Ditto.
	(lower_eh_constructs_2): Ditto.
	(lower_catch): Ditto, and ensure gsi_start is called with lvalue.
	(lower_eh_constructs): Adjust calls to lower_eh_constructs_1, and
	set possibly changed body.
	(optimize_double_finally): Call gsi_start with lvalue.

	* tree-cfg.c (make_blocks): Adjust call to gsi_split_seq_before.
	(gimple_split_block): Ditto.
	(gimple_merge_blocks): Use gsi_start_phis.
	(move_stmt_r): Use walk_gimple_seq_mod.
	* tree-ssa-dse.c (dse_enter_block): Use gsi_last_bb.
	* cgraphbuild.c (build_cgraph_edges): Use gsi_start_phis.
	(rebuild_cgraph_edges): Ditto.
	(cgraph_rebuild_references): Ditto.
	* ipa-prop.c (ipa_analyze_params_uses): Ditto.
	* tree-inline.c (copy_phis_for_bb): Ditto.
	* tree-ssa-dce.c: Ditto.

	* cgraphunit.c (cgraph_analyze_function): Use gimple_has_body_p.

From-SVN: r187053
2012-05-02 16:41:48 +00:00
Steven Bosscher 68e7284038 re PR middle-end/53153 (ice in tree_low_cst, at tree.c:6569)
gcc/
	PR middle-end/53153
	* gimplify.c (preprocess_case_label_vec_for_gimple): New function,
	split out from ...
	(gimplify_switch_expr): ... here.
	* gimple.h (preprocess_case_label_vec_for_gimple): Add prototype.
	* tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): New function
	to clean up case labels with values outside the index type range.
	(simplify_gimple_switch): Call it if something changed.
	Remove strange and unnecessary assert.

testsuite/
	PR middle-end/53153
	* gcc.dg/pr53153.c: New test.

From-SVN: r187048
2012-05-02 12:57:10 +00:00
Ian Lance Taylor a845a7f5aa re PR c/37303 (const compound initializers in structs are written to .data instead of .rodata)
gcc/:
	PR c/37303
	* c-decl.c (build_compound_literal): Make the decl readonly if it
	an array of a readonly type.
	* gimplify.c (gimplify_compound_literal_expr): Add fallback
	parameter.  Change all callers.  If the decl is not addressable
	and is not an l-value, make it readonly.
gcc/testsuite:
	PR c/37303
	* gcc.dg/pr37303.c: New test.

From-SVN: r187027
2012-05-01 21:25:15 +00:00
Steven Bosscher 809e5f8273 fix accidentally checked-in assert.
From-SVN: r186580
2012-04-18 18:36:32 +00:00
Steven Bosscher 0cd2402db7 targhooks.c (default_case_values_threshold): Fix code style nit.
gcc/
	* targhooks.c (default_case_values_threshold): Fix code style nit.

	* stmt.c (add_case_node, expand_case): Move logic to remove/reduce
	case range and type folding from here...
	* gimplify.c (gimplify_switch_expr): ... to here.  Expect NULL_TREE
	type, as documented in tree.def

fortran/
	* trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR
	with NULL_TREE type instead of void_type_node.
	* trans-io.c (io_result): Likewise.
	* trans-stmt.c (gfc_trans_integer_select,
	gfc_trans_character_select): Likewise.

go/
	* go-gcc.cc (Gcc_backend::switch_statement): Build SWITCH_EXPR
	with NULL_TREE type instead of void_type_node.

From-SVN: r186579
2012-04-18 18:27:51 +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
Richard Guenther 216820a4ad gimple.c (walk_gimple_op): Compute val_only for the LHS of an assigment in the canonical way...
2012-04-05  Richard Guenther  <rguenther@suse.de>

	* gimple.c (walk_gimple_op): Compute val_only for the LHS
	of an assigment in the canonical way, avoiding is_gimple_mem_rhs.
	(is_gimple_mem_rhs, is_gimple_reg_rhs, is_gimple_stmt): Move ...
	* gimplify.c (is_gimple_mem_rhs, is_gimple_reg_rhs, is_gimple_stmt):
	... here and make static.
	* gimple.h (is_gimple_mem_rhs, is_gimple_reg_rhs, is_gimple_stmt):
	Remove.

From-SVN: r186165
2012-04-05 13:38:47 +00:00
Richard Guenther cf1867a027 re PR middle-end/48814 (Incorrect scalar increment result)
2012-03-16  Richard Guenther  <rguenther@suse.de>
	Kai Tietz  <ktietz@redhat.com>

	PR middle-end/48814
	* gimplify.c (gimplify_self_mod_expr): Evaluate postfix
	side-effects completely in the pre-queue and use a temporary
	for the result.

	* gcc.c-torture/execute/pr48814-1.c: New test.
	* gcc.c-torture/execute/pr48814-2.c: New test.
	* gcc.dg/tree-ssa/assign-1.c: New test.
	* gcc.dg/tree-ssa/assign-2.c: New test.
	* gcc.dg/tree-ssa/assign-3.c: New test.

Co-Authored-By: Kai Tietz <ktietz@redhat.com>

From-SVN: r185465
2012-03-16 11:48:48 +00:00
Richard Guenther 0c2ad2033d re PR middle-end/52314 (gimplifier produces volatile)
2012-02-21  Richard Guenther  <rguenther@suse.de>

	PR middle-end/52314
	* gimplify.c (create_tmp_from_val): Use the main variant type
	for the type of the temporary we create.

From-SVN: r184436
2012-02-21 14:10:31 +00:00
Richard Guenther 01718e96e7 re PR tree-optimization/52324 (Store motion no longer performed)
2012-02-21  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/52324
	* gimplify.c (gimplify_expr): When re-gimplifying expressions
	do not gimplify a MEM_REF address operand if it is already
	in suitable form.

	* gcc.dg/tree-ssa/ssa-lim-10.c: New testcase.

From-SVN: r184435
2012-02-21 12:37:33 +00:00
Michael Matz 81bfd1977a re PR tree-optimization/46590 (long compile time with -O2 and many loops)
PR tree-optimization/46590
	* cfgexpand.c: Revert last change (r183305).
	* gimplify.c (gimplify_bind_expr): Add clobbers for all non-gimple
	regs.
	* tree-eh.c (cleanup_empty_eh): Try to optimize clobbers before
	checking for emptiness.

From-SVN: r183566
2012-01-26 15:50:33 +00:00
Richard Guenther aabb90e5ad re PR c/8081 (ICE with variably sized types returned from nested functions)
2012-01-13  Richard Guenther  <rguenther@suse.de>

	PR middle-end/8081
	* gimplify.c (gimplify_modify_expr_rhs): For calls with a
	variable-sized result always use RSO.

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

From-SVN: r183153
2012-01-13 12:05:27 +00:00
Eric Botcazou 3ad065efe1 gimple.h (gimplify_body): Remove first argument.
* gimple.h (gimplify_body): Remove first argument.
	* gimplify.c (copy_if_shared): Add DATA argument.  Do not create the
	pointer set here, instead just pass DATA to walk_tree.
	(unshare_body): Remove BODY_P argument and adjust.  Create the pointer
	set here and invoke copy_if_shared on the size trees of DECL_RESULT.
	(unvisit_body): Likewise, but with unmark_visited.
	(gimplify_body): Remove BODY_P argument and adjust.
	(gimplify_function_tree): Adjust call to gimplify_body.
	* omp-low.c (finalize_task_copyfn): Likewise.

From-SVN: r183104
2012-01-11 18:50:54 +00:00
Aldy Hernandez 345ae17774 gimple.c (is_gimple_non_addressable): Remove.
* gimple.c (is_gimple_non_addressable): Remove.
        * gimple.h: Remove is_gimple_non_addressable.
        * gimplify.c (gimplify_modify_expr_rhs): Use is_gimple_reg instead of
        is_gimple_non_addressable.
        * trans-mem.c (expand_assign_tm): Same.

From-SVN: r183015
2012-01-09 15:14:19 +00:00
Jakub Jelinek 32be32afef re PR middle-end/51761 (ICE in verify_gimple_stmt, at tree-cfg.c:4241)
PR middle-end/51761
	* gimple.h (struct gimplify_ctx): Add in_cleanup_point_expr
	field.
	* gimplify.c (gimplify_cleanup_point_expr): Save and set
	in_cleanup_point_expr before gimplify_stmt call and restore it
	afterwards.
	(gimplify_target_expr): Don't add {CLOBBER} cleanup if
	in_cleanup_point_expr is false.

	* gcc.c-torture/compile/pr51761.c: New test.

From-SVN: r182914
2012-01-05 16:10:26 +01:00
Jakub Jelinek a1a6c5b26a gimple.h (gimplify_seq_add_stmt): Rename to...
* gimple.h (gimplify_seq_add_stmt): Rename to...
	(gimple_seq_add_stmt_without_update): ... this.
	* gimplify.c (gimplify_seq_add_stmt): Rename to...
	(gimple_seq_add_stmt_without_update): ... this.
	(gimplify_seq_add_stmt): New inline wrapper for it.
	* tree-vect-patterns.c (append_pattern_def_seq): Use
	gimple_seq_add_stmt_without_update instead of gimplify_seq_add_stmt.

	* cp-gimplify.c (gimplify_must_not_throw_expr): Use
	gimple_seq_add_stmt_without_update instead of gimplify_seq_add_stmt.

From-SVN: r182482
2011-12-19 15:25:28 +01:00
Torvald Riegel 5f23640f57 Add default handling for outermost wrappers in voidify_wrapper_expr.
gcc/
	* gimplify.c (voidify_wrapper_expr): Add default handling for
	outermost wrapper.

From-SVN: r182232
2011-12-12 12:05:01 +00:00
Richard Guenther 89faf322d8 cgraph.c (cgraph_create_edge_1): Initialize call_stmt_cannot_inline_p from the stmt if possible.
2011-12-05  Richard Guenther  <rguenther@suse.de>

	* cgraph.c (cgraph_create_edge_1): Initialize
	call_stmt_cannot_inline_p from the stmt if possible.
	(cgraph_make_edge_direct): Likewise.
	* gimple-streamer-in.c (input_gimple_stmt): Do not
	call gimple_call_set_cannot_inline.
	* gimple.h (enum gf_mask): Remove GF_CALL_CANNOT_INLINE, shift
	values.
	(gimple_call_set_cannot_inline): Remove.
	(gimple_call_cannot_inline_p): Likewise.
	* ipa-inline-analysis.c (initialize_inline_failed): Look
	at the edge call_stmt_cannot_inline_p flag.
	* ipa-inline.c (can_inline_edge_p): Likewise.
	(early_inliner): Only update the edge flag.
	* ipa-prop.c (update_indirect_edges_after_inlining): Likewise.
	(ipa_modify_call_arguments): Do not call gimple_call_set_cannot_inline.
	* cgraphunit.c (assemble_thunk): Likewise.
	* gimple-fold.c (gimple_fold_call): Likewise.

	* tree.h (CALL_CANNOT_INLINE_P): Remove.
	* tree-mudflap.c (mf_xform_statements): Do not modify alloca calls.
	* builtins.c (expand_builtin_alloca): With -fmudflap do not expand
	alloca calls inline.
	* cfgexpand.c (expand_call_stmt): Do not set CALL_CANNOT_INLINE_P.
	* gimple.c (gimple_build_call_from_tree): Do not read
	CALL_CANNOT_INLINE_P.
	* gimplify.c (gimplify_call_expr): Do not copy CALL_CANNOT_INLINE_P.

From-SVN: r182001
2011-12-05 08:51:53 +00:00
Jason Merrill d0ad58f94e re PR c++/51060 (Temporary object stack space is not re-used)
PR c++/51060
	* gimplify.c (gimplify_target_expr): Add a clobber to the cleanup.
	(gimplify_modify_expr): Don't try to simplify it.
	* cp/cp-gimplify.c (cp_gimplify_expr): Leave clobbers alone.

From-SVN: r181332
2011-11-12 19:44:39 -05:00
Michael Matz 47598145be gengtype.c (write_field_root): Avoid out-of-scope access of newv.
* gengtype.c (write_field_root): Avoid out-of-scope access of newv.

	* tree-stdarg.c (execute_optimize_stdarg): Accept clobbers.

	* tree.h (TREE_CLOBBER_P): New macro.
	* gimple.h (gimple_clobber_p): New inline function.
	* gimplify.c (gimplify_bind_expr): Add clobbers for all variables
	that go out of scope and live in memory.
	* tree-ssa-operands.c (get_expr_operands): Transfer volatility also
	for constructors.
	* cfgexpand.c (decl_to_stack_part): New static variable.
	(add_stack_var): Allocate it, and remember mapping.
	(fini_vars_expansion): Deallocate it.
	(stack_var_conflict_p): Add early outs.
	(visit_op, visit_conflict, add_scope_conflicts_1,
	add_scope_conflicts): New static functions.
	(expand_used_vars_for_block): Don't call add_stack_var_conflict, tidy.
	(expand_used_vars): Add scope conflicts.
	(expand_gimple_stmt_1): Expand clobbers to nothing.
	(expand_debug_expr): Ditto.

	* tree-pretty-print.c (dump_generic_node): Dump clobbers nicely.
	* tree-ssa-live.c (remove_unused_locals): Remove clobbers that
	refer to otherwise unused locals.
	* tree-sra.c (build_accesses_from_assign): Ignore clobbers.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Clobbers of
	SSA names aren't necessary.
	(propagate_necessity): Accept and ignore constructors on the rhs,
	tidy.
	* gimple.c (walk_gimple_op): Accept constructors like mem_rhs.
	* tree-ssa-structalias.c (find_func_aliases): Clobbers don't store
	any known value.
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Ditto, in particular they
	don't zero-initialize something.
	* tree-ssa-phiopt.c (cond_if_else_store_replacement_1): Ignore
	clobber RHS, we don't want PHI nodes with those.

testsuite/
	* gcc.dg/tree-ssa/20031015-1.c: Adjust.
	* g++.dg/tree-ssa/ehcleanup-1.C: Ditto.
	* g++.dg/eh/builtin1.C: Rewrite to not use local variables.
	* g++.dg/eh/builtin2.C: Ditto.
	* g++.dg/eh/builtin3.C: Ditto.

From-SVN: r181172
2011-11-08 16:47:16 +00:00
Aldy Hernandez 0a35513e4e Merge from transactional-memory branch.
From-SVN: r181154
2011-11-08 11:13:41 +00:00
Kai Tietz fc1f4caf5f gimplify.c (gimplify_expr): Take care that for bitwise-binary transformation the operands have compatible types.
* gimplify.c (gimplify_expr): Take care that for bitwise-binary
        transformation the operands have compatible types.

	* gfortran.fortran-torture/compile/logical-2.f90: New test.

From-SVN: r180006
2011-10-14 21:30:42 +02: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
Richard Henderson 2205ed2513 Rename vshuffle/vec_shuffle to vec_perm.
* doc/extend.texi (__builtin_shuffle): Improve the description to
        include the modulus of the selector.  Mention OpenCL.
        * doc/md.texi (vec_perm, vec_perm_const): Document named patterns.

        * tree.def (VEC_PERM_EXPR): Rename from VEC_SHUFFLE_EXPR.
        * genopinit.c (optabs): Rename vshuffle to vec_perm.
        * c-typeck.c (c_build_vec_perm_expr): Rename from
        c_build_vec_shuffle_expr.  Update for name changes.
        * optabs.c (expand_vec_perm_expr_p): Rename from
        expand_vec_shuffle_expr_p.
        (expand_vec_perm_expr): Rename from expand_vec_shuffle_expr.
        * optabs.h (OTI_vec_perm): Rename from DOI_vshuffle.
        (vec_perm_optab): Rename from vshuffle_optab.
        * expr.c, gimple-pretty-print.c, gimple.c, gimplify.c,
        c-tree.h, c-parser.c, tree-cfg.c, tree-inline.c, tree-pretty-print.c,
        tree-ssa-operands.c, tree-vect-generic.c: Update for name changes.

        * config/i386/i386.c (ix86_expand_vec_perm): Rename from
        ix86_expand_vshuffle.
        * config/i386/i386-protos.h: Update.
        * config/i386/sse.md (VEC_PERM_AVX2): Rename from VSHUFFLE_AVX2.
        (vec_perm<VEC_PERM_AVX2>): Rename from vshuffle<VSHUFFLE_AVX2>.

From-SVN: r179701
2011-10-07 15:41:48 -07: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
Artjoms Sinkarovs f90e8e2eae Vector shuffling patch from Artem Shinkarov.
From-SVN: r179462
2011-10-03 08:13:26 -07:00
Richard Guenther 315f5f1bfb re PR tree-optimization/48571 (Missed data-dependence for (bogus?) reconstructed array-refs)
2011-08-30  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48571
	* gimple.h (maybe_fold_offset_to_address): Remove.
	(maybe_fold_offset_to_reference): Likewise.
	(maybe_fold_stmt_addition): Likewise.
	(may_propagate_address_into_dereference): Likewise.
	* tree-inline.c (remap_gimple_op_r): Do not reconstruct
	array references.
	* gimple-fold.c (canonicalize_constructor_val): Likewise.
	Canonicalize invariant POINTER_PLUS_EXPRs to invariant MEM_REF
	addresses instead.
	(may_propagate_address_into_dereference): Remove.
	(maybe_fold_offset_to_array_ref): Likewise.
	(maybe_fold_offset_to_reference): Likewise.
	(maybe_fold_offset_to_address): Likewise.
	(maybe_fold_stmt_addition): Likewise.
	(fold_gimple_assign): Do not reconstruct array references but
	instead canonicalize invariant POINTER_PLUS_EXPRs to invariant
	MEM_REF addresses.
	(gimple_fold_stmt_to_constant_1): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Likewise.
	* gimplify.c (gimplify_conversion): Likewise.
	(gimplify_expr): Likewise.

	* gcc.c-torture/execute/pr48571-1.c: New testcase.
	* gcc.dg/tree-ssa/ssa-ccp-25.c: Remove.
	* gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise.
	* gcc.dg/pr36902.c: XFAIL.

From-SVN: r178312
2011-08-30 14:06:00 +00:00
Artjoms Sinkarovs 544d960a12 20011-08-29 Artjoms Sinkarovs <artyom.shinkaroff@gmail.com>
Richard Guenther  <rguenther@suse.de>

	* tree.h (constant_boolean_node): Adjust prototype.
	* fold-const.c (fold_convert_loc): Move aggregate conversion
	leeway down.
	(constant_boolean_node): Make value parameter boolean, add
	vector type handling.
	(fold_unary_loc): Use constant_boolean_node.
	(fold_binary_loc): Preserve types properly when folding
	COMPLEX_EXPR <__real x, __imag x>.
	* gimplify.c (gimplify_expr): Handle vector comparison.
	* tree.def (EQ_EXPR, ...): Document behavior on vector typed
	comparison.
	* tree-cfg.c (verify_gimple_comparison): Verify vector typed
	comparisons.

From-SVN: r178209
2011-08-29 11:55:45 +00:00
Richard Guenther 0d82a1c872 tree.h (convert_to_ptrofftype_loc): New function.
2011-08-17  Richard Guenther  <rguenther@suse.de>

	* tree.h (convert_to_ptrofftype_loc): New function.
	(convert_to_ptrofftype): Define.
	* builtins.c (expand_builtin_bzero): Use size_type_node.
	(fold_builtin_bzero): Likewise.
	(std_gimplify_va_arg_expr): Build the BIT_AND_EXPR on the pointer.
	* c-typeck.c (build_unary_op): Use convert_to_ptrofftype_loc.
	* cgraphunit.c (thunk_adjust): Use fold_build_pointer_plus_loc.
	(cgraph_redirect_edge_call_stmt_to_callee): Use size_int.
	* expr.c (expand_expr_addr_expr_1): Use fold_build_pointer_plus.
	* fold-const.c (build_range_check): Negate using the original
	type.
	(fold_unary_loc): Use fold_build_pointer_plus_loc.
	* gimple-fold.c (gimple_adjust_this_by_delta): Use
	convert_to_ptrofftype.
	* gimplify.c (gimplify_self_mod_expr): Likewise.
	* graphite-clast-to-gimple.c (clast_to_gcc_expression): Likewise.
	(graphite_create_new_loop_guard): Likewise.
	* graphite-sese-to-poly.c (my_long_long): Remove.
	(scop_ivs_can_be_represented): Adjust.
	* tree-cfg.c (verify_gimple_assign_unary): Use ptrofftype_p.
	* tree-chrec.c (chrec_fold_plus_1): Use fold_build_pointer_plus.
	* tree-loop-distribution.c (build_size_arg_loc): Use
	size_type_node.
	(generate_memset_zero): Simplify.
	* tree-mudflap.c: Use fold_convert, not convert.
	* tree-predcom.c (suitable_reference_p): Expand DR_OFFSET in
	its own type.
	(determine_offset): Likewise for DR_STEP.
	(valid_initializer_p): Likewise.
	* tree-profile.c (prepare_instrumented_value): Convert the pointer
	to an integer type of same size.
	* tree-scalar-evolution.c (interpret_rhs_expr): Do not refer
	to sizetype without need.
	* tree-ssa-address.c (tree_mem_ref_addr): Likewise.
	* tree-ssa-loop-ivopts.c (find_bivs): Use convert_to_ptrofftype.
	* tree-ssa-loop-manip.c (create_iv): Likewise.
	(determine_exit_conditions): Adjust comment.
	* tree-ssa-pre.c (create_expression_by_pieces): Use
	convert_to_ptrofftype.
	* tree-ssa-structalias.c (get_constraint_for_1): Likewise.
	* varasm.c (array_size_for_constructor): Compute using double_ints.

From-SVN: r177828
2011-08-17 12:00:35 +00:00
Richard Guenther 8d2b04104d re PR middle-end/50040 (missed warning: ‘x.y’ is used uninitialized in this function)
2011-08-11  Richard Guenther  <rguenther@suse.de>

	PR middle-end/50040
	* gimplify.c (gimplify_modify_expr_complex_part): Mark the
	load of the other piece with TREE_NO_WARNING.
	* tree-flow.h (warn_uninit): Adjust prototype.
	* tree-ssa.c (warn_uninit): Take uninitialized SSA name,
	the base variable and the expression that is used separately.
	Properly query all TREE_NO_WARNING flags.
	(struct walk_data): Remove.
	(warn_uninitialized_var): Likewise.
	(warn_uninitialized_vars): Do not walk gimple pieces but simply
	look at all SSA uses of the statement.  Handle unused memory
	separately.
	* tree-ssa-uninit.c (warn_uninitialized_phi): Adjust.

	* g++.dg/warn/unit-1.C: Un-XFAIL.
	* gcc.dg/uninit-I.c: Likewise.

From-SVN: r177667
2011-08-11 14:28:36 +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
Kai Tietz 7f3ff78299 ChangeLog gcc/
2011-07-21  Kai Tietz  <ktietz@redhat.com>

	* fold-const.c (fold_unary_loc): Preserve indirect
	comparison cast to none-boolean type.
	* tree-ssa.c (useless_type_conversion_p): Preserve cast
	from/to boolean-type.
	* gimplify.c (gimple_boolify): Handle boolification
	of comparisons.
	(gimplify_expr): Boolifiy non aggregate-typed
	comparisons.
	* tree-cfg.c (verify_gimple_comparison): Check result
	type of comparison expression.
	* tree-ssa-forwprop.c (forward_propagate_comparison):
	Adjust test of condition result and disallow type-cast
	sinking into comparison.

ChangeLog gcc/testsuite

2011-07-21  Kai Tietz  <ktietz@redhat.com>

	* gcc.dg/tree-ssa/pr30978.c: adjusted.
	* gcc.dg/tree-ssa/ssa-fre-6.c: Likewise.
	* gcc.dg/binop-xor1.c: Set to fail.
	* gcc.dg/binop-xor3.c: Set to fail.

From-SVN: r176563
2011-07-21 14:11:28 +02:00
Richard Guenther 5302064826 gimplify.c (gimplify_expr): Gimplify TRUTH_NOT_EXPR as BIT_XOR_EXPR, same as the RTL expander does.
2011-07-19  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimplify_expr): Gimplify TRUTH_NOT_EXPR as
	BIT_XOR_EXPR, same as the RTL expander does.
	* tree-cfg.c (verify_expr): Disallow TRUTH_NOT_EXPR in the gimple IL.
	(verify_gimple_assign_unary): Likewise.
	* tree-ssa-propagate.c (valid_gimple_rhs_p): Disallow TRUTH_*_EXPR.
	* tree-ssa-forwprop.c (forward_propagate_comparison): Handle
	BIT_NOT_EXPR and BIT_XOR_EXPR instead of TRUTH_NOT_EXPR.

	* gcc.dg/tree-ssa/bool-10.c: Adjust expected pattern.
	* gcc.dg/tree-ssa/bool-11.c: Likewise.
	* gcc.dg/torture/20110719-1.c: New testcase.

From-SVN: r176442
2011-07-19 10:57:15 +00:00
Richard Guenther 4b4455e51c gimplify.c (gimplify_expr): Use input_location, not saved_location when building new trees.
2011-07-18  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimplify_expr): Use input_location, not saved_location
	when building new trees.

From-SVN: r176400
2011-07-18 14:22:50 +00:00
Richard Guenther bd5d002e99 gimplify.c (gimplify_expr): Only do required conversions.
2011-07-14  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimplify_expr): Only do required conversions.

From-SVN: r176267
2011-07-14 11:23:02 +00:00
Richard Sandiford 953d0c90a2 tree.h (categorize_ctor_elements): Remove comment.
gcc/
	* tree.h (categorize_ctor_elements): Remove comment.  Fix long line.
	(count_type_elements): Delete.
	(complete_ctor_at_level_p): Declare.
	* expr.c (flexible_array_member_p): New function, split out from...
	(count_type_elements): ...here.  Make static.  Replace allow_flexarr
	parameter with for_ctor_p.  When for_ctor_p is true, return the
	number of elements that should appear in the top-level constructor,
	otherwise return an estimate of the number of scalars.
	(categorize_ctor_elements): Replace p_must_clear with p_complete.
	(categorize_ctor_elements_1): Likewise.  Use complete_ctor_at_level_p.
	(complete_ctor_at_level_p): New function, borrowing union logic
	from old categorize_ctor_elements_1.
	(mostly_zeros_p): Return true if the constructor is not complete.
	(all_zeros_p): Update call to categorize_ctor_elements.
	* gimplify.c (gimplify_init_constructor): Update call to
	categorize_ctor_elements.  Don't call count_type_elements.
	Unconditionally prevent clearing for variable-sized types,
	otherwise rely on categorize_ctor_elements to detect
	incomplete initializers.

gcc/cp/
	* typeck2.c (split_nonconstant_init_1): Pass the initializer directly,
	rather than a pointer to it.  Return true if the whole of the value
	was initialized by the generated statements.  Use
	complete_ctor_at_level_p instead of count_type_elements.

gcc/testsuite/
2011-07-12  Chung-Lin Tang  <cltang@codesourcery.com>

	* gcc.target/arm/pr48183.c: New test.

From-SVN: r176228
2011-07-13 11:16:36 +00:00
Jason Merrill 4063e61bc6 re PR c++/45437 (Loses reference during update)
PR c++/45437
gcc/
	* gimplify.c (goa_stabilize_expr): Handle RHS preevaluation in
	compound assignment.
gcc/c-family/
	* c-omp.c (check_omp_for_incr_expr): Handle preevaluation.
gcc/cp/
	* typeck.c (cp_build_modify_expr): Preevaluate RHS.

From-SVN: r176072
2011-07-08 23:33:54 -04:00
Jakub Jelinek 19c44640eb re PR middle-end/49640 (Internal compiler in C99 code (using variable-length arrays) and OpenMP)
PR middle-end/49640
	* gimplify.c (gimplify_compound_lval): For last 2 ARRAY_*REF
	operands and last COMPONENT_REF operand call gimplify_expr on it
	if non-NULL.

	* gcc.dg/gomp/pr49640.c: New test.

From-SVN: r175967
2011-07-07 14:49:17 +02:00
Paolo Carlini b504a91833 cp-tree.h (error_operand_p): Remove.
/gcc/cp
2011-06-10  Paolo Carlini  <paolo.carlini@oracle.com>

	* cp-tree.h (error_operand_p): Remove.

/gcc
2011-06-10  Paolo Carlini  <paolo.carlini@oracle.com>

	* tree.h (error_operand_p): Add.
	* dbxout.c (dbxout_type_fields): Use the latter.
	* c-decl.c (add_stmt): Likewise.
	* gimplify.c (omp_add_variable, omp_notice_variable,
	gimplify_scan_omp_clauses): Likewise.

From-SVN: r174899
2011-06-10 11:08:14 +00:00
Jakub Jelinek 1537737f28 re PR c++/49165 (ICE on for-loop/throw combination)
PR c++/49165
	* gimplify.c (shortcut_cond_r): Don't special case
	COND_EXPRs if they have void type on one of their arms.

	* g++.dg/eh/cond5.C: New test.

From-SVN: r174273
2011-05-26 12:25:21 +02:00
Kai Tietz da5fb46991 tree-cfg.c (verify_gimple_assign_binary): Barf on TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
2011-05-19  Kai Tietz  <ktietz@redhat.com>

	* tree-cfg.c (verify_gimple_assign_binary): Barf on
	TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
	(gimplify_expr): Move TRUTH_AND|OR|XOR_EXPR to its binary form.

From-SVN: r173903
2011-05-19 13:16:20 +02:00
Kai Tietz 3c6cbf7ad1 gimplify.c (gimplify_expr): Make sure operand is boolified.
2011-05-13  Kai Tietz  <ktietz@redhat.com>

        * gimplify.c (gimplify_expr): Make sure operand is boolified.
        * tree-cfg.c (verify_gimple_assign_unary): Check for boolean
        compatible type for TRUTH_NOT_EXPR.

From-SVN: r173732
2011-05-13 15:37:16 +02:00
Kai Tietz 221df0b62d re PR middle-end/48984 (Many testsuite failures)
2011-05-13  Kai Tietz  <ktietz@redhat.com>

        PR middle-end/48984
        * gimplify.c (gimplify_expr): Check for boolean_type_node instead
        for BOOLEAN_TYPE for TRUTH-NOT/AND/OR/XOR.
        (gimple_boolify): Check for cast for boolean_type_node instead for
        BOOLEAN_TYPE.

From-SVN: r173726
2011-05-13 11:21:36 +02:00
Kai Tietz 1d15f620aa gimplify.c (gimple_boolify): Re-boolify expression arguments even if expression type is of kind BOOLEAN_TYPE.
2011-05-12  Kai Tietz  <ktietz@redhat.com>

	* gimplify.c (gimple_boolify): Re-boolify expression
	arguments even if expression type is of kind BOOLEAN_TYPE.
	(gimplify_boolean_expr): Removed.
	(gimplify_expr): Boolify truth opcodes AND, ANDIF, OR, ORIF,
	and XOR. Additional take care that we keep expression's type.
	* tree-cfg.c (verify_gimple_assign_binary): Adjust check for type
	of TRUTH_AND|OR|XOR_EXPR.

From-SVN: r173711
2011-05-12 20:19:07 +02: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
Jakub Jelinek d0228c2eae * gimplify.c (create_tmp_var_raw): Don't call build_type_variant.
From-SVN: r173426
2011-05-05 14:04:29 +02:00
Jakub Jelinek 144f4153e8 re PR c/48716 (gcc OpenMP static variable declared in scope inside construct is predetermined shared)
PR c/48716
	* gimplify.c (gimplify_bind_expr): Mark as GOVD_LOCAL also
	TREE_STATIC variables declared inside of some OpenMP construct.

	* gcc.dg/gomp/pr48716.c: New test.
	* g++.dg/gomp/pr48716.C: New test.

From-SVN: r172859
2011-04-22 16:10:45 +02:00
Michael Matz 63d2a3533f tree.h (ALLOCA_FOR_VAR_P): Rename to CALL_ALLOCA_FOR_VAR_P.
* tree.h (ALLOCA_FOR_VAR_P): Rename to CALL_ALLOCA_FOR_VAR_P.
	* builtins.c (expand_builtin): Use CALL_ALLOCA_FOR_VAR_P.
	* function.c (gimplify_parameters): Ditto.
	* gimplify.c (gimplify_vla_decl): Ditto.

	* gimple.h (enum gf_mask): Add GF_CALL_ALLOCA_FOR_VAR.
	(gimple_call_set_alloca_for_var): New inline function.
	(gimple_call_alloca_for_var_p): Ditto.
	* gimple.c (gimple_build_call_from_tree): Remember CALL_ALLOCA_FOR_VAR_P
	state.
	* cfgexpand.c (expand_call_stmt): Restore CALL_ALLOCA_FOR_VAR_P state.

	* tree-inline.c (inline_forbidden_p_stmt): Don't reject alloca
	calls if they were for VLA objects.

From-SVN: r172516
2011-04-15 19:48:25 +00:00
Eric Botcazou ad19c4be9a gimplify.c: Fix issues in comments throughout.
* gimplify.c: Fix issues in comments throughout.
	(voidify_wrapper_expr): Fix long line.
	(build_stack_save_restore): Likewise.
	(gimplify_loop_expr): Likewise.
	(gimplify_compound_lval): Likewise.
	(gimplify_init_ctor_eval): Likewise.
	(gimplify_modify_expr_rhs): Likewise.
	(omp_notice_threadprivate_variable): Likewise.

From-SVN: r172476
2011-04-15 08:48:15 +00:00
Richard Guenther f20ca72587 re PR tree-optimization/46076 (constant propagation and compile-time math no longer happening versus 4.4 and 4.5)
2011-04-12  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/46076
	* gimple.h (struct gimple_statement_call): Add fntype field.
	(gimple_call_fntype): Adjust.
	(gimple_call_set_fntype): New function.
	* gimple.c (gimple_build_call_1): Set the call function type.
	* gimplify.c (gimplify_call_expr): Preserve the function
	type the frontend used for the call.
	(gimplify_modify_expr): Likewise.
	* lto-streamer-in.c (input_gimple_stmt): Input the call stmts
	function type.
	* lto-streamer-out.c (output_gimple_stmt): Output the call stmts
	function type.
	* tree-ssa.c (useless_type_conversion_p): Function pointer
	conversions are useless.

	* gcc.dg/tree-ssa/pr46076.c: Un-XFAIL.

From-SVN: r172310
2011-04-12 10:44:15 +00:00
Richard Guenther 956011be1f gimplify.c (gimple_fold_indirect_ref): Check host_integerp before calling tree_low_cst.
2011-04-11  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimple_fold_indirect_ref): Check host_integerp
	before calling tree_low_cst.

From-SVN: r172263
2011-04-11 15:50:57 +00:00
Martin Jambor 9f9ebcdfc6 cgraph.c (cgraph_local_info): Call cgraph_get_node instead of cgraph_node, handle NULL return value.
2011-04-11  Martin Jambor  <mjambor@suse.cz>

gcc/
	* cgraph.c (cgraph_local_info): Call cgraph_get_node instead
	of cgraph_node,	handle NULL return value.
	(cgraph_global_info): Likewise.
	(cgraph_rtl_info): Likewise.
	* tree-inline.c (estimate_num_insns): Likewise.
	* gimplify.c (unshare_body): Likewise.
	(unvisit_body): Likewise.
	(gimplify_body): Likewise.
	* predict.c (optimize_function_for_size_p): Likewise.
	* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Likewise.
	(call_may_clobber_ref_p_1): Likewise.
	* varasm.c (function_section_1): Likewise.
	(assemble_start_function): Likewise.

gcc/java/
	* decl.c (java_mark_decl_local): Call cgraph_get_node instead of
	cgraph_node and handle returned NULL.

From-SVN: r172258
2011-04-11 17:17:44 +02:00
Richard Guenther 34019e282b tree-flow.h (verify_stmts): Rename to verify_gimple_in_cfg.
2011-03-25  Richard Guenther  <rguenther@suse.de>

	* tree-flow.h (verify_stmts): Rename to verify_gimple_in_cfg.
	(verify_types_in_gimple_seq): Rename to verify_gimple_in_seq.
	(verify_gimple): Remove.
	* tree-cfg.c (verify_gimple_call): Merge verification
	from verify_stmts.
	(verify_gimple_phi): Merge verification from verify_stmts.
	(verify_gimple_label): New function.
	(verify_types_in_gimple_seq_2): Rename to verify_gimple_in_seq_2.
	(verify_types_in_gimple_seq): Rename to verify_gimple_in_seq.
	(verify_stmt): Merge into verify_gimple_in_cfg and callees.
	(verify_stmts): Rename to verify_gimple_in_cfg.
	(verify_gimple_in_cfg): New function.
	* passes.c (execute_function_todo): Call verify_gimple_in_cfg.
	* tree-ssa.c (verify_ssa): Likewise.
	* gimplify.c (gimplify_body): Call verify_gimple_in_seq.

From-SVN: r171453
2011-03-25 15:05:00 +00:00
Eric Botcazou f2f81d5708 * gimplify.c (gimplify_cond_expr): Gimplify COMPOUND_EXPR conditions.
From-SVN: r171282
2011-03-22 10:14:07 +00:00
Eric Botcazou 31408f60e9 * gimplify.c (gimplify_vla_decl): Set TREE_THIS_NOTRAP flag.
From-SVN: r171253
2011-03-21 18:04:50 +00:00
Jason Merrill b4ef8aac30 re PR c++/23372 (Temporary aggregate copy not elided when passing parameters by value)
PR c++/23372
	* gimplify.c (gimplify_arg): Strip redundant TARGET_EXPR.

From-SVN: r171146
2011-03-18 11:06:51 -04:00
Paul Wögerer 5952728238 gimplify.c (gimplify_function_tree): Fix building calls to __builtin_return_address.
gcc/
	* gimplify.c (gimplify_function_tree): Fix building calls
	to __builtin_return_address.

gcc/testsuite/
	* gcc.dg/20001117-1.c: Abort on NULL call_sites.


Co-Authored-By: Nathan Froyd <froydnj@codesourcery.com>

From-SVN: r170738
2011-03-07 15:28:50 +00:00
Jakub Jelinek 423ed4163b re PR c/47963 (ICE: tree check: expected tree that contains 'decl common' structure, have 'integer_cst' in is_global_var, at tree-flow-inline.h:599 on invalid code with -fopenmp)
PR c/47963
	* gimplify.c (omp_add_variable): Only call omp_notice_variable
	on TYPE_SIZE_UNIT if it is a DECL.

	* gcc.dg/gomp/pr47963.c: New test.
	* g++.dg/gomp/pr47963.C: New test.

From-SVN: r170655
2011-03-03 17:09:55 +01:00
Richard Guenther fdd7cdbfee gimplify.c (gimple_tree_eq): Assert hashes are equal only when checking is enabled.
2010-12-08  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimple_tree_eq): Assert hashes are equal only
	when checking is enabled.

From-SVN: r167591
2010-12-08 16:14:29 +00:00
Jan Hubicka b01890ffd3 tree.c (build_common_builtin_nodes): Do not initialize BUILT_IN_PROFILE_FUNC_ENTER and BUILT_IN_PROFILE_FUNC_EXIT.
* tree.c (build_common_builtin_nodes): Do not initialize
	BUILT_IN_PROFILE_FUNC_ENTER and BUILT_IN_PROFILE_FUNC_EXIT.
	* builtins.c (expand_builtin_profile_func): Remove.
	(expand_builtin): Do not handle BUILT_IN_PROFILE_FUNC_ENTER and
	BUILT_IN_PROFILE_FUNC_EXIT.
	* builtins.def (profile_func_enter, profile_func_exit): Remove stubs.
	(__cyg_profile_func_enter, __cyg_profile_func_exit): New.
	* gimplify.c (gimplify_function_tree): Reorganize code calling
	profiling functions.

From-SVN: r167342
2010-12-01 16:45:36 +00:00
Joseph Myers 7c475d1159 diagnostic-core.h: Include bversion.h.
* diagnostic-core.h: Include bversion.h.
	* toplev.h: Don't include input.h or bversion.h.
	(parse_optimize_options): Don't declare here.
	* alias.c, auto-inc-dec.c, c-aux-info.c, c-convert.c, c-parser.c,
	caller-save.c, cfg.c, cfganal.c, cfgbuild.c, cfgcleanup.c,
	combine-stack-adj.c, config/arm/pe.c, config/darwin-c.c,
	config/host-darwin.c, config/i386/host-cygwin.c,
	config/i386/host-mingw32.c, config/i386/msformat-c.c,
	config/i386/netware.c, config/i386/nwld.c,
	config/i386/winnt-cxx.c, config/i386/winnt-stubs.c,
	config/ia64/ia64-c.c, config/m32c/m32c-pragma.c,
	config/mep/mep-pragma.c, config/microblaze/microblaze-c.c,
	config/rs6000/host-darwin.c, config/rs6000/rs6000-c.c,
	config/score/score3.c, config/score/score7.c,
	config/sh/symbian-base.c, config/sh/symbian-c.c,
	config/sh/symbian-cxx.c, config/sol2-c.c, config/sol2.c,
	config/v850/v850-c.c, config/vxworks.c, convert.c, cppbuiltin.c,
	cselib.c, dbgcnt.c, ddg.c, dfp.c, dominance.c, emit-rtl.c,
	fixed-value.c, fwprop.c, ggc-common.c, gimple.c, gimplify.c,
	graphite-blocking.c, graphite-clast-to-gimple.c,
	graphite-dependences.c, graphite-flattening.c,
	graphite-interchange.c, graphite-poly.c,
	graphite-scop-detection.c, graphite.c, haifa-sched.c,
	implicit-zee.c, integrate.c, ipa-pure-const.c, ipa-reference.c,
	ira-build.c, ira-conflicts.c, ira-costs.c, ira-lives.c, jump.c,
	lists.c, loop-doloop.c, loop-iv.c, lto-cgraph.c, lto-compress.c,
	lto-opts.c, lto-section-in.c, lto-section-out.c,
	lto-streamer-out.c, lto-symtab.c, modulo-sched.c, optabs.c,
	params.c, postreload-gcse.c, postreload.c, predict.c, profile.c,
	regcprop.c, reginfo.c, regmove.c, reorg.c, resource.c,
	sched-deps.c, sched-ebb.c, sched-rgn.c, sdbout.c,
	sel-sched-dump.c, sel-sched-ir.c, sese.c, stmt.c, targhooks.c,
	tree-cfgcleanup.c, tree-mudflap.c, tree-nomudflap.c,
	tree-object-size.c, tree-outof-ssa.c, tree-phinodes.c,
	tree-profile.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c,
	tree-ssa-live.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c,
	tree-ssa-operands.c, tree-ssa-structalias.c, tree-ssa-uninit.c,
	tree-vect-patterns.c, value-prof.c, var-tracking.c, web.c: Don't
	include toplev.h.
	* Makefile.in (TOPLEV_H): Remove.  All uses changed to use
	toplev.h.  Dependencies for above files and c-family files changed
	to remove $(TOPLEV_H) or toplev.h.
	(C_TREE_H): Don't include $(TOPLEV_H).
	(DIAGNOSTIC_CORE_H): Use $(INPUT_H) instead of input.h.  Add
	bversion.h.
	* config/arm/t-pe, config/arm/t-wince-pe, config/i386/t-cygming,
	config/ia64/t-ia64, config/mep/t-mep, config/score/t-score-elf,
	config/t-darwin, config/t-sol2,
	config/t-vxworks, config/v850/t-v850, config/v850/t-v850e:
	Dependencies for above files changed to remove $(TOPLEV_H) or
	toplev.h.

c-family:
	* c-common.h (parse_optimize_options): Declare.
	* c-cppbuiltin.c, c-format.c, c-gimplify.c, c-lex.c, c-omp.c,
	c-pch.c, c-pragma.c, c-semantics.c: Don't include toplev.h.

cp:
	* cp-gimplify.c, cp-lang.c, cvt.c, cxx-pretty-print.c, error.c,
	except.c, expr.c, friend.c, init.c, mangle.c, name-lookup.c,
	optimize.c, parser.c, rtti.c, tree.c, typeck2.c: Don't include
	toplev.h.
	* Make-lang.in: Dependencies for above files changed to remove
	toplev.h.

java:
	* expr.c, lang.c, mangle.c, mangle_name.c, typeck.c,
	verify-glue.c: Don't include toplev.h.
	* Make-lang.in: Dependencies for above files changed to remove
	toplev.h.

lto:
	* Make-lang.in (lto/lto-object.o): Depend on toplev.h instead of
	$(TOPLEV_H).

From-SVN: r167293
2010-11-30 11:41:24 +00:00
Joseph Myers 6a1f6c9c86 common.opt (flag_instrument_functions_exclude_functions, [...]): New Variable definitions.
* common.opt (flag_instrument_functions_exclude_functions,
	flag_instrument_functions_exclude_files): New Variable
	definitions.
	* flags.h (flag_instrument_functions_exclude_p): Don't declare.
	* gimplify.c (char_p): Declare type and vectors.
	(flag_instrument_functions_exclude_p): Moved from opts.c.  Make
	static.
	* opts.c (flag_instrument_functions_exclude_functions,
	flag_instrument_functions_exclude_files): Remove.
	(add_comma_separated_to_vector): Take void **.
	(flag_instrument_functions_exclude_p): Move to gimplify.c.
	(common_handle_option): Use options structure for
	-finstrument-functions-exclude- options.

From-SVN: r166943
2010-11-19 13:27:18 +00:00
Jakub Jelinek 502c50846c re PR middle-end/43690 (Internal compiler error detected by avr-gcc.)
PR middle-end/43690
	* gimplify.c (gimplify_asm_expr): If a "m" input is a
	{pre,post}{in,de}crement, fail.

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

From-SVN: r166354
2010-11-05 12:11:50 +01:00
Richard Guenther 844d5fca1f re PR tree-optimization/45991 (ICE: verify_stmts failed: Invalid address operand in in TARGET_MEM_REF. with -fstrict-overflow)
2010-11-04  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45991
	* gimplify.c (force_gimple_operand_1): Use the provded test
	function in the initial test.

	* gcc.dg/pr45991.c: New testcase.

From-SVN: r166312
2010-11-04 14:07:48 +00:00
Richard Guenther 1694907238 tree.def (FMA_EXPR): New tree code.
2010-11-04  Richard Guenther  <rguenther@suse.de>
	Richard Henderson  <rth@redhat.com>

	* tree.def (FMA_EXPR): New tree code.
	* expr.c (expand_expr_real_2): Add FMA_EXPR expansion code.
	* gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS.
	* tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types.
	* tree-inline.c (estimate_operator_cost): Handle FMA_EXPR.
	* gimple-pretty-print.c (dump_ternary_rhs): Likewise.
	* tree-ssa-math-opts.c (convert_mult_to_fma): New function.
	(execute_optimize_widening_mul): Call it.  Reorganize to allow
	dead stmt removal.  Move TODO flags ...
	(pass_optimize_widening_mul): ... here.
	* flag-types.h (enum fp_contract_mode): New enum.
	* common.opt (flag_fp_contract_mode): New variable.
	(-ffp-contract): New option.
	* opts.c (common_handle_option): Handle it.
	* doc/invoke.texi (-ffp-contract): Document.
	* tree.h (fold_fma): Declare.
	* builtins.c (fold_fma): New function.
	(fold_builtin_fma): Likewise.
	(fold_builtin_3): Call it for fma.
	* fold-const.c (fold_ternary_loc): Fold FMA_EXPR.
	* optabs.c (optab_for_tree_code): Handle FMA_EXPR.
	* config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4):
	New expanders.
	* doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new
	named patterns.
	* genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab.
	* optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms.
	(fms_optab, fnma_optab, fnms_optab): New defines.
	* gimplify.c (gimplify_expr): Handle binary truth expressions
	explicitly.  Handle FMA_EXPR.
	* tree-vect-stmts.c (vectorizable_operation): Handle ternary
	operations.

	* gcc.target/i386/fma4-vector-2.c: New testcase.

Co-Authored-By: Richard Henderson <rth@redhat.com>

From-SVN: r166304
2010-11-04 10:56:22 +00:00
Nathan Froyd e8160c9a60 builtins.c (fold_builtin_signbit): Use build_zero_cst instead of fold_convert.
gcc/
	* builtins.c (fold_builtin_signbit): Use build_zero_cst instead of
	fold_convert.
	* c-typeck.c (build_function_call_vec): Likewise.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* cgraphunit.c (assemble_thunk): Likewise.
	* config/sparc/sparc.c (sparc_fold_builtin): Likewise.
	* fold-const.c (fold_unary_loc, fold_mult_zconjz): Likewise.
	(fold_binary_loc, fold_ternary_loc): Likewise.
	* gimple-fold.c (get_symbol_constant_value): Likewise.
	* gimple-low.c (lower_builtin_setjmp): Likewise.
	* gimple.c (gimple_cond_get_ops_from_tree): Likewise.
	* gimplify.c (gimplify_init_constructor): Likewise.
	* lambda.h (build_linear_expr): Likewise.
	* omp-low.c (omp_reduction_init): Likewise.
	* tree-inline.c (remap_ssa_name): Likewise.
	* tree-object-size.c (compute_object_sizes): Likewise.
	* tree-sra.c (init_subtree_with_zero): Likewise.
	(sra_ipa_modify_assign): Likewise.
	* tree-ssa-copy.c (propagate_tree_value_into_stmt): Likewise.
	* tree-ssa-reassoc.c (eliminate_duplicate_pair): Likewise.
	(eliminate_plus_minus_pair, eliminate_not_pairs): Likewise.
	(undistribute_ops_list): Likewise.
	* tree-ssa-sccvn.c (vn_reference_lookup_3): Likewise.
	* tree-vect-stmts.c (vectorizable_call): Likewise.
	* tree.c (build_vector_from_ctor, build_one_cst): Likewise.
	(build_zero_cst): Handle more cases directly.  Update comment.

gcc/cp/
	* class.c (build_base_path, add_vcall_offset): Use build_zero_cst
	instead of fold_convert.
	* init.c (build_zero_init): Likewise.
	* typeck.c (cp_build_binary_op): Likewise.

gcc/fortran/
	* trans-decl.c (add_argument_checking): Use build_zero_cst instead of
	fold_convert.
	* trans-expr.c (gfc_conv_missing_dummy, fill_with_spaces): Likewise.
	* trans-stmt.c (gfc_trans_do): Likewise.

From-SVN: r166227
2010-11-03 00:49:00 +00:00
Jason Merrill ec52b1115d tree.h (EXPR_LOC_OR_HERE): New macro.
* tree.h (EXPR_LOC_OR_HERE): New macro.
	* builtins.c (c_strlen): Use it.
	* c-decl.c (build_enumerator): Likewise.
	* gimplify.c (internal_get_tmp_var): Likewise.
	(shortcut_cond_expr): Likewise.
	(gimplify_one_sizepos): Likewise.
c-family/
	* c-common.c (conversion_warning, warn_for_collisions_1): Use
	EXPR_LOC_OR_HERE.
cp/
	* decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
	* typeck.c (convert_for_assignment): Likewise.

From-SVN: r166123
2010-10-31 22:04:39 -04:00
Jason Merrill 221925596f gimplify.c (gimplify_decl_expr): Handle anonymous artificial variables sooner.
* gimplify.c (gimplify_decl_expr): Handle anonymous artificial
	variables sooner.

From-SVN: r166004
2010-10-27 11:47:52 -04:00
Eric Botcazou 692ad9aab2 gimplify.c (gimplify_variable_sized_compare): Preserve the source location info of the expression.
* gimplify.c (gimplify_variable_sized_compare): Preserve the source
	location info of the expression.

From-SVN: r165875
2010-10-22 23:39:16 +00:00
Eric Botcazou 08d78391b7 gimplify.c (gimplify_type_sizes): If the type is to be ignored for debug info purposes...
* gimplify.c (gimplify_type_sizes) <ARRAY_TYPE>: If the type is to be
	ignored for debug info purposes, do not clear the DECL_IGNORED_P flag
	on the bounds of its domain.
	* tree.h (DECL_IGNORED_P): Document effect on TYPE_DECL specifically.

From-SVN: r165544
2010-10-16 14:35:59 +00:00
Nathan Froyd 5095da95bd vec.h (VEC_qsort): Define.
gcc/
	* vec.h (VEC_qsort): Define.
	* dbxout.c (output_used_types): Use it.
	* df-scan.c (df_sort_and_compress_refs): Likewise.
	(df_sort_and_compress_mws): Likewise.
	* genautomata.c (uniq_sort_alt_states): Likewise.
	(evaluate_equiv_classes): Likewise.
	(output_trans_table): Likewise.
	(output_state): Likewise.
	* gimplify.c (compare_case_labels): Likewise.
	* graphite-sese-to-poly.c (graphite_sort_dominated_info): Likewise.
	* ipa.c (build_cdtor_fns): Likewise.
	* lto.c (lto_wpa_write_files): Likewise.
	* sel-sched.c (fill_vec_av_set): Likewise.
	* tree-predcom.c (determine_roots_comp): Likewise.
	* tree-sra.c (sort_and_spliace_var_accesses): Likewise.
	(splice_param_accesses): Likewise.
	* tree-ssa-live.c (dump_enumerated_decls): Likewise.
	* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
	(reassociate_bb): Likewise.
	* tree-ssa-sccvn.c (sort_scc): Likewise.
	* tree-ssa-structalias.c (sort_fieldstack): Likewise.

gcc/ada/
	* gcc-interface/utils2.c (gnat_build_constructor): Use VEC_qsort.

From-SVN: r165314
2010-10-11 15:08:28 +00:00
Ian Lance Taylor 3748f5c9d3 tree.h (TREE_THIS_NOTRAP): Use TREE_CHECK5.
* tree.h (TREE_THIS_NOTRAP): Use TREE_CHECK5.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Only check
	TREE_THIS_NOTRAP when appropriate.
	(get_spill_slot_decl): Don't set TREE_THIS_NOTRAP on the new
	VAR_DECL.
	* gimplify.c (gimplify_expr): Copy NOTRAP from INDIRECT_REF to
	newly created MEM_REF.

From-SVN: r165313
2010-10-11 14:56:39 +00:00
Richard Guenther dca267461a re PR tree-optimization/45750 (ICE: in iterative_hash_expr, at tree.c:6831 on invalid code)
2010-09-23  Richard Guenther  <rguenther@suse.de>

	PR middle-end/45750
	* gimplify.c (gimplify_expr): Properly pass on GS_ERROR when
	gimplifying MEM_REF.

	* gcc.dg/pr45750.c: New testcase.

From-SVN: r164555
2010-09-23 11:00:27 +00:00
Richard Guenther 06baaba377 re PR tree-optimization/45704 (load byte instruction is used for volatile int)
2010-09-20  Richard Guenther  <rguenther@suse.de>

	PR middle-end/45704
	* gimplify.c (gimplify_modify_expr_rhs): Preserve volatileness.

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

From-SVN: r164439
2010-09-20 15:54:03 +00:00
Jan Hubicka 64e0f5ff1f re PR tree-optimization/45605 (Missed devirtualization)
PR tree-optimize/45605
	* cgraph.h (const_value_known_p): Declare.
	(varpool_decide_const_value_known): Remove.
	* tree-ssa-ccp.c (get_base_constructor): Use it.
	* lto-cgraph.c (compute_ltrans_boundary): Likewise.
	* expr.c (string_constant): Likewise.
	* tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise.
	* ipa.c (ipa_discover_readonly_nonaddressable_var,
	function_and_variable_visibility): Likewise.
	* gimplify.c (gimplify_call_expr): Likewise.
	* gimple-fold.c (get_symbol_constant_value): Likewise.
	* varpool.c (varpool_decide_const_value_known): Replace by...
	(const_value_known_p): ... this one; handle other kinds of DECLs
	too and work for automatic vars.
	(varpool_finalize_decl): Use const_value_known_p.

	* lto.c (lto_promote_cross_file_statics): Use const_value_known_p.

	* g++.dg/tree-ssa/pr45605.C: New testcase.

From-SVN: r164438
2010-09-20 15:48:42 +00:00
Richard Guenther be1ac4ecae tree.def (MISALIGNED_INDIRECT_REF): Remove.
2010-09-06  Richard Guenther  <rguenther@suse.de>

	* tree.def (MISALIGNED_INDIRECT_REF): Remove.
	* tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF.
	(build_aligned_type): Declare.
	* tree.c (check_qualified_type): Also compare TYPE_ALIGN.
	(check_aligned_type): New function.
	(build_aligned_type): Likewise.
	* expr.c (expand_assignment): Handle misaligned stores via
	TARGET_MEM_REF and MEM_REF using movmisalign_optab.
	(expand_expr_real_1): Likewise.
	(safe_from_p): Remove MISALIGNED_INDIRECT_REF handling.
	* tree-vect-stmts.c (vectorizable_store): Do not build
	MISALIGNED_INDIRECT_REF but initialize alignment information.
	(vectorizable_load): Likewise.
	* builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF
	handling.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* dwarf2out.c (loc_list_from_tree): Likewise.
	* fold-const.c (maybe_lvalue_p): Likewise.
	(operand_equal_p): Likewise.
	(build_fold_addr_expr_with_type_loc): Likewise.
	* gimplify.c (gimplify_addr_expr): Likewise.
	(gimplify_expr): Likewise.
	* tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
	(verify_gimple_assign_single): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	(tree_could_trap_p): Likewise.
	* tree-predcom.c (ref_at_iteration): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	(op_code_prio): Likewise.
	(op_symbol_code): Likewise.
	* tree-ssa-ccp.c (get_value_from_alignment): Likewise.
	* tree-ssa-loop-im.c (for_each_index): Likewise.
	(gen_lsm_tmp_name): Likewise.
	* tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
	(find_interesting_uses_address): Likewise.
	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
	(ao_ref_init_from_vn_reference): Likewise.
	* tree.c (staticp): Likewise.
	(build1_stat): Likewise.
	(reference_alias_ptr_type): Likewise.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
	* config/rs6000/rs6000.c (rs6000_check_sdmode): Remove
	MISALIGNED_INDIRECT_REF handling.

From-SVN: r163915
2010-09-06 13:26:13 +00:00
Richard Guenther bcf7167336 re PR bootstrap/45519 (Failed to bootstrap)
2010-09-04  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/45519
	* tree-flow.h (force_gimple_operand_1): Declare.
	(force_gimple_operand_gsi_1): Likewise.
	* gimplify.c (force_gimple_operand_1): New worker taking a
	gimple predicate for ...
	(force_gimple_operand): ... which now wraps it.
	(force_gimple_operand_gsi_1, force_gimple_operand_gsi): Likewise.
	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Revert
	last change.
	* tree-ssa-address.c (gimplify_mem_ref_parts): Use
	force_gimple_operand_gsi_1 with is_gimple_mem_ref_addr.
	(create_mem_ref): Likewise.

From-SVN: r163858
2010-09-04 10:21:07 +00:00
Richard Guenther 4d948885d0 tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE.
2010-09-03  Richard Guenther  <rguenther@suse.de>

	* tree.def (TARGET_MEM_REF): Merge TMR_SYMBOL and TMR_BASE.
	Move TMR_OFFSET to second operand.  Add TMR_INDEX2.
	* tree.h (TMR_SYMBOL): Remove.
	(TMR_BASE, TMR_OFFSET): Adjust.
	(TMR_INDEX2): New.
	* alias.c (ao_ref_from_mem): Use TMR_BASE.
	* builtins.c (get_object_alignment): Merge TMR_BASE and
	TMR_SYMBOL handling.
	* cfgexpand.c (expand_debug_expr): Use TMR_BASE.
	* gimple.c (get_base_address): Merge MEM_REF and TARGET_MEM_REF
	handling.  Also allow TARGET_MEM_REF as base address.
	(walk_stmt_load_store_addr_ops): TMR_BASE is always non-NULL.
	* gimplify.c (gimplify_expr): Gimplify TMR_BASE like MEM_REF
	base.  Gimplify TMR_INDEX2.
	* tree-cfg.c (verify_types_in_gimple_reference): Adjust.
	* tree-dfa.c (get_ref_base_and_extent): Likewise.
	(get_addr_base_and_unit_offset): Likewise.
	* tree-eh.c (tree_could_trap_p): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-ssa-address.c (tree_mem_ref_addr): Simplify.  Handle
	TMR_INDEX2.
	(create_mem_ref_raw): Merge symbol and base.  Move 2ndary
	base to index2.
	(get_address_description): Reconstruct addres description
	from merged TMR_BASE and TMR_INDEX2.
	(maybe_fold_tmr): Fold propagated addresses.
	* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Merge
	MEM_REF and TARGET_MEM_REF paths.
	(indirect_refs_may_alias_p): Likewise.
	* tree-ssa-live.c (mark_all_vars_used_1): Handle TMR_INDEX2
	instead of TMR_SYMBOL.
	* tree-ssa-operands.c (get_tmr_operands): Simplify.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Adjust
	according to changes ...
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): ... here.
	Split TARGET_MEM_REF into two fields plus the base.
	* tree.c (mem_ref_offset): Simplify.
	* tree-ssa-loop-im.c (for_each_index): Handle TMR_INDEX2.
	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise.
	Strip NOPs when folding MEM_REF addresses.
	* tree-ssa-sink.c (is_hidden_global_store): Handle TARGET_MEM_REF.
	* gimple-fold.c (maybe_fold_reference): Fold TARGET_MEM_REF here ...
	(fold_gimple_assign): ... not here.

From-SVN: r163802
2010-09-03 09:50:17 +00:00
Richard Guenther 23a534a102 alias.c (ao_ref_from_mem): Adjust.
2010-09-01  Richard Guenther  <rguenther@suse.de>

	* alias.c (ao_ref_from_mem): Adjust.
	* builtins.c (get_object_alignment): Likewise.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* gimple.c (get_base_address): Likewise.
	* tree-dfa.c (get_ref_base_and_extent): Likewise.
	(get_addr_base_and_unit_offset): Likewise.  Fix for
	both TMR_SYMBOL and TMR_BASE being set.
	* tree-eh.c (tree_could_trap_p): Likewise.
	* gimplify.c (gimplify_expr): Do not attempt to gimplify
	TMR_SYMBOL.  Always gimplify TMR_BASE.
	* tree-cfg.c (verify_types_in_gimple_reference): Verify
	TMR_BASE if there is a TMR_SYMBOL.
	* tree-pretty-print.c (dump_generic_node): Adjust.
	* tree-ssa-address.c (addr_for_mem_ref): Likewise.
	(tree_mem_ref_addr): Likewise.
	(create_mem_ref_raw): Likewise.
	(move_fixed_address_to_symbol): Likewise.
	(create_mem_ref): Likewise.
	(dump_mem_address): Likewise.
	* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Adjust.
	Fix for both TMR_SYMBOL and TMR_BASE being set.
	(indirect_refs_may_alias_p): Likewise.
	* tree-ssa-operands.c (get_tmr_operands): Adjust.
	* tree.def (TARGET_MEM_REF): Adjust documentation.

From-SVN: r163733
2010-09-01 13:28:46 +00:00
Eric Botcazou 558af7ca1c gimplify.c (gimplify_init_constructor): Do not create a temporary for a volatile LHS if...
* gimplify.c (gimplify_init_constructor): Do not create a temporary for
	a volatile LHS if the constructor has only one element.

From-SVN: r163727
2010-09-01 12:15:08 +00:00
Eric Botcazou d3c1230697 Stack usage support
Stack usage support
	* common.opt (-fstack-usage): New option.
	* doc/invoke.texi (Debugging options): Document it.
	* builtins.c (expand_builtin_apply): Pass TRUE as 4th argument to
	allocate_dynamic_stack_space.
	(expand_builtin_alloca): Add 4th bool parameter CANNOT_ACCUMULATE
	and propagate it to allocate_dynamic_stack_space.
	(expand_builtin) <BUILT_IN_ALLOCA>: Adjust for above change.
	* calls.c (initialize_argument_information): Pass TRUE as 4th
	argument to allocate_dynamic_stack_space.
	(expand_call): Set current_function_has_unbounded_dynamic_stack_size
	to 1 when pushing a variable-sized argument onto the stack.  Pass
	TRUE as 4th argument to allocate_dynamic_stack_space.
	Update current_function_pushed_stack_size.
	(emit_library_call_value_1): Likewise.
	* explow.c (allocate_dynamic_stack_space): Add 4th bool parameter
	CANNOT_ACCUMULATE.  If flag_stack_usage, look into the size and
	attempt to find an upper bound.  Remove redundant code for the
	SETJMP_VIA_SAVE_AREA case.
	* expr.h (allocate_dynamic_stack_space): Add 4th bool parameter.
	* function.h (struct stack_usage): New structure.
	(current_function_static_stack_size): New macro.
	(current_function_dynamic_stack_size): Likewise.
	(current_function_pushed_stack_size): Likewise.
	(current_function_dynamic_alloc_count): Likewise.
	(current_function_has_unbounded_dynamic_stack_size): Likewise.
	(current_function_allocates_dynamic_stack_space): Likewise.
	(struct function): Add new field 'su'.
	* function.c (instantiate_virtual_regs): If SETJMP_VIA_SAVE_AREA,
	add the value of the dynamic offset to the dynamic stack usage.
	(gimplify_parameters): Set ALLOCA_FOR_VAR_P on call to BUILT_IN_ALLOCA
	for variable-sized objects.
	(prepare_function_start): Allocate cfun->su if flag_stack_usage.
	(rest_of_handle_thread_prologue_and_epilogue): Call output_stack_usage.
	* gimplify.c (gimplify_decl_expr): Set ALLOCA_FOR_VAR_P on call to
	BUILT_IN_ALLOCA for variable-sized objects.
	* output.h (output_stack_usage): Declare.
	* toplev.c (stack_usage_file): New file pointer.
	(output_stack_usage): New function.
	(open_auxiliary_file): Likewise.
	(lang_dependent_init): Open file if flag_stack_usage is set.
	(finalize): Close file if stack_usage_file is not null.
	* tree.h (ALLOCA_FOR_VAR_P): New macro.
	* config/alpha/alpha.c (compute_frame_size): New function.
	(alpha_expand_prologue): Use it.
	(alpha_start_function): Likewise.
	(alpha_expand_epilogue): Likewise.  Set stack usage info.
	* config/i386/i386.c (ix86_expand_prologue): Likewise.
	* config/ia64/ia64.c (ia64_expand_prologue): Likewise.
	* config/mips/mips.c (mips_expand_prologue): Likewise.
	* config/pa/pa.c (hppa_expand_prologue): Likewise.
	* config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise.
	* config/sparc/sparc.c (sparc_expand_prologue): Likewise.
testsuite/
	* lib/gcc-dg.exp (cleanup-stack-usage): New procedure.
	* lib/scanasm.exp (scan-stack-usage): Likewise.
	(scan-stack-usage-not): Likewise.
	* gcc.dg/stack-usage-1.c: New test.
	* gcc.target/i386/stack-usage-realign.c: Likewise.

From-SVN: r163660
2010-08-30 20:04:49 +00:00
Jakub Jelinek f2b11865fe re PR middle-end/45423 (#pragma omp atomic on bool has issues)
PR middle-end/45423
	* gimplify.c (goa_stabilize_expr): Handle TRUTH_NOT_EXPR
	and TRUTH_{AND,OR,XOR}_EXPR.
	* c-parser.c (c_parser_omp_atomic): Handle boolean
	{PRE,POST}_{INC,DEC}REMENT.
cp/
	* parser.c (cp_parser_omp_atomic): Handle boolean
	{PRE,POST}_INCREMENT.
testsuite/
	* gcc.dg/gomp/atomic-12.c: New test.
	* gcc.dg/gomp/atomic-13.c: New test.
	* gcc.dg/gomp/atomic-14.c: New test.
	* g++.dg/gomp/atomic-11.C: New test.
	* g++.dg/gomp/atomic-12.C: New test.
	* g++.dg/gomp/atomic-13.C: New test.
	* g++.dg/gomp/atomic-14.C: New test.

From-SVN: r163653
2010-08-30 19:16:29 +02:00
Nathan Froyd ac47786e99 vec.h (FOR_EACH_VEC_ELT): Define.
gcc/
	* vec.h (FOR_EACH_VEC_ELT): Define.
	* c-decl.c: Use it.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* dbxout.c: Likewise.
	* df-scan.c: Likewise.
	* dominance.c: Likewise.
	* dse.c: Likewise.
	* dwarf2out.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* function.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* ggc-common.c: Likewise.
	* gimplify.c: Likewise.
	* graphite-blocking.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* graphite-dependences.c: Likewise.
	* graphite-interchange.c: Likewise.
	* graphite-poly.c: Likewise.
	* graphite-scop-detection.c: Likewise.
	* graphite-sese-to-poly.c: Likewise.
	* graphite.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* implicit-zee.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-emit.c: Likewise.
	* lambda-code.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.c: Likewise.
	* lto-cgraph.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-streamer-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-symtab.c: Likewise.
	* matrix-reorg.c: Likewise.
	* opts.c: Likewise.
	* predict.c: Likewise.
	* print-tree.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched.c: Likewise.
	* sese.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-chrec.c: Likewise.
	* tree-data-ref.c: Likewise.
	* tree-emutls.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-scalar-evolution.c: Likewise.
	* tree-ssa-live.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-phiprop.c: Likewise.
	* tree-ssa-pre.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-vect-data-refs.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-vrp.c: Likewise.
	* tree.c: Likewise.
	* value-prof.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

gcc/ada/
	* gcc-interface/decl.c: Use FOR_EACH_VEC_ELT.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.

gcc/c-family/
	* c-common.c: Use FOR_EACH_VEC_ELT.
	* c-gimplify.c: Likewise.
	* c-pragma.c: Likewise.

gcc/cp/
	* call.c: Use FOR_EACH_VEC_ELT.
	* class.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* error.c: Likewise.
	* except.c: Likewise.
	* mangle.c: Likewise.
	* method.c: Likewise.
	* name-lookup.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* repo.c: Likewise.
	* semantics.c: Likewise.
	* typeck2.c: Likewise.

gcc/fortran/
	* trans-openmp.c: Use FOR_EACH_VEC_ELT.

gcc/java/
	* class.c: Use FOR_EACH_VEC_ELT.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* resource.c: Likewise.

gcc/lto/
	* lto.c: Use FOR_EACH_VEC_ELT.

From-SVN: r163401
2010-08-20 12:48:59 +00:00
Nathan Sidwell 8f0fe81379 gimplify.c (gimplify_modify_expr): When assigning to volatiles, copy the src value and return a copy.
gcc/
	* gimplify.c (gimplify_modify_expr): When assigning to volatiles,
	copy the src value and return a copy.
	* doc/extend.texi (Volatiles): Move from C++ to C and expand.
	(C++ Volatiles): Adjust to describe C++ semantics only.

	gcc/testsuite/
	* gcc.target/i386/volatile-2.c: New.

From-SVN: r163400
2010-08-20 12:22:11 +00:00
Jason Merrill ce3beba3df re PR middle-end/45307 (Stores expanding to no RTL not removed by tree optimizers, Empty ctors/dtors not eliminated)
PR c++/45307
	* gimplify.c (gimplify_init_constructor): Just return GS_UNHANDLED
	if ctor is empty.
	(gimplify_modify_expr_rhs): Adjust.

From-SVN: r163380
2010-08-19 13:00:51 -04:00
Nathan Froyd 910ad8dee5 tree.h (DECL_CHAIN): Define.
gcc/
	* tree.h (DECL_CHAIN): Define.
	* alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* c-decl.c: Likewise.
	* c-parser.c: Likewise.
	* c-typeck.c: Likewise.
	* cfgexpand.c: Likewise.
	* cgraph.c: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/winnt-cxx.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mips/mips.c: Likewise.
	* config/pa/som.h: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/symbian-cxx.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* coverage.c: Likewise.
	* dbxout.c: Likewise.
	* dwarf2out.c: Likewise.
	* emit-rtl.c: Likewise.
	* expr.c: Likewise.
	* function.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimplify.c: Likewise.
	* integrate.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-split.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-type-escape.c: Likewise.
	* langhooks.c: Likewise.
	* lto-cgraph.c: Likewise.
	* omp-low.c: Likewise.
	* stor-layout.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-complex.c: Likewise.
	* tree-dfa.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-sra.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-math-opts.c: Likewise.
	* tree-ssa-reassoc.c: Likewise.
	* tree-ssa-sccvn.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-tailcall.c: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.

gcc/ada/
	* gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* gcc-interface/trans.c: Likewise.
	* gcc-interface/utils.c: Likewise.
	* gcc-interface/utils2.c: Likewise.

gcc/c-family/
	* c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* c-format.c: Likewise.

gcc/cp/
	* cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* call.c: Likewise.
	* class.c: Likewise.
	* cp-gimplify.c: Likewise.
	* decl.c: Likewise.
	* decl2.c: Likewise.
	* init.c: Likewise.
	* mangle.c: Likewise.
	* name-lookup.c: Likewise.
	* optimize.c: Likewise.
	* parser.c: Likewise.
	* pt.c: Likewise.
	* rtti.c: Likewise.
	* search.c: Likewise.
	* semantics.c: Likewise.
	* typeck.c: Likewise.
	* typeck2.c: Likewise.

gcc/fortran/
	* f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* trans-common.c: Likewise.
	* trans-decl.c: Likewise.
	* trans-types.c: Likewise.
	* trans.c: Likewise.

gcc/java/
	* java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
	* boehm.c: Likewise.
	* class.c: Likewise.
	* decl.c: Likewise.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* typeck.c: Likewise.
	* verify-glue.c: Likewise.

gcc/objc/
	* objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN.

gcc/testsuite/
	* g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN
	with DECL_CHAIN.

From-SVN: r162223
2010-07-15 14:31:28 +00:00
Manuel López-Ibáñez 718f9c0f87 toplev.h: Do not include diagnostic-core.h.
2010-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* toplev.h: Do not include diagnostic-core.h.
	Include diagnostic-core.h in every file that includes toplev.h.
	* c-tree.h: Do not include toplev.h.
	* pretty-print.h: Update comment.
	* Makefile.in: Update dependencies.
	* alias.c: Include diagnostic-core.h in every file that includes
	toplev.h.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.c: Likewise.
	* cfgloop.c: Likewise.
	* combine.c: Likewise.
	* config/alpha/alpha.c: Likewise.
	* config/arc/arc.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/arm/pe.c: Likewise.
	* config/avr/avr.c: Likewise.
	* config/bfin/bfin.c: Likewise.
	* config/cris/cris.c: Likewise.
	* config/crx/crx.c: Likewise.
	* config/darwin-c.c: Likewise.
	* config/darwin.c: Likewise.
	* config/fr30/fr30.c: Likewise.
	* config/frv/frv.c: Likewise.
	* config/h8300/h8300.c: Likewise.
	* config/host-darwin.c: Likewise.
	* config/i386/i386.c: Likewise.
	* config/i386/netware.c: Likewise.
	* config/i386/nwld.c: Likewise.
	* config/i386/winnt-cxx.c: Likewise.
	* config/i386/winnt-stubs.c: Likewise.
	* config/i386/winnt.c: Likewise.
	* config/ia64/ia64-c.c: Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/iq2000/iq2000.c: Likewise.
	* config/lm32/lm32.c: Likewise.
	* config/m32c/m32c-pragma.c: Likewise.
	* config/m32c/m32c.c: Likewise.
	* config/m32r/m32r.c: Likewise.
	* config/m68hc11/m68hc11.c: Likewise.
	* config/m68k/m68k.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/mep/mep-pragma.c: Likewise.
	* config/mep/mep.c: Likewise.
	* config/mmix/mmix.c: Likewise.
	* config/mn10300/mn10300.c: Likewise.
	* config/moxie/moxie.c: Likewise.
	* config/pa/pa.c: Likewise.
	* config/pdp11/pdp11.c: Likewise.
	* config/picochip/picochip.c: Likewise.
	* config/rs6000/rs6000-c.c: Likewise.
	* config/rs6000/rs6000.c: Likewise.
	* config/rx/rx.c: Likewise.
	* config/s390/s390.c: Likewise.
	* config/score/score.c: Likewise.
	* config/score/score3.c: Likewise.
	* config/score/score7.c: Likewise.
	* config/sh/sh.c: Likewise.
	* config/sh/symbian-base.c: Likewise.
	* config/sh/symbian-c.c: Likewise.
	* config/sh/symbian-cxx.c: Likewise.
	* config/sol2-c.c: Likewise.
	* config/sol2.c: Likewise.
	* config/sparc/sparc.c: Likewise.
	* config/spu/spu.c: Likewise.
	* config/stormy16/stormy16.c: Likewise.
	* config/v850/v850-c.c: Likewise.
	* config/v850/v850.c: Likewise.
	* config/vax/vax.c: Likewise.
	* config/vxworks.c: Likewise.
	* config/xtensa/xtensa.c: Likewise.
	* convert.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* dbxout.c: Likewise.
	* ddg.c: Likewise.
	* dominance.c: Likewise.
	* emit-rtl.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* fixed-value.c: Likewise.
	* fold-const.c: Likewise.
	* fwprop.c: Likewise.
	* gcse.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc-zone.c: Likewise.
	* gimple-low.c: Likewise.
	* gimplify.c: Likewise.
	* graph.c: Likewise.
	* haifa-sched.c: Likewise.
	* ifcvt.c: Likewise.
	* implicit-zee.c: Likewise.
	* integrate.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-iv.c: Likewise.
	* lto-opts.c: Likewise.
	* lto-symtab.c: Likewise.
	* main.c: Likewise.
	* modulo-sched.c: Likewise.
	* optabs.c: Likewise.
	* params.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* profile.c: Likewise.
	* real.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regmove.c: Likewise.
	* reorg.c: Likewise.
	* resource.c: Likewise.
	* rtl.c: Likewise.
	* rtlanal.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-rgn.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-ir.c: Likewise.
	* simplify-rtx.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* targhooks.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfgcleanup.c: Likewise.
	* tree-dump.c: Likewise.
	* tree-eh.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-ssa-ccp.c: Likewise.
	* tree-ssa-coalesce.c: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-ssa-loop-prefetch.c: Likewise.
	* tree-ssa-loop.c: Likewise.
	* tree-ssa-structalias.c: Likewise.
	* tree-ssa-uninit.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-vect-data-refs.c: Likewise.
	* tree-vect-loop-manip.c: Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-patterns.c: Likewise.
	* tree-vect-stmts.c: Likewise.
	* tree-vrp.c: Likewise.
	* varasm.c: Likewise.
	* vec.c: Likewise.
	* web.c: Likewise.
	* xcoffout.c: Likewise.

c-family/
	* c-common.h: Include diagnostic-core.h. Error if already
	included.
	* c-semantics.c: Do not define GCC_DIAG_STYLE here.
cp/
	* cp-tree.h: Do not include toplev.h.
	
java/
	* boehm.c: Include diagnostic-core.h in every file that includes
	toplev.h.
	* class.c: Likewise.
	* constants.c: Likewise.
	* decl.c: Likewise.
	* except.c: Likewise.
	* expr.c: Likewise.
	* jcf-parse.c: Likewise.
	* mangle.c: Likewise.
	* mangle_name.c: Likewise.
	* resource.c: Likewise.
	* typeck.c: Likewise.
	* verify-glue.c: Likewise.
ada/
	* gcc-interface/utils.c: Include diagnostic-core.h in every file
	that includes toplev.h.
lto/
	* lto-coff.c: Include diagnostic-core.h in every file that
	includes toplev.h.
	* lto-elf.c: Likewise.
	* lto-lang.c: Likewise.
	* lto-macho.c: Likewise.

From-SVN: r161943
2010-07-08 04:22:54 +00:00
Jakub Jelinek f2896bc961 re PR c++/44808 (ICE: tree check: expected var_decl, have result_decl in gimplify_modify_expr)
PR c++/44808
	* gimplify.c (gimplify_modify_expr): Only SET_DECL_DEBUG_EXPR if
	*from_p is VAR_DECL.

	* g++.dg/opt/nrv16.C: New test.

From-SVN: r161838
2010-07-05 16:42:20 +02:00
Richard Guenther 75421dcdc6 tree-ssa-loop-im.c (for_each_index): Do not handle ALIGN_INDIRECT_REF.
2010-07-05  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-loop-im.c (for_each_index): Do not handle
	ALIGN_INDIRECT_REF.
	(gen_lsm_tmp_name): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	(op_code_prio): Likewise.
	(op_symbol_code): Likewise.
	* tree.c (staticp): Likewise.
	(build1_stat): Likewise.
	* tree.h (INDIRECT_REF_P): Likewise.
	* fold-const.c (maybe_lvalue_p): Likewise.
	(operand_equal_p): Likewise.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
	(ao_ref_init_from_vn_reference): Likewise.
	* tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
	(find_interesting_uses_address): Likewise.
	* dwarf2out.c (loc_list_from_tree): Likewise.
	* gimplify.c (gimplify_expr): Likewise.
	* tree-eh.c (tree_could_trap_p): Likewise.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
	* tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
	* config/rs6000/rs6000 (rs6000_check_sdmode): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* expr.c (safe_from_p): Likewise.
	(expand_expr_real_1): Likewise.  TER BIT_AND_EXPRs into MEM_REFs.
	* tree-vect-data-refs.c (vect_setup_realignment): Build
	BIT_AND_EXPR and MEM_REF instead of ALIGN_INDIRECT_REF.
	* tree-vect-stmts.c (vectorizable_load): Likewise.
	* tree.def (ALIGN_INDIRECT_REF): Remove.

From-SVN: r161830
2010-07-05 12:25:20 +00:00
Richard Guenther 7f5ad6d757 re PR middle-end/44809 (Mozilla build fails in gimplification.)
2010-07-04  Richard Guenther  <rguenther@suse.de>

	PR middle-end/44809
	* gimplify.c (gimplify_expr): Properly build a MEM_REF instead
	of an INDIRECT_REF.

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

From-SVN: r161803
2010-07-04 16:55:40 +00:00
Eric Botcazou 6687b74039 * gimplify.c (mostly_copy_tree_r): Deal with BIND_EXPR.
From-SVN: r161774
2010-07-03 13:14:48 +00:00
Richard Guenther 70f348148c re PR middle-end/42834 (memcpy folding overeager)
2010-07-01  Richard Guenther  <rguenther@suse.de>

	PR middle-end/42834
	PR middle-end/44468
	* doc/gimple.texi (is_gimple_mem_ref_addr): Document.
	* doc/generic.texi (References to storage): Document MEM_REF.
	* tree-pretty-print.c (dump_generic_node): Handle MEM_REF.
	(print_call_name): Likewise.
	* tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF.
	(build_simple_mem_ref_loc): New function.
	(mem_ref_offset): Likewise.
	* tree.h (build_simple_mem_ref_loc): Declare.
	(build_simple_mem_ref): Define.
	(mem_ref_offset): Declare.
	* fold-const.c: Include tree-flow.h.
	(operand_equal_p): Handle MEM_REF.
	(build_fold_addr_expr_with_type_loc): Likewise.
	(fold_comparison): Likewise.
	(fold_unary_loc): Fold
	VIEW_CONVERT_EXPR <T1, MEM_REF <T2, ...>> to MEM_REF <T1, ...>.
	(fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2],
	fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2].
	* tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF.
	(ptr_deref_may_alias_ref_p_1): Likewise.
	(ao_ref_base_alias_set): Properly differentiate base object for
	offset and TBAA.
	(ao_ref_init_from_ptr_and_size): Use MEM_REF.
	(indirect_ref_may_alias_decl_p): Handle MEM_REFs properly.
	(indirect_refs_may_alias_p): Likewise.
	(refs_may_alias_p_1): Likewise.  Remove pointer SSA name def
	chasing code.
	(ref_maybe_used_by_call_p_1): Handle MEM_REF.
	(call_may_clobber_ref_p_1): Likewise.
	* dwarf2out.c (loc_list_from_tree): Handle MEM_REF.
	* expr.c (expand_assignment): Handle MEM_REF.
	(store_expr): Handle MEM_REFs from STRING_CSTs.
	(store_field): If expanding a MEM_REF of a non-addressable
	decl use bitfield operations.
	(get_inner_reference): Handle MEM_REF.
	(expand_expr_addr_expr_1): Likewise.
	(expand_expr_real_1): Likewise.
	* tree-eh.c (tree_could_trap_p): Handle MEM_REF.
	* alias.c (ao_ref_from_mem): Handle MEM_REF.
	(get_alias_set): Likewise.  Properly handle VIEW_CONVERT_EXPRs.
	* tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF.
	(dr_analyze_indices): Likewise.
	(dr_analyze_alias): Likewise.
	(object_address_invariant_in_loop_p): Likewise.
	* gimplify.c (mark_addressable): Handle MEM_REF.
	(gimplify_cond_expr): Build MEM_REFs.
	(gimplify_modify_expr_to_memcpy): Likewise.
	(gimplify_init_ctor_preeval_1): Handle MEM_REF.
	(gimple_fold_indirect_ref): Adjust.
	(gimplify_expr): Handle MEM_REF.  Gimplify INDIRECT_REF to MEM_REF.
	* tree.def (MEM_REF): New tree code.
	* tree-dfa.c: Include toplev.h.
	(get_ref_base_and_extent): Handle MEM_REF.
	(get_addr_base_and_unit_offset): New function.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF.
	* gimple-fold.c (may_propagate_address_into_dereference): Handle
	MEM_REF.
	(maybe_fold_offset_to_array_ref): Allow possibly out-of bounds
	accesses if the array has just one dimension.  Remove always true
	parameter.  Do not require type compatibility here.
	(maybe_fold_offset_to_component_ref): Remove.
	(maybe_fold_stmt_indirect): Remove.
	(maybe_fold_reference): Remove INDIRECT_REF handling.
	Fold back to non-MEM_REF.
	(maybe_fold_offset_to_address): Simplify.  Deal with type
	mismatches here.
	(maybe_fold_reference): Likewise.
	(maybe_fold_stmt_addition): Likewise.  Also handle
	&ARRAY + I in addition to &ARRAY[0] + I.
	(fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs.
	(gimple_get_relevant_ref_binfo): Handle MEM_REF.
	* cfgexpand.c (expand_debug_expr): Handle MEM_REF.
	* tree-ssa.c (useless_type_conversion_p): Make most pointer
	conversions useless.
	(warn_uninitialized_var): Handle MEM_REF.
	(maybe_rewrite_mem_ref_base): New function.
	(execute_update_addresses_taken): Implement re-writing of MEM_REFs
	to SSA form.
	* tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove
	INDIRECT_REF handling.
	(copy_tree_body_r): Handle MEM_REF.
	* gimple.c (is_gimple_addressable): Adjust.
	(is_gimple_address): Likewise.
	(is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with
	invariant base are invariant.
	(is_gimple_min_lval): Adjust.
	(is_gimple_mem_ref_addr): New function.
	(get_base_address): Handle MEM_REF.
	(count_ptr_derefs): Likewise.
	(get_base_loadstore): Likewise.
	* gimple.h (is_gimple_mem_ref_addr): Declare.
	(gimple_call_fndecl): Handle invariant MEM_REF addresses.
	* tree-cfg.c (verify_address): New function, split out from ...
	(verify_expr): ... here.  Use for verifying ADDR_EXPRs and
	the address operand of MEM_REFs.  Verify MEM_REFs.  Reject
	INDIRECT_REFs.
	(verify_types_in_gimple_min_lval): Handle MEM_REF.  Disallow
	INDIRECT_REF.  Allow conversions.
	(verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of
	a register does not change its size.
	(verify_types_in_gimple_reference): Verify MEM_REF.
	(verify_gimple_assign_single): Disallow INDIRECT_REF.
	Handle MEM_REF.
	* tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable):
	New.
	(mark_address_taken): Handle MEM_REF.
	(get_indirect_ref_operands): Pass through opf_not_non_addressable.
	(get_asm_expr_operands): Pass opf_not_non_addressable.
	(get_expr_operands): Handle opf_[not_]non_addressable.
	Handle MEM_REF.  Remove INDIRECT_REF handling.
	* tree-vrp.c: (check_array_ref): Handle MEM_REF.
	(search_for_addr_array): Likewise.
	(check_array_bounds): Likewise.
	(vrp_stmt_computes_nonzero): Adjust for MEM_REF.
	* tree-ssa-loop-im.c (for_each_index): Handle MEM_REF.
	(ref_always_accessed_p): Likewise.
	(gen_lsm_tmp_name): Likewise.  Handle ADDR_EXPR.
	* tree-complex.c (extract_component): Do not handle INDIRECT_REF.
	Handle MEM_REF.
	* cgraphbuild.c (mark_load): Properly check for NULL result
	from get_base_address.
	(mark_store): Likewise.
	* tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF.
	* tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF
	handling for MEM_REF.
	* tree-scalar-evolution.c (follow_ssa_edge_expr): Handle
	&MEM[ptr + CST] similar to POINTER_PLUS_EXPR.
	* builtins.c (stabilize_va_list_loc): Use the function ABI
	valist type if we couldn't canonicalize the argument type.
	Always dereference with the canonical va-list type.
	(maybe_emit_free_warning): Handle MEM_REF.
	(fold_builtin_memory_op): Simplify and handle MEM_REFs in folding
	memmove to memcpy.
	* builtins.c (fold_builtin_memory_op): Use ref-all types
	for all memcpy foldings.
	* omp-low.c (build_receiver_ref): Adjust for MEM_REF.
	(build_outer_var_ref): Likewise.
	(scan_omp_1_op): Likewise.
	(lower_rec_input_clauses): Likewise.
	(lower_lastprivate_clauses): Likewise.
	(lower_reduction_clauses): Likewise.
	(lower_copyprivate_clauses): Likewise.
	(expand_omp_atomic_pipeline): Likewise.
	(expand_omp_atomic_mutex): Likewise.
	(create_task_copyfn): Likewise.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF.
	Remove old union trick.  Initialize constant offsets.
	(ao_ref_init_from_vn_reference): Likewise.  Do not handle
	INDIRECT_REF.  Init base_alias_set properly.
	(vn_reference_lookup_3): Replace INDIRECT_REF handling with
	MEM_REF.
	(vn_reference_fold_indirect): Adjust for MEM_REFs.
	(valueize_refs): Fold MEM_REFs.  Re-evaluate constant offset
	for ARRAY_REFs.
	(may_insert): Remove.
	(visit_reference_op_load): Do not test may_insert.
	(run_scc_vn): Remove parameter, do not fiddle with may_insert.
	* tree-ssa-sccvn.h (struct vn_reference_op_struct): Add
	a field to store the constant offset this op applies.
	(run_scc_vn): Adjust prototype.
	* cgraphunit.c (thunk_adjust): Adjust for MEM_REF.
	* tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with
	MEM_REF.  Propagate &foo + CST as &MEM[&foo, CST].  Do not
	bother about volatile qualifiers on pointers.
	(fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF.
	* tree-ssa-loop-ivopts.c
	* tree-ssa-loop-ivopts.c (determine_base_object): Adjust
	for MEM_REF.
	(strip_offset_1): Likewise.
	(find_interesting_uses_address): Replace INDIRECT_REF handling with
	MEM_REF handling.
	(get_computation_cost_at): Likewise.
	* ipa-pure-const.c (check_op): Handle MEM_REF.
	* tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF.
	* tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF
	and constants.
	* ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF.
	* tree-parloops.c (take_address_of): Adjust for MEM_REF.
	(eliminate_local_variables_1): Likewise.
	(create_call_for_reduction_1): Likewise.
	(create_loads_for_reductions): Likewise.
	(create_loads_and_stores_for_name): Likewise.
	* matrix-reorg.c (may_flatten_matrices_1): Sanitize.
	(ssa_accessed_in_tree): Handle MEM_REF.
	(ssa_accessed_in_assign_rhs): Likewise.
	(update_type_size): Likewise.
	(analyze_accesses_for_call_stmt): Likewise.
	(analyze_accesses_for_assign_stmt): Likewise.
	(transform_access_sites): Likewise.
	(transform_allocation_sites): Likewise.
	* tree-affine.c (tree_to_aff_combination): Handle MEM_REF.
	* tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do
	not handle INDIRECT_REF.
	* tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF.
	(cond_store_replacement): Likewise.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle
	MEM_REF, no not handle INDIRECT_REFs.
	(insert_into_preds_of_block): Properly initialize avail.
	(phi_translate_1): Fold MEM_REFs.  Re-evaluate constant offset
	for ARRAY_REFs.  Properly handle reference lookups that
	require a bit re-interpretation.
	(can_PRE_operation): Do not handle INDIRECT_REF.  Handle MEM_REF.
	* tree-sra.c
	* tree-sra.c (build_access_from_expr_1): Handle MEM_REF.
	(build_ref_for_offset_1): Remove.
	(build_ref_for_offset): Build MEM_REFs.
	(gate_intra_sra): Disable for now.
	(sra_ipa_modify_expr): Handle MEM_REF.
	(ipa_early_sra_gate): Disable for now.
	* tree-sra.c (create_access): Swap INDIRECT_REF handling for
	MEM_REF handling.
	(disqualify_base_of_expr): Likewise.
	(ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for
	MEM_REF handling.
	(sra_ipa_modify_expr): Remove INDIRECT_REF handling.
	Use mem_ref_offset.  Remove bogus folding.
	(build_access_from_expr_1): Properly handle MEM_REF for
	non IPA-SRA.
	(make_fancy_name_1): Add support for MEM_REF.
	* tree-predcom.c (ref_at_iteration): Handle MEM_REFs.
	* tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF.
	* ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF.
	(compute_complex_ancestor_jump_func): Likewise.
	(ipa_analyze_virtual_call_uses): Likewise.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace
	INDIRECT_REF folding with more generalized MEM_REF folding.
	(tree_ssa_forward_propagate_single_use_vars): Adjust accordingly.
	(forward_propagate_addr_into_variable_array_index): Also handle
	&ARRAY + I in addition to &ARRAY[0] + I.
	* tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF.
	* tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that
	creates assignments with overlap.
	* tree-nested.c (get_static_chain): Adjust for MEM_REF.
	(get_frame_field): Likewise.
	(get_nonlocal_debug_decl): Likewise.
	(convert_nonlocal_reference_op): Likewise.
	(struct nesting_info): Add mem_refs pointer-set.
	(create_nesting_tree): Allocate it.
	(convert_local_reference_op): Insert to be folded mem-refs.
	(fold_mem_refs): New function.
	(finalize_nesting_tree_1): Perform defered folding of mem-refs 
	(free_nesting_tree): Free the pointer-set.
	* tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF.
	(vectorizable_load): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF.
	(propagate_with_phi): Likewise.
	* tree-object-size.c (addr_object_size): Handle MEM_REFs
	instead of INDIRECT_REFs.
	(compute_object_offset): Handle MEM_REF.
	(plus_stmt_object_size): Handle MEM_REF.
	(collect_object_sizes_for): Dispatch to plus_stmt_object_size
	for &MEM_REF.
	* tree-flow.h (get_addr_base_and_unit_offset): Declare.
	(symbol_marked_for_renaming): Likewise.
	* Makefile.in (tree-dfa.o): Add $(TOPLEV_H).
	(fold-const.o): Add $(TREE_FLOW_H).
	* tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF.
	(find_func_clobbers): Likewise.
	* ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF.
	(decompose_access): Likewise.
	(replace_field_acc): Likewise.
	(replace_field_access_stmt): Likewise.
	(insert_new_var_in_stmt): Likewise.
	(get_stmt_accesses): Likewise.
	(reorg_structs_drive): Disable.
	* config/i386/i386.c (ix86_va_start): Adjust for MEM_REF.
	(ix86_canonical_va_list_type): Likewise.

	cp/
	* cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
	predicate we are looking for, allow non-gimplified
	INDIRECT_REFs.

	testsuite/
	* gcc.c-torture/execute/20100316-1.c: New testcase.
	* gcc.c-torture/execute/pr44468.c: Likewise.
	* gcc.c-torture/compile/20100609-1.c: Likewise.
	* gcc.dg/volatile2.c: Adjust.
	* gcc.dg/plugin/selfassign.c: Likewise.
	* gcc.dg/pr36902.c: Likewise.
	* gcc.dg/tree-ssa/foldaddr-2.c: Remove.
	* gcc.dg/tree-ssa/foldaddr-3.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-8.c: Adjust.
	* gcc.dg/tree-ssa/pr17141-1.c: Likewise.
	* gcc.dg/tree-ssa/ssa-fre-13.c: Likewise.
	* gcc.dg/tree-ssa/ssa-fre-14.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise.
	* gcc.dg/tree-ssa/20030807-7.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-10.c: Likewise.
	* gcc.dg/tree-ssa/ssa-fre-1.c: Likewise.
	* gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-1.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-2.c: Likewise.
	* gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-26.c: Likewise.
	* gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise.
	* gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise.
	* gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise.
	* gcc.dg/tree-ssa/ssa-pre-7.c: Likewise.
	* gcc.dg/tree-ssa/forwprop-5.c: Likewise.
	* gcc.dg/struct/w_prof_two_strs.c: XFAIL.
	* gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise.
	* gcc.dg/struct/wo_prof_global_var.c: Likewise.
	* gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise.
	* gcc.dg/struct/w_prof_local_array.c: Likewise.
	* gcc.dg/struct/w_prof_single_str_global.c: Likewise.
	* gcc.dg/struct/wo_prof_escape_str_init.c: Likewise.
	* gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise.
	* gcc.dg/struct/w_prof_global_array.c: Likewise.
	* gcc.dg/struct/wo_prof_array_field.c: Likewise.
	* gcc.dg/struct/wo_prof_single_str_local.c: Likewise.
	* gcc.dg/struct/w_prof_local_var.c: Likewise.
	* gcc.dg/struct/wo_prof_two_strs.c: Likewise.
	* gcc.dg/struct/wo_prof_empty_str.c: Likewise.
	* gcc.dg/struct/wo_prof_local_array.c: Likewise.
	* gcc.dg/struct/w_prof_global_var.c: Likewise.
	* gcc.dg/struct/wo_prof_single_str_global.c: Likewise.
	* gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise.
	* gcc.dg/struct/wo_prof_global_array.c: Likewise.
	* gcc.dg/struct/wo_prof_escape_return.c: Likewise.
	* gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise.
	* gcc.dg/struct/wo_prof_double_malloc.c: Likewise.
	* gcc.dg/struct/w_ratio_cold_str.c: Likewise.
	* gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise.
	* gcc.dg/struct/wo_prof_local_var.c: Likewise.
	* gcc.dg/tree-prof/stringop-1.c: Adjust.
	* g++.dg/tree-ssa/pr31146.C: Likewise.
	* g++.dg/tree-ssa/copyprop-1.C: Likewise.
	* g++.dg/tree-ssa/pr33604.C: Likewise.
	* g++.dg/plugin/selfassign.c: Likewise.
	* gfortran.dg/array_memcpy_3.f90: Likewise.
	* gfortran.dg/array_memcpy_4.f90: Likewise.
	* c-c++-common/torture/pr42834.c: New testcase.

From-SVN: r161655
2010-07-01 08:49:19 +00:00
Manuel López-Ibáñez 129473197d re PR middle-end/44665 (typo in comment, incorrect/out-of-date comment)
2010-06-25  Manuel López-Ibáñez  <manu@gcc.gnu.org>

       PR 44665
       * tree-inline.c (gimple_expand_calls_inline): Fix typo in comment.
       * gimplify.c (is_gimple_reg_rhs_or_call): Likewise.
       (gimplify_expr): Likewise.

From-SVN: r161380
2010-06-25 13:09:28 +00:00
Richard Guenther bd2e63a1c4 gimplify.c (gimplify_bind_expr): Always promote complex and vector variables to registers if possible.
2010-06-17  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimplify_bind_expr): Always promote complex
	and vector variables to registers if possible.

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

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

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

From-SVN: r160779
2010-06-15 14:15:26 +02:00
Richard Guenther ae0595b089 gimplify.c (gimplify_cleanup_point_expr): For empty body and EH-only cleanup drop the cleanup instead of inserting it...
2010-06-07  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (gimplify_cleanup_point_expr): For empty body
	and EH-only cleanup drop the cleanup instead of inserting it
	unconditionally.

From-SVN: r160371
2010-06-07 13:10:10 +00:00
Steven Bosscher f66d6761ee gimplify.c (gimplify_body): Revert "Do not initialize RTL profiling" change from yesterday.
* gimplify.c (gimplify_body): Revert "Do not initialize RTL profiling"
	change from yesterday.

From-SVN: r160144
2010-06-02 09:12:50 +00:00
Steven Bosscher 2eb79bbbb3 gimplify.c: Do not include except.h and optabs.h.
* gimplify.c: Do not include except.h and optabs.h.
	(gimplify_body): Do not initialize RTL profiling.
	* gimple-low.c: Do not include rtl.h, diagnostic.h, langhooks.h,
	langhooks-def.h, timevar.h, except.h, hashtab.h, and expr.h.
	* gimple-fold.c: Do not include rtl.h, tm_p.h, ggc.h, basic-block.h,
	output.h, expr.h, diagnostic.h, timevar.h, value-prof.h, and
	langhooks.h.

	* tree-pretty-print.h: Include pretty-print.h.
	* gimple-pretty-print.h: Include pretty-print.h.

	* tree-pretty-print.c: Do not include diagnostic.h.
	* tree-vrp.c: Likewise.
	* tree-tailcall.c: Likewise
	* tree-scalar-evolution.c: Likewise
	* tree-ssa-dse.c: Likewise
	* tree-chrec.c: Likewise
	* tree-ssa-sccvn.c: Likewise
	* tree-ssa-copyrename.c: Likewise
	* tree-nomudflap.c: Likewise
	* tree-call-cdce.c: Likewise
	* tree-stdarg.c: Likewise
	* tree-ssa-math-opts.c: Likewise
	* tree-nrv.c: Likewise
	* tree-ssa-sink.c: Likewise
	* tree-browser.c: Likewise
	* tree-ssa-loop-ivcanon.c: Likewise
	* tree-ssa-loop.c: Likewise
	* tree-parloops.c: Likewise
	* tree-ssa-address.c: Likewise
	* tree-ssa-ifcombine.c: Likewise
	* tree-if-conv.c: Likewise
	* tree-data-ref.c: Likewise
	* tree-affine.c: Likewise
	* tree-ssa-phiopt.c: Likewise
	* tree-ssa-coalesce.c: Likewise
	* tree-ssa-pre.c: Likewise
	* tree-ssa-live.c: Likewise
	* tree-predcom.c: Likewise
	* tree-ssa-forwprop.c: Likewise
	* tree-ssa-dce.c: Likewise
	* tree-ssa-ter.c: Likewise
	* tree-ssa-loop-prefetch.c: Likewise
	* tree-optimize.c: Likewise
	* tree-ssa-phiprop.c: Likewise
	* tree-object-size.c: Likewise
	* tree-outof-ssa.c: Likewise
	* tree-ssa-structalias.c: Likewise
	* tree-switch-conversion.c: Likewise
	* tree-ssa-reassoc.c: Likewise
	* tree-ssa-operands.c: Likewise
	* tree-vectorizer.c: Likewise
	* tree-vect-data-refs.c: Likewise
	* tree-vect-generic.c: Likewise
	* tree-vect-stmts.c: Likewise
	* tree-vect-patterns.c: Likewise
	* tree-vect-slp.c: Likewise
	* tree-vect-loop.c: Likewise
	* tree-ssa-loop-ivopts.c: Likewise
	* tree-ssa-loop-im.c: Likewise
	* tree-ssa-loop-niter.c: Likewise
	* tree-ssa-loop-unswitch.c: Likewise
	* tree-ssa-loop-manip.c: Likewise
	* tree-ssa-loop-ch.c: Likewise
	* tree-dump.c: Likewise
	* tree-complex.c: Likewise

	* tree-into-ssa.c: Do not include diagnostic.h and expr.h.
	* tree-ssa-uninit.c: Likewise
	* tree-ssa-threadupdate.c: Likewise
	* tree-ssa-uncprop.c: Likewise
	* tree-ssa-ccp.c: Likewise
	* tree-ssa-dom.c: Likewise
	* tree-ssa-propagate.c: Likewise
	* tree-ssa-alias.c: Likewise
	* tree-dfa.c: Likewise
	* tree-cfgcleanup.c: Likewise
	* tree-sra.c: Likewise
	* tree-ssa-copy.c: Likewise
	* tree-ssa.c: Likewise
	* tree-profile.c: Likewise
	* tree-cfg.c: Likewise
	* tree-ssa-threadedge.c: Likewise
	* tree-vect-loop-manip.c: Likewise

	* tree-inline.c: Do not include diagnostic.h and expr.h.
	Include rtl.h.
	(copy_decl_for_dup_finish): Do not use NULL_RTX.

	* tree-loop-linear.c: Do not include diagnostic.h, expr.h,
	and optabs.h.
	* tree-loop-distribution.c: Likewise.

From-SVN: r160125
2010-06-01 22:00:56 +00:00
Joseph Myers 1da2ed5f19 diagnostic-core.h: New.
* diagnostic-core.h: New.  Contents moved from diagnostic.h and
	toplev.h.
	* diagnostic.c: Don't include toplev.h.
	(progname): Define.  Moved from toplev.c.
	(seen_error): New function.
	* diagnostic.h: Include diagnostic-core.h.
	(diagnostic_t, emit_diagnostic): Don't declare here.
	* toplev.c (progname): Move to toplev.c.
	(emit_debug_global_declarations, compile_file, finalize,
	do_compile, toplev_main): Use seen_error.
	* toplev.h: Include diagnostic-core.h.
	(trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG,
	internal_error, warning, warning_at, error, error_n, error_at,
	fatal_error, pedwarn, permerror, sorry, inform, inform_n,
	verbatim, fnotice, progname): Move to diagnostic-core.h.
	* builtins.c: Include diagnostic-core.h instead of diagnostic.h.
	(expand_builtin_expect): Use seen_error.
	* c-decl.c: Include diagnostic-core.h instead of diagnostic.h.
	(c_make_fname_decl, c_write_global_declarations): Use seen_error.
	* c-format.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-lang.c: Include diagnostic-core.h instead of diagnostic.h.
	* c-lex.c (c_lex_with_flags, interpret_float): Don't increment
	errorcount for errors.
	* c-opts.c (c_common_finish): Use seen_error.
	* cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
	* cgraphunit.c (verify_cgraph_node, verify_cgraph,
	cgraph_output_pending_asms, cgraph_optimize): Use seen_error.
	* coverage.c: Include diagnostic-core.h instead of diagnostic.h.
	(get_coverage_counts): Use seen_error.
	* dwarf2out.c (dwarf2out_finish): Use seen_error.
	* gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup,
	gimplify_body): Use seen_error.
	* ipa-inline.c (cgraph_early_inlining): Use seen_error.
	* ipa-pure-const.c (gate_pure_const): Use seen_error.
	* ipa-reference.c (gate_reference): Use seen_error.
	* jump.c: Include diagnostic-core.h instead of diagnostic.h.
	* lambda-code.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
	* lto-compress.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-section-in.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-streamer-out.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* lto-streamer.c: Include diagnostic-core.h instead of
	diagnostic.h.
	(gate_lto_out): Use seen_error.
	* matrix-reorg.c: Include diagnostic-core.h instead of
	diagnostic.h.
	* omega.c: Include diagnostic-core.h instead of diagnostic.h.
	* omp-low.c: Include diagnostic-core.h instead of diagnostic.h.
	(gate_expand_omp, lower_omp_1): Use seen_error.
	* passes.c: Include diagnostic-core.h instead of diagnostic.h.
	(rest_of_decl_compilation, rest_of_type_compilation,
	gate_rest_of_compilation, ipa_write_summaries): Use seen_error.
	* tree-cfg.c (label_to_block_fn): Use seen_error.
	* tree-inline.c (optimize_inline_calls): Use seen_error.
	* tree-mudflap.c (mudflap_finish_file): Use
	seen_error.
	* tree-optimize.c (gate_all_optimizations,
	gate_all_early_local_passes, gate_all_early_optimizations): Use
	seen_error.
	* tree-ssa-structalias.c (gate_ipa_pta): Use seen_error.
	* varpool.c: Include diagnostic-core.h instead of diagnostic.h.
	(varpool_remove_unreferenced_decls,
	varpool_assemble_pending_decls): Use seen_error.
	* Makefile.in (DIAGNOSTIC_CORE_H): Define.
	(TOPLEV_H, DIAGNOSTIC_H): Update.
	(c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o,
	lto-streamer-out.o, lto-section-in.o, lto-streamer.o,
	c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o,
	builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o,
	coverage.o, lambda-code.o): Update dependencies.

cp:
	* call.c: Include diagnostic-core.h instead of diagnostic.h.
	* cp-lang.c: Don't include diagnostic.h
	* name-lookup.c: Include diagnostic-core.h instead of
	diagnostic.h.
	(cp_emit_debug_info_for_using): Use seen_error.
	* optimize.c: Include diagnostic-core.h instead of diagnostic.h.
	* parser.c: Include diagnostic-core.h instead of diagnostic.h.
	* pt.c (iterative_hash_template_arg): Use seen_error.
	* repo.c: Include diagnostic-core.h instead of diagnostic.h.
	* typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
	* Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
	cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
	dependencies.

lto:
	* lto.c: Include diagnostic-core.h instead of diagnostic.h.
	(read_cgraph_and_symbols, lto_main): Use seen_error.
	* Make-lang.in (lto/lto.o): Update dependencies.

objc:
	* objc-act.c: Include diagnostic-core.h instead of diagnostic.h.
	* Make-lang.in (objc/objc-act.o): Update dependencies.

From-SVN: r159947
2010-05-27 21:16:07 +01:00
Joseph Myers cf8358387d diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h.
* diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or
	langhooks-def.h.
	(diagnostic_initialize): Initialize x_data not last_function.
	(diagnostic_report_current_function): Move to tree-diagnostic.c.
	(default_diagnostic_starter): Call
	diagnostic_report_current_module not
	diagnostic_report_current_function.
	(diagnostic_report_diagnostic): Initialize x_data not
	abstract_origin.
	(verbatim): Likewise.
	* diagnostic.h (struct diagnostic_info): Change abstract_origin to
	x_data.
	(struct diagnostic_context): Change last_function to x_data.
	(diagnostic_auxiliary_data): Replace with
	diagnostic_context_auxiliary_data and
	diagnostic_info_auxiliary_data.
	(diagnostic_last_function_changed, diagnostic_set_last_function,
	diagnostic_report_current_function): Move to tree-diagnostic.h.
	(print_declaration, dump_generic_node, print_generic_stmt,
	print_generic_stmt_indented, print_generic_expr,
	print_generic_decl, debug_c_tree, dump_omp_clauses,
	print_call_name, debug_generic_expr, debug_generic_stmt,
	debug_tree_chain, default_tree_printer): Move to
	tree-pretty-print.h.
	(debug_gimple_stmt, debug_gimple_seq, print_gimple_seq,
	print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to
	gimple-pretty-print.h.
	* pretty-print.c: Don't include tree.h
	(pp_base_format): Don't handle %K here.
	(pp_base_tree_identifier): Move to tree-pretty-print.c.
	* pretty-print.h (text_info): Change abstract_origin to x_data.
	(pp_tree_identifier, pp_unsupported_tree,
	pp_base_tree_identifier): Move to tree-pretty-print.h.
	* gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h,
	tree-pretty-print.h: New files.
	* tree-pretty-print.c: Include tree-pretty-print.h.
	(percent_K_format): New.  Moved from pretty-print.c.
	(pp_base_tree_identifier): Move from pretty-print.c.
	* c-objc-common.c: Include tree-pretty-print.h.
	(c_tree_printer): Handle %K here.
	* langhooks.c: Include tree-diagnostic.h.
	(lhd_print_error_function): Use diagnostic_abstract_origin macro.
	* toplev.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(default_tree_printer): Handle %K using percent_K_format.
	(general_init): Use default_tree_diagnostic_starter.
	* tree.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(free_lang_data): Use default_tree_diagnostic_starter.
	* c-pretty-print.c: Include tree-pretty-print.h.
	* cfgexpand.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* cgraphunit.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* dwarf2out.c: Include tree-pretty-print.h.
	* except.c: Include tree-pretty-print.h.
	* gimple-pretty-print.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* gimplify.c: Include tree-pretty-print.h.
	* graphite-poly.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-cp.c: Include tree-pretty-print.h.
	* ipa-inline.c: Include gimple-pretty-print.h.
	* ipa-prop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-pure-const.c: Include gimple-pretty-print.h.
	* ipa-struct-reorg.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* ipa-type-escape.c: Include tree-pretty-print.h.
	* print-rtl.c: Include tree-pretty-print.h.
	* print-tree.c: Include gimple-pretty-print.h.
	* sese.c: Include tree-pretty-print.h.
	* tree-affine.c: Include tree-pretty-print.h.
	* tree-browser.c: Include tree-pretty-print.h.
	* tree-call-cdce.c: Include gimple-pretty-print.h.
	* tree-cfg.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-chrec.c: Include tree-pretty-print.h.
	* tree-data-ref.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-dfa.c: Include tree-pretty-print.h.
	* tree-if-conv.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-inline.c: Include tree-pretty-print.h.
	* tree-into-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-nrv.c: Include tree-pretty-print.h.
	* tree-object-size.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-outof-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-parloops.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-predcom.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-scalar-evolution.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-sra.c: Include tree-pretty-print.h.
	* tree-ssa-address.c: Include tree-pretty-print.h.
	* tree-ssa-alias.c: Include tree-pretty-print.h.
	* tree-ssa-ccp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-coalesce.c: Include tree-pretty-print.h.
	* tree-ssa-copy.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-copyrename.c: Include tree-pretty-print.h.
	* tree-ssa-dce.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-dom.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-dse.c: Include gimple-pretty-print.h.
	* tree-ssa-forwprop.c: Include tree-pretty-print.h.
	* tree-ssa-ifcombine.c: Include tree-pretty-print.h.
	* tree-ssa-live.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-im.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-niter.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-loop-prefetch.c: Include tree-pretty-print.h.
	* tree-ssa-math-opts.c: Include gimple-pretty-print.h.
	* tree-ssa-operands.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-phiprop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-pre.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-propagate.c: Include gimple-pretty-print.h.
	* tree-ssa-reassoc.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-sccvn.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-sink.c: Include gimple-pretty-print.h.
	* tree-ssa-ter.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-ssa-uninit.c: Include gimple-pretty-print.h.
	* tree-ssa.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-stdarg.c: Include gimple-pretty-print.h.
	* tree-switch-conversion.c: Include gimple-pretty-print.h.
	* tree-tailcall.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-data-refs.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-loop-manip.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-loop.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-patterns.c: Include gimple-pretty-print.h.
	* tree-vect-slp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vect-stmts.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* tree-vectorizer.c: Include tree-pretty-print.h.
	* tree-vrp.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* value-prof.c: Include tree-pretty-print.h and
	gimple-pretty-print.h.
	* var-tracking.c: Include tree-pretty-print.h.
	* Makefile.in (OBJS-common): Add tree-diagnostic.o.
	(tree-diagnostic.o): New dependencies.
	(c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o,
	tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o,
	tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o,
	tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o,
	tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o,
	tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o,
	tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o,
	tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o,
	tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o,
	tree-ssa-address.o, tree-ssa-loop-niter.o,
	tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o,
	tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o,
	tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o,
	gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o,
	tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o,
	tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o,
	tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o,
	tree-parloops.o, tree-stdarg.o, tree-object-size.o,
	gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o,
	toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o,
	ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o,
	ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o,
	tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o,
	tree-switch-conversion.o, var-tracking.o, value-prof.o,
	cfgexpand.o, pretty-print.o): Update dependencies.

cp:
	* error.c: Include tree-diagnostic.h and tree-pretty-print.h.
	(cp_print_error_function): Use diagnostic_abstract_origin macro.
	(cp_printer): Handle %K here using percent_K_format.
	* cxx-pretty-print.c: Include tree-pretty-print.h.
	* Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
	dependencies.

From-SVN: r159685
2010-05-21 23:34:26 +01:00
Steven Bosscher 40013784db tree.h: Include real.h and fixed-value.h as basic datatypes.
gcc/ChangeLog:
	* tree.h: Include real.h and fixed-value.h as basic datatypes.
	* dfp.c, convert.c, reload1.c, reginfo.c, tree-flow.h,
	tree-ssa-threadedge.c, tree-ssanames.c, tree-loop-linear.c,
	tree-into-ssa.c, tree-vect-generic.c, tree-ssa-structalias.c,
	tree-ssa-loop-im.c, tree-dump.c, tree-complex.c, tree-ssa-uninit.c,
	genrecog.c, tree-ssa-threadupdate.c, tree-ssa-loop-niter.c,
	tree-pretty-print.c, tree-loop-distribution.c,
	tree-ssa-loop-unswitch.c, c-lex.c, optabs.c, postreload-gcse.c,
	tree-ssa-loop-manip.c, postreload.c, tree-ssa-loop-ch.c,
	tree-tailcall.c, tree.c, reload.c, tree-scalar-evolution.c, rtlanal.c,
	tree-phinodes.c, builtins.c, final.c, genoutput.c, fold-const.c,
	tree-ssa-dse.c, genautomata.c, tree-ssa-uncprop.c, toplev.c,
	tree-chrec.c, genemit.c, c-cppbuiltin.c, tree-ssa-sccvn.c,
	tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, mode-switching.c,
	tree-call-cdce.c, cse.c, genpeep.c, tree-ssa-math-opts.c,
	tree-ssa-dom.c, tree-nrv.c, tree-ssa-propagate.c, tree-ssa-alias.c,
	tree-ssa-sink.c, jump.c, ifcvt.c, dwarf2out.c, expr.c, genattrtab.c,
	genconditions.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop.c,
	tree-parloops.c, recog.c, tree-ssa-address.c, lcm.c, tree-eh.c,
	gimple-pretty-print.c, c-pretty-print.c, print-rtl.c, gcse.c,
	tree-if-conv.c, tree-data-ref.c, tree-affine.c, gimplify.c,
	tree-ssa-phiopt.c, implicit-zee.c, expmed.c, tree-dfa.c, emit-rtl.c,
	store-motion.c, cselib.c, tree-cfgcleanup.c, simplify-rtx.c,
	tree-ssa-pre.c, genpreds.c, tree-mudflap.c, print-tree.c,
	tree-ssa-copy.c, tree-ssa-forwprop.c, tree-ssa-dce.c, varasm.c,
	tree-nested.c, tree-ssa.c, tree-ssa-loop-prefetch.c, rtl.c,
	tree-inline.c, integrate.c, tree-optimize.c, tree-ssa-phiprop.c,
	fixed-value.c, combine.c, tree-profile.c, c-common.c, sched-vis.c,
	tree-cfg.c, passes.c, tree-ssa-reassoc.c, config/alpha/alpha.c,
	config/frv/frv.c, config/s390/s390.c, config/m32c/m32c.c,
	config/spu/spu.c, config/sparc/sparc.c, config/mep/mep.c,
	config/m32r/m32r.c, config/rx/rx.c, config/i386/i386.c,
	config/sh/sh.c, config/pdp11/pdp11.c, config/avr/avr.c,
	config/crx/crx.c, config/xtensa/xtensa.c, config/stormy16/stormy16.c,
	config/fr30/fr30.c, config/lm32/lm32.c, config/moxie/moxie.c,
	config/m68hc11/m68hc11.c, config/cris/cris.c, config/iq2000/iq2000.c,
	config/mn10300/mn10300.c, config/ia64/ia64.c, config/m68k/m68k.c,
	config/rs6000/rs6000.c, config/picochip/picochip.c, config/darwin.c,
	config/arc/arc.c, config/mcore/mcore.c, config/score/score3.c,
	config/score/score7.c, config/score/score.c, config/arm/arm.c,
	config/pa/pa.c, config/mips/mips.c, config/vax/vax.c,
	config/h8300/h8300.c, config/v850/v850.c, config/mmix/mmix.c,
	config/bfin/bfin.c:
	Clean up redundant includes.
	* Makefile.in: Update accordingly.

java/ChangeLog:
	* typeck.c, decl.c, jcf-parse.c, except.c, expr.c:

cp/Changelog:
	* error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
	Clean up redundant includes.

fortran/ChangeLog:
	* trans-const.c, trans-types.c, trans-intrinsic.c:
	Clean up redundant includes.

From-SVN: r159663
2010-05-21 13:53:22 +00:00
Eric Botcazou 46314d3e81 re PR middle-end/44101 (ICE compiling 25_algorithms/fill/4.cc on Tru64 UNIX V5.1B)
PR middle-end/44101
	* gimplify.c (gimplify_init_constructor): Build a VIEW_CONVERT_EXPR
	around the uniquized constructor if its type requires a conversion.

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

From-SVN: r159592
2010-05-19 17:53:58 +00:00
Steven Bosscher f4ce02c5bf vecir.h: New file with VEC primitives for tree, gimple, and rtl.
gcc/ChangeLog
	* vecir.h: New file with VEC primitives for tree, gimple, and rtl.
	* Makefile.in: Add it.
	Fix all other Makefile dependencies for changes below.
	* tree.h: Include it instead of defining VEC primitives here.
	* gimple.h: Likewise.
	* rtl.h: Likewise.
	* tree-inline.h: Inlclude vecir.h instead of gimple.h.
	* except.h: Include vecir.h, break dependence on tree.h.

	* gimplify.c (append_to_statement_list_1, append_to_statement_list):
	Move from here...
	* tree-iterator.c: ...to here.
	* tree-iterator.h: Fix file introduction comment.  Add extern markers.

	* c-lex.c: Include fixed-value.h instead of rtl.h.  Do not include
	tm_p.h.
	* c-cppbuiltin.c: Explain why debug.h and tm_p.h are included.
	* c-objc-common.h: Do not include tm.h, rtl.h, insn-config.h,
	integrate.h, function.h, toplev.h, tree-inline.h, ggc.h,
	tree-mudflap.h, and target.h.
	* c-semantics.c: Do not include except.h, ggc.h, rtl.h, timevar.h,
	predict.h, tree-inline.h, gimple.h, and langhooks.h.
	* c-decl.c: Do not include expr.h, ggc.h, libfuncs.h, except.h.
	Add FIXME for why gimple.h is still included (should be unnecessary
	since GCC 4.5 gimplification unit-at-a-time).
	* c-typeck.c: Do not include rtl.h, tm_p.h, ggc.h, and gimple.h.
	* c-pragma.c: Add FIXME for why function.h needs to be included just
	for cfun, at front-end level.
	Add note that REGISTER_TARGET_PRAGMAS should probably be a target hook.
	Do not include ggc.h, but include vecprim.h for VEC(char).
	* c-opts.c: Do not include tm.h, tree-inline.h, and tm_p.h.
	Explain why target.h is included.
	* c-omp.h: Do not include tm.h, function.h, and bitmap.h.
	Explain why gimple.h is included.
	* c-ppoutput.c: Do not include tm.h.
	* c-common.c: Do not include gimple.h.  Explain why expr.h is included.
	* c-parses.c: Explain why rtl.h is included, and that this (and only
	this) is also why tm.h must be included.
	Do not include except.h.
	* c-lang.c: Do not include ggc.h.

cp/ChangeLog
	* decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
	* Make-lang.in: Fix dependencies accordingly.

From-SVN: r159442
2010-05-15 20:02:11 +00:00
Jason Merrill 786f715dc6 re PR c++/44127 (G++ emits unnecessary EH code)
PR c++/44127
gcc:
	* gimplify.c (gimplify_seq_add_stmt): No longer static.
	* gimple.h: Declare it.
	* gimple.c (gimple_build_eh_filter): No ops.
gcc/cp:
	* cp-gimplify.c (gimplify_must_not_throw_expr): Use
	gimple_build_eh_must_not_throw.

From-SVN: r159407
2010-05-14 14:55:10 -04:00
Jakub Jelinek f22f434020 re PR middle-end/44085 (OpenMP - untied task accesses threadprivate - non-conforming but no msg)
PR middle-end/44085
	* gimplify.c (enum omp_region_type): Add ORT_UNTIED_TASK,
	change value of ORT_TASK.
	(new_omp_context): Handle ORT_UNTIED_TASK like ORT_TASK.
	(omp_notice_threadprivate_variable): New function.
	(omp_notice_variable): Call it for threadprivate variables.
	If enclosing ctx is a task, print enclosing task rather than
	enclosing parallel.  Handle ORT_UNTIED_TASK like ORT_TASK.
	(gimplify_omp_task): Pass ORT_UNTIED_TASK instead of ORT_TASK
	if task has untied clause.

	* gcc.dg/gomp/pr44085.c: New test.
	* gfortran.dg/gomp/pr44085.f90: New test.

From-SVN: r159316
2010-05-12 14:11:00 +02:00
Jason Merrill 941f78d103 gimplify.c (gimplify_expr): Set GS_ALL_DONE when appropriate.
gcc:
	* gimplify.c (gimplify_expr): Set GS_ALL_DONE when appropriate.
	Don't change GS_OK to GS_ALL_DONE.  Make sure that all cases set
	ret appropriately.
	(gimplify_compound_lval): Return GS_ALL_DONE as appropriate.
gcc/cp:
	* semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.

From-SVN: r159125
2010-05-06 15:46:14 -04:00
Jason Merrill ebad523301 gimplify.c (gimplify_modify_expr_rhs): Don't return GS_OK for stripping WITH_SIZE_EXPR.
* gimplify.c (gimplify_modify_expr_rhs): Don't return GS_OK for
	stripping WITH_SIZE_EXPR.
	(gimplify_expr) [MODIFY_EXPR]: Trust GS_OK even if the rhs didn't
	change.

From-SVN: r159124
2010-05-06 15:46:03 -04:00
Eric Botcazou ca361dec8f gimplify.c (gimplify_return_expr): Gimplify the size expressions of a variable-sized RESULT_DECL.
* gimplify.c (gimplify_return_expr): Gimplify the size expressions of
	a variable-sized RESULT_DECL.

From-SVN: r159074
2010-05-05 17:48:01 +00:00
Jason Merrill 6d729f282c re PR c++/43787 (memory copy of empty class (sizeof is one))
PR c++/43787
gcc:
	* gimplify.c (gimplify_expr): Keep working if gimplify_modify_expr
	returns GS_OK.
	(gimplify_modify_expr_rhs): Return GS_OK if anything changed.
gcc/cp:
	* cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
	* call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.

From-SVN: r159072
2010-05-05 12:32:20 -04:00
Steven Bosscher 9aae8d16dd toplev.c: Include varray.h for statistics dumping.
gcc/ChangeLog:
	* toplev.c: Include varray.h for statistics dumping.
	* tree.h: Do not declare varray_head_tag.
	* tree-into-ssa.c, tree-ssa-uninit.c, tree-phinodes.c, omega.c,
	regs.h, lto-cgraph.c, tree-ssa-loop-ivopts.c, tree-nomudflap.c,
	c-objc-common.c, lto-streamer-out.c, tree-ssa-propagate.c,
	gimple-low.c, c-semantics.c, dwarf2out.c, lto-streamer-in.c,
	lto-section-in.c, alias.c, tree-if-conv.c, gimplify.c, ggc-zone.c,
	tree-ssa.c, tree-ssa-loop-prefetch.c, integrate.h, c-gimplify.c,
	c-common.c, c-common.h, reg-stack.c, basic-block.h,
	tree-ssa-structalias.c, lto-section-out.c, tree-ssanames.c: Do not
	include varray.h.
	* Makefile.in: Update for abovementioned changes.

objc/ChangeLog:
	* objc-act.c: Do not include varray.h.

objcp/ChangeLog:
	* objcp-decl.c: Do not include varray.h.

cp/ChangeLog:
	* optimize.c, parser.c,mangle.c, cp-tree.h: DO not include varray.h.
	* Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.

From-SVN: r158933
2010-04-30 11:58:49 +00:00
Eric Botcazou 8478130d94 Uniquization of constants at the Tree level
Uniquization of constants at the Tree level
	* tree.h (DECL_IN_CONSTANT_POOL): New macro
	(tree_decl_with_vis): Add in_constant_pool bit, move shadowed_for_var_p
	bit to the end.
	(tree_output_constant_def): Declare.
	* gimplify.c (gimplify_init_constructor): When using block copy,
	uniquize the constant constructor on the RHS.
	* lto-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Deal
	with DECL_IN_CONSTANT_POOL flag.
	* lto-streamer-out.c (pack_ts_decl_with_vis_value_fields): Likewise.
	* varasm.c (make_decl_rtl): Deal with variables belonging to the
	global constant pool.
	(assemble_variable): Deal with symbols belonging to the tree constant
	pool.
	(get_constant_section): Add ALIGN parameter and simplify.
	(build_constant_desc): Build a VAR_DECL and attach it to the symbol.
	(assemble_constant_contents): Use the expression of the VAR_DECL.
	(output_constant_def_contents): Use the alignment of the VAR_DECL.
	(tree_output_constant_def): New global function.
	(mark_constant): Use the expression of the VAR_DECL.
	(place_block_symbol): Use the alignment of the VAR_DECL and the size
	of its expression.
	(output_object_block): Likewise and assemble the expression.
ada/
	* gcc-interface/trans.c (gnat_gimplify_expr) <ADDR_EXPR>: Uniquize
	constant constructors before taking their address.

From-SVN: r158838
2010-04-28 19:11:50 +00:00
Eric Botcazou 06ec59e614 gimplify.c (gimplify_cond_expr): Use THEN_ and ELSE_ local variables.
* gimplify.c (gimplify_cond_expr): Use THEN_ and ELSE_ local variables.
	Use VOID_TYPE_P for all void type tests.  Adjust TYPE variable instead
	of shadowing it.  Fix comments.

From-SVN: r158737
2010-04-26 16:32:45 +00:00
Martin Jambor acd6380155 gimple.h (create_tmp_reg): Declare.
2010-04-19  Martin Jambor  <mjambor@suse.cz>

	* gimple.h (create_tmp_reg): Declare.
	* gimplify.c (create_tmp_reg): New function.
	(gimplify_return_expr): Use create_tmp_reg.
	(gimplify_omp_atomic): Likewise.
	(gimple_regimplify_operands): Likewise.
	* tree-dfa.c (make_rename_temp): Likewise.
	* tree-predcom.c (predcom_tmp_var): Likewise.
	(reassociate_to_the_same_stmt): Likewise.
	* tree-sra.c (replace_uses_with_default_def_ssa_name): Likewise.
	(get_replaced_param_substitute): Likewise.
	* tree-ssa-phiprop.c (phiprop_insert_phi): Likewise.
	* tree-ssa-phiopt.c (cond_store_replacement): Likewise.
	* tree-ssa-pre.c (get_representative_for): Likewise.
	(create_expression_by_pieces): Likewise.
	* tree-tailcall.c (adjust_return_value_with_ops): Likewise.
	(create_tailcall_accumulator): Likewise.

From-SVN: r158523
2010-04-19 19:58:54 +02:00
Eric Botcazou 675c873bfe expr.c (categorize_ctor_elements_1): Properly count sub-elements of non-constant aggregate elements.
* expr.c (categorize_ctor_elements_1): Properly count sub-elements of
	non-constant aggregate elements.

	* gimplify.c (gimplify_init_constructor): Do not pre-evaluate if this
	is a real initialization.

From-SVN: r158219
2010-04-12 10:00:13 +00:00
Eric Botcazou d47d0a8d97 tree.h (TREE_ADDRESSABLE): Document its effect for function types.
* tree.h (TREE_ADDRESSABLE): Document its effect for function types.
	* calls.c (expand_call): Pass the function type to aggregate_value_p.
	* function.c (aggregate_value_p): Do not honor DECL_BY_REFERENCE on
	the target function of a CALL_EXPR.  Honor TREE_ADDRESSABLE on the
	function type instead.  Reorder and simplify checks.

	* gimplify.c (gimplify_modify_expr_rhs) <WITH_SIZE_EXPR>: New case.
ada/
	* gcc-interface/ada-tree.h (TYPE_RETURNS_UNCONSTRAINED_P): Rename into.
	(TYPE_RETURN_UNCONSTRAINED_P): ...this.
	(TYPE_RETURNS_BY_REF_P): Rename into.
	(TYPE_RETURN_BY_DIRECT_REF_P): ...this.
	(TYPE_RETURNS_BY_TARGET_PTR_P): Delete.
	* gcc-interface/gigi.h (create_subprog_type): Adjust parameter names.
	(build_return_expr): Likewise.
	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Subprogram_Type>:
	Rename local variables.  If the return Mechanism is By_Reference, pass
	return_by_invisible_ref_p to create_subprog_type instead of toggling
	TREE_ADDRESSABLE.  Test return_by_invisible_ref_p in order to annotate
	the mechanism.  Use regular return for contrained types with non-static
	size and return by invisible reference for unconstrained return types
	with default discriminants.  Update comment.
	* gcc-interface/trans.c (Subprogram_Body_to_gnu): If the function
	returns by invisible reference, turn the RESULT_DECL into a pointer.
	Do not handle DECL_BY_REF_P in the CICO case here.
	(call_to_gnu): Remove code handling return by target pointer.  For a
	function call, if the return type has non-constant size, generate the
	assignment with an INIT_EXPR.
	(gnat_to_gnu) <N_Return_Statement>: Remove dead code in the CICO case.
	If the function returns by invisible reference, build the copy return
	operation manually.
	(add_decl_expr): Initialize the variable with an INIT_EXPR.
	* gcc-interface/utils.c (create_subprog_type): Adjust parameter names.
	Adjust for renaming of macros.  Copy the node only when necessary.
	(create_subprog_decl): Do not toggle TREE_ADDRESSABLE on the return
	type, only change DECL_BY_REFERENCE on the RETURN_DECL.
	(convert_from_reference): Delete.
	(is_byref_result): Likewise.
	(gnat_genericize_r): Likewise.
	(gnat_genericize): Likewise.
	(end_subprog_body): Do not call gnat_genericize.
	* gcc-interface/utils2.c (build_binary_op) <INIT_EXPR>: New case.
	(build_return_expr): Adjust parameter names, logic and comment.

From-SVN: r158139
2010-04-08 20:16:36 +00:00
Jakub Jelinek d53c73e02c re PR c/43385 (glibc regex testsuite failures)
PR c/43385
	* gimplify.c (gimple_boolify): Only recurse on __builtin_expect
	argument if the argument is truth_value_p.

	* gcc.c-torture/execute/pr43385.c: New test.

From-SVN: r157721
2010-03-25 09:16:18 +01:00
Richard Guenther f0c10f0fab re PR middle-end/41250 (hppa has DECL_VALUE_EXPR decls appearing in the function)
2010-03-01  Richard Guenther  <rguenther@suse.de>
	Martin Jambor  <mjambor@suse.cz>

	PR middle-end/41250
	* gimplify.c (gimplify_body): Unset DECL_HAS_VALUE_EXPR_P on
	gimplified parameters.

Co-Authored-By: Martin Jambor <mjambor@suse.cz>

From-SVN: r157148
2010-03-01 15:43:32 +00:00
Jakub Jelinek 2e9577924b re PR debug/43150 (Proper debug info for debugging VLAs)
PR debug/43150
	* gimplify.c (gimplify_type_sizes): Clear DECL_IGNORED_P for VLA
	bounds even for -O+.
	* var-tracking.c (track_expr_p): If !need_rtl, don't mandate
	expr needs to have DECL_NAME set.

	* gcc.dg/guality/vla-1.c: New test.

From-SVN: r157032
2010-02-24 11:50:13 +01:00
Jakub Jelinek 554cf33034 re PR middle-end/42233 (c++ builtin_expect code generation regression)
PR middle-end/42233
	* gimplify.c (gimple_boolify): For __builtin_expect call
	gimple_boolify also on its first argument.

From-SVN: r156888
2010-02-19 10:50:30 +01:00
Richard Guenther cb6b911a63 re PR tree-optimization/42956 (internal compiler error: Segmentation fault with -O1)
2010-02-07  Richard Guenther  <rguenther@suse.de>

	PR middle-end/42956
	* gimplify.c (gimple_fold_indirect_ref): Avoid generating
	new ARRAY_REFs on variable size element or minimal index arrays.
	Complete.
	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Use
	gimple_fold_indirect_ref.

	* gcc.c-torture/compile/pr42956.c: New testcase.

From-SVN: r156571
2010-02-07 13:42:52 +00:00
Richard Guenther 61c7cbf8e5 re PR middle-end/42898 (volatile structures and compound literal initializers)
2010-01-31  Richard Guenther  <rguenther@suse.de>

	PR middle-end/42898
	* gimplify.c (gimplify_init_constructor): For volatile LHS
	initialize a temporary.

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

From-SVN: r156404
2010-01-31 17:01:38 +00:00
Alexandre Oliva 7c0281633f Update copyright notices of my recent commits.
From-SVN: r155766
2010-01-09 14:46:25 +00:00
Alexandre Oliva 5de8da9b68 re PR middle-end/42363 (ICE: verify_flow_info failed for gcc.c-torture/compile/pr37913.c -O1 -g)
gcc/ChangeLog:
PR middle-end/42363
* gimplify.c (gimplify_modify_expr): Drop lhs on noreturn calls.
* tree-cfg.c (is_ctrl_altering_stmt): Don't compute flags twice.
(verify_gimple_call): Reject LHS in noreturn calls.
gcc/testsuite/ChangeLog:
PR middle-end/42363
* gcc.dg/torture/pr42363.c: New.

From-SVN: r155762
2010-01-09 14:40:59 +00:00
H.J. Lu b8698a0f37 Remove trailing white spaces.
2009-11-25  H.J. Lu  <hongjiu.lu@intel.com>

	* alias.c: Remove trailing white spaces.
	* alloc-pool.c: Likewise.
	* alloc-pool.h: Likewise.
	* attribs.c: Likewise.
	* auto-inc-dec.c: Likewise.
	* basic-block.h: Likewise.
	* bb-reorder.c: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* builtins.def: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-cppbuiltin.c: Likewise.
	* c-decl.c: Likewise.
	* c-format.c: Likewise.
	* c-lex.c: Likewise.
	* c-omp.c: Likewise.
	* c-opts.c: Likewise.
	* c-parser.c: Likewise.
	* c-pretty-print.c: Likewise.
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.
	* caller-save.c: Likewise.
	* calls.c: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgexpand.c: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h: Likewise.
	* cfglayout.c: Likewise.
	* cfgloop.c: Likewise.
	* cfgloop.h: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphbuild.c: Likewise.
	* cgraphunit.c: Likewise.
	* cif-code.def: Likewise.
	* collect2.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* coverage.c: Likewise.
	* crtstuff.c: Likewise.
	* cse.c: Likewise.
	* cselib.c: Likewise.
	* dbgcnt.c: Likewise.
	* dbgcnt.def: Likewise.
	* dbgcnt.h: Likewise.
	* dbxout.c: Likewise.
	* dce.c: Likewise.
	* ddg.c: Likewise.
	* ddg.h: Likewise.
	* defaults.h: Likewise.
	* df-byte-scan.c: Likewise.
	* df-core.c: Likewise.
	* df-problems.c: Likewise.
	* df-scan.c: Likewise.
	* df.h: Likewise.
	* dfp.c: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dominance.c: Likewise.
	* domwalk.c: Likewise.
	* double-int.c: Likewise.
	* double-int.h: Likewise.
	* dse.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2asm.h: Likewise.
	* dwarf2out.c: Likewise.
	* ebitmap.c: Likewise.
	* ebitmap.h: Likewise.
	* emit-rtl.c: Likewise.
	* et-forest.c: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* fwprop.c: Likewise.
	* gcc.c: Likewise.
	* gcov-dump.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genattr.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* genchecksum.c: Likewise.
	* genconfig.c: Likewise.
	* genflags.c: Likewise.
	* gengtype-parse.c: Likewise.
	* gengtype.c: Likewise.
	* gengtype.h: Likewise.
	* genmddeps.c: Likewise.
	* genmodes.c: Likewise.
	* genopinit.c: Likewise.
	* genpreds.c: Likewise.
	* gensupport.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* ggc-zone.c: Likewise.
	* ggc.h: Likewise.
	* gimple-iterator.c: Likewise.
	* gimple-low.c: Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple.c: Likewise.
	* gimple.def: Likewise.
	* gimple.h: Likewise.
	* gimplify.c: Likewise.
	* graphds.c: Likewise.
	* graphite-clast-to-gimple.c: Likewise.
	* gthr-nks.h: Likewise.
	* gthr-posix.c: Likewise.
	* gthr-posix.h: Likewise.
	* gthr-posix95.h: Likewise.
	* gthr-single.h: Likewise.
	* gthr-tpf.h: Likewise.
	* gthr-vxworks.h: Likewise.
	* gthr.h: Likewise.
	* haifa-sched.c: Likewise.
	* hard-reg-set.h: Likewise.
	* hooks.c: Likewise.
	* hooks.h: Likewise.
	* hosthooks.h: Likewise.
	* hwint.h: Likewise.
	* ifcvt.c: Likewise.
	* incpath.c: Likewise.
	* init-regs.c: Likewise.
	* integrate.c: Likewise.
	* ipa-cp.c: Likewise.
	* ipa-inline.c: Likewise.
	* ipa-prop.c: Likewise.
	* ipa-pure-const.c: Likewise.
	* ipa-reference.c: Likewise.
	* ipa-struct-reorg.c: Likewise.
	* ipa-struct-reorg.h: Likewise.
	* ipa-type-escape.c: Likewise.
	* ipa-type-escape.h: Likewise.
	* ipa-utils.c: Likewise.
	* ipa-utils.h: Likewise.
	* ipa.c: Likewise.
	* ira-build.c: Likewise.
	* ira-color.c: Likewise.
	* ira-conflicts.c: Likewise.
	* ira-costs.c: Likewise.
	* ira-emit.c: Likewise.
	* ira-int.h: Likewise.
	* ira-lives.c: Likewise.
	* ira.c: Likewise.
	* jump.c: Likewise.
	* lambda-code.c: Likewise.
	* lambda-mat.c: Likewise.
	* lambda-trans.c: Likewise.
	* lambda.h: Likewise.
	* langhooks.c: Likewise.
	* lcm.c: Likewise.
	* libgcov.c: Likewise.
	* lists.c: Likewise.
	* loop-doloop.c: Likewise.
	* loop-init.c: Likewise.
	* loop-invariant.c: Likewise.
	* loop-iv.c: Likewise.
	* loop-unroll.c: Likewise.
	* lower-subreg.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-in.c: Likewise.
	* lto-streamer-out.c: Likewise.
	* lto-streamer.c: Likewise.
	* lto-streamer.h: Likewise.
	* lto-symtab.c: Likewise.
	* lto-wpa-fixup.c: Likewise.
	* matrix-reorg.c: Likewise.
	* mcf.c: Likewise.
	* mode-switching.c: Likewise.
	* modulo-sched.c: Likewise.
	* omega.c: Likewise.
	* omega.h: Likewise.
	* omp-low.c: Likewise.
	* optabs.c: Likewise.
	* optabs.h: Likewise.
	* opts-common.c: Likewise.
	* opts.c: Likewise.
	* params.def: Likewise.
	* params.h: Likewise.
	* passes.c: Likewise.
	* plugin.c: Likewise.
	* postreload-gcse.c: Likewise.
	* postreload.c: Likewise.
	* predict.c: Likewise.
	* predict.def: Likewise.
	* pretty-print.c: Likewise.
	* pretty-print.h: Likewise.
	* print-rtl.c: Likewise.
	* print-tree.c: Likewise.
	* profile.c: Likewise.
	* read-rtl.c: Likewise.
	* real.c: Likewise.
	* recog.c: Likewise.
	* reg-stack.c: Likewise.
	* regcprop.c: Likewise.
	* reginfo.c: Likewise.
	* regmove.c: Likewise.
	* regrename.c: Likewise.
	* regs.h: Likewise.
	* regstat.c: Likewise.
	* reload.c: Likewise.
	* reload1.c: Likewise.
	* resource.c: Likewise.
	* rtl.c: Likewise.
	* rtl.def: Likewise.
	* rtl.h: Likewise.
	* rtlanal.c: Likewise.
	* sbitmap.c: Likewise.
	* sched-deps.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-rgn.c: Likewise.
	* sched-vis.c: Likewise.
	* sdbout.c: Likewise.
	* sel-sched-dump.c: Likewise.
	* sel-sched-dump.h: Likewise.
	* sel-sched-ir.c: Likewise.
	* sel-sched-ir.h: Likewise.
	* sel-sched.c: Likewise.
	* sel-sched.h: Likewise.
	* sese.c: Likewise.
	* sese.h: Likewise.
	* simplify-rtx.c: Likewise.
	* stack-ptr-mod.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* store-motion.c: Likewise.
	* stringpool.c: Likewise.
	* stub-objc.c: Likewise.
	* sync-builtins.def: Likewise.
	* target-def.h: Likewise.
	* target.h: Likewise.
	* targhooks.c: Likewise.
	* targhooks.h: Likewise.
	* timevar.c: Likewise.
	* tlink.c: Likewise.
	* toplev.c: Likewise.
	* toplev.h: Likewise.
	* tracer.c: Likewise.
	* tree-affine.c: Likewise.
	* tree-affine.h: Likewise.
	* tree-browser.def: 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-dump.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-eh.c: Likewise.
	* tree-flow-inline.h: Likewise.
	* tree-flow.h: Likewise.
	* tree-if-conv.c: Likewise.
	* tree-inline.c: Likewise.
	* tree-into-ssa.c: Likewise.
	* tree-loop-distribution.c: Likewise.
	* tree-loop-linear.c: Likewise.
	* tree-mudflap.c: Likewise.
	* tree-nested.c: Likewise.
	* tree-nomudflap.c: Likewise.
	* tree-nrv.c: Likewise.
	* tree-object-size.c: Likewise.
	* tree-optimize.c: Likewise.
	* tree-outof-ssa.c: Likewise.
	* tree-parloops.c: Likewise.
	* tree-pass.h: Likewise.
	* tree-phinodes.c: Likewise.
	* tree-predcom.c: Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-profile.c: Likewise.
	* tree-scalar-evolution.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-live.h: 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-operands.h: 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-structalias.c: Likewise.
	* tree-ssa-ter.c: Likewise.
	* tree-ssa-threadedge.c: Likewise.
	* tree-ssa-threadupdate.c: Likewise.
	* tree-ssa-uncprop.c: Likewise.
	* tree-ssa.c: Likewise.
	* tree-ssanames.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-vectorizer.h: Likewise.
	* tree-vrp.c: Likewise.
	* tree.c: Likewise.
	* tree.def: Likewise.
	* tree.h: Likewise.
	* treestruct.def: Likewise.
	* unwind-compat.c: Likewise.
	* unwind-dw2-fde-glibc.c: Likewise.
	* unwind-dw2.c: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.
	* var-tracking.c: Likewise.
	* varasm.c: Likewise.
	* varpool.c: Likewise.
	* vec.c: Likewise.
	* vec.h: Likewise.
	* vmsdbgout.c: Likewise.
	* web.c: Likewise.
	* xcoffout.c: Likewise.

From-SVN: r154645
2009-11-25 02:55:54 -08:00
Jakub Jelinek 2b32c27d98 re PR middle-end/42029 (ICE with complex data type and openmp for reduction clause)
PR middle-end/42029
	* gimplify.c (gimplify_omp_atomic): Set DECL_GIMPLE_REG_P on
	tmp_load if needed.

	* libgomp.c/pr42029.c: New test.

From-SVN: r154161
2009-11-13 19:38:36 +01:00
Janus Weil 60f5ed26b3 re PR fortran/41714 ([OOP] ALLOCATE SOURCE= does not properly copy the value from SOURCE)
2009-10-26  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41714
	* gimple.h (tree_annotate_all_with_location): Remove prototype.
	* gimplify.c (tree_should_carry_location_p,
	tree_annotate_one_with_location,tree_annotate_all_with_location):
	Remove obsolete functions.


2009-10-26  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41714
	* trans.c (gfc_trans_code): Remove call to
	'tree_annotate_all_with_location'. Location should already be set.
	* trans-openmp.c (gfc_trans_omp_workshare): Ditto.
	* trans-stmt.c (gfc_trans_allocate): Do correct data initialization for
	CLASS variables with SOURCE tag, plus some cleanup.


2009-10-26  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/41714
	* gfortran.dg/class_allocate_4.f03: New test.

From-SVN: r153547
2009-10-26 10:08:03 +01:00
Richard Henderson 1c384bf142 builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.
* builtins.c (expand_builtin_synchronize): Use gimple_build_asm_vec.
	* cfgbuild.c (make_edges): Handle asm goto.
	* cfglayout.c (fixup_reorder_chain): Likewise.
	* cfgrtl.c (patch_jump_insn): Likewise.
	* gimple-pretty-print.c (dump_gimple_asm): Likewise.
	* gimple.c (gimple_build_asm_1): Add and use nlabels parameter.
	(gimple_build_asm_vec): Add and use labels parameter.
	(gimple_build_asm): Remove.
	(walk_gimple_asm): Walk labels too.
	* gimple.def (GIMPLE_ASM): Update docs.
	* gimple.h: Update decls.
	(struct gimple_statement_asm): Change nc to use unsigned char;
	add nl member.
	(gimple_asm_nlabels): New.
	(gimple_asm_label_op, gimple_asm_set_label_op): New.
	* gimplify.c (gimplify_asm_expr): Copy labels from ASM_EXPR
	into gimple_build_asm_vec.
	* jump.c (mark_jump_label_asm): New.
	(mark_jump_label): Use it.
	(redirect_jump_1): Handle asm goto.
	(invert_jump_1): Soft fail if X is null.
	* recog.c (extract_asm_operands): New.
	(asm_noperands): Use it; handle asm labels.
	(decode_asm_operands): Use extract_asm_operands.
	(asm_operand_ok): Properly handle empty string.
	* reg-stack.c (get_asm_operands_in_out): Rename from
	get_asm_operand_n_inputs; use extract_asm_operands; return both
	inputs and outputs by reference; update all callers.
	* rtl.def (ASM_OPERANDS): Add label vector as operand 6.
	* rtl.h (ASM_OPERANDS_LABEL_VEC): New.
	(ASM_OPERANDS_LABEL_LENGTH, ASM_OPERANDS_LABEL): New.
	(ASM_OPERANDS_SOURCE_LOCATION): Renumber.
	(extract_asm_operands): Declare.
	* stmt.c (expand_asm_operands): Add and use labels parameter.
	(check_unique_operand_names): Likewise.
	(resolve_asm_operand_names, resolve_operand_name_1): Likewise.
	(expand_asm_stmt): Handle asm labels.
	* tree-cfg.c (make_gimple_asm_edges): New.
	(make_edges): Use it.
	(cleanup_dead_labels): Handle asm labels.
	(is_ctrl_altering_stmt): Likewise.
	(gimple_redirect_edge_and_branch): Likewise.
	* tree.def (ASM_EXPR): Add 5th operand.
	* tree.h (ASM_LABELS): New.
	(resolve_asm_operand_names): Update decl.

	* c-parser.c (c_parser_asm_statement): Parse asm goto.
	(c_parser_asm_goto_operands): New.
	* c-tree.h (build_asm_expr): Update decl.
	* c-typeck.c (build_asm_expr): Add and use labels parameter.
	* doc/extend.texi: Document asm goto.

gcc/ada/
	* gcc-interface/trans.c (Pragma_to_gnu): Use build5 for ASM_EXPR.

gcc/cp/
	* cp-tree.h (finish_asm_stmt): Update decl.
	* parser.c (cp_parser_asm_definition): Parse asm goto.
	(cp_parser_asm_label_list): New.
	* pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
	(tsubst_expr): Handle asm labels.
	* semantics.c (finish_asm_stmt): Add and use labels parameter.

gcc/testsuite/
	* c-c++-common/asmgoto-1.c, c-c++-common/asmgoto-2.c,
	c-c++-common/asmgoto-3.c, gcc.c-torture/compile/asmgoto-1.c,
	gcc.dg/tree-ssa/asmgoto-1.c: New files.

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

From-SVN: r151701
2009-09-14 13:17:24 -07:00
Richard Henderson 1d65f45cfa Squash commit of EH in gimple
From-SVN: r151696
2009-09-14 12:18:58 -07:00
Richard Guenther 6b8b9e4262 re PR c/41163 (verify_gimple fails)
2009-08-26  Richard Guenther  <rguenther@suse.de>

	PR middle-end/41163
	* gimplify.c (gimplify_addr_expr): Canonicalize ADDR_EXPRs if
	the types to not match.
	* tree-cfg.c (verify_gimple_assign_single): Adjust ADDR_EXPR
	verification.
	* tree-ssa.c (useless_type_conversion_p): Conversions to
	pointers to unprototyped functions are useless.

	* gcc.c-torture/compile/pr41163.c: New testcase.
	* gcc.dg/pr35899.c: Adjust.

From-SVN: r151122
2009-08-26 13:23:04 +00:00
Eric Botcazou f76d6e6f37 gimplify.c (prepare_gimple_addressable): New static function.
* gimplify.c (prepare_gimple_addressable): New static function.
	(gimplify_modify_expr_to_memcpy): Invoke it on the RHS before marking
	it addressable.
	(gimplify_addr_expr): Invoke it similarly on the operand instead of
	manually fiddling with it.
ada/
	* gcc-interface/trans.c (call_to_gnu): Tidy.
	(gnat_to_gnu) <N_Slice>: Set TYPE_ARRAY_MAX_SIZE if the slice has
	non-constant size but the array itself has constant size.
	* gcc-interface/utils.c (convert_vms_descriptor64): Fix type
	consistency error.
	(convert_vms_descriptor32): Likewise.

From-SVN: r151082
2009-08-25 15:02:19 +00:00
Michael Matz 9600efe1a6 omp-low.c (optimize_omp_library_calls): Use types_compatible_p instead of comparing TYPE_MAIN_VARIANT for equality.
* omp-low.c (optimize_omp_library_calls): Use types_compatible_p
        instead of comparing TYPE_MAIN_VARIANT for equality.
        * tree-vect-patterns.c (vect_recog_dot_prod_pattern,
        vect_recog_widen_mult_pattern, vect_recog_widen_sum_pattern): Ditto.
        * tree-vect-loop.c (vect_is_simple_reduction): Ditto.
        * gimplify.c (goa_lhs_expr_p): Ditto and use
        STRIP_USELESS_TYPE_CONVERSION.

From-SVN: r150936
2009-08-19 14:29:52 +00:00
Richard Guenther e5fdcd8cc5 re PR middle-end/41047 (gcc.target/mips/memcpy-1.c failing)
2009-08-13  Richard Guenther  <rguenther@suse.de>

	PR middle-end/41047
	* tree-ssa-ccp.c (ccp_fold): When folding pointer additions
	use the constant pointer type.
	* gimplify.c (canonicalize_addr_expr): Canonicalize independent
	of CV qualifiers on the target pointer type.
	* tree-ssa.c (useless_type_conversion_p): Move incomplete pointer
	conversion check before restrict check.

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

From-SVN: r150715
2009-08-13 08:19:10 +00:00
Richard Guenther daad02781a alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P.
2009-08-12  Richard Guenther  <rguenther@suse.de>

	* alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P.
	* gimplify.c (gimplify_modify_expr): Do not use
	lang_hooks.types_compatible_p.
	* tree-ssa.c (useless_type_conversion_p): For aggregates
	just return false if the canonical types differ.

From-SVN: r150695
2009-08-12 15:10:47 +00:00
Richard Guenther 33922890f6 re PR c/40787 (ICE: verify_gimple failed in gcc.dg/pr35899.c)
2009-07-18  Richard Guenther  <rguenther@suse.de>

	PR c/40787
	* gimplify.c (gimplify_call_expr): Reject code using results from
	functions returning void.

	* gcc.dg/pr35899.c: Adjust.

From-SVN: r149770
2009-07-18 11:16:07 +00:00
Richard Guenther a406865a08 re PR c/40401 (ICE: verify_gimple failed)
2009-07-17  Richard Guenther  <rguenther@suse.de>

	PR c/40401
	* tree-pass.h (pass_diagnose_omp_blocks): Declare.
	(pass_warn_unused_result): Likewise.
	(TODO_set_props): Remove.
	* omp-low.c (diagnose_omp_structured_block_errors): Change to
	run as a pass.
	(pass_diagnose_omp_blocks): Define.
	* c-decl.c (pop_file_scope): Do not finalize the CU here.
	(c_gimple_diagnostics_recursively): Remove.
	(finish_function): Do not call it.
	(c_write_global_declarations): Continue after errors.
	Finalize the CU here.
	* c-gimplify.c (c_genericize): Do not gimplify here.
	* c-common.c (c_warn_unused_result): Move ...
	* tree-cfg.c (do_warn_unused_result): ... here.
	(run_warn_unused_result): New function.
	(gate_warn_unused_result): New function.
	(pass_warn_unused_result): New pass.
	* c-common.h (c_warn_unused_result): Remove.
	* flags.h (flag_warn_unused_result): Declare.
	* c-opts.c (c_common_init_options): Enable flag_warn_unused_result.
	* opts.c (flag_warn_unused_result): Initialize to false.

	* toplev.c (compile_file): Add comment.
	* omp-low.c (create_omp_child_function): Do not register
	the function with the frontend.
	(diagnose_omp_structured_block_errors): Prepare to be
	called as optimization pass.
	(gate_diagnose_omp_blocks): New function.
	(pass_diagnose_omp_blocks): New pass.
	* cgraph.h (cgraph_optimize): Remove.
	(cgraph_analyze_function): Likewise.
	* cgraph.c (cgraph_add_new_function): Gimplify C++ thunks.
	* cgraphunit.c (cgraph_lower_function): Lower nested functions
	before their parents here.
	(cgraph_finalize_function): Not here.
	(cgraph_analyze_function): Gimplify functions here.
	(cgraph_finalize_compilation_unit): Continue after errors.
	Optimize the callgraph from here.
	(cgraph_optimize): Make static.
	* langhooks.c (write_global_declarations): Finalize the CU.
	* gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors.
	(gimplify_function_tree): Assert we gimplify only once.
	Set PROP_gimple_any property.
	* tree-nested.c (gimplify_all_functions): New function.
	(lower_nested_functions): Gimplify all nested functions.
	* gimple.h (diagnose_omp_structured_block_errors): Remove.
	* passes.c (init_optimization_passes): Add pass_warn_unused_result
	and pass_diagnose_omp_blocks after gimplification.  Do not
	set TODO_set_props on all_lowering_passes.
	(execute_one_pass): Do not handle TODO_set_props.
	* Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency.
	(gimplify.o): Add tree-pass.h dependency.
	* tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST.
	(copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR.
	(unsave_r): Likewise.
	* c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the
	temporary variable.

	cp/
	* decl.c (finish_function): Do not emit unused result warnings
	from here.
	* cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
	c_warn_unused_result_pass.
	* semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
	* optimize.c (clone_body): Clone in GENERIC.
	(maybe_clone_body): Do not clear DECL_SAVED_TREE.
	* decl2.c (cp_write_global_declarations): Fix body test.
	Do not call cgraph_optimize.
	* Make-lang.in (optimize.o): Add tree-iterator.h dependency.
	* method.c (use_thunk): Register thunk with
	cgraph_finalize_function.
	* error.c (function_category): Guard access of DECL_LANG_SPECIFIC.

	java/
	* java-gimplify.c (java_genericize): Do not gimplify here.
	But replace all local references.
	(java_gimplify_expr): Do not replace local references here.
	(java_gimplify_modify_expr): Likewise.
	* jcf-parse.c (java_parse_file): Do not finalize the CU or
	optimize the cgraph here.
	* decl.c (java_replace_reference): Make static.
	(java_replace_references): New function.
	(end_java_method): Clear base_decl_map.
	* java-tree.h (java_replace_references): Declare.
	(java_replace_reference): Remove.

	ada/
	* utils.c (end_subprog_body): Revert to pre-tuples state.  Remove
	unused parameter.
	(gnat_gimplify_function): Do not gimplify here.
	Fold into its only caller and remove.
	(gnat_builtin_function): Adjust for end_subprog_body signature change.
	(gnat_write_global_declarations): Also finalize the CU.
	* misc.c (gnat_parse_file): Do not finalize the CU here.
	* trans.c (gigi): Revert to pre-tuples state.
	(Subprogram_Body_to_gnu): Adjust for end_subprog_body signature
	change.
	* gigi.h (end_subprog_body): Remove unused parameter.

	fortran/
	* f95-lang.c (gfc_be_parse_file): Do not finalize the CU here.
	* trans-decl.c (gfc_gimplify_function): Remove.
	(build_entry_thunks): Do not gimplify here.
	(create_main_function): Likewise.
	(gfc_generate_function_code): Likewise.

	* g++.dg/rtti/crash4.C: New testcase.
	* g++.dg/torture/20090706-1.C: Likewise.
	* gcc.dg/redecl-17.c: Likewise.

	* gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern.
	* gcc.dg/declspec-9.c: Expect extra error.
	* gcc.dg/declspec-10.c: Likewise.
	* gcc.dg/declspec-11.c: Likewise.
	* gcc.dg/redecl-10.c: Expect extra warnings.
	* gcc.target/i386/pr39082-1.c: Adjust diagnostic location.
	* gcc.target/i386/pr39545-1.c: Likewise.
	* g++.dg/ext/asm3.C: Expect more errors.
	* g++.dg/gomp/block-1.C: Likewise.
	* g++.dg/gomp/block-2.C: Likewise.
	* g++.dg/gomp/block-3.C: Likewise.
	* g++.dg/gomp/block-5.C: Likewise.
	* g++.old-deja/g++.jason/report.C: Expect extra warnings.
	* g++.dg/warn/unused-result1.C: XFAIL.

From-SVN: r149750
2009-07-17 15:49:34 +00:00
Jakub Jelinek 4f93480919 re PR c++/40780 (ICE in gimplify_conversion)
PR c++/40780
	* gimplify.c (gimplify_conversion): Don't change non-conversions into
	VIEW_CONVERT_EXPR.

	* g++.dg/template/ptrmem19.C: New test.

From-SVN: r149740
2009-07-17 12:40:09 +02:00
Aldy Hernandez db3927fb49 re PR c/40435 (Revision 148442 caused many regressions on trunk)
2009-07-17  Aldy Hernandez  <aldyh@redhat.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 40435 
	* tree-complex.c, tree-loop-distribution.c,
	tree.c, tree.h, builtins.c, fold-const.c, omp-low.c,
	cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c,
	gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c,
	stor-layout.c, tree-if-conv.c, c-typeck.c,
	gimplify.c, calls.c, tree-sra.c, tree-mudflap.c,
	tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c,
	varasm.c, tree-inline.c, c-common.c,
	c-common.h, gimple.c, tree-switch-conversion.c, gimple.h,
	tree-cfg.c, c-parser.c, convert.c: Add location
	argument to fold_{unary,binary,ternary}, fold_build[123],
	build_call_expr, build_size_arg, build_fold_addr_expr,
	build_call_array, non_lvalue, size_diffop,
	fold_build1_initializer, fold_build2_initializer,
	fold_build3_initializer, fold_build_call_array,
	fold_build_call_array_initializer, fold_single_bit_test,
	omit_one_operand, omit_two_operands, invert_truthvalue,
	fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
	combine_comparisons, fold_builtin_*, fold_call_expr,
	build_range_check, maybe_fold_offset_to_address, round_up,
	round_down.
objc/
	* objc-act.c: Add location argument to all calls to
	build_fold_addr_expr.
testsuite/
	* gcc.dg/pr36902.c: Add column info.
	* g++.dg/gcov/gcov-2.C: Change count for definition.
cp/
	* typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
	tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
	call.c, cvt.c, mangle.c: Add location argument to
	fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
	build_size_arg, build_fold_addr_expr, build_call_array,
	non_lvalue, size_diffop, fold_build1_initializer,
	fold_build2_initializer, fold_build3_initializer,
	fold_build_call_array, fold_build_call_array_initializer,
	fold_single_bit_test, omit_one_operand, omit_two_operands,
	invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
	fold_indirect_ref, combine_comparisons, fold_builtin_*,
	fold_call_expr, build_range_check, maybe_fold_offset_to_address,
	round_up, round_down.
fortran/
	* trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c,
	trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location
	argument to fold_{unary,binary,ternary}, fold_build[123],
	build_call_expr, build_size_arg, build_fold_addr_expr,
	build_call_array, non_lvalue, size_diffop,
	fold_build1_initializer, fold_build2_initializer,
	fold_build3_initializer, fold_build_call_array,
	fold_build_call_array_initializer, fold_single_bit_test,
	omit_one_operand, omit_two_operands, invert_truthvalue,
	fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref,
	combine_comparisons, fold_builtin_*, fold_call_expr,
	build_range_check, maybe_fold_offset_to_address, round_up,
	round_down.

Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org>

From-SVN: r149722
2009-07-16 22:29:52 +00:00
Manuel López-Ibáñez d665b6e585 re PR c++/31246 (-Wunreachable-code warnings for compiler-generated code)
2009-07-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR c++/31246
	* gimplify.c (gimplify_expr): Propagate no_warning flag when
	gimplifying.
	* gimple (gimple_build_call_from_tree): Likewise.
	* tree-cfg.c (remove_useless_stmts_warn_notreached): Check
	no_warning flag before warning.
cp/
	* init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
	code.
	* cp-gimplify.c (genericize_eh_spec_block): Likewise.
	
testsuite/	
	* g++.dg/warn/pr31246.C: New.
	* g++.dg/warn/pr31246-2.C: New.

From-SVN: r149354
2009-07-07 22:18:35 +00:00
Manuel López-Ibáñez 5e278028ed tree.c (set_expr_locus): Remove.
2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* tree.c (set_expr_locus): Remove.
	* tree.h (EXPR_LOCUS,SET_EXPR_LOCUS,set_expr_locus): Remove.
	* c-typeck.c (c_finish_stmt_expr):  Replace EXPR_LOCUS by
	EXPR_LOCATION.
	* gimplify.c (internal_get_tmp_var): Likewise.
	(gimplify_call_expr): Likewise.
	(gimplify_one_sizepos): Likewise.
objc/
	* objc-act.c (next_sjlj_build_catch_list): Replace EXPR_LOCUS by
	EXPR_LOCATION.
cp/	
	* semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
	EXPR_LOCATION.
ada/
	* gcc-interface/trans.c (gnat_gimplify_expr):  Replace EXPR_LOCUS by
	EXPR_LOCATION.

From-SVN: r149350
2009-07-07 21:52:01 +00:00
Manuel López-Ibáñez fab922b1f5 c-lex.c: Replace %H by an explicit location.
2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* c-lex.c: Replace %H by an explicit location. Update all calls.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-typeck.c: Likewise.
	* fold-const.c: Likewise.
	* gimplify.c: Likewise.
	* stmt.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-ssa-loop-niter.c: Likewise.
	* tree-vrp.c: Likewise.
	* value-prof.c: Likewise.
java/
	* jcf-parse.c: Replace %H by an explicit location. Update all calls.
objc/
	* objc-act.c: Replace %H by an explicit location. Update all calls.
testsuite/
	* gcc.dg/plugin/selfassign.c: Replace %H by an explicit
	location. Update all calls.
	* g++.dg/plugin/selfassign.c: Likewise.

From-SVN: r149310
2009-07-07 02:10:19 +00:00
Richard Guenther 5b21f0f37d re PR middle-end/38212 (restrict implementation causes wrong-code)
2009-06-29  Richard Guenther  <rguenther@suse.de>

	PR middle-end/38212
	* alias.c (find_base_decl): Remove.
	(get_deref_alias_set_1): Remove restrict handling.
	* c-common.c (c_apply_type_quals_to_decl): Do not set
	DECL_POINTER_ALIAS_SET.
	* gimplify.c (find_single_pointer_decl_1): Remove.
	(find_single_pointer_decl): Likewise.
	(internal_get_tmp_var): Remove restrict handling.
	(gimple_regimplify_operands): Likewise.
	* omp-low.c (expand_omp_atomic_pipeline): Do not set
	DECL_POINTER_ALIAS_SET. Use ref-all pointers.
	* print-tree.c (print_node): Do not print DECL_POINTER_ALIAS_SET.
	* tree.c (restrict_base_for_decl): Remove.
	(init_ttree): Do not allocate it.
	(make_node_stat): Do not set DECL_POINTER_ALIAS_SET.  Set
	LABEL_DECL_UID for label decls.
	(copy_node_stat): Do not copy restrict information.
	(decl_restrict_base_lookup): Remove.
	(decl_restrict_base_insert): Likewise.
	(print_restrict_base_statistics): Likewise.
	(dump_tree_statistics): Do not call print_restrict_base_statistics.
	* tree.h (DECL_POINTER_ALIAS_SET): Remove.
	(DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise.
	(struct tree_decl_common): Rename pointer_alias_set to label_decl_uid.
	(LABEL_DECL_UID): Adjust.
	(DECL_BASED_ON_RESTRICT_P): Remove.
	(DECL_GET_RESTRICT_BASE): Likewise.
	(SET_DECL_RESTRICT_BASE): Likewise.
	(struct tree_decl_with_vis): Remove based_on_restrict_p flag.

	* config/i386/i386.c (ix86_gimplify_va_arg): Use ref-all pointers
	instead of DECL_POINTER_ALIAS_SET.
	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
	* config/s390/s390.c (s390_gimplify_va_arg): Likewise.
	* config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise.

	* gcc.c-torture/execute/pr38212.c: New testcase.

From-SVN: r149047
2009-06-29 12:20:39 +00:00
Aldy Hernandez c2255bc488 java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt.
gcc/java/
	* java-gimplify.c (java_gimplify_block): New argument to
	build_empty_stmt.
	* expr.c (force_evaluation_order): Same.
	* typeck.c: Add location to build_decl or PUSH_FIELD calls.
	* class.c: Same.
	* decl.c: Same.
	* jcf-parse.c: Same.
	* constants.c: Same.
	* resource.c: Same.
	* except.c: Same.
	* builtins.c: Same.
	* expr.c: Same.
	* java-tree.h (PUSH_FIELD): Add location field.
gcc/objc/
	* objc-act.c (finish_var_decl): Pass location to finish_decl.
	(objc_get_parm_info): Same.
	(get_super_receiver): Same.
	* objc-act.c (objc_build_component_ref): Pass location to
	build_compound_ref.
	(build_module_initializer_routine): Pass location to
	c_end_compound_stmt.
	(objc_generate_static_init_call): Pass location to build_stmt.
	(build_typed_selector_reference): New location argument.
	(build_selector_reference): Same.
	(objc_substitute_decl): Pass location to build_array_ref.
	(next_sjlj_build_try_catch_finally): Pass location to build_stmt.
	(objc_begin_catch_clause): Same.
	(objc_finish_try_stmt): Same.
	(objc_finish_catch_clause): Pass location to c_end_compound_stmt.
	(objc_build_throw_stmt): New argument.
	(generate_shared_structures): Pass location to build_c_cast.
	(objc_build_message_expr): Use local location.
	(objc_finish_message_expr): Use input_location.
	(build_objc_method_call): New argument.
	(objc_build_selector_expr): Same.
	(get_super_receiver): Pass location to build_c_cast,
	build_modify_expr, build_compound_expr.
	* objc-act.c: Add location to all calls to start_struct, build_decl,
	finish_struct.
gcc/
	* tree-pretty-print.c (dump_generic_node): Dump column numbers.
	* gimple-pretty-print.c (dump_gimple_stmt): Same.
	* gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs
	created.
	* c-parser.c (c_parser_binary_expression): Use current column while
	building binary operations.
	* common.opt (fshow-column): Enable by default.
	* tree-vrp.c (check_array_ref): Use warning_at.
	(check_array_bounds): Use location from call back if expr has no
	location.
	* tree.h: Add location argument to maybe_fold_*.
	* tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*.
	(maybe_fold_offset_to_array_ref): Add location argument and use it.
	(maybe_fold_offset_to_component_ref): Same.
	(maybe_fold_offset_to_reference): Same.
	(maybe_fold_offset_to_address): Same.
	(maybe_fold_stmt_indirect): Same.
	(maybe_fold_stmt_addition): Same.
	(fold_stmt_r): Pass location to maybe_fold_*.
	(fold_gimple_assign): Same.
	* c-tree.h: Add location argument to finish_decl,
	default_function_array_conversion, store_init_value.
	* c-decl.c (define_label): Use error_at.
	(c_make_fname_decl): Pass location to finish_decl.
	(finish_decl): New location argument.
	(build_compound_literal): Pass location to store_init_value.
	(grokdeclarator): Pass location to finish_decl.
	(grokfield): Same.
	* c-typeck.c (array_to_pointer_conversion): New location argument.
	(function_to_pointer_conversion): Same.
	(default_function_array_conversion): Same.
	(parser_build_unary_op): Pass location to overflow_warning.
	(parser_build_binary_op): Same.  Use warning_at.
	(build_unary_op): Pass location to array_to_pointer_conversion.
	(build_c_cast): Pass location to digest_init.
	(build_modify_expr): New location argument.
	(convert_for_assignment): Same.
	(store_init_value): Same.
	(digest_init): Same.
	(output_init_element): Pass location to digest_init and
	array_to_pointer_conversion.
	(c_finish_return): Pass location to convert_for_assignment.
	* gimplify.c (gimplify_conversion): Pass location to
	maybe_fold_offset_to_address.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location
	to maybe_fold_stmt_addition.
	* c-omp.c (c_finish_omp_atomic): Pass new location to
	build_modify_expr.
	(c_finish_omp_for): Same.
	* c-common.c (overflow_warning): New argument.
	* c-common.h: New argument to build_modify_expr, overflow_warning.
	* c-parser.c (c_parser_declaration_or_fndef): Pass location to
	finish_decl.
	(c_parser_initializer): Pass location to
	default_function_array_conversion.
	(c_parser_initelt): Same.
	(c_parser_initval): Same.
	(c_parser_asm_operands): Same.
	(c_parser_expr_no_commas): Same.  Pass location to build_modify_expr.
	(c_parser_conditional_expression): Same.
	(c_parser_binary_expression): Add location info to stack.  Use it.
	(c_parser_unary_expression): Pass location to
	default_function_array_conversion, parser_build_unary_op,
	build_indirect_ref, c_parser_postfix_expression_after_primary.
	(c_parser_postfix_expression_after_primary): New location argument.
	Use it.
	(c_parser_expression_conv): Pass location to
	default_function_array_conversion.
	(c_parser_expr_list): Same.
	(c_parser_omp_atomic): Same.
	(c_parser_omp_for_loop): Same.
	* c-tree.h: (struct c_declarator): Add comment to id_loc.
	(build_array_declarator): New argument.
	* c-decl.c (build_array_declarator): Add location argument.
	(grokdeclarator): Set id_loc for cdk_array.
	* c-parser.c (c_parser_direct_declarator_inner): Pass location to
	build_array_declarator.
	* tree.c (build_omp_clause): Add location argument.
	* tree.h (OMP_CLAUSE_HAS_LOCATION): New macro.
	(OMP_CLAUSE_LOCATION): New macro.
	(struct tree_omp_clause): Add location field.
	(build_omp_clause): Add argument.
	* testsuite/gcc.dg/gomp/for-1.c: Fix column.
	* cp/pt.c (tsubst_omp_for_iterator): Pass location to
	build_omp_clause.
	* cp/parser.c (cp_parser_omp_var_list_no_open): Same.
	(cp_parser_omp_clause_collapse): Same.
	(cp_parser_omp_clause_default): Same.
	(cp_parser_omp_clause_if): Same.
	(cp_parser_omp_clause_nowait): Same.
	(cp_parser_omp_clause_num_threads): Same.
	(cp_parser_omp_clause_ordered): Same.
	(cp_parser_omp_clause_schedule): Same.
	(cp_parser_omp_clause_untied): Same.
	(cp_parser_omp_for_loop): Same.
	(cp_parser_omp_parallel): Pass location to c_split_parallel_clauses.
	* c-tree.h (c_start_case): Add location argument.
	(c_process_expr_stmt): Same.
	(c_finish_goto_*): Same.
	* tree-parloops.c (initialize_reductions): Pass location to
	build_omp_clause.
	(create_parallel_loop): Same.
	* fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same.
	(gfc_trans_omp_reduction_list): Same.
	(gfc_trans_omp_clauses): Same.
	(gfc_trans_omp_do): Same.
	* c-typeck.c (c_finish_goto_label): Same.
	(c_finish_goto_ptr): New location argument.
	(c_start_case): Same.
	(emit_side_effect_warnings): Same.
	(c_process_expr_stmt): Same.
	(c_finish_stmt_expr): Same.
	(c_finish_omp_clauses): Use error_at instead of error.
	* gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to
	build_omp_clause.
	* c-omp.c (c_split_parallel_clauses): New location argument.
	* tree-nested.c (convert_nonlocal_reference_stmt): Pass location
	to build_omp_clause.
	(convert_local_reference_stmt): Same.
	(convert_gimple_call): Same.
	* c-common.h (c_split_parallel_clauses): New argument.
	* c-parser.c (c_parser_statement_after_labels): Pass location to
	c_finish_goto_label.
	(c_parser_switch_statement): Pass location to c_start_case.
	(c_parser_for_statement): Pass location to c_finish_expr_stmt,
	and c_process_expr_stmt.
	(c_parser_omp_variable_list): Add location argument.
	(c_parser_omp_clause_collapse): Pass location to
	build_omp_clause.
	(c_parser_omp_clause_default): Same.
	(c_parser_omp_clause_if): Same.
	(c_parser_omp_clause_num_threads): Same.
	(-c_parser_omp_clause_ordered): Same.
	(c_parser_omp_clause_reduction): Pass location to
	c_parser_omp_variable_list.
	(c_parser_omp_clause_schedule): Pass location to build_omp_clause.
	(c_parser_omp_clause_untied): Same.
	(c_parser_omp_for_loop): Pass location to c_process_expr_stmt.
	(c_parser_omp_parallel): Pass location to
	c_split_parallel_clauses.
	* c-tree.h (check_for_loop_decls, undeclared_variable,
	build_component_ref, build_array_ref, build_external_ref,
	c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op,
	build_conditional_expr, build_compound_expr, c_cast_expr,
	build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr,
	c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New
	argument.
	* c-semantics.c (build_stmt): Same.
	(build_case_label): Same.
	* c-decl.c (c_finish_incomplete_decl): Pass location on down.
	(undeclared_variable): New argument.
	(make_label): Same.
	(lookup_label): Pass location on down.
	(define_label): Same.
	(finish_decl): Same.
	(build_compound_literal): Same.
	(finish_struct): Same.
	(finish_function): Do not set location here.
	(check_for_loop_decls): New argument.
	* tree.c (save_expr): Set location.
	(build_empty_stmt): New argument.
	* tree.h (build_empty_stmt): New argument to build_empty_stmt.
	(CAN_HAVE_LOCATION_P): Make sure we have a non empty node.
	* builtins.c (gimplify_va_arg_expr): Use locations.
	(expand_builtin_sync_operation): Same.
	* c-typeck.c (build_component_ref): New argument.
	(build_array_ref): Same.
	(build_external_ref): Same.
	(c_expr_sizeof_expr): Same.
	(c_expr_sizeof_type): Same.
	(parser_build_unary_op): Same.
	(build_conditional_expr): Same.
	(build_compound_expr): Pass location on down.
	(build_compound_expr): New argument.
	(build_c_cast): Same.
	(c_cast_expr): Same.
	(build_asm_expr): Same.
	(c_finish_return): Same.
	(c_process_expr_stmt): Pass location on down.
	(c_finish_stmt_expr): New argument.
	(push_clenaup): Same.
	(c_finish_omp_parallel): Same.
	(c_finish_omp_task): Same.
	* gimplify.c (gimplify_call_expr): Pass location on down.
	* c-omp.c (c_finish_omp_master): New argument.
	(c_finish_omp_critical): Same.
	(c_finish_omp_ordered): Same.
	(c_finish_omp_barrier): Same.
	(-c_finish_omp_taskwait): Same.
	(c_finish_omp_atomic): Same.
	(c_finish_omp_flush): Same.
	* tree-inline.c (copy_tree_body_r): Pass location on down.
	(inline_forbidden_p): Remove use of input_location.
	* c-gimplify.c (c_build_bind_expr): New argument.
	* c-common.c (c_common_truthvalue_conversion): Pass location on down.
	(c_sizeof_or_alignof_type): New argument.
	(c_alignof_expr): Same.
	(build_va_arg): Same.
	(c_add_case_label): Same.
	* c-common.h (c_sizeof_or_alignof_type, c_alignof_expr,
	c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label,
	c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt,
	c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
	c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush,
	c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses):
	New argument.
	* stub-objc.c (objc_build_selector_expr): Same.
	(objc_build_throw_stmt): Same.
	* c-parser.c (c_parser_declaration_or_fndef): Pass location on down.
	(c_parser_initelt): Same.
	(c_parser_compound_statement): Same.
	(c_parser_compound_statement_nostart): Same.
	(c_parser_label): Same.
	(c_parser_statement_after_labels): Same.
	(c_parser_if_body): Same.
	(c_parser_else_body): Same.
	(c_parser_if_statement): Same.
	(c_parser_switch_statement): Same.
	(c_parser_while_statement): Same.
	(c_parser_do_statement): Same.
	(c_parser_for_statement): Same.
	(c_parser_asm_statement): Same.
	(c_parser_conditional_expression): Same.
	(c_parser_binary_expression): Same.
	(c_parser_cast_expression): Same.
	(c_parser_unary_expression): Same.
	(c_parser_sizeof_expression): Same.
	(c_parser_alignof_expression): Same.
	(c_parser_postfix_expression): Same.
	(c_parser_expression): Same.
	(c_parser_objc_receiver): Same.
	(c_parser_omp_variable_list): Same.
	(c_parser_omp_structured_block): Same.
	(c_parser_omp_atomic): New argument.
	(c_parser_omp_barrier): Same.
	(c_parser_omp_critical): Same.
	(c_parser_omp_flush): Pass location on down.
	(c_parser_omp_for_loop): New argument.
	(c_parser_omp_for): Same.
	(c_parser_omp_master): Same.
	(c_parser_omp_ordered): Same.
	(c_parser_omp_sections_scope): Same.
	(c_parser_omp_sections): Same.
	(c_parser_omp_parallel): Same.
	(c_parser_omp_single): Same.
	(c_parser_omp_task): Same.
	(c_parser_omp_taskwait): Pass location on down.
	(c_parser_omp_construct): Same.
	(c_parser_omp_threadprivate): Same.
	* dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h,
	builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c,
	tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c,
	c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c,
	c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c,
	emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c,
	rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h,
	tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c,
	config/i386/i386.c, stmt.c:
	Add location argument to the following function definitions and/or
	function calls: build_decl, objcp_start_struct, objcp_finish_struct,
	start_struct, finish_struct, PUSH_FIELD, create_artificial_label,
	cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl,
	build_compound_literal, parser_xref_tag, resolve_overloaded_builtin,
	do_case, c_finish_bc_stmt, build_compound_literal,
	build_function_call.
	* c-decl.c (build_compound_literal): Add location argument.
	Make all diagnostic calls use location.
	(start_struct): Same.
	(finish_struct): Same.
	(start_enum): Same.
	(build_enumerator): Same.
	(start_function): Same.
	(grokdeclarator): Make all diagnostic calls use location.
	(store_parm_decls_oldstyle): Same.
	* c-typeck.c (build_function_call): Add location argument.
	Make all diagnostic calls use location.
	(do_case): Same.
	(c_finish_bc_stmt): Same.
	* tree-nested.c (get_trampoline_type): Add argument.
	Pass location to build_decl.
	(lookup_tramp_for_decl): Pass location to get_trampoline_type.
	* rtl.h (RTL_LOCATION): New.
	* c-common.c (c_add_case_label): Add location argument.
	Make all diagnostic calls use location.
	* c-common.h: Add location argument to make_fname_decl, do_case,
	c_add_case_label, build_function_call, resolve_overloaded_builtin.
	* c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc.
	Set it appropriately for every case.  Pass enum_loc to start_enum
	call.  Pass value_loc first to build_enumerator.  Pass enum_loc to
	parser_xref_tag.
	(c_parser_struct_or_union_specifier): Save location.  Use it for
	start_struct, finish_struct, and parser_xref_tag.
gcc/testsuite/
	* gcc.dg/old-style-prom-3.c: Add column info.
	* gcc.dg/overflow-warn-1.c
	* gcc.dg/gomp/pr27415.c
	* gcc.dg/gomp/for-1.c: Same.
	* gcc.dg/enum-compat-1.c: Same.
	* gcc.dg/c99-tag-3.c: Same.
	* gcc.dg/Wredundant-decls-2.c: Same.
	* gcc.dg/func-ptr-conv-1.c: Same.
	* gcc.dg/asm-wide-1.c: Same.
	* gcc.dg/nofixed-point-2.c: Same.
	* gcc.dg/cpp/line3.c: Same.
	* gcc.dg/array-10.c: Same.
	* gcc.dg/c99-vla-jump-1.c: Same.
	* gcc.dg/pr20368-1.c: Same.
	* gcc.dg/Wshadow-3.c: Same.
	* gcc.dg/c90-const-expr-8.c: Same.
	* gcc.dg/label-decl-2.c: Same.
	* gcc.dg/dremf-type-compat-2.c: Same.
	* gcc.dg/c90-const-expr-5.c: Same.
	* gcc.dg/builtins-30.c: Same.
	* gcc.dg/Warray-bounds.c: Same.
	* gcc.dg/Wcxx-compat-2.c: Same.
	* gcc.dg/tree-ssa/col-1.c: Same.
	* gcc.dg/old-style-prom-2.c: Same.
	* gcc.dg/cast-function-1.c: Same.
	* gcc.dg/pr15698-1.c: Same.
	* gcc.dg/dremf-type-compat-3.c: Same.
	* gcc.dg/vla-8.c: Same.
	* gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct
	line.
	* gcc.dg/label-decl-2.c: Move label diagnostic to correct line.
	* gcc.dg/old-style-prom-3.c: Check for error on the correct line.
	* gcc.dg/enum-compat-1.c: Same.
	* gcc.dg/dremf-type-compat-2.c: Same.
	* gcc.dg/old-style-prom-2.c: Same.
	* gcc.dg/pr15698-1.c: Same.
	* gcc.dg/pr20368-1.c: Same.
	* gcc.dg/dremf-type-compat-3.c: Same.
	* gcc.dg/builtins-30.c: Same.  Test for columns.
gcc/objcp/
	* objcp-decl.h (c_end_compound_stmt): New argument.
	* objcp-decl.c (objcp_start_struct): Add argument.
	(objcp_finish_struct): Same.
gcc/cp/
	* typeck.c (cp_build_binary_op): Pass location to overflow_warning.
	(build_modify_expr): New arg.
	* semantics.c (finish_unary_op_expr): Pass location to
	overflow_warning.
	(handle_omp_for_class_iterator): Pass location to build_modify_expr.
	* typeck.c (cxx_sizeof_or_alignof_type): Pass location to
	c_sizeof_or_alignof_type.
	(build_array_ref): New argument.
	(build_compound_expr): Same.
	(build_const_cast): Same.
	(build_ptrmemfunc): Pass location to build_c_cast.
	* init.c (avoid_placement_new_aliasing): Pass location to
	build_stmt.
	(build_vec_delete_1): Pass location to cp_build_modify_expr,
	build_compound_expr.
	* class.c (build_vtbl_ref_1): Pass location to build_array_ref.
	* decl.c (poplevel): Pass location to c_build_bind_expr.
	(finish_case_label): Pass location to build_case_label.
	(finish_constructor_body): Same.
	(finish_destructor_body): Pass location to build_stmt.
	(cxx_maybe_build_cleanup): Same, but to build_compound_expr.
	* call.c (build_new_op): Pass location to build_array_ref.
	(build_x_va_arg): Pass location to build_va_arg.
	* except.c (expand_end_catch_block): Pass location to
	build_stmt.
	* cp-tree.h (build_array_ref): New argument.
	(build_compound_expr): Same.
	(build_c_cast): Same.
	* cp-gimplify.c (gimplify_if_stmt): Pass location on down.
	(gimplify_switch_stmt): Same.
	* typeck2.c (split_nonconstant_init_1): Same.
	* pt.c (tsubst_copy): Same.
	* semantics.c (add_decl_expr): Same.
	(do_poplevel): Same.
	(push_cleanup): Same.
	(finish_goto_stmt): Same.
	(finish_expr_stmt): Same.
	(begin_if_stmt): Same.
	(begin_while_stmt): Same.
	(begin_do_stmt): Same.
	(finish_return_stmt): Same.
	(begin_for_stmt): Same.
	(finish_break_stmt): Same.
	(finish_continue_stmt): Same.
	(begin_switch_stmt): Same.
	(begin_try_block): Same.
	(begin_handler): Same.
	(finish_asm_stmt): Same.
	(finish_label_stmt): Same.
	(finish_stmt_expr_expr): Same.
	(finalize_nrv_r): Same.
	(finish_omp_atomic): Same.
	* name-lookup.c (do_using_directive): Same.
	* decl2.c (grok_array_decl): Same.
	* parser.c (cp_parser_cast_expression): Same.
	(cp_parser_selection_statement): Same.
	(cp_parser_implicitly_scoped_statement): Same.
	(cp_parser_objc_selector_expression): Same.
	(cp_parser_objc_synchronized_statement): Same.
	(cp_parser_objc_throw_statement): Same.
	(cp_parser_omp_critical): Same.
	(cp_parser_omp_master): Same.
	* typeck.c (build_function_call): Add location argument.
	* init.c: Add location argument to all build_decl calls.
	* class.c: Same.
	* method.c: Same.
	* rtti.c: Same.
	* tree.c: Same.
	* pt.c: Same.
	* semantics.c: Same.
	* lex.c: Same.
	* decl2.c: Same.
	* cp-gimplify.c: Same.
	* decl.c: Same.
	(cp_make_fname_decl): Add location argument.  Pass location ot
	build_decl.
	(finish_case_label): Same.
	* cp-tree.h (finish_case_label): Add location argument.
	* parser.c (cp_parser_label_for_labeled_statement): Pass location to
	finish_case_label.
gcc/fortran/
	* trans-array.c (gfc_trans_allocate_array_storage): Pass
	location on down.
	(gfc_trans_array_constructor_value): Same.
	(gfc_trans_scalarized_loop_end): Same.
	(gfc_conv_ss_startstride): Same.
	(gfc_trans_g77_array): Same.
	(gfc_trans_dummy_array_bias): Same.
	(gfc_conv_array_parameter): Same.
	(structure_alloc_comps): Same.
	* trans-expr.c (gfc_conv_function_call): Same.
	(fill_with_spaces): Same.
	(gfc_trans_string_copy): Same.
	(gfc_trans_scalar_assign): Same.
	* trans-stmt.c (gfc_trans_goto): Same.
	(gfc_trans_if_1): Same.
	(gfc_trans_simple_do): Same.
	(gfc_trans_do): Same.
	(gfc_trans_do_while): Same.
	(gfc_trans_logical_select): Same.
	(gfc_trans_select): Same.
	(gfc_trans_forall_loop): Same.
	(gfc_trans_nested_forall_loop): Same.
	(generate_loop_for_temp_to_lhs): Same.
	(generate_loop_for_rhs_to_temp): Same.
	(gfc_trans_forall_1): Same.
	(gfc_trans_where_assign): Same.
	(gfc_trans_where_3): Same.
	(gfc_trans_allocate): Same.
	* trans.c (gfc_finish_block): Same.
	(gfc_trans_runtime_check): Same.
	(gfc_call_malloc): Same.
	(gfc_allocate_with_status): Same.
	(gfc_call_free): Same.
	(gfc_deallocate_with_status): Same.
	(gfc_call_realloc): Same.
	(gfc_trans_code): Same.
	* trans-decl.c (gfc_init_default_dt): Same.
	(gfc_generate_constructors): Same.
	* trans-io.c (gfc_trans_io_runtime_check): Same.
	* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same.
	(gfc_conv_intrinsic_fdate): Same.
	(gfc_conv_intrinsic_ttynam): Same.
	(gfc_conv_intrinsic_minmax): Same.
	(gfc_conv_intrinsic_minmax_char): Same.
	(gfc_conv_intrinsic_anyall): Same.
	(gfc_conv_intrinsic_count): Same.
	(gfc_conv_intrinsic_arith): Same.
	(gfc_conv_intrinsic_minmaxloc): Same.
	(gfc_conv_intrinsic_minmaxval): Same.
	(gfc_conv_intrinsic_rrspacing): Same.
	(gfc_conv_intrinsic_array_transfer): Same.
	(gfc_conv_intrinsic_trim): Same.
	(gfc_conv_intrinsic_repeat): Same.

From-SVN: r148442
2009-06-12 22:06:47 +00:00
Richard Guenther 4d7a65ea61 re PR tree-optimization/38964 (TBAA side-effects of C++ new still missing)
2009-05-22  Richard Guenther  <rguenther@suse.de>

	PR middle-end/38964
	* alias.c (write_dependence_p): Do not use TBAA for answering
	anti-dependence or output-dependence.
	* tree-ssa-structalias.c (set_uids_in_ptset): Remove TBAA pruning
	code.
	(emit_pointer_definition): Remove.
	(emit_alias_warning): Likewise.
	(find_what_var_points_to): Remove TBAA pruning code.
	(find_what_p_points_to): Likewise.  Do not warn about strict-aliasing
	violations.
	(compute_points_to_sets): Remove code computing the set of
	dereferenced pointers.
	* tree-data-ref.c (dr_may_alias_p): Properly use the split
	oracle for querying anti and output dependencies.
	* tree-ssa-alias.c (refs_may_alias_p_1): Add argument specifying
	if TBAA may be applied.
	(refs_anti_dependent_p): New function.
	(refs_output_dependent_p): Likewise.
	* tree-ssa-alias.h (refs_anti_dependent_p): Declare.
	(refs_output_dependent_p): Likewise.

	* doc/tree-ssa.texi (Memory model): New section.

	testsuite/
	* g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: XFAIL.
	* gcc.dg/Wstrict-aliasing-converted-assigned.c: Likewise.
	* gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: Likewise.

	* doc/c-tree.texi (CHANGE_DYNAMIC_TYPE_EXPR): Remove.
	* doc/gimple.texi (GIMPLE_CHANGE_DYNAMIC_TYPE): Remove.

	* cfgexpand.c (expand_gimple_basic_block): Do not handle
	GIMPLE_CHANGE_DYNAMIC_TYPE or CHANGE_DYNAMIC_TYPE_EXPR.
	* expr.c (expand_expr_real_1): Likewise.
	* gimple-low.c (lower_stmt): Likewise.
	* gimple-pretty-print.c (dump_gimple_stmt): Likewise.
	(dump_gimple_cdt): Remove.
	* gimple.c (gss_for_code): Do not handle GIMPLE_CHANGE_DYNAMIC_TYPE.
	(gimple_size): Likewise.
	(walk_gimple_op): Likewise.
	(is_gimple_stmt): Likewise.
	(walk_stmt_load_store_addr_ops): Likewise.
	(gimple_build_cdt): Remove.
	* gimple.def (GIMPLE_CHANGE_DYNAMIC_TYPE): Remove.
	* gimple.h (gimple_cdt_new_type): Remove.
	(gimple_cdt_new_type_ptr): Likewise.
	(gimple_cdt_set_new_type): Likewise.
	(gimple_cdt_location): Likewise.
	(gimple_cdt_location_ptr): Likewise.
	(gimple_cdt_set_location): Likewise.
	* gimplify.c (gimplify_expr): Do not handle CHANGE_DYNAMIC_TYPE_EXPR.
	* tree-cfg.c (remove_useless_stmts_1): Do not handle
	GIMPLE_CHANGE_DYNAMIC_TYPE.
	(verify_types_in_gimple_stmt): Likewise.
	* tree-inline.c (estimate_num_insns): Likewise.
	(expand_call_inline): Do not copy DECL_NO_TBAA_P.
	(copy_decl_to_var): Likewise.
	(copy_result_decl_to_var): Likewise.
	* tree-pretty-print.c (dump_generic_node): Do not handle
	CHANGE_DYNAMIC_TYPE_EXPR.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-ssa-structalias.c (struct variable_info): Remove
	no_tbaa_pruning member.
	(new_var_info): Do not set it based on DECL_NO_TBAA_P.
	(unify_nodes): Do not copy it.
	(find_func_aliases): Do not handle GIMPLE_CHANGE_DYNAMIC_TYPE.
	(dump_solution_for_var): Do not dump no_tbaa_pruning state.
	(set_uids_in_ptset): Do not check it.
	(find_what_var_points_to): Likewise.
	(compute_tbaa_pruning): Remove.
	(compute_points_to_sets): Do not call it.
	* tree.c (walk_tree_1): Do not handle CHANGE_DYNAMIC_TYPE_EXPR.
	* tree.def (CHANGE_DYNAMIC_TYPE_EXPR): Remove.
	* tree.h (CHANGE_DYNAMIC_TYPE_NEW_TYPE): Remove.
	(CHANGE_DYNAMIC_TYPE_LOCATION): Likewise.
	(DECL_NO_TBAA_P): Likewise.
	(struct tree_decl_common): Move no_tbaa_flag to unused flags section.
	* omp-low.c (copy_var_decl): Do not copy DECL_NO_TBAA_P.
	(expand_omp_atomic_pipeline): Do not set it.
	* print-tree.c (print_node): Do not dump it.
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce): Remove
	redundant check.

	cp/
	* init.c (avoid_placement_new_aliasing): Remove.
	(build_new_1): Do not call it.

From-SVN: r147805
2009-05-22 20:41:31 +00:00
Richard Guenther 150e39291c tree-ssa-sccvn.c (copy_reference_ops_from_ref): Record TMR_ORIGINAL.
2009-05-22  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Record
	TMR_ORIGINAL.  Always either record TMR_SYMBOL or TMR_BASE.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle
	TARGET_MEM_REF.
	(create_expression_by_pieces): Only convert if necessary.
	* gimplify.c (gimplify_expr): Handle TARGET_MEM_REF.
	* tree-ssa-loop-im.c (gen_lsm_tmp_name): Handle INTEGER_CST.

From-SVN: r147779
2009-05-21 22:43:19 +00:00
Paolo Bonzini f5a1f0d01f re PR middle-end/40026 (ICE during gimplify_init_constructor)
2009-05-11  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/40026
	* gimplify.c (gimplify_init_constructor): Change initial conditional
	to assertion.  Rewrite TREE_OPERAND (*expr_p, 1) after
	optimize_compound_literals_in_ctor.

testsuite:
2009-05-11  Paolo Bonzini  <bonzini@gnu.org>

	* gcc.c-torture/compile/pr40026.c: New testcase.

From-SVN: r147386
2009-05-11 16:05:45 +00:00
Jakub Jelinek 32f579f6eb re PR middle-end/39666 (spurious warning with ranged-switch statements)
PR middle-end/39666
	* gimplify.c (gimplify_switch_expr): If case labels cover the whole
	range of the type, but default label is missing, add it with one
	of the existing labels instead of adding a new label for it.

	* gcc.dg/pr39666-1.c: New test.
	* gcc.dg/pr39666-2.c: Likewise.
	* g++.dg/warn/Wuninitialized-4.C: Likewise.
	* g++.dg/warn/Wuninitialized-5.C: Likewise.
	* gfortran.dg/pr39666-1.f90: Likewise.
	* gfortran.dg/pr39666-2.f90: Likewise.

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

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

From-SVN: r147111
2009-05-05 00:44:36 +01:00
Richard Guenther 4636b850f6 re PR regression/40001 (r146817 broke libgloss build for SPU)
2009-05-02  Richard Guenther  <rguenther@suse.de>

	PR middle-end/40001
	* tree-ssa.c (execute_update_addresses_taken): Properly check
	if we can mark a variable DECL_GIMPLE_REG_P.
	* gimple.c (is_gimple_reg): Re-order check for DECL_GIMPLE_REG_P
	back to the end of the function.
	(is_gimple_reg_type): Remove complex type special casing.
	* gimplify.c (gimplify_bind_expr): Do not set DECL_GIMPLE_REG_P
	if not optimizing.

	* gcc.target/spu/pr40001.c: New testcase.

From-SVN: r147064
2009-05-02 17:49:32 +00:00
Richard Guenther c685de4a22 re PR c/39928 (gimplify_expr failure)
2009-04-27  Richard Guenther  <rguenther@suse.de>

	PR middle-end/39928
	* gimplify.c (gimplify_expr): If we are required to create
	a temporary make sure it ends up as register.

	* gcc.c-torture/compile/pr39928-1.c: New testcase.
	* gcc.c-torture/compile/pr39928-2.c: Likewise.

From-SVN: r146846
2009-04-27 15:50:05 +00:00
Jakub Jelinek 77f2a97066 tree-nested.c (get_nonlocal_vla_type): If not optimizing, call note_nonlocal_vla_type for nonlocal VLAs.
* tree-nested.c (get_nonlocal_vla_type): If not optimizing, call
	note_nonlocal_vla_type for nonlocal VLAs.
	(note_nonlocal_vla_type, note_nonlocal_block_vlas,
	contains_remapped_vars, remap_vla_decls): New functions.
	(convert_nonlocal_reference_stmt): If not optimizing, call
	note_nonlocal_block_vlas on GIMPLE_BIND block vars.
	(nesting_copy_decl): Return {VAR,PARM,RESULT}_DECL unmodified
	if it wasn't found in var_map.
	(finalize_nesting_tree_1): Call remap_vla_decls.  If outermost
	GIMPLE_BIND doesn't have gimple_bind_block, chain debug_var_chain
	to BLOCK_VARS (DECL_INITIAL (root->context)) instead of calling
	declare_vars.
	* gimplify.c (nonlocal_vlas): New variable.
	(gimplify_var_or_parm_decl): Add debug VAR_DECLs for non-local
	referenced VLAs.
	(gimplify_body): Create and destroy nonlocal_vlas.

	* trans-decl.c: Include pointer-set.h.
	(nonlocal_dummy_decl_pset, tree nonlocal_dummy_decls): New variables.
	(gfc_nonlocal_dummy_array_decl): New function.
	(gfc_get_symbol_decl): Call it for non-local dummy args with saved
	descriptor.
	(gfc_get_symbol_decl): Set DECL_BY_REFERENCE when needed.
	(gfc_generate_function_code): Initialize nonlocal_dummy_decl{s,_pset},
	chain it to outermost block's vars, destroy it afterwards.
	* Make-lang.in (trans-decl.o): Depend on pointer-set.h.

From-SVN: r146810
2009-04-26 20:47:54 +02:00
Ian Lance Taylor 32e8bb8ebf combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
gcc/:
	* combine.c (record_value_for_reg): Change 0 to VOIDmode, twice.
	(record_dead_and_set_regs): Likewise.
	* df.h (struct df_mw_hardreg): Change flags field to int.
	(struct df_base_ref): Likewise.
	(struct df): Change changeable_flags field to int.
	* df-scan.c (df_defs_record): Change clobber_flags to int.
	* dwarf2.h (enum dwarf_tag): Make lo_user and hi_user values enum
	constants rather than #define macros.
	(enum dwarf_attribute, enum dwarf_location_atom): Likewise.
	(enum dwarf_type, enum dwarf_endianity_encoding): Likewise.
	(enum dwarf_calling_convention): Likewise.
	(enum dwarf_line_number_x_ops): Likewise.
	(enum dwarf_call_frame_info): Likewise.
	(enum dwarf_source_language): Likewise.
	* dwarf2out.c (int_loc_descriptor): Add cast to enum type.
	(add_calling_convention_attribute): Likewise.
	* fold-const.c (fold_undefer_overflow_warnings): Add cast to enum
	type.
	(combine_comparisons): Change compcode to int.  Add cast to enum
	type.
	* genrecog.c (maybe_both_true_2): Change c to int.
	(write_switch): Likewise.  Add cast to enum type.
	* gimplify.c (gimplify_omp_for): Handle return values from
	gimplify_expr using MIN rather than bitwise or.
	(gimplify_expr): Add cast to enum type.
	* ipa-prop.c (update_jump_functions_after_inlining): Change
	IPA_BOTTOM to IPA_JF_UNKNOWN.
	* ira.c (setup_class_subset_and_memory_move_costs): Change mode to
	int.  Add casts to enum type.
	(setup_cover_and_important_classes): Change cl to int.  Add casts
	to enum type.
	(setup_class_translate): Change cl and mode to int.
	(ira_init_once): Change mode to int.
	(free_register_move_costs): Likewise.
	(setup_prohibited_mode_move_regs): Add casts to enum type.
	* langhooks.c (add_builtin_function_common): Rework assertion that
	value fits bitfield.
	* mcf.c (add_fixup_edge): Change type parameter to edge_type.
	* omega.c (omega_do_elimination): Avoid math on enum types.
	* optabs.c (expand_vec_shift_expr): Remove casts to int.
	* opts.c (set_debug_level): Change 2 to enum constant.  Use new
	int local to handle integral_argment value.
	* regmove.c (try_auto_increment): Change PUT_MODE to
	PUT_REG_NOTE_KIND.
	* reload.c (push_secondary_reload): Add casts to enum type.
	(secondary_reload_class, find_valid_class): Likewise.
	* reload1.c (emit_input_reload_insns): Likewise.
	* rtl.h (NOTE_VAR_LOCATION_STATUS): Likewise.
	* sel-sched.c (init_hard_regs_data): Change cur_mode to int.
	* sel-sched-ir.c (hash_with_unspec_callback): Change 0 to enum
	constant.
	* tree.c (build_common_builtin_nodes): Add casts to enum type.
	* tree-complex.c (complex_lattice_t): Typedef to int rather than
	enum type.
	(expand_complex_libcall): Add casts to enum type.
	* tree-into-ssa.c (get_ssa_name_ann): Change 0 to enum constant.
	* tree-vect-loop.c (vect_model_reduction_cost): Compare reduc_code
	with ERROR_MARK, not NUM_TREE_CODES.
	(vect_create_epilog_for_reduction): Likewise.
	(vectorizable_reduction): Don't initialize epiloc_reduc_code.
	When not using it, set it to ERROR_MARK rather than
	NUM_TREE_CODES.
	* tree-vect-patterns.c (vect_pattern_recog_1): Change vec_mode to
	enum machine_mode.
	* tree-vect-stmts.c (new_stmt_vec_info): Change 0 to
	vect_unused_in_loop.  Change 0 to loop_vect.
	* tree-vectorizer.c (vect_set_verbosity_level): Add casts to enum
	type.
	* var-tracking.c (get_init_value): Change return type to enum
	var_init_status.
	* vec.h (DEF_VEC_FUNC_P) [iterate]: Cast 0 to type T.
	* config/arm/arm.c (fp_model_for_fpu): Change to array to enum
	arm_fp_model.
	(arm_override_options): Add casts to enum type.
	(arm_emit_tls_decoration): Likewise.
	* config/i386/i386.c (ix86_function_specific_restore): Add casts
	to enum type.
	* config/i386/i386-c.c (ix86_pragma_target_parse): Likewise.
	* config/ia64/ia64.c (ia64_expand_compare): Change magic to int.
	* config/rs6000/rs6000.c (rs6000_override_options): Add casts to
	enum type.
	* config/s390/s390.c (code_for_builtin_64): Change to array of
	enum insn_code.
	(code_for_builtin_31): Likewise.
	(s390_expand_builtin): Change code_for_builtin to enum insn_code
	const *.
	* config/sparc/sparc.c (sparc_override_options): Change value
	field in struct code_model to enum cmodel.  In initializer change
	0 to NULL and add cast to enum type.

	* c-typeck.c (build_modify_expr): Add lhs_origtype parameter.
	Change all callers.  Issue a -Wc++-compat warning using
	lhs_origtype if necessary.
	(convert_for_assignment): Issue -Wc++-compat warnings about
	invalid conversions to enum type on assignment.
	* c-common.h (build_modify_expr): Update declaration.

gcc/cp/:
	* call.c (build_temp): Change 0 to enum constant.
	* cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
	type.
	* cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
	* decl2.c (constrain_visibility): Likewise.
	* parser.c (cp_lexer_get_preprocessor_token): Likewise.
	(cp_parser_flags): Typedef to int rather than enum type.
	(cp_parser_expression_stack_entry): Change prec field to enum
	cp_parser_prec.

	* typeck.c (build_modify_expr): Add lhs_origtype parameter.
	Change all callers.

gcc/fortran/:
	* gfortran.h (enum gfc_symbol_type): New named enum type, broken
	out of struct gfc_symbol.
	(struct gfc_symbol): Use enum gfc_symbol_type.
	(enum gfc_array_ref_dimen_type): New named enum type, broken out
	of struct gfc_array_ref).
	(struct gfc_array_ref): Use enum gfc_array_ref_dimen_type.
	(mod_pointee_as): Update declaration.
	* decl.c (add_global_entry): Change type to enum gfc_symbol_type.
	(gfc_mod_pointee_as): Change return type to "match".
	* module.c (mio_array_ref): Add cast to enum type.
	(mio_symbol): Likewise.
	* resolve.c (resolve_global_procedure): Change type to enum
	gfc_symbol_type.
	* trans-io.c (gfc_build_st_parameter): Change type to unsigned
	int.

gcc/java/:
	* jcf-parse.c (handle_constant): Add cast to enum type.

gcc/objc/:
	* objc-act.c (get_super_receiver): Update calls to
	build_modify_expr to pass new argument.

gcc/testsuite/:
	* gcc.dg/Wcxx-compat-4.c: New testcase.

From-SVN: r146735
2009-04-24 15:31:38 +00:00
Eric Botcazou bbaba73f06 gimplify.c (gimplify_modify_expr_rhs): Do not do a direct assignment from the constructor either if the target is volatile.
* gimplify.c (gimplify_modify_expr_rhs) <VAR_DECL>: Do not do a direct
	assignment from the constructor either if the target is volatile.
ada/
	* einfo.ads (Is_True_Constant): Lift restriction on atomic objects.
	* sinfo.ads (Object Declaration): Likewise.
	(Assignment Statement): Likewise.
	* freeze.adb (Expand_Atomic_Aggregate): Remove useless test.
	Do not force Is_True_Constant to false on the temporary.
	(Freeze_Entity): Do not force Is_True_Constant to false on names on
	the RHS of object declarations.
	* gcc-interface/trans.c (lvalue_required_p) <N_Object_Declaration>:
	New case.  Return 1 if the object is atomic.
	<N_Assignment_Statement>: Likewise.

From-SVN: r146652
2009-04-23 16:40:55 +00:00
Eric Botcazou ca80e52b01 c-common.c (c_common_truthvalue_conversion): Use LOCATION to build NE_EXPR operations as well.
* c-common.c (c_common_truthvalue_conversion): Use LOCATION to build
	NE_EXPR operations as well.
	* c-parser.c (c_parser_condition): Do not set location information on
	the condition.
	(c_parser_conditional_expression): Likewise.
	(c_parser_binary_expression): Set location information on operators.
	* c-typeck.c (build_unary_op) <TRUTH_NOT_EXPR>: Reset the location if
	TRUTH_NOT_EXPR has been folded.
	* fold-const.c (fold_truth_not_expr): Copy location information from
	the incoming expression to the outgoing one.
	* gimplify.c (shortcut_cond_r): Add locus parameter.  Pass it to
	recursive calls on the LHS of the operator but pass that of the
	operator to recursive calls on the RHS of the operator.  Set it
	on the COND_EXPR.
	(shortcut_cond_expr): Set the locus of the operator on the second
	COND_EXPR and that of the expression on the first in degenerate cases.
	Pass the locus of the expression to calls to shortcut_cond_r.
	Set the locus of the 'then' block on the associated jump, if any.
	(gimplify_boolean_expr): Add locus parameter.  Set it on the COND_EXPR.
	(gimplify_expr) <TRUTH_ANDIF_EXPR>: Pass the locus of the outer
	expression to call to gimplify_boolean_expr.
ada/
	* gcc-interface/trans.c (gnat_to_gnu): Do not overwrite location info.

From-SVN: r146532
2009-04-21 17:17:13 +00:00
Richard Guenther ba4d8f9d37 re PR middle-end/23401 (Gimplifier produces too many temporaries)
2009-03-31  Richard Guenther  <rguenther@suse.de>

	PR middle-end/23401
	PR middle-end/27810
	* tree.h (DECL_GIMPLE_FORMAL_TEMP_P): Remove.
	(struct tree_decl_with_vis): Remove gimple_formal_temp member.
	* tree-eh.c (lower_eh_constructs_2): Move LHS assignment to
	a separate statement.
	* gimplify.c (pop_gimplify_context): Remove formal temp handling.
	(lookup_tmp_var): Likewise.
	(is_gimple_formal_tmp_or_call_rhs): Remove.
	(is_gimple_reg_or_call_rhs): Rename to ...
	(is_gimple_reg_rhs_or_call): ... this.
	(is_gimple_mem_or_call_rhs): Rename to ...
	(is_gimple_mem_rhs_or_call): ... this.
	(internal_get_tmp_var): Use is_gimple_reg_rhs_or_call.  Set
	DECL_GIMPLE_REG_P only if is_formal is true.
	(gimplify_compound_lval): Use is_gimple_reg.  Remove workaround
	for non-proper post-modify expression gimplification.
	(gimplify_self_mod_expr): For post-modify expressions gimplify
	the lvalue to a minimal lvalue.
	(rhs_predicate_for): Remove formal temp case.
	(gimplify_modify_expr_rhs): Likewise.
	(gimplify_addr_expr): Use is_gimple_reg.
	(gimplify_expr): Remove formal temp cases.
	(gimple_regimplify_operands): Likewise.
	* tree-ssa-pre.c (get_or_alloc_expr_for): Treat EXC_PTR_EXPR
	and FILTER_EXPR like constants.
	* gimple.c (walk_gimple_op): Fix val_only initialization, use
	is_gimple_reg.
	(is_gimple_formal_tmp_rhs): Remove.
	(is_gimple_reg_rhs): Remove special casing.
	(is_gimple_mem_rhs): Fix.
	(is_gimple_reg): Move DECL_GIMPLE_REG_P handling earlier.
	(is_gimple_formal_tmp_var): Remove.
	(is_gimple_formal_tmp_reg): Likewise.
	(is_gimple_min_lval): Allow invariant component ref parts.
	* gimple.h (is_gimple_formal_tmp_rhs, is_gimple_formal_tmp_var,
	is_gimple_formal_tmp_reg): Remove declarations.
	* tree-cfg.c (verify_expr): Verify that variables with address
	taken do not have DECL_GIMPLE_REG_P set.
	* tree-mudflap.c (mf_build_check_statement_for): Use
	force_gimple_operand instead of gimplify_expr.

	java/
	* java-gimplify.c (java_gimplify_expr): Do not manually gimplify
	the first operand of binary and comaprison expressions.

	* gcc.dg/tree-ssa/pr23401.c: New testcase.
	* gcc.dg/tree-ssa/pr27810.c: Likewise.

From-SVN: r145338
2009-03-31 10:23:44 +00:00
Paolo Bonzini 2ec5deb5c3 c-common.c (c_expand_expr, c_staticp): Remove.
2009-03-28  Paolo Bonzini  <bonzini@gnu.org>

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

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

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

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

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

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

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

From-SVN: r145256
2009-03-29 18:26:43 +00:00
Richard Guenther 628c189edb gimplify.c (mark_addressable): Export.
2009-03-27  Richard Guenther  <rguenther@suse.de>

	* gimplify.c (mark_addressable): Export.
	* tree-flow.h (mark_addressable): Declare.
	* tree-ssa-loop-manip.c (create_iv): Mark the base addressable.
	* tree-ssa.c (verify_phi_args): Verify that address taken
	variables have TREE_ADDRESSABLE set.

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

	* fold-const.c (build_fold_addr_expr_with_type_1): Rename back to ...
	(build_fold_addr_expr_with_type): ... this.  Remove in_fold handling.
	Do not mark decls TREE_ADDRESSABLE.
	(build_fold_addr_expr): Adjust.
	(fold_addr_expr): Remove.
	(fold_unary): Use build_fold_addr_expr.
	(fold_comparison): Likewise.
	(split_address_to_core_and_offset): Likewise.
	* coverage.c (tree_coverage_counter_addr): Mark the array decl
	TREE_ADDRESSABLE.
	* gimplify.c (mark_addressable): Do not exclude RESULT_DECLs.
	(gimplify_modify_expr_to_memcpy): Mark source and destination
	addressable.
	* omp-low.c (create_omp_child_function): Mark the object decl
	TREE_ADDRESSABLE.
	(lower_rec_input_clauses): Mark the var we take the address of
	TREE_ADDRESSABLE.
	(lower_omp_taskreg): Mark the sender decl TREE_ADDRESSABLE.

	fortran/
	* trans-array.c (gfc_conv_descriptor_data_addr): Use
	gfc_build_addr_expr instead of build_fold_addr_expr.
	(gfc_trans_allocate_array_storage, gfc_trans_array_constructor_value,
	gfc_trans_constant_array_constructor, gfc_conv_array_data,
	gfc_conv_expr_descriptor, gfc_conv_array_parameter): Likewise.
	* trans-expr.c (gfc_conv_missing_dummy, gfc_conv_variable,
	gfc_conv_function_val, gfc_conv_operator_assign,
	gfc_conv_subref_array_arg, gfc_conv_function_call,
	gfc_conv_expr_reference, gfc_trans_scalar_assign): Likewise.
	* trans-intrinsic.c (gfc_conv_intrinsic_exponent,
	gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate,
	gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax_char,
	gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_spacing,
	gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_set_exponent,
	gfc_conv_intrinsic_array_transfer, gfc_conv_intrinsic_transfer,
	gfc_conv_intrinsic_si_kind, gfc_conv_intrinsic_trim): Likewise.
	* trans-io.c (gfc_trans_io_runtime_check, set_parameter_ref,
	gfc_convert_array_to_string, gfc_trans_open, gfc_trans_close,
	build_filepos, gfc_trans_inquire, gfc_trans_wait,
	nml_get_addr_expr, transfer_namelist_element, build_dt,
	gfc_trans_dt_end, transfer_array_component, transfer_expr,
	transfer_array_desc, gfc_trans_transfer): Likewise.
	* trans-stmt.c (gfc_trans_allocate, gfc_trans_deallocate): Likewise.
	* trans.c (gfc_build_addr_expr): Mark the base of the address
	TREE_ADDRESSABLE.

From-SVN: r145142
2009-03-27 23:00:22 +00:00
Adam Nemet 498e51cabb gimplify.c (gimplify_call_expr): Don't set CALL_CANNOT_INLINE_P for functions for which the parameter types are...
* gimplify.c (gimplify_call_expr): Don't set CALL_CANNOT_INLINE_P
	for functions for which the parameter types are unknown.

testsuite/
	* gcc.dg/inline-33.c: New test.

From-SVN: r144801
2009-03-12 01:02:16 +00:00
Jakub Jelinek 9a9ba8d9b1 re PR tree-optimization/39394 (ICE in copy_tree_body_r)
PR tree-optimization/39394
	* gimplify.c (gimplify_type_sizes): Gimplify DECL_SIZE and
	DECL_SIZE_UNIT of variable length FIELD_DECLs.

	* gcc.c-torture/compile/pr39394.c: New test.

From-SVN: r144727
2009-03-09 15:01:29 +01:00
Jakub Jelinek 067dd3c96d re PR fortran/39354 (bad codegen for openmp atomics (Intel64 Fortran logical ops))
PR fortran/39354
	* gimplify.c (goa_stabilize_expr): Handle tcc_comparison,
	TRUTH_ANDIF_EXPR and TRUTH_ORIF_EXPR.

	* gfortran.dg/gomp/pr39354.f90: New test.

From-SVN: r144575
2009-03-03 17:43:42 +01:00
Jakub Jelinek 3ad6b2669b re PR middle-end/39154 (Miscompilation of VLAs in nested parallel regions)
PR middle-end/39154
	* gimplify.c (omp_notice_variable): If adding GOVD_SEEN
	bit to variable length decl's flags, add it also to its
	pointer replacement variable.

	* testsuite/libgomp.c/pr39154.c: New test.

From-SVN: r144111
2009-02-11 22:57:52 +01:00
Jakub Jelinek fc3103e7c9 re PR target/39139 (ICE with stringop and register var)
PR target/39139
	* function.h (struct function): Add has_local_explicit_reg_vars
	bit.
	* gimplify.c (gimplify_bind_expr): Set it if local DECL_HARD_REGISTER
	VAR_DECLs were seen.
	* tree-ssa-live.c (remove_unused_locals): Recompute
	cfun->has_local_explicit_reg_vars.
	* tree-ssa-sink.c (statement_sink_location): Don't sink BLKmode
	copies or clearings if cfun->has_local_explicit_reg_vars.

	* gcc.target/i386/pr39139.c: New test.

From-SVN: r144065
2009-02-10 17:22:29 +01:00
Richard Guenther bdec4dc7be re PR middle-end/39127 (Invalid GIMPLE with OpenMP)
2009-02-10  Richard Guenther  <rguenther@suse.de>

	PR middle-end/39127
	* gimplify.c (gimple_regimplify_operands): Always look if
	we need to create a temporary.

From-SVN: r144061
2009-02-10 14:55:15 +00:00
Steve Ellcey d0ea0759a0 re PR middle-end/38615 (invalid promotion to static from auto)
PR middle-end/38615
	* gimplify.c (gimplify_init_constructor): Fix promotion of const
	variables to static.
	* doc/invoke.texi (-fmerge-all-constants): Update description.

From-SVN: r143570
2009-01-22 17:02:21 +00:00
Jakub Jelinek e878958850 re PR middle-end/38676 (ICE during regimplification of GIMPLE_SWITCH)
PR middle-end/38676
	* gimplify.c (gimple_regimplify_operands): For GIMPLE_SWITCH
	only regimplify switch index.

	* gcc.dg/gomp/pr38676.c: New test.

From-SVN: r142970
2008-12-31 00:20:45 +01:00
Jakub Jelinek 329ad38002 re PR c++/38253 (g++.dg/ipa/iinline-1.C scan-ipa-dump inline fails on powerpc)
PR c++/38253
	* gimplify.c (gimplify_init_constructor): Don't force constructor
	into memory if there is just one nonzero element.

From-SVN: r142674
2008-12-11 10:15:17 +01:00
Jason Merrill 8afd015aab gimplify.c (gimplify_init_constructor): Revert to using < rather than <= for sparseness test.
* gimplify.c (gimplify_init_constructor): Revert to using < rather
        than <= for sparseness test.

From-SVN: r142618
2008-12-09 18:04:01 -05:00
Jason Merrill c69c7be10b re PR c++/38410 (g++.dg/eh/crossjump1.C (internal compiler error))
PR c++/38410
        * gimplify.c (gimplify_init_constructor): Don't write out a static
        copy of the CONSTRUCTOR for TREE_ADDRESSABLE types or small sparse
        initializers.

From-SVN: r142580
2008-12-09 01:04:50 -05:00
Jakub Jelinek 6fc4fb069d re PR tree-optimization/37716 (ice for legal C++ code with -O2 on 20080926)
PR tree-optimization/37716
	* gimplify.c (gimplify_expr): Allow COND_EXPR if
	gimplify_ctxp->allow_rhs_cond_expr.

From-SVN: r142476
2008-12-05 15:33:14 +01:00
Richard Guenther 050bbfebe2 re PR middle-end/36326 (gimplification of aggregate copies introduces extra aggregate copy)
2008-12-03  Richard Guenther  <rguenther@suse.de>

	PR middle-end/36326
	* gimplify.c (is_gimple_mem_or_call_rhs): Remove work-around for
	non-BLKmode types.

	* gcc.dg/tree-ssa/pr36326.c: New testcase.

From-SVN: r142396
2008-12-03 15:10:03 +00:00
Jakub Jelinek f9487002a4 re PR c++/36631 (attribute always_inline -> sorry, unimplemented: recursive inlining)
PR c++/36631
	* gimplify.c (gimplify_call_expr): Defer most of the cannot inline
	checking until GIMPLE lowering.
	* gimple-low.c (check_call_args): New function.
	(lower_stmt) <case GIMPLE_CALL>: Call it.

	* g++.dg/template/call5.C: New test.

From-SVN: r142033
2008-11-20 02:47:10 +01:00
Jakub Jelinek f93bc6f57c re PR tree-optimization/38104 (ICE segmentation fault (with -O3 when deref a NULL pointer in the code??))
PR tree-optimization/38104
	* gimplify.c (gimple_regimplify_operands): Add referenced vars
	before calling mark_symbols_for_renaming, not after it.

	* g++.dg/tree-ssa/pr38104.C: New test.

From-SVN: r141857
2008-11-14 13:26:05 +01:00
Jakub Jelinek cfcd6a9830 revert: gimplify.c (gimplify_expr): Drop TREE_OVERFLOW from INTEGER_CSTs.
Revert:
	2008-10-21  Jakub Jelinek  <jakub@redhat.com>
	* gimplify.c (gimplify_expr): Drop TREE_OVERFLOW from
	INTEGER_CSTs.

From-SVN: r141802
2008-11-12 21:56:41 +01:00
Richard Guenther f7c0ffb441 re PR middle-end/37742 (ICE in vectorizer with restrict pointer)
2008-11-05  Richard Guenther  <rguenther@suse.de>

	PR middle-end/37742
	* tree-ssa.c (useless_type_conversion_p_1): Check different restrict
	qualified pointer conversion before stripping qualifiers.
	* gimplify.c (create_tmp_from_val): Use correctly qualified type.
	* tree-flow.h (may_propagate_address_into_dereference): Declare.
	* tree-ssa-ccp.c (may_propagate_address_into_dereference): New function.
	(ccp_fold): Use it.
	* tree-ssa-forwprop.c (rhs_to_tree): Remove useless conversions,
	properly canonicalize binary ops.
	(forward_propagate_addr_expr_1): Use
	may_propagate_address_into_dereference.

	cp/
	* decl.c (start_preparsed_function): Use the correct type for
	building the RESULT_DECL.

	* gcc.c-torture/compile/pr37742.c: New testcase.
	* g++.dg/pr37742.C: Likewise.
	* gcc.dg/tree-ssa/forwprop-7.c: Check for two volatile loads.

From-SVN: r141606
2008-11-05 12:17:10 +00:00
Jakub Jelinek 8df67f4fe5 gimplify.c (gimplify_expr): Drop TREE_OVERFLOW from INTEGER_CSTs.
* gimplify.c (gimplify_expr): Drop TREE_OVERFLOW from
	INTEGER_CSTs.

From-SVN: r141251
2008-10-21 00:57:27 +02:00
Aldy Hernandez 1282697f08 + * gimplify.c (gimplify_arg): Add location argument.
+       * gimplify.c (gimplify_arg): Add location argument.  Use it.
+       (gimplify_call_expr): Pass location to gimplify_arg.
+       (gimplify_modify_expr_to_memcpy): Same.
+       (gimplify_modify_expr_to_memset): Same.

From-SVN: r140917
2008-10-06 22:40:02 +00:00
Jakub Jelinek 32001f69b9 gimplify.c (gimplify_function_tree): For -finstrument-functions use gimple_bind_{,set_}block instead of...
* gimplify.c (gimplify_function_tree): For -finstrument-functions
	use gimple_bind_{,set_}block instead of gimple_{,set_}block.
	* gimple.h (gimple_bind_set_block): Allow second argument to be NULL.

From-SVN: r140858
2008-10-03 21:28:09 +02:00
Jakub Jelinek 524d9a4532 re PR debug/37726 (Even at -O0 -g debuginfo for vars mentioned in nested fns is not emitted)
PR debug/37726
	* gimplify.c (declare_vars): Use gimple_bind_block instead of
	gimple_block.

	* gcc.dg/debug/dwarf2/pr37726.c: New test.

From-SVN: r140857
2008-10-03 20:55:39 +02:00
Jakub Jelinek 802e9f8e7c re PR debug/34037 (Bounds for VLAs not emitted into debuginfo)
PR debug/34037
	* gimplify.c (gimplify_type_sizes): When not optimizing, ensure
	TYPE_MIN_VALUE and TYPE_MAX_VALUE is not is not DECL_IGNORED_P
	VAR_DECL.
	* cfgexpand.c (expand_used_vars): Keep DECL_ARTIFICIAL
	!DECL_IGNORED_P vars in local_decls list for instantiate_decls,
	ggc_free other TREE_LIST nodes from that chain.
	* function.c (instantiate_decls): Instantiate also DECL_RTL
	of vars in cfun->local_decls, free that list afterwards.

From-SVN: r140459
2008-09-18 17:17:10 +02:00
Jakub Jelinek 8c50b49502 re PR c/37529 (ICE with invalid goto)
PR c/37529
	* gimplify.c (gimplify_expr) <case GOTO_EXPR>: If gimplification of
	GOTO_DESTINATION failed, don't create GIMPLE_GOTO.

	* gcc.dg/pr37529.c: New test.

From-SVN: r140402
2008-09-17 00:08:01 +02:00
Jakub Jelinek cc8b343d26 re PR c++/37530 (ICE with invalid catch)
PR c++/37530
	* gimplify.c (gimplify_expr) <case TRY_CATCH_EXPR>: Don't create
	GIMPLE_TRY if cleanup sequence is empty.

	* g++.dg/parse/crash48.C: New test.

From-SVN: r140401
2008-09-17 00:06:28 +02:00
Jan Hubicka a856e96f84 * gimplify.c (pop_gimplify_context): Free bind_expr_stack.
From-SVN: r140280
2008-09-11 12:32:24 +00:00
Jakub Jelinek 0b056e4e1c re PR middle-end/37338 (gcc.dg/array-init-1.c)
PR middle-end/37338
	* gimplify.c (gimplify_body): Call default_rtl_profile.

From-SVN: r140249
2008-09-10 23:08:17 +02:00
Richard Guenther 8b17cc05d3 re PR tree-optimization/37354 (ICE: in find_func_aliases, at tree-ssa-structalias.c:3906)
2008-09-09  Richard Guenther  <rguenther@suse.de>

	PR middle-end/37354
	PR middle-end/30165
	* gimplify.c (gimplify_conversion): Change conversions of
	non-register type to VIEW_CONVERT_EXPRs.
	(gimplify_addr_expr): If we need to make the operand
	addressable make sure to use a properly initialized
	temporary for that so it gets a valid gimple store.

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

From-SVN: r140145
2008-09-09 11:26:45 +00:00
Aldy Hernandez 6a3799eb00 tree.c (protected_set_expr_location): New.
* tree.c (protected_set_expr_location): New.
        * tree.h (protected_set_expr_location): New prototype.
        * c-tree.h (build_array_ref): Add argument.
        (parser_build_unary_op): Same.
        * c-typeck.c (build_indirect_ref): Handle new location argument.
        (build_array_ref): Same.
        (parser_build_unary_op): Same.
        * gimplify.c (gimplify_asm_expr): Set input_location before calling
        error.
        * c-omp.c (c_finish_omp_atomic): Pass location when calling
        build_indirect_ref.
        * c-common.c (finish_label_address_expr): Handle new location
        argument.
        * c-common.h (build_indirect_ref): Add argument.
        (finish_label_address_expr): Same.
        * c-parser.c (c_parser_unary_expression): Pass location to build
        functions.
        (c_parser_postfix_expression): Same.
objc/
        * objc-act.c (build_typed_selector_reference): Pass input_location to
        build_unary_op calls.
        (build_selector_reference): Same, but to build_array_ref.
        (objc_substitute_decl): Same.
        (build_ivar_reference): Same, but to build_indirect_ref.
        (get_super_receiver): Same.
testsuite/
        * gcc.dg/20010516-1.c: Test for columns.
cp/
        * typeck.c (build_x_indirect_ref): Add location argument.
        * class.c (build_base_path): Pass location to build_indirect_ref.
        * pt.c (tsubst_copy_and_build): Pass location to
        finish_label_address_expr.
        * parser.c (cp_parser_unary_expression): Same.

From-SVN: r139867
2008-09-01 15:02:27 +00:00