Commit Graph

61148 Commits

Author SHA1 Message Date
Matthew Wahab d81cb6135e [AArch64] Move iterators from atomics.md to iterators.md
* config/aarch64/atomics.md (unspecv): Move to iterators.md.
	(ATOMIC_LDOP): Likewise.
	(atomic_ldop): Likewise.
	* config/aarch64/iterators.md (unspecv): Moved from atomics.md.
	(ATOMIC_LDOP): Likewise.
	(atomic_ldop): Likewise.

From-SVN: r230114
2015-11-10 15:59:37 +00:00
Martin Liska 8bd37a2ec9 Enhance pool allocator
* alloc-pool.h (allocate_raw): New function.
	(operator new (size_t, object_allocator<T> &a)): Use the
	function instead of object_allocator::allocate).

From-SVN: r230105
2015-11-10 12:27:33 +00:00
Ilya Enkovich bea408857a sse.md (HALFMASKMODE): New attribute.
gcc/

	* config/i386/sse.md (HALFMASKMODE): New attribute.
	(DOUBLEMASKMODE): New attribute.
	(vec_pack_trunc_qi): New.
	(vec_pack_trunc_<mode>): New.
	(vec_unpacks_lo_hi): New.
	(vec_unpacks_lo_si): New.
	(vec_unpacks_lo_di): New.
	(vec_unpacks_hi_hi): New.
	(vec_unpacks_hi_<mode>): New.

gcc/testsuite/

	* gcc.target/i386/mask-pack.c: New test.
	* gcc.target/i386/mask-unpack.c: New test.

From-SVN: r230104
2015-11-10 12:19:42 +00:00
Ilya Enkovich e6f5c25d91 optabs.c (expand_binop_directly): Allow scalar mode for vec_pack_trunc_optab.
gcc/

	* optabs.c (expand_binop_directly): Allow scalar mode for
	vec_pack_trunc_optab.
	* tree-vect-loop.c (vect_determine_vectorization_factor): Skip
	boolean vector producers from pattern sequence when computing VF.
	* tree-vect-patterns.c (vect_vect_recog_func_ptrs) Add
	vect_recog_mask_conversion_pattern.
	(search_type_for_mask): Choose the smallest
	type if different size types are mixed.
	(build_mask_conversion): New.
	(vect_recog_mask_conversion_pattern): New.
	(vect_pattern_recog_1): Allow scalar mode for boolean vectype.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Support masked
	load with pattern.
	(vectorizable_conversion): Support boolean vectors.
	(free_stmt_vec_info): Allow patterns for statements with no lhs.
	* tree-vectorizer.h (NUM_PATTERNS): Increase to 14.

From-SVN: r230103
2015-11-10 12:17:30 +00:00
Ilya Enkovich f79fe06f4d i386-protos.h (ix86_expand_sse_movcc): New.
gcc/

2015-11-10  Ilya Enkovich  <enkovich.gnu@gmail.com>

	* config/i386/i386-protos.h (ix86_expand_sse_movcc): New.
	* config/i386/i386.c (ix86_expand_sse_movcc): Make public.
	Cast mask to FP mode if required.
	* config/i386/sse.md (vcond_mask_<mode><avx512fmaskmodelower>): New.
	(vcond_mask_<mode><avx512fmaskmodelower>): New.
	(vcond_mask_<mode><sseintvecmodelower>): New.
	(vcond_mask_<mode><sseintvecmodelower>): New.
	(vcond_mask_v2div2di): New.
	(vcond_mask_<mode><sseintvecmodelower>): New.
	(vcond_mask_<mode><sseintvecmodelower>): New.

From-SVN: r230102
2015-11-10 12:15:42 +00:00
Ilya Enkovich a414c77f2a optabs-query.h (get_vcond_mask_icode): New.
gcc/

2015-11-10  Ilya Enkovich  <enkovich.gnu@gmail.com>

	* optabs-query.h (get_vcond_mask_icode): New.
	* optabs-tree.c (expand_vec_cond_expr_p): Use
	get_vcond_mask_icode for VEC_COND_EXPR with mask.
	* optabs.c (expand_vec_cond_mask_expr): New.
	(expand_vec_cond_expr): Use get_vcond_mask_icode
	when possible.
	* optabs.def (vcond_mask_optab): New.
	* tree-vect-patterns.c (vect_recog_bool_pattern): Don't
	generate redundant comparison for COND_EXPR.
	* tree-vect-stmts.c (vect_is_simple_cond): Allow SSA_NAME
	as a condition.
	(vectorizable_condition): Likewise.
	* tree-vect-slp.c (vect_get_and_check_slp_defs): Allow
	cond_exp with no embedded comparison.
	(vect_build_slp_tree_1): Likewise.

From-SVN: r230101
2015-11-10 12:14:19 +00:00
Ilya Enkovich 1ab8a1b176 sse.md (maskload<mode>): Rename to ...
2015-11-10  Ilya Enkovich  <enkovich.gnu@gmail.com>

	* config/i386/sse.md (maskload<mode>): Rename to ...
	(maskload<mode><sseintvecmodelower>): ... this.
	(maskstore<mode>): Rename to ...
	(maskstore<mode><sseintvecmodelower>): ... this.
	(maskload<mode><avx512fmaskmodelower>): New.
	(maskstore<mode><avx512fmaskmodelower>): New.

From-SVN: r230100
2015-11-10 12:08:02 +00:00
Ilya Enkovich 045c12782c internal-fn.c (expand_MASK_LOAD): Adjust to maskload optab changes.
gcc/

	* internal-fn.c (expand_MASK_LOAD): Adjust to maskload optab changes.
	(expand_MASK_STORE): Adjust to maskstore optab changes.
	* optabs-query.c (can_vec_mask_load_store_p): Add MASK_MODE arg.
	 Adjust to maskload, maskstore optab changes.
	* optabs-query.h (can_vec_mask_load_store_p): Add MASK_MODE arg.
	* optabs.def (maskload_optab): Transform into convert optab.
	(maskstore_optab): Likewise.
	* tree-if-conv.c (ifcvt_can_use_mask_load_store): Adjust to
	can_vec_mask_load_store_p signature change.
	(predicate_mem_writes): Use boolean mask.
	* tree-vect-stmts.c (vectorizable_mask_load_store): Adjust to
	can_vec_mask_load_store_p signature change.  Allow invariant masks.
	(vectorizable_operation): Ignore type precision for boolean vectors.

gcc/testsuite/

	* gcc.target/i386/avx2-vec-mask-bit-not.c: New test.

From-SVN: r230099
2015-11-10 12:06:05 +00:00
Ilya Enkovich 42fd8198b4 expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results.
gcc/

	* expr.c (do_store_flag): Use expand_vec_cmp_expr for mask results.
	(const_vector_mask_from_tree): New.
	(const_vector_from_tree): Use const_vector_mask_from_tree
	for boolean vectors.
	* optabs-query.h (get_vec_cmp_icode): New.
	* optabs-tree.c (expand_vec_cmp_expr_p): New.
	* optabs-tree.h (expand_vec_cmp_expr_p): New.
	* optabs.c (vector_compare_rtx): Add OPNO arg.
	(expand_vec_cond_expr): Adjust to vector_compare_rtx change.
	(expand_vec_cmp_expr): New.
	* optabs.def (vec_cmp_optab): New.
	(vec_cmpu_optab): New.
	* optabs.h (expand_vec_cmp_expr): New.
	* tree-vect-generic.c (expand_vector_comparison): Add vector
	comparison optabs check.
	* tree-vect-loop.c (vect_determine_vectorization_factor):  Ignore mask
	operations for VF.  Add mask type computation.
	* tree-vect-stmts.c (get_mask_type_for_scalar_type): New.
	(vectorizable_comparison): New.
	(vect_analyze_stmt): Add vectorizable_comparison.
	(vect_transform_stmt): Likewise.
	(vect_init_vector): Support boolean vector invariants.
	(vect_get_vec_def_for_operand): Add VECTYPE arg.
	(vectorizable_condition): Directly provide vectype for invariants
	used in comparison.
	* tree-vectorizer.h (get_mask_type_for_scalar_type): New.
	(enum vect_var_kind): Add vect_mask_var.
	(enum stmt_vec_info_type): Add comparison_vec_info_type.
	(vectorizable_comparison): New.
	(vect_get_vec_def_for_operand): Add VECTYPE arg.
	* tree-vect-data-refs.c (vect_get_new_vect_var): Support vect_mask_var.
	(vect_create_destination_var): Likewise.
	* tree-vect-patterns.c (check_bool_pattern): Check fails
	if we can vectorize comparison directly.
	(search_type_for_mask): New.
	(vect_recog_bool_pattern): Support cases when bool pattern
	check fails.
	* tree-vect-slp.c (vect_build_slp_tree_1): Allow
	comparison statements.
	(vect_get_constant_vectors): Support boolean vector
	constants.
	* config/i386/i386-protos.h (ix86_expand_mask_vec_cmp): New.
	(ix86_expand_int_vec_cmp): New.
	(ix86_expand_fp_vec_cmp): New.
	* config/i386/i386.c (ix86_expand_sse_cmp): Allow NULL for
	op_true and op_false.
	(ix86_int_cmp_code_to_pcmp_immediate): New.
	(ix86_fp_cmp_code_to_pcmp_immediate): New.
	(ix86_cmp_code_to_pcmp_immediate): New.
	(ix86_expand_mask_vec_cmp): New.
	(ix86_expand_fp_vec_cmp): New.
	(ix86_expand_int_sse_cmp): New.
	(ix86_expand_int_vcond): Use ix86_expand_int_sse_cmp.
	(ix86_expand_int_vec_cmp): New.
	(ix86_get_mask_mode): New.
	(TARGET_VECTORIZE_GET_MASK_MODE): New.
	* config/i386/sse.md (avx512fmaskmodelower): New.
	(vec_cmp<mode><avx512fmaskmodelower>): New.
	(vec_cmp<mode><sseintvecmodelower>): New.
	(vec_cmpv2div2di): New.
	(vec_cmpu<mode><avx512fmaskmodelower>): New.
	(vec_cmpu<mode><sseintvecmodelower>): New.
	(vec_cmpuv2div2di): New.

gcc/testsuite/

	* gcc.dg/vect/slp-cond-5.c: New test.

From-SVN: r230098
2015-11-10 11:57:34 +00:00
Richard Biener 94852c8ec4 re PR tree-optimization/68240 (compilation hangs on valid code at -O1 and above on x86_64-linux-gnu)
2015-11-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/68240
	* tree-ssa-sccvn.c (cond_stmts_equal_p): Handle commutative compares
	properly.
	(visit_phi): For PHIs with just a single executable edge
	take its value directly.
	(expressions_equal_p): Handle VN_TOP properly.

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

From-SVN: r230095
2015-11-10 10:14:02 +00:00
Richard Biener ef785d9f19 tree-vect-data-refs.c (vect_slp_analyze_node_dependences): Handle memory using/clobbering stmts without a STMT_VINFO_DATA_REF conservatively.
2015-11-10  Richard Biener  <rguenther@suse.de>

	* tree-vect-data-refs.c (vect_slp_analyze_node_dependences):
	Handle memory using/clobbering stmts without a STMT_VINFO_DATA_REF
	conservatively.

From-SVN: r230094
2015-11-10 10:12:13 +00:00
Richard Biener a6524bba20 re PR tree-optimization/56118 (Piecewise vector / complex initialization from constants not combined)
2015-11-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56118
	* tree-vect-slp.c (vect_bb_vectorization_profitable_p): Make equal
	cost favor vectorized version.

	* gcc.target/i386/pr56118.c: New testcase.

From-SVN: r230091
2015-11-10 09:43:54 +00:00
Kyrylo Tkachov 3204ac9868 [AArch64][2/3] Implement negcc, notcc optabs
* config/aarch64/aarch64.md (<neg_not_op><mode>cc): New define_expand.
	* config/aarch64/iterators.md (NEG_NOT): New code iterator.
	(neg_not_op): New code attribute.

	* gcc.target/aarch64/cond_op_imm_1.c: New test.

From-SVN: r230090
2015-11-10 09:37:51 +00:00
Kyrylo Tkachov ce68b5cfb9 [optabs][ifcvt][1/3] Define negcc, notcc optabs
* ifcvt.c (noce_try_inverse_constants): New function.
	(noce_process_if_block): Call it.
	* optabs.h (emit_conditional_neg_or_complement): Declare prototype.
	* optabs.def (negcc_optab, notcc_optab): Declare.
	* optabs.c (emit_conditional_neg_or_complement): New function.
	* doc/tm.texi (Standard Names): Document negcc, notcc names.

From-SVN: r230089
2015-11-10 09:35:11 +00:00
Kyrylo Tkachov df554b0e49 [haifa-sched] PR rtl-optimization/68236: Exit early from autoprefetcher lookahead if not in haifa sched
PR rtl-optimization/68236
	* haifa-sched.c (autopref_multipass_dfa_lookahead_guard): Return 0
	if insn_queue doesn't exist.
	(haifa_sched_finish): Reset insn_queue to NULL.

From-SVN: r230088
2015-11-10 09:22:58 +00:00
Robert Suchanek 0d20a76b28 Tie chains for move instructions.
gcc/
	* regrename.c (create_new_chain): Initialize renamed and tied_chain.
	(build_def_use): Initialize terminated_this_insn.
	(find_best_rename_reg): Pick and check register from the tied chain.
	(regrename_do_replace): Mark head as renamed.
	(struct du_head *terminated_this_insn). New static variable.
	(scan_rtx_reg): Tie chains in move insns.  Set terminated_this_insn.
	* regrename.h (struct du_head): Add tied_chain, renamed members.

From-SVN: r230087
2015-11-10 09:12:52 +00:00
Ramana Radhakrishnan 3eece53d3a Workaround PR68256 on AArch64
> This is causing a bootstrap comparison failure in gcc/go/gogo.o.

I've had a look at this and the trigger is the
aarch64_use_constant_blocks_p change which appears to be causing a
bootstrap comparison failure because of differences to offsets when
built with debug and without debug. I don't think the problem is
specifically in the backend but this needs some careful
investigation. For now, in the interest of go bootstraps continuing on
trunk - I'm proposing a patch that partially rolls back the change in
aarch64_use_constant_blocks_p and am still looking into the issue but
it will take me some more time to get to the bottom of the issue.

Bootstrapped on aarch64-none-linux-gnu including (c,c++ and go) -
testing finished ok.

2015-11-10  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

	PR bootstrap/68256
	* config/aarch64/aarch64.c (aarch64_use_constant_blocks_p):
	Return false.

From-SVN: r230085
2015-11-10 08:35:21 +00:00
Eric Botcazou fbae25c008 re PR target/57845 (ICE with -freg-struct-return on SPARC)
PR target/57845
	* config/sparc/sparc.c (sparc_function_value_1): In 32-bit mode, do
	not promote the mode for aggregate types.

From-SVN: r230074
2015-11-10 00:45:03 +00:00
Nathan Sidwell 3a40d81dcd omp-low.h (replace_oacc_fn_attrib, [...]): Declare.
* omp-low.h (replace_oacc_fn_attrib, build_oacc_routine_dims): Declare.
	* omp-low.c (build_oacc_routine_dims): New.

	c/
	* c-parser.c (c_parser_declaration_or_fndef): Add OpenACC
	routine arg.
	(c_parser_declaration_or_fndef): Call c_finish_oacc_routine.
	(c_parser_pragma): Parse 'acc routine'.
	(OACC_ROUTINE_CLAUSE_MARK): Define.
	(c_parser_oacc_routine, (c_finish_oacc_routine): New.

	c-family/
	* c-pragma.c (oacc_pragmas): Add "routine".
	* c-pragma.h (pragma_kind): Add PRAGMA_OACC_ROUTINE.

	cp/
	* parser.h (struct cp_parser): Add oacc_routine field.
	* parser.c (cp_ensure_no_oacc_routine): New.
	(cp_parser_new): Initialize oacc_routine field.
	(cp_parser_linkage_specification): Call cp_ensure_no_oacc_routine.
	(cp_parser_namespace_definition,
	cp_parser_class_specifier_1): Likewise.
	(cp_parser_init_declarator): Call cp_finalize_oacc_routine.
	(cp_parser_function_definition,
	cp_parser_save_member_function_body): Likewise.
	(OACC_ROUTINE_CLAUSE_MASK): New.
	(cp_parser_finish_oacc_routine, cp_parser_oacc_routine,
	cp_finalize_oacc_routine): New.
	(cp_parser_pragma): Adjust omp_declare_simd checking.  Call
	cp_ensure_no_oacc_routine.
	(cp_parser_pragma): Add OpenACC routine handling.

From-SVN: r230072
2015-11-10 00:27:26 +00:00
Michael Meissner 0299bc7261 constraints.md (wF constraint): New constraints for power9/toc fusion.
[gcc]
2015-11-08  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/constraints.md (wF constraint): New constraints
	for power9/toc fusion.
	(wG constraint): Likewise.

	* config/rs6000/predicates.md (u6bit_cint_operand): New
	predicate, recognize 0..63.
	(upper16_cint_operand): New predicate for power9 and toc fusion.
	(fpr_reg_operand): Likewise.
	(toc_fusion_or_p9_reg_operand): Likewise.
	(toc_fusion_mem_raw): Likewise.
	(toc_fusion_mem_wrapped): Likewise.
	(fusion_gpr_addis): If power9 fusion, allow fusion for a larger
	address range.
	(fusion_gpr_mem_combo): Delete, use fusion_addis_mem_combo_load
	instead.
	(fusion_addis_mem_combo_load): Add support for power9 fusion of
	floating point loads, floating point stores, and gpr stores.
	(fusion_addis_mem_combo_store): Likewise.
	(fusion_offsettable_mem_operand): Likewise.

	* config/rs6000/rs6000-protos.h (emit_fusion_addis): Add
	declarations.
	(emit_fusion_load_store): Likewise.
	(fusion_p9_p): Likewise.
	(expand_fusion_p9_load): Likewise.
	(expand_fusion_p9_store): Likewise.
	(emit_fusion_p9_load): Likewise.
	(emit_fusion_p9_store): Likewise.
	(fusion_wrap_memory_address): Likewise.

	* config/rs6000/rs6000.c (struct rs6000_reg_addr): Add new
	elements for power9 fusion.
	(rs6000_debug_print_mode): Rework debug information to print more
	information about fusion.
	(rs6000_init_hard_regno_mode_ok): Setup for power9 fusion
	support.
	(rs6000_legitimate_address_p): Recognize toc fusion as a valid
	offsettable memory address.
	(rs6000_rtx_costs): Update costs for new ISA 3.0 instructions.
	(emit_fusion_gpr_load): Move most of the code from
	emit_fusion_gpr_load into emit_fusion-addis that handles both
	power8 and power9 fusion.
	(emit_fusion_addis): Likewise.
	(emit_fusion_load_store): Likewise.
	(fusion_wrap_memory_address): Add support for TOC fusion.
	(fusion_split_address): Likewise.
	(fusion_p9_p): Add support for power9 fusion.
	(expand_fusion_p9_load): Likewise.
	(expand_fusion_p9_store): Likewise.
	(emit_fusion_p9_load): Likewise.
	(emit_fusion_p9_store): Likewise.

	* config/rs6000/rs6000.h (TARGET_EXTSWSLI): Macros for support for
	new instructions in ISA 3.0.
	(TARGET_CTZ): Likewise.
	(TARGET_TOC_FUSION_INT): Macros for power9 fusion support.
	(TARGET_TOC_FUSION_FP): Likewise.

	* config/rs6000/rs6000.md (UNSPEC_FUSION_P9): New power9/toc
	fusion unspecs.
	(UNSPEC_FUSION_ADDIS): Likewise.
	(QHSI mode iterator): New iterator for power9 fusion.
	(GPR_FUSION): Likewise.
	(FPR_FUSION): Likewise.
	(mod<mode>3): Add support for ISA 3.0
	modulus instructions.
	(umod<mode>3): Likewise.
	(divmod peephole): Likewise.
	(udivmod peephole): Likewise.
	(ctz<mode>2): Add support for ISA 3.0 count trailing zeros scalar
	instructions.
	(ctz<mode>2_h): Likewise.
	(ashdi3_extswsli): Add support for ISA 3.0 EXTSWSLI instruction.
	(ashdi3_extswsli_dot): Likewise.
	(ashdi3_extswsli_dot2): Likewise.
	(power9 fusion splitter): New power9/toc fusion support.
	(toc_fusionload_<mode>): Likewise.
	(toc_fusionload_di): Likewise.
	(fusion_gpr_load_<mode>): Update predicate function.
	(power9 fusion peephole2s): New power9/toc fusion support.
	(fusion_gpr_<P:mode>_<GPR_FUSION:mode>_load): Likewise.
	(fusion_gpr_<P:mode>_<GPR_FUSION:mode>_store): Likewise.
	(fusion_fpr_<P:mode>_<FPR_FUSION:mode>_load): Likewise.
	(fusion_fpr_<P:mode>_<FPR_FUSION:mode>_store): Likewise.
	(fusion_p9_<mode>_constant): Likewise.

[gcc/testsuite]
2015-11-08  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* lib/target-supports.exp (check_p8vector_hw_available): Split
	long line.
	(check_vsx_hw_available): Likewise.
	(check_p9vector_hw_available): Add new checks for ISA 3.0 hardware
	support and for PowerPC float128 support.
	(check_p9modulo_hw_available): Likewise.
	(check_ppc_float128_sw_available): Likewise.
	(check_ppc_float128_hw_available): Likewise.
	(check_effective_target_powerpc_p9vector_ok): Likewise.
	(check_effective_target_powerpc_p9modulo_ok): Likewise.
	(check_effective_target_powerpc_float128_sw_ok): Likewise.
	(check_effective_target_powerpc_float128_hw_ok): Likewise.
	(is-effective-target): Add new PowerPc targets.
	(is-effective-target-keyword): Likewise.
	(check_vect_support_and_set_flags): If we have ISA 3.0 vector
	instructions, use it.

	* gcc.target/powerpc/mod-1.c: New test for ISA 3.0 instructions.
	* gcc.target/powerpc/mod-2.c: Likewise.
	* gcc.target/powerpc/ctz-1.c: Likewise.
	* gcc.target/powerpc/ctz-2.c: Likewise.
	* gcc.target/powerpc/extswsli-1.c: Likewise.
	* gcc.target/powerpc/extswsli-2.c: Likewise.
	* gcc.target/powerpc/extswsli-3.c: Likewise.

	* gcc.target/powerpc/fusion.c (fusion_vector): Move to fusion2.c
	and allow the test on PowerPC LE.
	* gcc.target/powerpc/fusion2.c (fusion_vector): Likewise.
	* gcc.target/powerpc/fusion3.c: New file, test power9 fusion.

	* gcc.target/powerpc/float128-call.c: Use powerpc_float128_sw_ok
	check instead of powerpc_vsx_ok.
	* gcc.target/powerpc/float128-mix.c: Likewise.

From-SVN: r230066
2015-11-10 00:04:03 +00:00
Steve Ellcey cbb521e78e optabs.c (prepare_libcall_arg): New function.
2015-11-09  Steve Ellcey  <sellcey@imgtec.com>

	* optabs.c (prepare_libcall_arg): New function.
	(expand_fixed_convert): Add call to prepare_libcall_arg.

From-SVN: r230065
2015-11-09 23:56:33 +00:00
Nikolai Bozhenov cdb0d9478f [sched] Dump dependency graph to a dot file
* sched-int.h (dump_rgn_dependencies_dot): Declare
	* sched-rgn.c (dump_rgn_dependencies_dot): New function
	* print-rtl.h (print_insn): Add prototype

From-SVN: r230062
2015-11-09 16:29:36 -07:00
Nikolai Bozhenov 4111f1c9b2 Change behavior of -fsched-verbose option
* haifa-sched.c (setup_sched_dump): Don't redirect output to stderr.
	* common.opt (-fsched-verbose): Set default value to 1.
	* invoke.texi (-fsched-verbose): Update the option's description.

From-SVN: r230061
2015-11-09 16:26:15 -07:00
Eric Botcazou 01e83ff2d5 visium.h (PRINT_OPERAND): Delete.
* config/visium/visium.h (PRINT_OPERAND): Delete.
	(PRINT_OPERAND_PUNCT_VALID_P): Likewise.
	(PRINT_OPERAND_ADDRESS): Likewise.
	* config/visium/visium.c (TARGET_PRINT_OPERAND_PUNCT_VALID_P): Define
	to...
	(visium_print_operand_punct_valid_p): ...this.  New function.
	(TARGET_PRINT_OPERAND): Define to...
	(print_operand): Rename to...
	(visium_print_operand): ...this.
	(TARGET_PRINT_OPERAND_ADDRESS): Define to...
	(visium_output_address): Rename to...
	(visium_print_operand_address): ...this.
	(print_operand_address): Delete.

From-SVN: r230060
2015-11-09 22:53:31 +00:00
Eric Botcazou a91c72e214 re PR middle-end/68259 ([sso] tree checking failure in reverse_storage_order_for_component_p, at tree.h:4392)
PR middle-end/68259
	* tree.h (reverse_storage_order_for_component_p) <COMPONENT_REF>:
	Check that the type of the first operand is an aggregate type.

From-SVN: r230056
2015-11-09 22:40:44 +00:00
Nathan Sidwell 374d022552 omp-low.c: Fix some OpenACC comment typos.
* omp-low.c: Fix some OpenACC comment typos.
	(lower_reduction_clauses): Remove BUILT_IN_GOACC_GET_THREAD_NUM call.
	* omp-builtins.def (BUILT_IN_GOACC_GET_THREAD_NUM,
	BUILT_IN_GOACC_GET_NUM_THREADS): Delete.

From-SVN: r230054
2015-11-09 21:56:42 +00:00
Uros Bizjak 639fa8a319 i386.md (*strmovqi_1): Fix insn enable condition.
* config/i386/i386.md (*strmovqi_1): Fix insn enable condition.

From-SVN: r230050
2015-11-09 21:06:57 +01:00
Jeff Law 3d569e76df Re: [PATCH] Minor refactoring in tree-ssanames.c & freelists verifier
* tree-ssanames.c (verify_ssaname_freelists): Simplify check for
	being in gimple/ssa form.  Remove redundant check for SSA_NAME.
	Fix comment typo.

From-SVN: r230049
2015-11-09 12:56:57 -07:00
Michael Meissner d1f0d3769e rs6000.opt (-mpower9-fusion): Add new switches for ISA 3.0 (power9).
2015-11-09  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* config/rs6000/rs6000.opt (-mpower9-fusion): Add new switches for
	ISA 3.0 (power9).
	(-mpower9-vector): Likewise.
	(-mpower9-dform): Likewise.
	(-mpower9-minmax): Likewise.
	(-mtoc-fusion): Likewise.
	(-mmodulo): Likewise.
	(-mfloat128-hardware): Likewise.

	* config/rs6000/rs6000-cpus.def (ISA_3_0_MASKS_SERVER): Add option
	mask for ISA 3.0 (power9).
	(POWERPC_MASKS): Add new ISA 3.0 switches.
	(power9 cpu): Add power9 cpu.

	* config/rs6000/rs6000.h (ASM_CPU_POWER9_SPEC): Add support for
	power9.
	(ASM_CPU_SPEC): Likewise.
	(EXTRA_SPECS): Likewise.

	* config/rs6000/rs6000-opts.h (enum processor_type): Add
	PROCESSOR_POWER9.

	* config/rs6000/rs6000.c (power9_cost): Initial cost setup for
	power9.
	(rs6000_debug_reg_global): Add support for power9 fusion.
	(rs6000_setup_reg_addr_masks): Cache mode size.
	(rs6000_option_override_internal): Until real power9 tuning is
	added, use -mtune=power8 for -mcpu=power9.
	(rs6000_setup_reg_addr_masks): Do not allow pre-increment,
	pre-decrement, or pre-modify on SFmode/DFmode if we allow the use
	of Altivec registers.
	(rs6000_option_override_internal): Add support for ISA 3.0
	switches.
	(rs6000_loop_align): Add support for power9 cpu.
	(rs6000_file_start): Likewise.
	(rs6000_adjust_cost): Likewise.
	(rs6000_issue_rate): Likewise.
	(insn_must_be_first_in_group): Likewise.
	(insn_must_be_last_in_group): Likewise.
	(force_new_group): Likewise.
	(rs6000_register_move_cost): Likewise.
	(rs6000_opt_masks): Likewise.

	* config/rs6000/rs6000.md (cpu attribute): Add power9.
	* config/rs6000/rs6000-tables.opt: Regenerate.

	* config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define
	_ARCH_PWR9 if power9 support is available.

	* config/rs6000/aix61.h (ASM_CPU_SPEC): Add power9.
	* config/rs6000/aix53.h (ASM_CPU_SPEC): Likewise.

	* configure.ac: Determine if the assembler supports the ISA 3.0
	instructions.
	* config.in (HAVE_AS_POWER9): Likewise.
	* configure: Regenerate.

	* doc/invoke.texi (RS/6000 and PowerPC Options): Document ISA 3.0
	switches.

From-SVN: r230031
2015-11-09 16:56:22 +00:00
Kyrylo Tkachov ee78df47b1 [AArch64][cleanup] Remove uses of CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW
* config/aarch64/aarch64.c (aarch64_simd_valid_immediate):
	Remove integer CONST_DOUBLE handling.  It should never occur.

From-SVN: r230030
2015-11-09 15:55:56 +00:00
Kyrylo Tkachov 2ca5b4303b [AArch64] PR target/68129: Define TARGET_SUPPORTS_WIDE_INT
PR target/68129
	* config/aarch64/aarch64.h (TARGET_SUPPORTS_WIDE_INT): Define to 1.
	* config/aarch64/aarch64.c (aarch64_print_operand, CONST_DOUBLE):
	Delete VOIDmode case.  Assert that mode is not VOIDmode.
	* config/aarch64/predicates.md (const0_operand): Remove const_double
	match.

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

From-SVN: r230029
2015-11-09 15:53:26 +00:00
Martin Liska c34311917f Fix memory leaks in IPA.
* ipa-inline-analysis.c (estimate_function_body_sizes): Call
	body_info release function.
	* ipa-prop.c (ipa_release_body_info): New function.
	(ipa_analyze_node): Call the function.
	(ipa_node_params::~ipa_node_params): Release known_csts.
	* ipa-prop.h (ipa_release_body_info): Declare.

From-SVN: r230028
2015-11-09 15:47:01 +00:00
Martin Liska af121e828e Fix memory leaks and use a pool_allocator
* gcc.c (record_temp_file): Release name string.
	* ifcvt.c (noce_convert_multiple_sets): Use auto_vec instead
	of vec.
	* lra-lives.c (free_live_range_list): Utilize
	lra_live_range_pool for allocation and deallocation.
	(create_live_range): Likewise.
	(copy_live_range): Likewise.
	(lra_merge_live_ranges): Likewise.
	(remove_some_program_points_and_update_live_ranges): Likewise.
	(lra_create_live_ranges_1): Release point_freq_vec that can
	be not freed from previous iteration of the function.
	* tree-eh.c (lower_try_finally_switch): Use auto_vec instead of
	vec.
	* tree-sra.c (sra_deinitialize): Release all vectors in
	base_access_vec.
	* tree-ssa-dom.c (free_dom_edge_info): Make the function extern.
	* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges):
	Release edge_info for a removed edge.
	(thread_through_all_blocks): Free region vector.
	* tree-ssa.h (free_dom_edge_info): Declare function extern.

From-SVN: r230027
2015-11-09 15:45:59 +00:00
Ilya Enkovich 0e657ecb98 optabs.c (expand_vec_cond_expr): Always get sign from type.
gcc/

	* optabs.c (expand_vec_cond_expr): Always get sign from type.
	* tree.c (wide_int_to_tree): Support negative values for boolean.
	(build_nonstandard_boolean_type): Use signed type for booleans.

From-SVN: r230022
2015-11-09 15:11:02 +00:00
Richard Biener 0b3ecf7551 re PR tree-optimization/68248 (ICE on valid code at -O3 on x86_64-linux-gnu in uniform_vector_p, at tree.c:10807)
2015-11-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/68248
	* tree-vect-generic.c (expand_vector_operations_1): Handle
	scalar rhs2.

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

From-SVN: r230021
2015-11-09 14:47:09 +00:00
Richard Biener 64900538f1 re PR tree-optimization/56118 (Piecewise vector / complex initialization from constants not combined)
2015-11-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56118
	* tree-vectorizer.h (vect_find_last_scalar_stmt_in_slp): Declare.
	* tree-vect-slp.c (vect_find_last_scalar_stmt_in_slp): Export.
	* tree-vect-data-refs.c (vect_slp_analyze_node_dependences): New
	function.
	(vect_slp_analyze_data_ref_dependences): Instead of computing
	all dependences of the region DRs just analyze the code motions
	SLP vectorization will perform.  Remove SLP instances that
	cannot have their store/load motions applied.
	(vect_analyze_data_refs): Allow DRs without a vectype
	in BB vectorization.

	* gcc.dg/vect/no-tree-sra-bb-slp-pr50730.c: Adjust.

From-SVN: r230020
2015-11-09 12:59:17 +00:00
Julian Brown cc8ca59eb8 Machine modes for address printing.
* final.c (output_asm_insn): Pass VOIDmode to output_address.
	(output_address): Add MODE argument. Pass to print_operand_address
	hook.
	* targhooks.c (default_print_operand_address): Add MODE argument.
	* targhooks.h (default_print_operand_address): Update prototype.
	* output.h (output_address): Update prototype.
	* target.def (print_operand_address): Add MODE argument.
	* config/vax/vax.c (print_operand_address): Pass VOIDmode to
	output_address.
	(print_operand): Pass access mode to output_address.
	* config/mcore/mcore.c (mcore_print_operand_address): Add MODE
	argument.
	(mcore_print_operand): Update calls to mcore_print_operand_address.
	* config/fr30/fr30.c (fr30_print_operand): Pass VOIDmode to
	output_address.
	* config/lm32/lm32.c (lm32_print_operand): Pass mode in calls to
	output_address.
	* config/tilegx/tilegx.c (output_memory_reference_mode): Remove
	global.
	(tilegx_print_operand): Don't set above global. Update calls to
	output_address.
	(tilegx_print_operand_address): Add MODE argument. Use instead of
	output_memory_reference_mode global.
	* config/frv/frv.c (frv_print_operand_address): Add MODE argument.
	(frv_print_operand): Pass mode to frv_print_operand_address calls.
	* config/mn10300/mn10300.c (mn10300_print_operand): Pass mode to
	output_address.
	* config/cris/cris.c (cris_print_operand_address): Add MODE
	argument.
	(cris_print_operand): Pass mode to output_address calls.
	* config/spu/spu.c (print_operand): Pass mode to output_address
	calls.
	* config/aarch64/aarch64.h (aarch64_print_operand)
	(aarch64_print_operand_address): Remove prototypes.
	* config/aarch64/aarch64.c (aarch64_memory_reference_mode): Delete
	global.
	(aarch64_print_operand): Make static. Update calls to
	output_address.
	(aarch64_print_operand_address): Add MODE argument. Use instead of
	aarch64_memory_reference_mode global.
	(TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS): Define target
	hooks.
	* config/aarch64/aarch64.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS):
	Delete macro definitions.
	* config/pa/pa.c (pa_print_operand): Pass mode in output_address
	calls.
	* config/xtensa/xtensa.c (print_operand): Pass mode in
	output_address calls.
	* config/h8300/h8300.c (h8300_print_operand_address): Add MODE
	argument.
	(h83000_print_operand): Update calls to h8300_print_operand_address
	and output_address.
	* config/ia64/ia64.c (ia64_print_operand_address): Add MODE
	argument.
	* config/tilepro/tilepro.c (output_memory_reference_mode): Delete
	global.
	(tilepro_print_operand): Pass mode to output_address.
	(tilepro_print_operand_address): Add MODE argument. Use instead of
	output_memory_reference_mode.
	* config/nvptx/nvptx.c (output_decl_chunk, nvptx_assemble_integer)
	(nvptx_output_call_insn, nvptx_print_address_operand): Pass VOIDmode
	to output_address calls.
	(nvptx_print_operand_address): Add MODE argument.
	* config/alpha/alpha.c (print_operand): Pass mode argument in
	output_address calls.
	* config/m68k/m68k.c (print_operand): Pass mode argument in
	output_address call.
	* config/avr/avr.c (avr_print_operand_address): Add MODE argument.
	(avr_print_operand): Update calls to avr_print_operand_address.
	* config/sparc/sparc.c (sparc_print_operand_address): Add MODE
	argument. Update calls to output_address.
	(sparc_print_operand): Pass mode to output_address.
	* config/iq2000/iq2000.c (iq2000_print_operand_address): Add MODE
	argument.
	(iq2000_print_operand): Pass mode in output_address calls.
	* config/stormy16/stormy16.c (xstormy16_print_operand_address): Add
	MODE argument.
	(xstormy16_print_operand): Pass mode to
	xstormy16_print_operand_address calls.
	* config/mips/mips.c (mips_print_operand): Update calls to
	output_address.
	(mips_print_operand_address): Add MODE argument.
	* config/epiphany/epiphany.c (epiphany_print_operand): Update calls
	to output_address.
	(epiphany_print_operand_address): Add MODE argument. Add FIXME note.
	* config/pdp11/pdp11.c (pdp11_asm_print_operand): Update call to
	output_address.
	* config/rx/rx.c (rx_print_operand_address): Add MODE argument.
	(rx_print_operand): Update calls to output_address,
	rx_print_operand_address.
	* config/nds32/nds32.c (nds32_print_operand): Update calls to
	output_address.
	(nds32_print_operand_address): Add MODE argument.
	* config/rs6000/rs6000.c (print_operand): Pass mem mode to
	output_address calls.
	* config/c6x/c6x.c (print_address_offset): Pass mem mode to
	output_address call.
	(c6x_print_address_operand): Update calls to output_address.
	(c6x_print_operand_address): Pass mode to above.
	* config/v850/v850.c (v850_print_operand_address): Add MODE
	argument.
	(v850_print_operand): Pass mode to v850_print_operand_address,
	output_address.
	* config/mmix/mmix.c (mmix_print_operand_address): Add MODE
	argument.
	(mmix_print_operand): Pass mode in output_address calls.
	* config/sh/sh.c (sh_print_operand_address): Add MODE argument.
	(sh_print_operand): Pass mem mode to output_address,
	sh_print_operand_address.
	* config/cr16/cr16.c (cr16_print_operand_address): Add MODE
	argument.
	(cr16_print_operand): Pass mode to output_address,
	cr16_print_operand_address.
	* config/bfin/bfin.c (print_address_operand): Pass VOIDmode to
	output_address.
	* config/microblaze/microblaze.c (print_operand): Pass mode to
	output_address.
	* config/nios2/nios2.c (nios2_print_operand): Pass VOIDmode to
	output_address.
	(nios2_print_operand_address): Add MODE argument. Update call to
	nios2_print_operand_address.
	* config/s390/s390.c (print_operand): Pass mode to output_address.
	* config/m32c/m32c.c (m32c_print_operand_address): Add MODE
	argument.
	* config/arc/arc.c (arc_print_operand): Pass VOIDmode to
	output_address.
	* config/arm/arm.c (arm_print_operand_address): Add MODE argument.
	Use instead of output_memory_reference_mode.
	(output_memory_reference_mode): Delete global.
	(arm_print_operand): Pass mem mode to output_address.
	* config/m32r/m32r.c (m32r_print_operand_address): Add MODE
	argument.
	(m32r_print_operand): Pass mode to output_address.
	* config/msp430/msp430.c (msp430_print_operand_addr): Add MODE
	argument.
	(msp430_print_operand): Pass mode to msp430_print_operand_addr.
	* config/i386/i386.c (ix86_print_operand): Pass mode to
	output_address calls.
	(ix86_print_operand_address): Add MODE argument.

From-SVN: r230016
2015-11-09 12:16:55 +00:00
Eric Botcazou 7b95c72903 re PR middle-end/68251 (sorry, unimplemented: reverse storage order for BLKmode)
PR middle-end/68251
	* tree-core.h (REF_REVERSE_STORAGE_ORDER): Move around.
	* tree.h (REF_REVERSE_STORAGE_ORDER): Change to default_def_flag.
	* tree-streamer-in.c (unpack_ts_base_value_fields): Adjust.
	* tree-streamer-out.c (pack_ts_base_value_fields): Likewise.

From-SVN: r230015
2015-11-09 12:14:07 +00:00
Kyrylo Tkachov 0780fbabe8 [RTL-ifcvt] PR rtl-optimization/67749: Do not emit separate SET insn in IF-ELSE case
PR rtl-optimization/67749
	* ifcvt.c (noce_try_cmove_arith): Do not emit move in IF-ELSE
	case before emitting the two blocks.  Instead modify the register
	in the corresponding final insn of the basic block.

From-SVN: r230014
2015-11-09 11:40:17 +00:00
Rainer Orth e6b6bf09dd Support init priority on Solaris
libgcc:
	* config/ia64/crtbegin.S: Check HAVE_INITFINI_ARRAY_SUPPORT
	value.
	* config/ia64/crtend.S: Likewise.

	gcc:
	* acinclude.m4 (gcc_AC_INITFINI_ARRAY): Allow for differences in
	assembler syntax.
	Support Solaris ld.
	Define HAVE_INITFINI_ARRAY_SUPPORT as 0/1.

	* config/sol2.h (SUPPORTS_INIT_PRIORITY): Define to
	HAVE_INITFINI_ARRAY_SUPPORT.
	* config/initfini-array.h: Check HAVE_INITFINI_ARRAY_SUPPORT
	value.

	* configure.ac (gcc_cv_as_sparc_nobits): Remove.
	* config/sparc/sparc.c (sparc_solaris_elf_asm_named_section):
	Don't check HAVE_AS_SPARC_NOBITS.
	Heed SECTION_NOTYPE.

	* configure: Regenerate.
	* config.in: Regenerate.

From-SVN: r230013
2015-11-09 11:33:30 +00:00
Eric Botcazou e1c78addb3 re PR middle-end/68253 (conditional jump or move depends on uninitialized value in fold-const.c:5587)
PR middle-end/68253
	* fold-const.c (fold_truth_andor_1): Initialize new variables to 0.

From-SVN: r230011
2015-11-09 10:45:00 +00:00
Richard Henderson 00402c9415 i386: Add address spaces for fs/gs segments and tls
* config/i386/i386-c.c (ix86_target_macros): Define __SEG_FS,
        __SEG_GS, __SEG_TLS.
        (ix86_register_pragmas): Register address spaces __seg_fs,
        __seg_gs, __seg_tls.
        * config/i386/i386-protos.h (enum ix86_address_seg): Remove.
        (ADDR_SPACE_SEG_FS, ADDR_SPACE_SEG_GS, ADDR_SPACE_SEG_TLS): New.
        (struct ix86_address): Use addr_space_t instead of ix86_address_seg.
        * config/i386/i386.c (ix86_decompose_address): Likewise.
        (ix86_legitimate_address_p): Likewise.
        (memory_address_length): Likewise.  Check mem address space too.
        (ix86_print_operand): Use ix86_print_operand_address_as.
        (ix86_print_operand_address_as): Rename from
        ix86_print_operand_address, add new addr_space_t parameter.
        Validate that either the parameter or the ix86_address segment
        is default address space.  Handle ADDR_SPACE_SEG_TLS.
        (ix86_print_operand_address): New.
        (ix86_addr_space_subset_p, TARGET_ADDR_SPACE_SUBSET_P): New.
        (ix86_addr_space_convert, TARGET_ADDR_SPACE_CONVERT): New.
        (ix86_addr_space_debug, TARGET_ADDR_SPACE_DEBUG): New.
        (ix86_addr_space_zero_address_valid): New.
        (TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): New.
        * config/i386/i386.h (DEFAULT_TLS_SEG_REG): Use addr_space_t constants.
        * config/i386/rdos.h (DEFAULT_TLS_SEG_REG): Likewise.
        * config/i386/predicates.md (address_no_seg_operand): Likewise.
        (vsib_address_operand): Likewise.
        (address_mpx_no_base_operand): Likewise.
        (address_mpx_no_index_operand): Likewise.
        * doc/extend.texi (x86 Named Address Spaces): New section.

        * gcc.target/i386/addr-space-1.c: New test.
        * gcc.target/i386/addr-space-2.c: New test.
        * gcc.target/i386/addr-space-3.c: New test.

From-SVN: r230003
2015-11-09 01:20:21 -08:00
Richard Henderson 1673467767 i386: Disallow address spaces with string insns
While cmps and movs allow a segment override of the ds:esi
source, the es:edi source/destination cannot be overriden.
Simplify things in the backend for now by disallowing
segments for string insns entirely.

	* config/i386/i386.c (ix86_check_no_addr_space): New.
	(decide_alg): Add have_as parameter.
	(alg_usable_p): Likewise; disable rep algorithms if set.
	(ix86_expand_set_or_movmem): Notice if either MEM has a
	non-default address space.
	(ix86_expand_strlen): Likewise.
	* config/i386/i386.md (strmov, strset): Likewise.
	(*strmovdi_rex_1): Use ix86_check_no_addr_space.
	(*strmovsi_1, *strmovqi_1, *rep_movdi_rex64, *rep_movsi, *rep_movqi,
	*strsetdi_rex_1, *strsetsi_1, *strsethi_1, *strsetqi_1,
	*rep_stosdi_rex64, *rep_stossi, *rep_stosqi, *cmpstrnqi_nz_1,
	*cmpstrnqi_1, *strlenqi_1): Likewise.

From-SVN: r230002
2015-11-09 01:19:59 -08:00
Richard Henderson fe5f926316 i386: Handle address spaces in movabs patterns
* config/i386/i386.md (*movabs<mode>_1): Print the full memory rtx.
	(*movabs<mode>_2): Likewise.

From-SVN: r230001
2015-11-09 01:19:40 -08:00
Richard Henderson f736b911e6 Add hook for modifying debug info for address spaces
* dwarf2out.c (modified_type_die): Pass the address space number
        through TARGET_ADDR_SPACE_DEBUG to produce the dwarf address class.
        * target.def (TARGET_ADDR_SPACE_DEBUG): New.
        * targhooks.c (default_addr_space_debug): New.
        * targhooks.h (default_addr_space_debug): Declare.
        * doc/tm.texi.in (TARGET_ADDR_SPACE_DEBUG): Mark it.
        * doc/tm.texi: Rebuild.

From-SVN: r230000
2015-11-09 01:19:19 -08:00
Richard Henderson 6626f97034 Add TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID
* gimple.c (check_loadstore): Return false when 0 is a valid address.
        * fold-const.c (const_unop) [ADDR_SPACE_CONVERT_EXPR]: Do not fold
        null when 0 is valid in the source address space.
        * target.def (TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): New.
        * targhooks.c (default_addr_space_zero_address_valid): New.
        * targhooks.h (default_addr_space_zero_address_valid): Declare.
        * doc/tm.texi.in (TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): Mark it.
        * doc/tm.texi: Rebuild.

From-SVN: r229999
2015-11-09 01:18:59 -08:00
Richard Henderson bd68a3a7e7 Avoid CSE of MEMs in different address spaces
* cselib.c (add_mem_for_addr): Compare address spaces when
        matching memories.
        (cselib_lookup_mem): Likewise.
        * fold-const.c (operand_equal_p): Check address spaces of
        pointer types before checking integer constants.

From-SVN: r229998
2015-11-09 01:18:35 -08:00
Richard Henderson f0ebde5ace re PR tree-optimization/66768 (address space gets lost on literal pointer)
PR tree-opt/66768

        * tree-ssa-address.c (create_mem_ref_raw): Use a pointer of
        the correct type for the base.

From-SVN: r229997
2015-11-09 01:18:16 -08:00
Jeff Law d2e2feaa4d [PATCH] Minor refactoring in tree-ssanames.c & freelists verifier
[PATCH] Minor refactoring in tree-ssanames.c & freelists verifier
	* tree-into-ssa.c (names_to_release): No longer static.
	* tree-into-ssa.h (names_to_release): Declare.
	* tree-ssanames.c (verify_ssaname_freelists): New debug function.
	(release_free_names_and_compact_live_names): New function extracted
	from pass_release_ssa_names::execute.
	(pass_release_ssa_names::execute): Use it.

Co-Authored-By: Nathan Sidwell <nathan@acm.org>

From-SVN: r229995
2015-11-09 02:02:27 -07:00
Alan Modra c240b3e0de New obstack_next_free is not an lvalue
New obstack.h casts obstack_next_free to (void *), resulting in it
being a non-lvalue, and warnings on pointer arithmetic.

gcc/
	* gensupport.c (add_mnemonic_string): Make len param a size_t.
	(gen_mnemonic_setattr): Make "size" var a size_t.  Use
	obstack_blank_fast to shrink obstack.  Cast obstack_next_free
	return value.
gcc/objc/
	* objc-encoding.c (encode_aggregate_within): Cast obstack_next_free
	return value.

From-SVN: r229984
2015-11-09 14:47:53 +10:30
Segher Boessenkool d4c8d5ede1 Fix bb-reorder problem with degenerate cond_jump (PR68182)
The code mistakenly thinks any cond_jump has two successors.  This is
not true if both destinations are the same, as can happen with weird
patterns as in the PR.


	PR rtl-optimization/68182
	* gcc/bb-reorder.c (reorder_basic_blocks_simple): Treat a conditional
	branch with only one successor just like unconditional branches.

From-SVN: r229983
2015-11-09 04:57:19 +01:00
Jeff Law 4f70cb39c0 [PATCH] Remove backedge handling support in tree-ssa-threadupdate.c
* tree-ssa-threadupdate.c (register_jump_thraed): Assert that a
	non-FSM path has no edges marked with EDGE_DFS_BACK.
	(ssa_redirect_edges): No longer call mark_loop_for_removal.
	(thread_single_edge, def_split_header_continue_p): Remove.
	(bb_ends_with_multiway_branch): Likewise.
	(thread_through_loop_header): Remove cases of threading from
	latch through the header.  Simplify knowing we won't thread
	the latch.
	(thread_through_all_blocks): Simplify knowing that only the FSM
	threader needs to handle backedges.

From-SVN: r229982
2015-11-08 20:19:09 -07:00
Eric Botcazou ee45a32dae Merge of the scalar-storage-order branch.
From-SVN: r229965
2015-11-08 18:33:42 +00:00
Eric Botcazou cad669df64 * config/sparc/sparc.opt (mfix-at697f): Add final period.
From-SVN: r229941
2015-11-07 22:34:20 +00:00
Segher Boessenkool bc05d49d10 i386: Use the STC bb-reorder algorithm at -Os (PR67864)
For x86, STC still gives better results for optimise-for-size than
"simple" does.  So use STC at -Os as well.


	PR rtl-optimization/67864
	* common/config/i386/i386-common.c (ix86_option_optimization_table)
	<OPT_freorder_blocks_algorithm_>: Use REORDER_BLOCKS_ALGORITHM_STC
	at -Os and up.

From-SVN: r229937
2015-11-07 20:44:21 +01:00
Richard Sandiford 6ca5a44255 Handle internal functions in is_tm_pure_call
The upcoming changes to use internal functions for things like sqrt
caused a failure in gcc.dg/tm/20100610.c, because we were trying to get
call flags from the null gimple_call_fn of an IFN_SQRT call.  We've been
making fairly heavy use of internal functions for a while now so I think
this might be latent.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* trans-mem.c (is_tm_pure_call): Use gimple_call_flags for
	internal functions.

From-SVN: r229925
2015-11-07 10:19:56 +00:00
Richard Sandiford 0aad019857 Move #undef DEF_BUILTIN* to builtins.def
I was confused at first why tree-core.h was undefining DEF_BUILTIN_CHKP
before defining it, then undefining it again after including builtins.def.
This is because builtins.def provides a default definition of
DEF_BUILTIN_CHKP, but leaves it up to the caller to undefine it where
necessary.  Similarly to the previous internal-fn.def patch, it seems
more obvious for builtins.def to #undef things unconditionally.

One argument might have been that keeping preprocessor stuff
out of the .def files makes it easier for non-cpp parsers.  In practice
though we already have #ifs and multiline #defines, so single-line #undefs
should be easy in comparison.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/ada/
	* gcc-interface/utils.c: Don't undef DEF_BUILTIN.

gcc/c-family/
	* c-common.c: Don't undef DEF_BUILTIN.

gcc/jit/
	* jit-builtins.c: Don't undef DEF_BUILTIN.

gcc/lto/
	* lto-lang.c: Don't undef DEF_BUILTIN.

gcc/
	* builtins.def: #undef DEF_BUILTIN and DEF_BUILTIN_CHKP
	* builtins.c, genmatch.c, tree-core.h: Don't undef them here.

From-SVN: r229924
2015-11-07 10:18:38 +00:00
Richard Sandiford 46e343b8d2 Move #undef DEF_INTERNAL_FN to internal-fn.def
In practice the definition of DEF_INTERNAL_FN is never reused after
including internal-fn.def, so we might as well #undef it there.

This becomes more obvious with a later patch that adds other
DEF_INTERNAL_* directives, such as DEF_INTERNAL_OPTAB_FN.
If the includer doesn't care about the information carried in
these new directives, it can simply leave the macro undefined
and internals.def will provide a definition that forwards to
DEF_INTERNAL_FN.  It doesn't make much sense for includers to have
to #undef macros that are defined by internals.def and it seems overly
complicated to get internals.def to undef macros only in the cases
where it provided a definition.  Instead I went with the approach of
#undeffing all the DEF_INTERNAL_* macros unconditionally.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* internal-fn.def: #undef DEF_INTERNAL_FN at the end.
	* internal-fn.c: Don't undef it here.
	* tree-core.h: Likewise.

From-SVN: r229923
2015-11-07 10:17:05 +00:00
Richard Sandiford df838ef0f1 Move const char * -> int/fp folds to fold-const-call.c
This patch moves folds that deal with constant string arguments and
return a constant integer or floating-point value.  For example, it
handles strcmp ("foo", "bar") but not strstr ("foobar", "bar"),
which wouldn't currently be accepted by the gimple folders.

The builtins.c folding for strlen (via c_strlen) is a bit more general
than what the fold-const-call.c code does (and more general than we need
for the gimple folders).  I've therefore left it as-is, even though it
partially duplicates the new code.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_nan): Delete.
	(fold_builtin_memcmp): Remove case where both arguments are constant.
	(fold_builtin_strcmp, fold_builtin_strncmp): Likewise.
	(fold_builtin_strspn, fold_builtin_strcspn): Likewise.
	(fold_builtin_1): Remove BUILT_IN_NAN* handling.
	* fold-const-call.c: Include fold-const.h.
	(host_size_t_cst_p): New function.
	(build_cmp_result, fold_const_builtin_nan): Likewise.
	(fold_const_call_1): New function, split out from...
	(fold_const_call): ...here (for all three interfaces).  Handle
	constant nan, nans, strlen, strcmp, strncmp, strspn and strcspn.

From-SVN: r229922
2015-11-07 10:10:44 +00:00
Richard Sandiford db9bd5d575 Move constant bitop and bswap folds to fold-const-call.c
The only folds left in builtins.c were for constants, so we can remove
the builtins.c handling entirely.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_bitop, fold_builtin_bswap): Delete.
	(fold_builtin_1): Don't call them.
	* fold-const-call.c: Include tm.h.
	(fold_const_call_ss): New variant for integer-to-integer folds.
	(fold_const_call): Call it.

From-SVN: r229921
2015-11-07 10:08:31 +00:00
Richard Sandiford 2556a032cc Handle constant fp classifications in fold-const-call.c
Move the constant "is finite", "is infinite" and "is nan" queries
to fold-const-call.c.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.c (fold_builtin_classify): Move constant cases to...
	* fold-const-call.c (fold_const_call_ss): ...here.

From-SVN: r229920
2015-11-07 10:05:51 +00:00
Richard Sandiford 5486d91300 Move c_getstr to fold-const.c
Upcoming patches to fold-const-call.c want to use c_getstr, which is
currently defined in builtins.c.  The function doesn't really do anything
related to built-ins, and I'd rather not make fold-const-call.c depend
on builtins.c and builtins.c depend on fold-const-call.c, so this patch
moves the function to fold-const.c instead.

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.h (c_getstr): Move to...
	* fold-const.h (c_getstr): ...here.
	* builtins.c (c_getstr): Move to...
	* fold-const.c (c_getstr): ...here.

From-SVN: r229919
2015-11-07 10:01:52 +00:00
Richard Sandiford eb0b164e5f Don't treat rint as setting errno
builtins.def says that rint sets errno, but it looks like this might
be a mistake.  C99 says that rint doesn't set errno and the builtins.c
expansion code doesn't try to keep errno up to date.

Perhaps this was because earlier versions of POSIX said that
rint sets errno on overflow:

        http://pubs.opengroup.org/onlinepubs/009695399/functions/rintf.html

However, this is another instance of the observation that "rounding
functions could never overflow" (because anything using exponents
that large is already integral).  The page above also says that
differences with C99 are unintentional and the ERANGE clause has
been removed from later versions of POSIX:

        http://pubs.opengroup.org/onlinepubs/9699919799/functions/rint.html

Also, the version of POSIX that lists ERANGE for rint does the same
for nearbyint:

        http://pubs.opengroup.org/onlinepubs/009695399/functions/nearbyintf.html

and we already treat nearbyint as not setting errno.  This too has been
clarified in later versions of POSIX:

        http://pubs.opengroup.org/onlinepubs/9699919799/functions/nearbyint.html

Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.

gcc/
	* builtins.def (BUILTIN_RINT, BUILTIN_RINTF, BUILTIN_RINTL): Use
	ATTR_MATHFN_FPROUNDING rather than ATTR_MATHFN_FPROUNDING_ERRNO.

From-SVN: r229918
2015-11-07 10:00:31 +00:00
Richard Sandiford f127ea514d Try to update dominance info in tree-call-cdce.c
The pass would free the dominance info after making a change, but it
should be pretty easy to keep the information up-to-date when the call
has no EH edges.

Tested on x86_64-linux-gnu, arm-linux-gnueabi and aarch64-linux-gnu.

gcc/
	* tree-call-cdce.c (shrink_wrap_one_built_in_call): Try to update
	the dominance info; free it if we can't.
	(pass_call_cdce::execute): Don't free the dominance info here.

From-SVN: r229916
2015-11-07 09:56:04 +00:00
Jeff Law 88419b5295 [PATCH] Remove more backedge threading support
* tree-ssa-threadedge.c (dummy_simplify): Remove.
	(thread_around_empty_blocks): Remove backedge_seen_p argument.
	If we thread to a backedge, then return false.  Update recursive
	call to eliminate backedge_seen_p argument.
	(thread_through_normal_block): Remove backedge_seen_p argument.
	Remove backedge_seen_p argument from calls to
	thread_around_empty_blocks.  Remove checks on backedge_seen_p.
	If we thread to a backedge, then return 0.
	(thread_across_edge): Remove bookkeeping for backedge_seen.  Don't
	pass it to thread_through_normal_block or thread_through_empty_blocks.
	For joiner handling, if we see a backedge, do not try normal
	threading.

From-SVN: r229911
2015-11-06 23:31:14 -07:00
Abderrazek Zaafrani 0473915e63 add original schedule to scop
* graphite-optimize-isl.c (optimize_isl): Call isl_union_map_is_equal.
    * graphite-poly.c (new_scop): Initialize original_schedule.
    (free_scop): Free original_schedule.
    * graphite-poly.h (struct scop): Add field original_schedule.
    * graphite-sese-to-poly.c (build_scop_original_schedule): New.
    (build_poly_scop): Call build_scop_original_schedule.

From-SVN: r229910
2015-11-07 01:32:27 +00:00
Abderrazek Zaafrani 504fbc11f4 do not create unnecessary dimensions in scop scattering
* graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Remove.
           (build_pbb_minimal_scattering_polyhedrons): New.
           (build_scop_scattering): Remove.
           (build_scop_minimal_scattering): New.
           (build_scop_scattering): Call build_pbb_minimal_scattering_polyhedrons.
           (build_poly_scop): Call build_scop_minimal_scattering.

From-SVN: r229909
2015-11-07 01:32:20 +00:00
Jeff Law b9e59e4f11 [PATCH] Allow vrp to thread across backedges using FSM threader
* cfg-flags.def (IGNORE): New edge flag.
	* tree-vrp.c (identify_jump_threads): Mark and clear edges
	scheduled for removal with EDGE_IGNORE around call into
	jump threader.  Do no thread across edges with EDGE_IGNORE,
	but do allow threading across those with EDGE_DFS_BACK.

	* gcc.dg/tree-ssa/ssa-dom-thread-7.c: Adjust to look for
	realized jump threads.
	* gcc.dg/tree-ssa-pr66752-3.c: Look in vrp1 dump for jump
	threads rather than dom1 dump.

From-SVN: r229902
2015-11-06 16:26:20 -07:00
David Wohlferd a6fa947e82 inline asm and multi-alternative constraints
* doc/md.texi (multi-alternative constraints): Don't document
	alternatives inherently tied to reload for the user documentation.

From-SVN: r229897
2015-11-06 15:52:35 -07:00
Michael Collison 84d289d4b7 revert: arm.md (*arm_smin_cmp): New pattern.
2015-11-06  Michael Collison  <michael.collison@linaro.org
	    Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

	Revert:
	2015-08-01  Michael Collison  <michael.collison@linaro.org
		    Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

	* config/arm/arm.md (*arm_smin_cmp): New pattern.
	(*arm_umin_cmp): Likewise.

2015-11-06  Michael Collison  <michael.collison@linaro.org
	    Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

	Revert:
	2015-08-01  Michael Collison  <michael.collison@linaro.org
		    Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

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

From-SVN: r229895
2015-11-06 22:38:25 +00:00
Jakub Jelinek d9f4ea18ac gimplify.c (gimplify_omp_ordered): Fix up diagnostics wording.
* gimplify.c (gimplify_omp_ordered): Fix up diagnostics
	wording.
	* omp-low.c (check_omp_nesting_restrictions): Update for the
	various new OpenMP 4.5 nesting restrictions, clarified
	nesting glossary, closely nested region relationship clarified
	to mean explicit or implicit parallel regions (target/teams),
	use %</%> or %qs where appropriate.

	* gcc.dg/gomp/ordered-2.c (f1): Expect an extra error.
	* g++.dg/gomp/ordered-2.C (f1): Likewise.
	* gfortran.dg/goacc/parallel-kernels-regions.f95: Adjust
	expected diagnostics for the addition of quotes.
	* gfortran.dg/gomp/target3.f90: Likewise.
	* c-c++-common/goacc/nesting-fail-1.c: Likewise.
	* c-c++-common/goacc-gomp/nesting-fail-1.c: Likewise.
	* c-c++-common/gomp/doacross-1.c: Likewise.
	* c-c++-common/gomp/nesting-warn-1.c: Likewise.
	* c-c++-common/gomp/cancel-1.c (f2): Add some new tests.
	Adjust expected diagnostics wording.
	* c-c++-common/gomp/clauses-4.c (foo): Likewise.
	Don't expect error on ordered threads simd when in for simd.
	* c-c++-common/gomp/nesting-2.c: New test.
	* c-c++-common/gomp/ordered-3.c (foo): Add some new tests.
	* c-c++-common/gomp/ordered-4.c: New test.

From-SVN: r229892
2015-11-06 22:21:16 +01:00
Aditya Kumar b4487cbc5e do not collect cold loops in scops
* graphite-scop-detection.c (loop_is_valid_scop): Call
           optimize_loop_nest_for_speed_p.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r229890
2015-11-06 20:43:52 +00:00
Aditya Kumar 40856c71be enable loop fusion on isl-15
* graphite-optimize-isl.c (optimize_isl): Call
       isl_options_set_schedule_maximize_band_depth.

       * gcc.dg/graphite/fuse-1.c: New.
       * gcc.dg/graphite/fuse-2.c: New.
       * gcc.dg/graphite/interchange-13.c: Remove bogus check.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r229889
2015-11-06 20:43:46 +00:00
Aditya Kumar 1167ebe707 Do not allow irreducible loops/regions in a scop
Irreducible regions are not going to be optimized by ISL
so discard them early. Passes bootstrap and regtest.

gcc/ChangeLog:

2015-11-06  Aditya Kumar  <aditya.k7@samsung.com>

        * graphite-scop-detection.c (scop_detection::merge_sese): Entry and exit edges should not be a part of irreducible loop.
        (scop_detection::can_represent_loop_1): Loops should not be irreducible.
        (scop_detection::harmful_stmt_in_region): All the basic block should belong to reducible loops.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r229888
2015-11-06 20:43:40 +00:00
Christophe Lyon 246cc06002 [AArch64] Fix vqtb[lx][234] on big-endian
2015-11-06  Christophe Lyon  <christophe.lyon@linaro.org>

	gcc/
	* config/aarch64/aarch64-simd-builtins.def: Update builtins
	tables: add tbl3v16qi, qtbl[34]*, tbx4v16qi, qtbx[34]*.
	* config/aarch64/aarch64-simd.md (aarch64_tbl3v8qi): Rename to...
	(aarch64_tbl3<mode>) ... this, which supports v16qi too.
	(aarch64_tbx4v8qi): Rename to...
	aarch64_tbx4<mode>): ... this.
	(aarch64_qtbl3<mode>): New pattern.
	(aarch64_qtbx3<mode>): New pattern.
	(aarch64_qtbl4<mode>): New pattern.
	(aarch64_qtbx4<mode>): New pattern.
	* config/aarch64/arm_neon.h (vqtbl2_s8, vqtbl2_u8, vqtbl2_p8)
	(vqtbl2q_s8, vqtbl2q_u8, vqtbl2q_p8, vqtbl3_s8, vqtbl3_u8)
	(vqtbl3_p8, vqtbl3q_s8, vqtbl3q_u8, vqtbl3q_p8, vqtbl4_s8)
	(vqtbl4_u8, vqtbl4_p8, vqtbl4q_s8, vqtbl4q_u8, vqtbl4q_p8)
	(vqtbx2_s8, vqtbx2_u8, vqtbx2_p8, vqtbx2q_s8, vqtbx2q_u8)
	(vqtbx2q_p8, vqtbx3_s8, vqtbx3_u8, vqtbx3_p8, vqtbx3q_s8)
	(vqtbx3q_u8, vqtbx3q_p8, vqtbx4_s8, vqtbx4_u8, vqtbx4_p8)
	(vqtbx4q_s8, vqtbx4q_u8, vqtbx4q_p8): Rewrite using builtin
	functions.

	gcc/testsuite/
	* gcc.target/aarch64/advsimd-intrinsics/vqtbX.c: New test.

From-SVN: r229886
2015-11-06 21:34:12 +01:00
Mike Stump a881fb0c2c re PR debug/66728 (CONST_WIDE_INT causes corrupted DWARF debug info)
PR debug/66728
	* dwarf2out.c (get_full_len): Return a value based upon the actual
	precision needed for the value.
	(add_const_value_attribute): Use a maximal wide-int for
	CONST_WIDE_INTs, not VOIDmode.
	(output_die): Don't ever output NULL with printf.

	* rtl.h (get_precision of rtx_mode_t): Ensure we never process
	BLKmode nor VOIDmode values.

From-SVN: r229885
2015-11-06 20:16:06 +00:00
David Malcolm 8a64515099 Reimplement diagnostic_show_locus, introducing rich_location classes
gcc/ChangeLog:
	* diagnostic-color.c (color_dict): Eliminate "caret"; add "range1"
	and "range2".
	(parse_gcc_colors): Update comment to describe default GCC_COLORS.
	* diagnostic-core.h (warning_at_rich_loc): New declaration.
	(error_at_rich_loc): New declaration.
	(permerror_at_rich_loc): New declaration.
	(inform_at_rich_loc): New declaration.
	* diagnostic-show-locus.c (adjust_line): Delete.
	(struct point_state): New struct.
	(class colorizer): New class.
	(class layout_point): New class.
	(class layout_range): New class.
	(struct line_bounds): New.
	(class layout): New class.
	(colorizer::colorizer): New ctor.
	(colorizer::~colorizer): New dtor.
	(layout::layout): New ctor.
	(layout::print_source_line): New method.
	(layout::print_annotation_line): New method.
	(layout::get_state_at_point): New method.
	(layout::get_x_bound_for_row): New method.
	(diagnostic_show_locus): Reimplement in terms of class layout.
	(diagnostic_print_caret_line): Delete.
	* diagnostic.c (diagnostic_initialize): Replace
	MAX_LOCATIONS_PER_MESSAGE with rich_location::MAX_RANGES.
	(diagnostic_set_info_translated): Convert param from location_t
	to rich_location *.  Eliminate calls to set_location on the
	message in favor of storing the rich_location ptr there.
	(diagnostic_set_info): Convert param from location_t to
	rich_location *.
	(diagnostic_build_prefix): Break out array into...
	(diagnostic_kind_color): New variable.
	(diagnostic_get_color_for_kind): New function.
	(diagnostic_report_diagnostic): Colorize the option_text
	using the color for the severity.
	(diagnostic_append_note): Update for change in signature of
	diagnostic_set_info.
	(diagnostic_append_note_at_rich_loc): New function.
	(emit_diagnostic): Update for change in signature of
	diagnostic_set_info.
	(inform): Likewise.
	(inform_at_rich_loc): New function.
	(inform_n): Update for change in signature of diagnostic_set_info.
	(warning): Likewise.
	(warning_at): Likewise.
	(warning_at_rich_loc): New function.
	(warning_n): Update for change in signature of diagnostic_set_info.
	(pedwarn): Likewise.
	(permerror): Likewise.
	(permerror_at_rich_loc): New function.
	(error): Update for change in signature of diagnostic_set_info.
	(error_n): Likewise.
	(error_at): Likewise.
	(error_at_rich_loc): New function.
	(sorry): Update for change in signature of diagnostic_set_info.
	(fatal_error): Likewise.
	(internal_error): Likewise.
	(internal_error_no_backtrace): Likewise.
	(source_range::debug): New function.
	* diagnostic.h (struct diagnostic_info): Eliminate field
	"override_column".  Add field "richloc".
	(struct diagnostic_context): Add field "colorize_source_p".
	(diagnostic_override_column): Delete.
	(diagnostic_set_info): Convert param from location_t to
	rich_location *.
	(diagnostic_set_info_translated): Likewise.
	(diagnostic_append_note_at_rich_loc): New function.
	(diagnostic_num_locations): New function.
	(diagnostic_expand_location): Get the location from the
	rich_location.
	(diagnostic_print_caret_line): Delete.
	(diagnostic_get_color_for_kind): New declaration.
	* genmatch.c (linemap_client_expand_location_to_spelling_point): New.
	(error_cb): Update for change in signature of "error" callback.
	(fatal_at): Likewise.
	(warning_at): Likewise.
	* input.c (linemap_client_expand_location_to_spelling_point): New.
	* pretty-print.c (text_info::set_range): New method.
	(text_info::get_location): New method.
	* pretty-print.h (MAX_LOCATIONS_PER_MESSAGE): Eliminate this macro.
	(struct text_info): Eliminate "locations" array in favor of
	"m_richloc", a rich_location *.
	(textinfo::set_location): Add a "caret_p" param, and reimplement
	in terms of a call to set_range.
	(textinfo::get_location): Eliminate inline implementation in favor of
	an out-of-line reimplementation.
	(textinfo::set_range): New method.
	* rtl-error.c (diagnostic_for_asm): Update for change in signature
	of diagnostic_set_info.
	* tree-diagnostic.c (default_tree_printer): Update for new
	"caret_p" param for textinfo::set_location.
	* tree-pretty-print.c (percent_K_format): Likewise.

gcc/c-family/ChangeLog:
	* c-common.c (c_cpp_error): Convert parameter from location_t to
	rich_location *.  Eliminate the "column_override" parameter and
	the call to diagnostic_override_column.
	Update the "done_lexing" clause to set range 0
	on the rich_location, rather than overwriting a location_t.
	* c-common.h (c_cpp_error): Convert parameter from location_t to
	rich_location *.  Eliminate the "column_override" parameter.

gcc/c/ChangeLog:
	* c-decl.c (warn_defaults_to): Update for change in signature
	of diagnostic_set_info.
	* c-errors.c (pedwarn_c99): Likewise.
	(pedwarn_c90): Likewise.
	* c-objc-common.c (c_tree_printer): Update for new "caret_p" param
	for textinfo::set_location.

gcc/cp/ChangeLog:
	* error.c (cp_printer): Update for new "caret_p" param for
	textinfo::set_location.
	(pedwarn_cxx98): Update for change in signature of
	diagnostic_set_info.

gcc/fortran/ChangeLog:
	* cpp.c (cb_cpp_error): Convert parameter from location_t to
	rich_location *.  Eliminate the "column_override" parameter.
	* error.c (gfc_warning): Update for change in signature of
	diagnostic_set_info.
	(gfc_format_decoder): Update handling of %C/%L for changes
	to struct text_info.
	(gfc_diagnostic_starter): Use richloc when determining whether to
	print one locus or two.  When handling a location that will
	involve a call to diagnostic_show_locus, only attempt to print the
	locus for the primary location, and don't call into
	diagnostic_print_caret_line.
	(gfc_warning_now_at): Update for change in signature of
	diagnostic_set_info.
	(gfc_warning_now): Likewise.
	(gfc_error_now): Likewise.
	(gfc_fatal_error): Likewise.
	(gfc_error): Likewise.
	(gfc_internal_error): Likewise.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic-test-show-locus-bw.c: New file.
	* gcc.dg/plugin/diagnostic-test-show-locus-color.c: New file.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: New file.
	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the above.
	* lib/gcc-dg.exp: Load multiline.exp.

libcpp/ChangeLog:
	* errors.c (cpp_diagnostic): Update for change in signature
	of "error" callback.
	(cpp_diagnostic_with_line): Likewise, calling override_column
	on the rich_location.
	* include/cpplib.h (struct cpp_callbacks): Within "error"
	callback, convert param from source_location to rich_location *,
	and drop column_override param.
	* include/line-map.h (struct source_range): New struct.
	(struct location_range): New struct.
	(class rich_location): New class.
	(linemap_client_expand_location_to_spelling_point): New declaration.
	* line-map.c (rich_location::rich_location): New ctors.
	(rich_location::lazily_expand_location): New method.
	(rich_location::override_column): New method.
	(rich_location::add_range): New methods.
	(rich_location::set_range): New method.

From-SVN: r229884
2015-11-06 19:50:50 +00:00
Ramana Radhakrishnan e78d485eb8 [Patch AArch64] Switch constant pools to separate rodata sections.
Properly apply ..

2015-11-06  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

	Properly apply.
	2015-11-05  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
        * config/aarch64/aarch64.c
        (aarch64_can_use_per_function_literal_pools_p): New.
        (aarch64_use_blocks_for_constant_p): Adjust declaration
        and use aarch64_can_use_function_literal_pools_p.
        (aarch64_select_rtx_section): Update.

From-SVN: r229878
2015-11-06 19:00:59 +00:00
Ramana Radhakrishnan bae4ce0ff3 [Patch ARM] Unified assembler in ARM state.
gcc/ChangeLog:

2015-11-06  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

	* config/arm/arm-ldmstm.ml: Rewrite to generate unified asm templates.
	* config/arm/arm.c (arm_asm_trampoline_template): Make unified asm safe.
	(arm_output_multireg_pop): Likewise.
	(output_move_double):  Likewise.
	(output_move_quad):  Likewise.
	(output_return_instruction): Likewise.
	(arm_print_operand): Remove support for %( and %. print modifiers.
	(arm_output_shift): Make unified asm.
	(arm_declare_function_name): Likewise.
	* config/arm/arm.h (TARGET_UNIFIED_ASM): Delete.
         (ASM_APP_OFF): Adjust.
         (ASM_OUTPUT_REG_PUSH): Undo special casing for TARGET_ARM.
         (ASM_OUTPUT_REG_POP): Likewise.
	* config/arm/arm.md: Adjust uses of %., %(, %) 
	* config/arm/sync.md: Likewise.
	* config/arm/thumb2.md: Likewise.
	* config/arm/ldmstm.md: Regenerate.
	* config/arm/arm.opt (masm-unified-syntax): Do not special case Thumb.
	* doc/invoke.texi (masm-unified-syntax): Update documentation.

gcc/testsuite/ChangeLog:

2015-11-06  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

	* gcc.target/arm/combine-movs.c:
	* gcc.target/arm/interrupt-1.c:
	* gcc.target/arm/interrupt-2.c:
	* gcc.target/arm/unaligned-memcpy-4.c:

From-SVN: r229875
2015-11-06 18:43:15 +00:00
David Malcolm ee015909ee Add stats on adhoc table to dump_line_table_statistics
gcc/ChangeLog:
	* input.c (dump_line_table_statistics): Dump stats on adhoc table.

libcpp/ChangeLog:
	* include/line-map.h (struct linemap_stats): Add fields
	"adhoc_table_size" and "adhoc_table_entries_used".
	* line-map.c (linemap_get_statistics): Populate above fields.

From-SVN: r229873
2015-11-06 18:40:56 +00:00
Jan Hubicka 2a8e33581b tree-core.h (size_type_kind): Remove OEP_CONSTANT_ADDRESS_OF and add OEP_MATCH_SIDE_EFFECTS.
* tree-core.h (size_type_kind): Remove OEP_CONSTANT_ADDRESS_OF and
	add OEP_MATCH_SIDE_EFFECTS.
	* fold-const.c (operand_equal_p): Update documentation; handle
	OEP_MATCH_SIDE_EFFECTS.
	* tree-ssa-tail-merge.c (gimple_operand_equal_value_p): Use
	OEP_MATCH_SIDE_EFFECTS.

From-SVN: r229867
2015-11-06 17:24:28 +00:00
Benedikt Huber a6fc00da76 aarch64-builtins.c: Builtins for rsqrt and rsqrtf.
2015-11-06  Benedikt Huber  <benedikt.huber@theobroma-systems.com>
	    Philipp Tomsich  <philipp.tomsich@theobroma-systems.com>

	* config/aarch64/aarch64-builtins.c: Builtins for rsqrt and rsqrtf.
	* config/aarch64/aarch64-protos.h: Declare.
	* config/aarch64/aarch64-simd.md: Matching expressions for frsqrte and
	frsqrts.
	* config/aarch64/aarch64-tuning-flags.def: Added recip_sqrt.
	* config/aarch64/aarch64.c: New functions. Emit rsqrt estimation code when
	applicable.
	* config/aarch64/aarch64.md: Added enum entries.
	* config/aarch64/aarch64.opt: Added option -mlow-precision-recip-sqrt.
	* testsuite/gcc.target/aarch64/rsqrt_asm_check_common.h: Common macros for
	assembly checks.
	* testsuite/gcc.target/aarch64/rsqrt_asm_check_negative_1.c: Make sure
	frsqrts and frsqrte are not emitted.
	* testsuite/gcc.target/aarch64/rsqrt_asm_check_1.c: Make sure frsqrts and
	frsqrte are emitted.
	* testsuite/gcc.target/aarch64/rsqrt_1.c: Functional tests for rsqrt.

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Co-Authored-By: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

From-SVN: r229866
2015-11-06 17:10:17 +00:00
Jan Hubicka 567700fddd re PR ipa/68057 (450.soplex in SPEC CPU 2006 failed to build)
PR ipa/68057
	PR ipa/68220
	* ipa-polymorphic-call.c
	(ipa_polymorphic_call_context::restrict_to_inner_type): Fix ordering
	issue when offset is out of range.
	(contains_type_p): Fix out of range check, clear dynamic flag.
	* g++.dg/lto/pr68057_0.C: New testcase.
	* g++.dg/lto/pr68057_1.C: New testcase.
	* g++.dg/torture/pr68220.C: New testcase.

From-SVN: r229859
2015-11-06 16:04:38 +00:00
Martin Sebor 8309230f83 Correct entry for PR c++/67942.
From-SVN: r229857
2015-11-06 08:42:41 -07:00
Arnout Vandecappelle 75d86b7d38 config.gcc (e6500): Fix cpu_is_64bit typo.
2015-11-06  Arnout Vandecappelle  <arnout@mind.be>
        * config.gcc (e6500): Fix cpu_is_64bit typo.

From-SVN: r229855
2015-11-06 10:31:52 -05:00
Alan Lawrence 55bf45c0f3 tree-sra.c: Fix completely_scalarize for negative indices.
* tree-sra.c (completely_scalarize): Properly handle negative array
	indices using offset_int.

From-SVN: r229852
2015-11-06 13:48:32 +00:00
Richard Biener f1aa4bb328 alloc-pool.h (object_allocator::allocate): Default-initialize object.
2015-11-06  Richard Biener  <rguenther@suse.de>

	* alloc-pool.h (object_allocator::allocate): Default-initialize
	object.

From-SVN: r229851
2015-11-06 13:47:17 +00:00
Richard Biener ff56974436 tree-ssa-sccvn.c (class sccvn_dom_walker): Add destructor.
2015-11-06  Richard Biener  <rguenther@suse.de>

	* tree-ssa-sccvn.c (class sccvn_dom_walker): Add destructor.
	* lra.c (init_reg_info): Truncate copy_vec instead of
	re-allocating a new one and leaking the old.
	* ipa-inline-analysis.c (estimate_function_body_sizes): Free
	bb_infos vec.
	* sched-deps.c (sched_deps_finish): Free the dn/dl pools.
	* postreload-gcse.c (free_mem): Free modify_mem_list and
	canon_modify_mem_list.

From-SVN: r229850
2015-11-06 13:45:54 +00:00
Ilya Enkovich b036c6c53e re PR tree-optimization/68145 (ICE: in vectorizable_store, at tree-vect-stmts.c:5684)
gcc/

	PR tree-optimization/68145
	* tree-vect-stmts.c (vectorizable_operation): Fix
	determination for booleans.

gcc/testsuite/

	PR tree-optimization/68145
	* g++.dg/vect/pr68145.cc: New test.

From-SVN: r229848
2015-11-06 13:31:51 +00:00
Tom de Vries 4a4b6c4c27 Fix transform_to_exit_first_loop_alt with -g
2015-11-06  Tom de Vries  <tom@codesourcery.com>

	* tree-cfg.c (gimple_split_block_before_cond_jump): Split before
	cond_jump, instead of split after last nondebug insn before cond_jump.
	* tree-parloops.c (transform_to_exit_first_loop_alt): Verify ssa before
	returning.

From-SVN: r229847
2015-11-06 13:21:51 +00:00
Kyrylo Tkachov c9aa6b940f [ARM/AArch64] PR 68088: Fix RTL checking ICE due to subregs inside accumulator forwarding check
PR target/68088
        * config/arm/aarch-common.c (aarch_accumulator_forwarding): Strip
        subregs from accumulator and make sure it's a register.

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

From-SVN: r229845
2015-11-06 12:04:15 +00:00
Simon Dardis 66c5c67baf Update loongson vector reductions.
2015-11-06  Simon Dardis  <simon.dardis@imgtec.com>

        * config/mips/loongson.md (vec_loongson_extract_lo_<mode>): New, extract
        low part to scalar.
        (reduc_uplus_<mode>): Remove.
        (reduc_plus_scal_<mode>): Rename from reduc_splus_<mode>, Use vec
        loongson_extract_lo_<mode>.
        (reduc_smax_scal_<mode>, reduc_smin_scal_<mode>): Rename from
        reduc_smax_<mode>, reduc_smax_<mode>, use vec
        loongson_extract_lo_<mode>.
        (reduc_umax_scal_<mode>, reduc_umin_scal_<mode>): Rename.

From-SVN: r229844
2015-11-06 11:59:20 +00:00
Richard Biener 61d371eb41 tree-vectorizer.h (struct _bb_vec_info): Add region_begin/end members.
2015-11-06  Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (struct _bb_vec_info): Add region_begin/end
	members.
	(vect_stmt_in_region_p): Declare.
	* tree-vect-slp.c (new_bb_vec_info): Work on a region.
	(destroy_bb_vec_info): Likewise.
	(vect_bb_slp_scalar_cost): Use vect_stmt_in_region_p.
	(vect_get_and_check_slp_defs): Likewise.
	(vect_slp_analyze_bb_1): Refactor to make it work on sub-BBs.
	(vect_slp_bb): Likewise.
	* tree-vect-patterns.c (vect_same_loop_or_bb_p): Implement
	in terms of vect_stmt_in_region_p.
	(vect_pattern_recog): Iterate over the BB region.
	* tree-vect-stmts.c (vect_is_simple_use): Use vect_stmt_in_region_p.
	* tree-vectorizer.c (vect_stmt_in_region_p): New function.
	(pass_slp_vectorize::execute): Initialize all stmt UIDs to -1.

	* config/i386/i386.c: Include gimple-iterator.h.
	* config/aarch64/aarch64.c: Likewise.

	* gcc.dg/vect/bb-slp-38.c: New testcase.

From-SVN: r229842
2015-11-06 11:15:40 +00:00
Alexandre Oliva a029addda2 [PR67753] fix copy of PARALLEL entry_parm to CONCAT target_reg
In assign_parms_setup_block, the copy of args in PARALLELs from
entry_parm to stack_parm is deferred to the parm conversion insn seq,
but the copy from stack_parm to target_reg was inserted in the normal
copy seq, that is executed before the conversion insn seq.  Oops.

We could do away with the need for an actual stack_parm in general,
which would have avoided the need for emitting the copy to target_reg
in the conversion seq, but at least on pa, due to the need for stack
to copy between SI and SF modes, it seems like using the reserved
stack slot is beneficial, so I put in logic to use a pre-reserved
stack slot when there is one, and emit the copy to target_reg in the
conversion seq if stack_parm was set up there.

for  gcc/ChangeLog

	PR rtl-optimization/67753
	PR rtl-optimization/64164
	* function.c (assign_parm_setup_block): Avoid allocating a
	stack slot if we don't have an ABI-reserved one.  Emit the
	copy to target_reg in the conversion seq if the copy from
	entry_parm is in it too.  Don't use the conversion seq to copy
	a PARALLEL to a REG or a CONCAT.

From-SVN: r229840
2015-11-06 10:34:13 +00:00
Richard Biener 8ba66467b9 tree-hash-traits.h (tree_operand_hash): Provide equal, not equal_keys.
2015-11-06  Richard Biener  <rguenther@suse.de>

	* tree-hash-traits.h (tree_operand_hash): Provide equal, not
	equal_keys.

From-SVN: r229838
2015-11-06 09:46:17 +00:00
Cesar Philippidis 7a5e4956cc gimplify.c (gimplify_scan_omp_clauses): Add support for OMP_CLAUSE_TILE.
gcc/
	* gimplify.c (gimplify_scan_omp_clauses): Add support for
	OMP_CLAUSE_TILE.  Update handling of OMP_CLAUSE_INDEPENDENT.
	(gimplify_adjust_omp_clauses): Likewise.
	* omp-low.c (scan_sharing_clauses): Add support for OMP_CLAUSE_TILE.
	* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_TILE.
	* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_TILE.
	* tree.c (omp_clause_num_ops): Add an entry for OMP_CLAUSE_TILE.
	(omp_clause_code_name): Likewise.
	(walk_tree_1): Handle OMP_CLAUSE_TILE.
	* tree.h (OMP_TILE_LIST): New macro.

	gcc/c-family/
	* c-omp.c (c_oacc_split_loop_clauses): Make TILE, GANG, WORKER, VECTOR,
	AUTO, SEQ, INDEPENDENT and PRIVATE loop clauses.  Associate REDUCTION
	clauses with parallel and kernels and loops.
	* c-pragma.h (enum pragma_omp_clause): Add entries for
	PRAGMA_OACC_CLAUSE_{INDEPENDENT,TILE,DEFAULT}.
	* pt.c (tsubst_omp_clauses): Add support for OMP_CLAUSE_{NUM_GANGS,
	NUM_WORKERS,VECTOR_LENGTH,GANG,WORKER,VECTOR,ASYNC,WAIT,TILE,AUTO,
	INDEPENDENT,SEQ}. 
	(tsubst_expr): Add support for OMP_CLAUSE_{KERNELS,PARALLEL,LOOP}.

	gcc/c/
	* c-parser.c (c_parser_omp_clause_name): Add support for
	PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
	(c_parser_omp_clause_default): Add is_oacc argument. Handle
	default(none) in OpenACC.
	(c_parser_oacc_shape_clause): Allow pointer variables as gang static
	arguments.
	(c_parser_oacc_clause_tile): New function.
	(c_parser_oacc_all_clauses): Add support for OMP_CLAUSE_DEFAULT,
	OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.
	(OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
	TILE}.
	(OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
	(OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
	FIRSTPRIVATE}.
	(c_parser_omp_all_clauses): Update call to c_parser_omp_clause_default.
	(c_parser_oacc_update): Update the error message for missing clauses.
	* c-typeck.c (c_finish_omp_clauses): Add support for OMP_CLAUSE_TILE
	and OMP_CLAUSE_INDEPENDENT.

	gcc/cp/
	* parser.c (cp_parser_omp_clause_name): Add support for
	PRAGMA_OACC_CLAUSE_INDEPENDENT and PRAGMA_OACC_CLAUSE_TILE.
	(cp_parser_oacc_shape_clause): Allow pointer variables as gang static
	arguments.
	(cp_parser_oacc_clause_tile): New function.
	(cp_parser_omp_clause_default): Add is_oacc argument. Handle
	default(none) in OpenACC.
	(cp_parser_oacc_all_clauses): Add support for
	(cp_parser_omp_all_clauses): Update call to
	cp_parser_omp_clause_default.
	PRAGMA_OACC_CLAUSE_{DEFAULT,INDEPENDENT,TILE,PRIVATE,FIRSTPRIVATE}.
	(OACC_LOOP_CLAUSE_MASK): Add PRAGMA_OACC_CLAUSE_{PRIVATE,INDEPENDENT,
	TILE}.
	(OACC_KERNELS_MASK): Add PRAGMA_OACC_CLAUSE_DEFAULT.
	(OACC_PARALLEL_MASK): Add PRAGMA_OACC_CLAUSE_{DEFAULT,PRIVATE,
	FIRSTPRIVATE}.
	(cp_parser_oacc_update): Update the error message for missing clauses.
	* semantics.c (finish_omp_clauses): Add support for
	OMP_CLAUSE_INDEPENDENT and OMP_CLAUSE_TILE.

	gcc/fortran/
	* openmp.c (gfc_match_omp_clauses): Update support for the tile
	and default clauses in OpenACC.
	(gfc_match_oacc_update): Error when data clauses are supplied.
	(oacc_compatible_clauses): Delete.
	(resolve_omp_clauses): Give special care for OpenACC reductions.
	Also update error reporting for the tile clause.
	(resolve_oacc_loop_blocks): Update error reporting for the tile clause.
	* trans-openmp.c (gfc_trans_omp_clauses): Update OMP_CLAUSE_SEQ. Add
	OMP_CLAUSE_{AUTO,TILE} and add support the the gang static argument.
	(gfc_trans_oacc_combined_directive): Update the list of clauses which
	are split to acc loops.

	gcc/testsuite/
	* c-c++-common/goacc/combined-directives.c: New test.
	* c-c++-common/goacc/loop-clauses.c: New test.
	* c-c++-common/goacc/tile.c: New test.
	* c-c++-common/goacc/loop-shape.c: Add test for pointer variable
	as gang static arguments.
	* c-c++-common/goacc/update-1.c: Adjust expected error message.
	* g++.dg/goacc/template.C: New test.
	* gfortran.dg/goacc/combined-directives.f90: New test.
	* gfortran.dg/goacc/default.f95: New test.
	* gfortran.dg/goacc/default_none.f95: New test.
	* gfortran.dg/goacc/firstprivate-1.f95: New test.
	* gfortran.dg/goacc/gang-static.f95: New test.
	* gfortran.dg/goacc/kernels-loop-inner.f95: New test.
	* gfortran.dg/goacc/kernels-loops-adjacent.f95: New test.
	* gfortran.dg/goacc/list.f95: Update test.
	* gfortran.dg/goacc/loop-2.f95: Likewise.
	* gfortran.dg/goacc/loop-4.f95: New test.
	* gfortran.dg/goacc/loop-5.f95: New test.
	* gfortran.dg/goacc/loop-6.f95: New test.
	* gfortran.dg/goacc/loop-tree-1.f90: Update test.
	* gfortran.dg/goacc/multi-clause.f90: New test.
	* gfortran.dg/goacc/parallel-tree.f95: Update test.
	* gfortran.dg/goacc/update.f95: New test.


Co-Authored-By: James Norris <jnorris@codesourcery.com>
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r229832
2015-11-05 18:03:48 -08:00
Martin Sebor e2f5cc96e5 PR c++/67942 - diagnose placement new buffer overflow
gcc/
        * invoke.texi (-Wplacement-new): Document new option.
	* gcc/testsuite/g++.dg/warn/Wplacement-new-size.C: New test.

gcc/c-family/
        * c.opt (-Wplacement-new): New option.

gcc/cp/
	* cp/init.c (warn_placement_new_too_small): New function.
	(build_new_1): Call it.

gcc/testsuite/
        * g++.dg/warn/Wplacement-new-size.C: New test.

From-SVN: r229827
2015-11-05 14:42:10 -07:00
Alan Lawrence 60f2d2f36d [PATCH] tree-scalar-evolution.c: Handle LSHIFT by constant
gcc/:

	PR tree-optimization/65963
	* tree-scalar-evolution.c (interpret_rhs_expr): Try to handle
	LSHIFT_EXPRs as equivalent unsigned MULT_EXPRs.

gcc/testsuite/:

	* gcc.dg/pr68112.c: New.
	* gcc.dg/vect/vect-strided-shift-1.c: New.

From-SVN: r229825
2015-11-05 18:39:38 +00:00
James Greenhalgh 5d819bb7c8 [Patch ifcvt] Teach RTL ifcvt to handle multiple simple set instructions
gcc/

	* ifcvt.c (bb_ok_for_noce_convert_multiple_sets): New.
	(noce_convert_multiple_sets): Likewise.
	(noce_process_if_block): Call them.

gcc/testsuite/

	* gcc.dg/ifcvt-4.c: New.

From-SVN: r229822
2015-11-05 18:11:12 +00:00
Nathan Sidwell 451e8dae5d gimple-fold.c: Include omp-low.h.
* gimple-fold.c: Include omp-low.h.
	(fold_internal_goacc_dim): New.
	(gimple_fold_call): Call it.

From-SVN: r229816
2015-11-05 15:46:59 +00:00
Jakub Jelinek e01d41e553 gcc/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* builtin-types.def
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New.
	* cgraph.h (enum cgraph_simd_clone_arg_type): Add
	SIMD_CLONE_ARG_TYPE_LINEAR_REF_VARIABLE_STEP,
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP and
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP.
	(struct cgraph_simd_clone_arg): Adjust comment.
	* omp-builtins.def (BUILT_IN_GOMP_TARGET): Rename GOMP_target_41
	to GOMP_target_ext.  Add num_teams and thread_limit arguments.
	(BUILT_IN_GOMP_TARGET_DATA): Rename GOMP_target_data_41
	to GOMP_target_data_ext.
	(BUILT_IN_GOMP_TARGET_UPDATE): Rename GOMP_target_update_41
	to GOMP_target_update_ext.
	(BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_START,
	BUILT_IN_GOMP_LOOP_NONMONOTONIC_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_NONMONOTONIC_GUIDED_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_START,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_START,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_DYNAMIC_NEXT,
	BUILT_IN_GOMP_LOOP_ULL_NONMONOTONIC_GUIDED_NEXT,
	BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_DYNAMIC,
	BUILT_IN_GOMP_PARALLEL_LOOP_NONMONOTONIC_GUIDED): New built-ins.
	* tree-core.h (enum omp_clause_schedule_kind): Add
	OMP_CLAUSE_SCHEDULE_MASK, OMP_CLAUSE_SCHEDULE_MONOTONIC,
	OMP_CLAUSE_SCHEDULE_NONMONOTONIC and change
	OMP_CLAUSE_SCHEDULE_LAST value.
	* tree.def (OMP_SIMD, CILK_SIMD, CILK_FOR, OMP_DISTRIBUTE,
	OMP_TASKLOOP, OACC_LOOP): Add OMP_FOR_ORIG_DECLS argument.
	* tree.h (OMP_FOR_ORIG_DECLS): Use OMP_LOOP_CHECK instead of
	OMP_FOR_CHECK.  Remove comment.
	* tree-pretty-print.c (dump_omp_clause): Handle
	GOMP_MAP_FIRSTPRIVATE_REFERENCE and GOMP_MAP_ALWAYS_POINTER.
	Simplify.  Print schedule clause modifiers.
	* tree-vect-stmts.c (vectorizable_simd_clone_call): Add
	SIMD_CLONE_ARG_TYPE_LINEAR_{REF,VAL,UVAL}_VARIABLE_STEP
	cases.
	* gimplify.c (enum gimplify_omp_var_data): Add GOVD_MAP_ALWAYS_TO.
	(omp_default_clause): Tweak for
	private/firstprivate/is_device_ptr variables on target
	construct and use_device_ptr on target data.
	(omp_check_private): Likewise.
	(omp_notice_variable): For references check whether what it refers
	to has mappable type, rather than the reference itself.
	(omp_is_private): Diagnose linear iteration variables on non-simd
	constructs.
	(omp_no_lastprivate): Return true only for Fortran.
	(gimplify_scan_omp_clauses): Or in GOVD_MAP_ALWAYS_TO for
	GOMP_MAP_ALWAYS_TO or GOMP_MAP_ALWAYS_TOFROM kinds.
	Add support for GOMP_MAP_FIRSTPRIVATE_REFERENCE and
	GOMP_MAP_ALWAYS_POINTER, remove old handling of structure element
	based array sections.  Use GOMP_MAP_ALWAYS_P.  Fix up handling of
	lastprivate and linear when combined with distribute.  Gimplify
	variable low-bound for array reduction.  Look through
	POINTER_PLUS_EXPR when looking for ADDR_EXPR for array section
	reductions.
	(gimplify_adjust_omp_clauses_1): For implicit references to
	variables with reference type and when not ref to scalar or
	ref to pointer, map what they refer to using tofrom and
	use GOMP_MAP_FIRSTPRIVATE_REFERENCE for the reference.
	(gimplify_adjust_omp_clauses): Remove GOMP_MAP_ALWAYS_POINTER
	from target exit data.  Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE.
	Drop OMP_CLAUSE_MAP_PRIVATE support.  Use GOMP_MAP_ALWAYS_P.
	Diagnose the same var on both firstprivate and lastprivate on
	distribute construct.
	(gimplify_omp_for): Fix up handling of predetermined
	lastprivate or linear iter vars when combined with distribute.
	(find_omp_teams, computable_teams_clause, optimize_target_teams): New
	functions.
	(gimplify_omp_workshare): Call optimize_target_teams.
	* omp-low.c (struct omp_region): Add sched_modifiers field.
	(struct omp_for_data): Likewise.
	(omp_any_child_fn_dumped): New variable.
	(extract_omp_for_data): Fill in sched_modifiers, and mask out
	OMP_CLAUSE_SCHEDULE_KIND bits outside of OMP_CLAUSE_SCHEDULE_MASK
	from sched_kind.
	(determine_parallel_type): Use only OMP_CLAUSE_SCHEDULE_MASK
	bits of OMP_CLAUSE_SCHED_KIND.
	(scan_sharing_clauses): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE,
	drop OMP_CLAUSE_MAP_PRIVATE support.  Look through POINTER_PLUS_EXPR
	for array section reductions.
	(add_taskreg_looptemp_clauses): Add one extra _looptemp_ clause even
	for distribute parallel for, if there are lastprivate clauses on the
	for.
	(lower_rec_input_clauses): Handle non-zero low-bound on array
	section reductions.
	(lower_reduction_clauses): Likewise.
	(lower_send_clauses): Look through POINTER_PLUS_EXPR
	for array section reductions.
	(expand_parallel_call): Use nonmonotonic entrypoints for
	nonmonotonic: dynamic/guided.
	(expand_omp_taskreg): Call assign_assembler_name_if_neeeded on
	child_fn if current_function_decl has assembler name set, but child_fn
	does not.  Dump the header and IL of the child function when not in SSA
	form.
	(expand_omp_target): Likewise.  Pass num_teams and thread_limit
	arguments to BUILT_IN_GOMP_TARGET.
	(expand_omp_for_static_nochunk, expand_omp_for_static_chunk):
	Initialize the extra _looptemp_ clause to fd->loop.n2.
	(expand_omp_for): Use nonmonotonic entrypoints for
	nonmonotonic: dynamic/guided.  Initialize region->sched_modifiers.
	(expand_omp): Clear omp_any_child_fn_dumped.  Dump function header
	again if we have dumped any child functions.
	(lower_omp_for_lastprivate): Determine the right count variable
	for distribute simd, or distribute parallel for{, simd}.
	(lower_omp_target): Handle GOMP_MAP_FIRSTPRIVATE_REFERENCE
	and GOMP_MAP_ALWAYS_POINTER.  Drop OMP_CLAUSE_MAP_PRIVATE
	support.
	(simd_clone_clauses_extract): Handle variable step
	for references and arguments passed by reference.
	(simd_clone_mangle): Mangle ref/uval/val variable steps.
	(simd_clone_adjust_argument_types): Handle
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP like
	SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP and
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP like
	SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP.
	(simd_clone_linear_addend): New function.
	(simd_clone_adjust): Handle variable step like similarly
	to constant step, use simd_clone_linear_addend to determine
	the actual step at runtime.
gcc/c-family/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>

	* c-common.h (c_finish_omp_atomic): Add TEST argument.
	(c_omp_check_loop_iv, c_omp_check_loop_iv_exprs): New prototypes.
	* c-omp.c (c_finish_omp_atomic): Add TEST argument.  Don't call
	save_expr or create_tmp_var* if TEST is true.
	(c_finish_omp_for): Store OMP_FOR_ORIG_DECLS always.
	Don't call add_stmt here.
	(struct c_omp_check_loop_iv_data): New type.
	(c_omp_check_loop_iv_r, c_omp_check_loop_iv,
	c_omp_check_loop_iv_exprs): New functions.
	(c_omp_split_clauses): Adjust for lastprivate being allowed on
	distribute.
	(c_omp_declare_simd_clauses_to_numbers): Change
	OMP_CLAUSE_LINEAR_VARIABLE_STRIDE OMP_CLAUSE_LINEAR_STEP into numbers.
	(c_omp_declare_simd_clauses_to_decls): Similarly change those
	from numbers to PARM_DECLs.
gcc/c/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* c-parser.c: Include context.h and gimple-expr.h.
	(c_parser_omp_clause_schedule): Parse schedule modifiers, diagnose
	monotonic together with nonmonotonic.
	(c_parser_omp_for_loop): Call c_omp_check_loop_iv.  Call add_stmt here.
	(OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
	(c_parser_omp_target_data, c_parser_omp_target_enter_data,
	c_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER.
	(c_parser_omp_target): Likewise.  Evaluate num_teams and thread_limit
	expressions on combined target teams before the target.
	(c_parser_omp_declare_target): If decl has "omp declare target" or
	"omp declare target link" attribute, and cgraph or varpool node already
	exists, then set corresponding flags.  Call c_finish_omp_clauses
	in the parenthesized extended-list syntax case.
	* c-decl.c (c_decl_attributes): Don't diagnose block scope vars inside
	declare target.
	* c-typeck.c (handle_omp_array_sections_1): Allow non-zero low-bound
	on OMP_CLAUSE_REDUCTION array sections.
	(handle_omp_array_sections): Encode low-bound into the MEM_REF, either
	into the constant offset, or for variable low-bound using
	POINTER_PLUS_EXPR.  For structure element based array sections use
	GOMP_MAP_ALWAYS_POINTER instead of GOMP_MAP_FIRSTPRIVATE_POINTER.
	(c_finish_omp_clauses): Drop generic_field_head, structure
	elements are now always mapped even as array section bases,
	diagnose same var in data sharing and mapping clauses.  Diagnose if
	linear step on declare simd is neither a constant nor a uniform
	parameter.  Look through POINTER_PLUS_EXPR for array section
	reductions.  Diagnose the same var or function appearing multiple
	times on the same directive.  Fix up wording for the to clause if t
	is neither a FUNCTION_DECL nor a VAR_DECL.  Diagnose nonmonotonic
	modifier on kinds other than dynamic or guided or nonmonotonic
	modifier together with ordered clause.
gcc/cp/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* cp-tree.h (finish_omp_for): Add ORIG_INITS argument.
	(omp_privatize_field): Add SHARED argument.
	* parser.c: Include context.h.
	(cp_parser_omp_clause_schedule): Parse schedule
	modifiers, diagnose monotonic together with nonmonotonic.
	(cp_parser_omp_clause_linear): Add DECLARE_SIMD argument.  Parse
	parameter name as linear step as id-expression rather than expression.
	(cp_parser_omp_all_clauses): Adjust caller.
	(cp_parser_omp_for_loop_init): Add ORIG_INIT argument,
	initialize it.  Adjust omp_privatize_field caller.
	(cp_parser_omp_for_loop): Compute orig_inits, pass it's address
	to finish_omp_for.
	(OMP_DISTRIBUTE_CLAUSE_MASK): Add lastprivate clause.
	(cp_parser_omp_target_data,
	cp_parser_omp_target_enter_data,
	cp_parser_omp_target_exit_data): Allow GOMP_MAP_ALWAYS_POINTER
	and GOMP_MAP_FIRSTPRIVATE_REFERENCE.
	(cp_parser_omp_target): Likewise.  Evaluate num_teams and
	thread_limit expressions on combined target teams before the target.
	(cp_parser_omp_declare_target): If decl has "omp declare target" or
	"omp declare target link" attribute, and cgraph or varpool node already
	exists, then set corresponding flags.  Call finish_omp_clauses
	in the parenthesized extended-list syntax case.  Call
	cp_parser_require_pragma_eol instead of cp_parser_skip_to_pragma_eol.
	(cp_parser_omp_end_declare_target): Call cp_parser_require_pragma_eol
	instead of cp_parser_skip_to_pragma_eol.
	* decl2.c (cplus_decl_attributes): Don't diagnose block scope vars inside
	declare target.
	* pt.c (tsubst_omp_clauses): If OMP_CLAUSE_LINEAR_VARIABLE_STRIDE,
	use tsubst_omp_clause_decl instead of tsubst_expr on
	OMP_CLAUSE_LINEAR_STEP.  Handle non-static data members in shared
	clauses.
	(tsubst_omp_for_iterator): Adjust omp_privatize_field caller.
	(tsubst_find_omp_teams): New function.
	(tsubst_expr): Evaluate num_teams and thread_limit expressions on
	combined target teams before the target.  Use OMP_FOR_ORIG_DECLS for
	all OpenMP/OpenACC/Cilk+ looping constructs.  Adjust finish_omp_for
	caller.
	* semantics.c (omp_privatize_field): Add SHARED argument, if true,
	always create artificial var and never put it into the hash table
	or vector.
	(handle_omp_array_sections_1): Adjust omp_privatize_field caller.
	Allow non-zero low-bound on OMP_CLAUSE_REDUCTION array sections.
	(handle_omp_array_sections): For structure element
	based array sections use GOMP_MAP_ALWAYS_POINTER instead of
	GOMP_MAP_FIRSTPRIVATE_POINTER.  Encode low-bound into the MEM_REF,
	either into the constant offset, or for variable low-bound using
	POINTER_PLUS_EXPR.
	(finish_omp_clauses): Adjust omp_privatize_field caller.  Drop
	generic_field_head, structure elements are now always mapped even
	as array section bases, diagnose same var in data sharing and
	mapping clauses.  For references map what they refer to using
	GOMP_MAP_ALWAYS_POINTER for structure elements and
	GOMP_MAP_FIRSTPRIVATE_REFERENCE otherwise.  Diagnose if linear step
	on declare simd is neither a constant nor a uniform parameter.
	Allow non-static data members on shared clauses.  Look through
	POINTER_PLUS_EXPR for array section reductions.  Diagnose nonmonotonic
	modifier on kinds other than dynamic or guided or nonmonotonic
	modifier together with ordered clause.  Diagnose the same var or
	function appearing multiple times on the same directive.  Fix up
	wording for the to clause if t is neither a FUNCTION_DECL nor a
	VAR_DECL, use special wording for OVERLOADs and TEMPLATE_ID_EXPR.
	(handle_omp_for_class_iterator): Add ORIG_DECLS argument.  Call
	c_omp_check_loop_iv_exprs on cond.
	(finish_omp_for): Add ORIG_INITS argument.  Call
	c_omp_check_loop_iv_exprs on ORIG_INITS elements.  Adjust
	handle_omp_for_class_iterator caller.  Call c_omp_check_loop_iv.
	Call add_stmt.
	(finish_omp_atomic): Adjust c_finish_omp_atomic caller.
gcc/fortran/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>

	* types.def (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR): Remove.
	(BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): New.
gcc/testsuite/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>

	* c-c++-common/gomp/clauses-2.c (foo): Adjust for diagnostics
	of variables in both data sharing and mapping clauses and for
	structure element based array sections being mapped rather than
	privatized.
	* c-c++-common/gomp/declare-target-2.c: Add various new tests.  Adjust
	expected diagnostics wording in one case.
	* c-c++-common/gomp/distribute-1.c: New test.
	* c-c++-common/gomp/element-1.c: New test.
	* c-c++-common/gomp/pr61486-2.c: Add #pragma omp declare target
	and #pragma omp end declare target pair around the function.
	Change s from a parameter to a file scope variable.
	* c-c++-common/gomp/pr67521.c: Add dg-error directives.
	* c-c++-common/gomp/reduction-1.c (foo): Don't expect diagnostics
	on non-zero low-bound in reduction array sections.  Add further
	tests.
	* c-c++-common/gomp/schedule-modifiers-1.c: New test.
	* c-c++-common/gomp/target-teams-1.c: New test.
	* gcc.dg/gomp/declare-simd-1.c: Add scan-assembler-times directives
	for expected mangling on x86_64/i?86.
	* gcc.dg/gomp/declare-simd-3.c: New test.
	* gcc.dg/gomp/declare-simd-4.c: New test.
	* gcc.dg/gomp/for-20.c: New test.
	* gcc.dg/gomp/for-21.c: New test.
	* gcc.dg/gomp/for-22.c: New test.
	* gcc.dg/gomp/for-23.c: New test.
	* gcc.dg/gomp/for-24.c: New test.
	* gcc.dg/gomp/linear-1.c: New test.
	* gcc.dg/gomp/loop-1.c: New test.
	* g++.dg/gomp/atomic-17.C: New test.
	* g++.dg/gomp/clause-1.C (T::test): Don't expect error on
	non-static data member in shared clause.  Add single construct.
	* g++.dg/gomp/declare-simd-1.C: Add dg-options.  Add
	scan-assembler-times directives for expected mangling on x86_64/i?86.
	* g++.dg/gomp/declare-simd-3.C: Likewise.
	* g++.dg/gomp/declare-simd-4.C: New test.
	* g++.dg/gomp/declare-simd-5.C: New test.
	* g++.dg/gomp/declare-target-1.C: New test.
	* g++.dg/gomp/linear-2.C: New test.
	* g++.dg/gomp/loop-1.C: New test.
	* g++.dg/gomp/loop-2.C: New test.
	* g++.dg/gomp/loop-3.C: New test.
	* g++.dg/gomp/member-2.C (B::m2, B::m4): Don't expect error on
	non-static data member in shared clause.
	* g++.dg/gomp/member-3.C: New test.
	* g++.dg/gomp/member-4.C: New test.
	* g++.dg/gomp/pr38639.C (foo): Adjust dg-error.
	(bar): Remove dg-message.
	* g++.dg/gomp/target-teams-1.C: New test.
include/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_2): Define.
	(GOMP_MAP_FLAG_ALWAYS): Remove.
	(enum gomp_map_kind): Use GOMP_MAP_FLAG_SPECIAL_2 instead of
	GOMP_MAP_FLAG_ALWAYS for GOMP_MAP_ALWAYS_TO, GOMP_MAP_ALWAYS_FROM,
	GOMP_MAP_ALWAYS_TOFROM, GOMP_MAP_STRUCT, GOMP_MAP_RELEASE.
	Add GOMP_MAP_ALWAYS_POINTER and GOMP_MAP_FIRSTPRIVATE_REFERENCE.
	(GOMP_MAP_ALWAYS_P): Define.
	(GOMP_TARGET_FLAG_NOWAIT): Adjust comment.
libgomp/
2015-11-05  Jakub Jelinek  <jakub@redhat.com>
	    Ilya Verbin  <ilya.verbin@intel.com>

	* libgomp_g.h (GOMP_loop_nonmonotonic_dynamic_next,
	GOMP_loop_nonmonotonic_dynamic_start,
	GOMP_loop_nonmonotonic_guided_next,
	GOMP_loop_nonmonotonic_guided_start,
	GOMP_loop_ull_nonmonotonic_dynamic_next,
	GOMP_loop_ull_nonmonotonic_dynamic_start,
	GOMP_loop_ull_nonmonotonic_guided_next,
	GOMP_loop_ull_nonmonotonic_guided_start,
	GOMP_parallel_loop_nonmonotonic_dynamic,
	GOMP_parallel_loop_nonmonotonic_guided): New prototypes.
	(GOMP_target_41): Renamed to ...
	(GOMP_target_ext): ... this.  Add num_teams and thread_limit
	arguments.
	(GOMP_target_data_41): Renamed to ...
	(GOMP_target_data_ext): ... this.
	(GOMP_target_update_41): Renamed to ...
	(GOMP_target_update_ext): ... this.
	* libgomp.map (GOMP_4.5): Export GOMP_target_ext,
	GOMP_target_data_ext and GOMP_target_update_ext instead of
	GOMP_target_41, GOMP_target_data_41 and GOMP_target_update_41.
	Export GOMP_loop_nonmonotonic_dynamic_next,
	GOMP_loop_nonmonotonic_dynamic_start,
	GOMP_loop_nonmonotonic_guided_next,
	GOMP_loop_nonmonotonic_guided_start,
	GOMP_loop_ull_nonmonotonic_dynamic_next,
	GOMP_loop_ull_nonmonotonic_dynamic_start,
	GOMP_loop_ull_nonmonotonic_guided_next,
	GOMP_loop_ull_nonmonotonic_guided_start,
	GOMP_parallel_loop_nonmonotonic_dynamic and
	GOMP_parallel_loop_nonmonotonic_guided.
	* loop.c (GOMP_parallel_loop_nonmonotonic_dynamic,
	GOMP_parallel_loop_nonmonotonic_guided,
	GOMP_loop_nonmonotonic_dynamic_start,
	GOMP_loop_nonmonotonic_guided_start,
	GOMP_loop_nonmonotonic_dynamic_next,
	GOMP_loop_nonmonotonic_guided_next): New aliases or functions.
	* loop_ull.c (GOMP_loop_ull_nonmonotonic_dynamic_start,
	GOMP_loop_ull_nonmonotonic_guided_start,
	GOMP_loop_ull_nonmonotonic_dynamic_next,
	GOMP_loop_ull_nonmonotonic_guided_next): Likewise.
	* target.c (gomp_map_0len_lookup, gomp_map_val): New inline
	functions.
	(gomp_map_vars): Handle GOMP_MAP_ALWAYS_POINTER.  For
	GOMP_MAP_ZERO_LEN_ARRAY_SECTION use gomp_map_0len_lookup.
	Use gomp_map_val function.
	(gomp_target_fallback_firstprivate): New static function.
	(GOMP_target_41): Renamed to ...
	(GOMP_target_ext): ... this.  Add num_teams and thread_limit
	arguments.  Move firstprivate fallback handling into a new
	function.
	(GOMP_target_data_41): Renamed to ...
	(GOMP_target_data_ext): ... this.
	(GOMP_target_update_41): Renamed to ...
	(GOMP_target_update_ext): ... this.
	(gomp_exit_data): For GOMP_MAP_*ZERO_LEN* use
	gomp_map_0len_lookup instead of gomp_map_lookup.
	(omp_target_is_present): Use gomp_map_0len_lookup instead of
	gomp_map_lookup.
	* testsuite/libgomp.c/target-28.c: Likewise.
	* testsuite/libgomp.c/monotonic-1.c: New test.
	* testsuite/libgomp.c/monotonic-2.c: New test.
	* testsuite/libgomp.c/nonmonotonic-1.c: New test.
	* testsuite/libgomp.c/nonmonotonic-2.c: New test.
	* testsuite/libgomp.c/pr66199-5.c: New test.
	* testsuite/libgomp.c/pr66199-6.c: New test.
	* testsuite/libgomp.c/pr66199-7.c: New test.
	* testsuite/libgomp.c/pr66199-8.c: New test.
	* testsuite/libgomp.c/pr66199-9.c: New test.
	* testsuite/libgomp.c/reduction-11.c: New test.
	* testsuite/libgomp.c/reduction-12.c: New test.
	* testsuite/libgomp.c/reduction-13.c: New test.
	* testsuite/libgomp.c/reduction-14.c: New test.
	* testsuite/libgomp.c/reduction-15.c: New test.
	* testsuite/libgomp.c/target-12.c (main): Adjust for
	omp_target_is_present change for one-past-last element.
	* testsuite/libgomp.c/target-17.c (foo): Drop tests where
	the same var is both mapped and privatized.
	* testsuite/libgomp.c/target-19.c (foo): Adjust for different
	handling of zero-length array sections.
	* testsuite/libgomp.c/target-28.c: New test.
	* testsuite/libgomp.c/target-29.c: New test.
	* testsuite/libgomp.c/target-30.c: New test.
	* testsuite/libgomp.c/target-teams-1.c: New test.
	* testsuite/libgomp.c++/member-6.C: New test.
	* testsuite/libgomp.c++/member-7.C: New test.
	* testsuite/libgomp.c++/monotonic-1.C: New test.
	* testsuite/libgomp.c++/monotonic-2.C: New test.
	* testsuite/libgomp.c++/nonmonotonic-1.C: New test.
	* testsuite/libgomp.c++/nonmonotonic-2.C: New test.
	* testsuite/libgomp.c++/pr66199-3.C: New test.
	* testsuite/libgomp.c++/pr66199-4.C: New test.
	* testsuite/libgomp.c++/pr66199-5.C: New test.
	* testsuite/libgomp.c++/pr66199-6.C: New test.
	* testsuite/libgomp.c++/pr66199-7.C: New test.
	* testsuite/libgomp.c++/pr66199-8.C: New test.
	* testsuite/libgomp.c++/pr66199-9.C: New test.
	* testsuite/libgomp.c++/reduction-11.C: New test.
	* testsuite/libgomp.c++/reduction-12.C: New test.
	* testsuite/libgomp.c++/target-13.C: New test.
	* testsuite/libgomp.c++/target-14.C: New test.
	* testsuite/libgomp.c++/target-15.C: New test.
	* testsuite/libgomp.c++/target-16.C: New test.
	* testsuite/libgomp.c++/target-17.C: New test.
	* testsuite/libgomp.c++/target-18.C: New test.
	* testsuite/libgomp.c++/target-19.C: New test.

Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>

From-SVN: r229814
2015-11-05 16:08:08 +01:00
Nathan Sidwell bd75197575 target.def (goacc.dim_limit): New hook.
* target.def (goacc.dim_limit): New hook.
	* targhooks.h (default_goacc_dim_limit): Declare.
	* doc/tm.texi.in (TARGET_GOACC_DIM_LIMIT): Add.
	* doc/tm.texi: Rebuilt.
	* omp-low.h (get_oacc_fn_dim_size, get_oacc_ifn_dim_arg): Declare.
	* omp-low.c (get_oacc_fn_dim_size, get_oacc_ifn_dim_arg): New.
	(default_goacc_dim_limit): New.
	* config/nvptx/nvptx.c (PTX_VECTOR_LENGTH, PTX_WORKER_LENGTH): New.
	(nvptx_goacc_dim_limit) New.
	(TARGET_GOACC_DIM_LIMIT): Override.
	* tree-vrp.c: Include omp-low.h, target.h.
	(extract_range_basic): Add handling for IFN_GOACC_DIM_SIZE &
	IFN_GOACC_DIM_POS.

From-SVN: r229809
2015-11-05 13:50:13 +00:00
Ilya Enkovich 337d2167cc tree-vect-generic.c (do_compare): Use -1 for true result instead of 1.
gcc/

	* tree-vect-generic.c (do_compare): Use -1 for true
	result instead of 1.

From-SVN: r229808
2015-11-05 12:21:33 +00:00
Ramana Radhakrishnan 61da5e46b4 [Patch AArch64] Switch constant pools to separate rodata sections.
Now that PR63304 is fixed and we have an option to address
any part of the memory using adrp / add or adrp / ldr instructions
it makes sense to switch out literal pools into their own
mergeable sections by default.

This would mean that by default we could now start getting
the benefits of constant sharing across the board, potentially
improving code size. The other advantage of doing so, for the
security conscious is that this prevents intermingling of literal
pools with code.

Wilco's kindly done some performance measurements and suggests that
there is not really a performance regression in doing this.
I've looked at the code size for SPEC2k6 today at -Ofast and
in general there is a good code size improvement as expected
by sharing said constants.

Tested on aarch64-none-elf with no regressions and bootstrapped
and regression tested in my tree for a number of days now.

2015-11-05  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

        * config/aarch64/aarch64.c
        (aarch64_can_use_per_function_literal_pools_p): New.
        (aarch64_use_blocks_for_constant_p): Adjust declaration
        and use aarch64_can_use_function_literal_pools_p.
        (aarch64_select_rtx_section): Update.

From-SVN: r229795
2015-11-05 09:48:53 +00:00
Ilya Enkovich e219e495bc targhooks.c (default_get_mask_mode): Use BLKmode in case target doesn't support required vector mode.
gcc/

2015-10-29  Ilya Enkovich  <enkovich.gnu@gmail.com>

	* targhooks.c (default_get_mask_mode): Use BLKmode in
	case target doesn't support required vector mode.
	* stor-layout.c (layout_type); Check for BLKmode.

From-SVN: r229794
2015-11-05 09:46:10 +00:00
Aditya Kumar 24bc75034b remove parameter_rename_map
This map was used in the transition to the new scop detection: with the new scop
detection, we do not need this map anymore.

       * graphite-isl-ast-to-gimple.c (gcc_expression_from_isl_ast_expr_id):
       Remove use of parameter_rename_map.
       (copy_def): Remove.
       (copy_internal_parameters): Remove.
       (graphite_regenerate_ast_isl): Remove call to copy_internal_parameters.
       * sese.c (new_sese_info): Do not initialize parameter_rename_map.
       (free_sese_info): Do not free parameter_rename_map.
       (set_rename): Do not use parameter_rename_map.
       (rename_uses): Update call to set_rename.
       (graphite_copy_stmts_from_block): Do not use parameter_rename_map.
       * sese.h (parameter_rename_map_t): Remove.
       (struct sese_info_t): Remove field parameter_rename_map.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r229783
2015-11-04 20:59:18 +00:00
Aditya Kumar 1b38d3ecfe improve debug of codegen
- fix printing of ISL stmt and parameter names
- move dot_scop* functions outside of anonymous namespace.

  * graphite-isl-ast-to-gimple.c: Include tree-cfg.h.
  (translate_isl_ast_node_user): Add more dumps: call print_loops_bb.
  * graphite-scop-detection.c (dot_all_scops_1): Moved out of
  anonymous namespace.
  * graphite-sese-to-poly.c (ssa_name_version_typesize): Remove.
  (isl_id_for_pbb): Use a buffer of size 10.
  (isl_id_for_ssa_name): Same.
  * sese.c (set_rename): Add more dumps.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r229782
2015-11-04 20:59:12 +00:00
Nathan Sidwell b76e99102f omp-low.c (struct omp_context): Remove reduction_map field.
* omp-low.c (struct omp_context): Remove reduction_map field.
	(lookup_oacc_reduction, maybe_lookup_oacc_reduction): Delete.
	(new_omp_context, delete_omp_context, scan_omp_target): Remove
	reduction_map handling.
	(lower_omp_target): Remove obsolete openacc reduction handling.

From-SVN: r229781
2015-11-04 20:54:24 +00:00
Nathan Sidwell ccc8282bab nvptx.c (nvptx_goacc_validate_dims): Add checking.
gcc/
	* config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add checking.

	libgomp/
	* testsuite/libgomp.oacc-fortran/reduction-1.f90: Fix dimensions
	and reduction copy.
	* testsuite/libgomp.oacc-fortran/reduction-2.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-3.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-4.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/collapse-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-initial-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: New.

From-SVN: r229780
2015-11-04 20:48:05 +00:00
Nathan Sidwell f355215826 nvptx.c: Include gimple headers.
* config/nvptx/nvptx.c: Include gimple headers.
	(worker_red_size, worker_red_align, worker_red_name,
	worker_red_sym): New.
	(nvptx_option_override): Initialize worker reduction buffer.
	(nvptx_file_end): Write out worker reduction buffer var.
	(nvptx_expand_shuffle, nvptx_expand_worker_addr,
	nvptx_expand_cmp_swap): New builtin expanders.
	(enum nvptx_builtins): New.
	(nvptx_builtin_decls): New.
	(nvptx_builtin_decl, nvptx_init_builtins, nvptx_expand_builtin): New
	(PTX_VECTOR_LENGTH, PTX_WORKER_LENGTH): New.
	(nvptx_get_worker_red_addr, nvptx_generate_vector_shuffle,
	nvptx_lockless_update): New helpers.
	(nvptx_goacc_reduction_setup, nvptx_goacc_reduction_init,
	nvptx_goacc_reduction_fini, nvptx_goacc_reduction_teaddown): New.
	(nvptx_goacc_reduction): New.
	(TARGET_INIT_BUILTINS, TARGET_EXPAND_BUILTIN,
	TARGET_BUILTIN_DECL): Override.
	(TARGET_GOACC_REDUCTION): Override.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r229768
2015-11-04 16:58:52 +00:00
Nathan Sidwell e50146711b internal-fn.def (GOACC_REDUCTION): New.
* internal-fn.def (GOACC_REDUCTION): New.
	* internal-fn.h (enum ifn_goacc_reduction_kind): New.
	* internal-fn.c (expand_GOACC_REDUCTION): New.
	* target.def (goacc.reduction): New OpenACC hook.
	* targhooks.h (default_goacc_reduction): Declare.
	* doc/tm.texi.in: Add TARGET_GOACC_REDUCTION.
	* doc/tm.texi: Rebuilt.
	* omp-low.c (oacc_get_reduction_array_id, oacc_max_threads,
	scan_sharing_clauses): Remove oacc reduction handling here.
	(lower_rec_input_clauses): Don't handle OpenACC reductions here.
	(oacc_lower_reduction_var_helper): Delete.
	(lower_oacc_reductions): New.
	(lower_reduction_clauses): Don't handle OpenACC reductions here.
	(lower_oacc_head_tail): Call lower_oacc_reductions.
	(oacc_gimple_assign, oacc_init_reduction_array,
	oacc_initialize_reduction_data, oacc_finalize_reduction_data,
	oacc_process_reduction_data): Delete.
	(lower_omp_target): Remove old OpenACC reduction handling.  Insert
	dummy OpenACC gang reduction for reductions at outer level.
	(oacc_loop_xform_head_tail): Transform IFN_GOACC_REDUCTION.
	(default_goacc_reduction): New.
	(execute_oacc_device_lower): Handle IFN_GOACC_REDUCTION.

From-SVN: r229767
2015-11-04 16:57:36 +00:00
Martin Liska be373510f8 Pass manager: add support for termination of pass list
* cgraphunit.c (cgraph_node::expand_thunk): Call
	allocate_struct_function before init_function_start.
	(cgraph_node::expand): Use push_cfun and pop_cfun.
	* config/i386/i386.c (ix86_code_end): Call
	allocate_struct_function before init_function_start.
	* config/rs6000/rs6000.c (rs6000_code_end): Likewise.
	* function.c (init_function_start): Move preamble to all
	callers.
	* passes.c (do_per_function_toporder): Use push_cfun and pop_cfun.
	(execute_one_pass): Handle newly added TODO_discard_function.
	(execute_pass_list_1): Terminate if cfun equals to NULL.
	(execute_pass_list): Do not push and pop cfun, expect that
	cfun is set.
	* tree-pass.h (TODO_discard_function): Define.

From-SVN: r229764
2015-11-04 16:50:45 +00:00
Mikhail Maltsev a6c764d02e ENABLE_CHECKING refactoring: remove remaining occurrences
libcpp/

	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Remove ENABLE_CHECKING.

gcc/

	* cfganal.c (inverted_post_order_compute): Remove conditional
	compilation, use flag_checking.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Remove ENABLE_CHECKING.
	* genconditions.c: Do not #undef ENABLE_CHECKING.
	* sese.h (bb_in_region): Comment out broken check.
	* tree-ssa-loop-manip.c (rewrite_into_loop_closed_ssa_1): Remove
	conditional compilation, use flag_checking.

From-SVN: r229758
2015-11-04 15:01:46 +00:00
Tom de Vries 7da5eaa09b Handle recursive restrict in function parameter
2015-11-04  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/67742
	* tree-ssa-structalias.c (struct fieldoff): Add restrict_pointed_type
	field.
	(push_fields_onto_fieldstack): Handle restrict_pointed_type field.
	(create_variable_info_for_1): Add and handle handle_param parameter.
	Add restrict handling.
	(create_variable_info_for): Call create_variable_info_for_1 with extra
	arg.
	(make_param_constraints): Drop restrict_name parameter.  Ignore
	vi->only_restrict_pointers.
	(intra_create_variable_infos): Call create_variable_info_for_1 with
	extra arg.  Remove restrict handling.  Call make_param_constraints with
	one less arg.

	* gcc.dg/tree-ssa/restrict-7.c: New test.
	* gcc.dg/tree-ssa/restrict-8.c: New test.

From-SVN: r229755
2015-11-04 14:18:43 +00:00
Tom de Vries 7b0a0ee25f Use decl_type in create_variable_info_for_1
2015-11-04  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (create_variable_info_for_1): Use decl_type
	variable.

From-SVN: r229754
2015-11-04 14:18:34 +00:00
Trevor Saunders d10e1bb512 remove unused config/arm/coff.h
gcc/ChangeLog:

2015-11-03  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/arm/coff.h: Remove.

From-SVN: r229726
2015-11-03 22:43:17 +00:00
Eric Botcazou 26eaa5a5eb Remove superfluous gcc/ prefixes
From-SVN: r229715
2015-11-03 17:25:24 +00:00
Eric Botcazou 5993d1c9a3 gimple-expr.c (useless_type_conversion_p): Reinstate type canonical check for aggregate types and beef up comment for mode...
* gimple-expr.c (useless_type_conversion_p): Reinstate type canonical
	check for aggregate types and beef up comment for mode check.

From-SVN: r229714
2015-11-03 17:19:30 +00:00
Richard Biener 428db0baaa tree-vect-data-refs.c (vect_analyze_data_refs): Do not collect data references here.
2015-11-03  Richard Biener  <rguenther@suse.de>

	* tree-vect-data-refs.c (vect_analyze_data_refs): Do not collect
	data references here.
	* tree-vect-loop.c: Include cgraph.h.
	(vect_analyze_loop_2): Collect data references here.
	* tree-vect-slp.c (find_bb_location): Inline ...
	(vect_slp_bb): ... here.  Renamed from vect_slp_analyze_bb.
	Factor in vect_slp_transform_bb.
	(vect_slp_transform_bb): Removed.
	(vect_slp_analyze_bb_1): Collect data references here.
	* tree-vectorizer.c (pass_slp_vectorize::execute): Call
	vect_slp_bb.
	* tree-vectorizer.h (vect_slp_bb): Declare.
	(vect_slp_analyze_bb): Remove.
	(vect_slp_transform_bb): Remove.
	(find_bb_location): Remove.
	(vect_analyze_data_refs): Remove stmt count reference parameter.

From-SVN: r229712
2015-11-03 15:59:17 +00:00
Evgeny Stupachenko f947799989 multiple_target.c (create_dispatcher_calls): Add target check on ifunc.
2015-11-03  Evgeny Stupachenko  <evstupac@gmail.com>

gcc/
	* multiple_target.c (create_dispatcher_calls): Add target check
	on ifunc.
	(create_target_clone): Change assembler name for versioned declarations.
gcc/testsuite/
	* g++.dg/ext/mvc4.C: Add dg-require-ifunc condition.
	* gcc.target/i386/mvc5.c: Ditto.
	* gcc.target/i386/mvc7.c: Add dg-require-ifunc condition and checks on
	resolver.

From-SVN: r229706
2015-11-03 12:02:53 +00:00
Thomas Schwinge 4bf9e5a8a2 OpenACC atomic directive
gcc/c-family/
	* c-pragma.c (oacc_pragmas): Add "atomic".
	* c-pragma.h (pragma_kind): Add PRAGMA_OACC_ATOMIC.
	gcc/c/
	* c-parser.c (c_parser_omp_construct): Handle PRAGMA_OACC_ATOMIC.
	gcc/cp/
	* parser.c (cp_parser_omp_construct, cp_parser_pragma): Handle
	PRAGMA_OACC_ATOMIC.
	gcc/fortran/
	* gfortran.h (gfc_statement): Add ST_OACC_ATOMIC,
	ST_OACC_END_ATOMIC.
	(gfc_exec_op): Add EXEC_OACC_ATOMIC.
	* match.h (gfc_match_oacc_atomic): New prototype.
	* openmp.c (gfc_match_omp_atomic, gfc_match_oacc_atomic): New
	wrapper functions around...
	(gfc_match_omp_oacc_atomic): ... this new function.
	(oacc_code_to_statement, gfc_resolve_oacc_directive): Handle
	EXEC_OACC_ATOMIC.
	* parse.c (decode_oacc_directive): Handle "atomic", "end atomic".
	(case_exec_markers): Add ST_OACC_ATOMIC.
	(gfc_ascii_statement): Handle ST_OACC_ATOMIC, ST_OACC_END_ATOMIC.
	(parse_omp_atomic): Rename to...
	(parse_omp_oacc_atomic): ... this new function.  Add omp_p formal
	parameter.  Adjust all users.
	(parse_executable): Handle ST_OACC_ATOMIC.
	(is_oacc): Handle EXEC_OACC_ATOMIC.
	* resolve.c (gfc_resolve_blocks, gfc_resolve_code): Handle
	EXEC_OACC_ATOMIC.
	* st.c (gfc_free_statement): Handle EXEC_OACC_ATOMIC.
	* trans-openmp.c (gfc_trans_oacc_directive): Handle
	EXEC_OACC_ATOMIC.
	* trans.c (trans_code): Handle EXEC_OACC_ATOMIC.
	gcc/
	* builtins.def (DEF_GOMP_BUILTIN): Enable for flag_openacc.
	* omp-low.c (check_omp_nesting_restrictions): Allow
	GIMPLE_OMP_ATOMIC_LOAD, GIMPLE_OMP_ATOMIC_STORE inside OpenACC
	contexts.
	gcc/testsuite/
	* c-c++-common/goacc-gomp/nesting-fail-1.c: Move "atomic" tests
	from here to...
	* c-c++-common/goacc-gomp/nesting-1.c: ... here, and expect them
	to succeed.
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-1.c: New
	file.
	* testsuite/libgomp.oacc-c-c++-common/atomic_capture-2.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/atomic_rw-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/atomic_update-1.c: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_capture-1.f90: Likewise.
	* testsuite/libgomp.oacc-fortran/atomic_rw-1.f90: New file.
	* testsuite/libgomp.oacc-fortran/atomic_update-1.f90: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: New file.
	* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-1a.c:
	Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/worker-single-6.c: Likewise.

From-SVN: r229703
2015-11-03 12:28:22 +01:00
Bilyan Borisov 496ea87db6 [AARCH64][PATCH 1/3] Implementing the variants of the vmulx_ NEON intrinsic
gcc/

	* config/aarch64/aarch64-simd-builtins.def (fmulx): New.
	* config/aarch64/aarch64-simd.md (aarch64_fmulx<mode>): New.
	* config/aarch64/arm_neon.h (vmulx_f32): Rewrite to call fmulx
	builtin.
	(vmulxq_f32): Likewise.
	(vmulx_f64): New.
	(vmulxq_f64): Rewrite to call fmulx builtin.
	(vmulxs_f32): Likewise.
	(vmulxd_f64): Likewise.
	(vmulx_lane_f32): Remove.
	* config/aarch64/iterators.md (UNSPEC): Add fmulx.

gcc/testsuite/

	* gcc/testsuite/gcc.target/aarch64/simd/vmulx_f32_1.c: New.
	* gcc/testsuite/gcc.target/aarch64/simd/vmulx_f64_1.c: New.
	* gcc/testsuite/gcc.target/aarch64/simd/vmulxq_f32_1.c: New.
	* gcc/testsuite/gcc.target/aarch64/simd/vmulxq_f64_1.c: New.
	* gcc/testsuite/gcc.target/aarch64/simd/vmulxs_f32_1.c: New.
	* gcc/testsuite/gcc.target/aarch64/simd/vmulxd_f64_1.c: New.

From-SVN: r229702
2015-11-03 10:58:27 +00:00
Alan Lawrence 04f725b907 [AArch64] Fix ICE on (const_double:HF 0.0)
gcc/:

	* config/aarch64/aarch64.md (*movhf_aarch64): Use
	aarch64_reg_or_fp_zero for second operand.

gcc/testsuite/:

	* gcc.target/aarch64/fp16/set_zero_1.c: New.

From-SVN: r229701
2015-11-03 10:35:31 +00:00
Uros Bizjak c7cf4ff97e ChangeLog: Fix whitespace.
* ChangeLog: Fix whitespace.
	* testsuite/ChangeLog: Ditto.

From-SVN: r229700
2015-11-03 09:45:55 +01:00
Alexandre Oliva 1b223a9f34 defer mark_addressable calls during expand till the end of expand
for  gcc/ChangeLog

	* gimple-expr.c: Include hash-set.h and rtl.h.
	(mark_addressable_queue): New var.
	(mark_addressable): Factor actual marking into...
	(mark_addressable_1): ... this.  Queue it up during expand.
	(mark_addressable_2): New.
	(flush_mark_addressable_queue): New.
	* gimple-expr.h (flush_mark_addressable_queue): Declare.
	* cfgexpand.c: Include gimple-expr.h.
	(pass_expand::execute): Flush mark_addressable queue.

From-SVN: r229696
2015-11-03 03:57:07 +00:00
Alexandre Oliva 067339d220 ifcombine: factor out inner block viability test
Bail out early if the inner block has side effects or is otherwise not
eligible for ifcombine.

for  gcc/ChangeLog

	* tree-ssa-ifcombine.c (tree_ssa_ifcombine_bb_1): Factor out
	bb_no_side_effects_p tests...
	(tree_ssa_ifcombine_bb): ... here.

From-SVN: r229691
2015-11-03 00:31:18 +00:00
Alexandre Oliva 828ca3d835 [PR68083] don't introduce undefined behavior in ifcombine
The ifcombine pass may move a conditional access to an uninitialized
value before the condition that ensures it is always well-defined,
thus introducing undefined behavior.  Stop it from doing so.

for  gcc/ChangeLog

	PR tree-optimization/68083
	* tree-ssa-ifcombine.c: Include tree-ssa.h.
	(bb_no_side_effects_p): Test for undefined uses too.
	* tree-ssa.c (gimple_uses_undefined_value_p): New.
	* tree-ssa.h (gimple_uses_undefined_value_p): Declare.

for  gcc/testsuite/ChangeLog

	PR tree-optimization/68083
	* gcc.dg/torture/pr68083.c: New.  From Zhendong Su.

From-SVN: r229690
2015-11-03 00:30:07 +00:00
Jeff Law b89410efd1 [PATCH] Avoid more irreducible loops in FSM threader
* tree-ssa-threadupdate.c (valid_jump_thread_path): Also detect
	cases where the loop latch edge is in the middle of an FSM
	path.

	* gcc.dg/tree-ssa/ssa-thread-11.c: Verify that we do not have
	irreducible loops in the CFG.

From-SVN: r229685
2015-11-02 16:25:06 -07:00
Tom de Vries 58b2d87ea1 Rename make_restrict_var_constraints to make_param_constraints
2015-11-03  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (make_restrict_var_constraints): Rename to ...
	(make_param_constraints): ... this.  Add and handle restrict_name
	parameter.  Handle is_full_var case.
	(intra_create_variable_infos): Use make_param_constraints.

From-SVN: r229684
2015-11-02 23:23:28 +00:00
Tom de Vries b9ae50844f Replace make_copy_constraint with make_constraint_from in make_restrict_var_constraints
2015-11-03  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (make_restrict_var_constraints): Replace
	make_copy_constraint call with make_constraint_from call.

From-SVN: r229683
2015-11-02 23:23:19 +00:00
Andreas Tobler 3b963b33ca freebsd64.h (ASM_SPEC32): Adust spec to handle PIE executables.
2015-11-02  Andreas Tobler  <andreast@gcc.gnu.org>

    * config/rs6000/freebsd64.h (ASM_SPEC32): Adust spec to handle
    PIE executables.

From-SVN: r229680
2015-11-02 22:51:25 +01:00
Richard Sandiford 5c1a2e639a Move constant folds for maths functions to new file
The new routines operate on the built-in enum rather than on tree decls.
The idea is to extend this to handle internal functions too, with a
combined enum for both.

The patch also moves fold_fma too, with the same prototype.  The long-term
plan is to replace FMA_EXPR with an internal function, for consistency
with the way that things like SQRT will be handled.

Tested on x86_64-linux-gnu, arm-linux-gnueabi and aarch64-linux-gnu.

gcc/
	* builtins.h (fold_fma): Move to fold-const-call.h.
	* builtins.c: Include fold-const-call.h.
	(mathfn_built_in_2): New function, split out from...
	(mathfn_built_in_1): ...here.
	(do_real_to_int_conversion, fold_const_builtin_pow)
	(fold_const_builtin_logb, fold_const_builtin_significand)
	(fold_const_builtin_load_exponent, do_mpfr_arg1, do_mpfr_arg2)
	(do_mpfr_arg3, do_mpfr_sincos, do_mpfr_bessel_n, do_mpc_arg1): Delete.
	(fold_builtin_sincos): Use fold_const_call to handle constants.
	(fold_builtin_1, fold_builtin_2, fold_builtin_3): Add explicit
	checks for ERROR_MARK.  Use fold_const_call to handle constant
	folds for math functions.
	(fold_fma): Move to fold-const-call.c.
	* fold-const.c: Include fold-const-call.h.
	* Makefile.in (OBJS): Add fold-const-call.o.
	(PLUGIN_HEADERS): Add fold-const-call.h.
	* realmpfr.h (real_from_mpfr): Allow the format to be specified
	directly.
	* realmpfr.c (real_from_mpfr): Likewise.
	* fold-const-call.h, fold-const-call.c: New files.

From-SVN: r229669
2015-11-02 16:34:16 +00:00
Julian Brown 6aadd15a41 [ARM] neon-testgen.ml typo
* config/arm/neon-testgen.ml (emit_epilogue): Remove extraneous
	brackets and semicolon.

From-SVN: r229662
2015-11-02 12:43:14 +00:00
Alan Lawrence 35e2be9fc9 Revert: tree-scalar-evolution.c: Handle LSHIFT by constant
gcc/:

		tree-scalar-evolution.c (interpret_rhs_expr): Handle some
		LSHIFT_EXPRs as equivalent MULT_EXPRs.

	gcc/testsuite/:

		gcc.dg/vect/vect-strided-shift.c: New.

From-SVN: r229660
2015-11-02 12:39:31 +00:00
Thomas Schwinge f5ce5ca118 [PR middle-end/68166] Restore build with fold checking enabled
gcc/
	PR middle-end/68166
	* fold-const.c: Include "md5.h".

From-SVN: r229652
2015-11-02 08:42:04 +01:00
Jeff Law 4815336c9a [PATCH] Fix vms targets
* vmsdbgout.c: Revert unused header file reduction patch.

From-SVN: r229650
2015-11-01 22:27:14 -07:00
Jeff Law 0f8012fbdd * config/mcore/mcore.c: Include regs.h.
From-SVN: r229649
2015-11-01 22:23:52 -07:00
Segher Boessenkool ee5c0d8af9 rs6000: Rewrite rs6000_reg_live_or_pic_offset_p
This function is quite a puzzle; untangle it.  No functional change.


2015-10-31  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Rewrite.

From-SVN: r229634
2015-10-31 20:50:09 +01:00
Segher Boessenkool f44c1eb7e1 rs6000: Another PIC LRA fix
This one for TARGET_TOC && TARGET_MINIMAL_TOC.  Without it, r30 is not
saved in the prologue for functions that do not use r30, but the register
is set later in the prologue anyhow.  This made all java tests fail.


2015-10-31  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Use the
	same condition for testing whether RS6000_PIC_OFFSET_TABLE_REGNUM is
	live as for using it elsewhere, for TARGET_MINIMAL_TOC.

From-SVN: r229633
2015-10-31 20:48:19 +01:00
Markus Trippelsdorf 67376cd2a5 ggc-common.c : Restore needed header for checking=release.
*ggc-common.c : Restore needed header for checking=release.

From-SVN: r229623
2015-10-31 10:57:33 +00:00
Tom de Vries 6664e41e59 Tune pointer-plus folding
2015-10-31  Tom de Vries  <tom@codesourcery.com>

	* fold-const.c (fold_unary_loc): Tune POINTER_PLUS_EXPR folding.

	* gfortran.dg/assumed_type_2.f90: Update test.
	* gfortran.dg/no_arg_check_2.f90: Same.

From-SVN: r229621
2015-10-31 09:33:25 +00:00
Tom de Vries 82d2c2706f Don't expect existing varinfo for arguments in intra_create_variable_infos
2015-10-31  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (intra_create_variable_infos): Don't expect
	existing varinfo for arguments.

From-SVN: r229620
2015-10-31 08:08:48 +00:00
Tom de Vries d0c9ca4461 Add initial constraints in create_function_info_for
2015-10-31  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (ipa_pta_execute): Add extra arg to call to
	create_function_info_for.  Dump constraints generated during
	create_function_info_for. Move intra_create_variable_infos call and
	function-return-values-escape bit to ...
	(create_function_info_for): ... here, and merge
	intra_create_variable_infos call with argument loop.  Add and handle
	nonlocal_p parameter.

From-SVN: r229619
2015-10-31 08:08:39 +00:00
Tom de Vries 2ce4413c7f Improve readability and structure of create_function_info_for
2015-10-31  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (create_function_info_for): Make sure prev_vi
	updating is alap, and seperated from preceding code.  Make sure
	insert_vi_for_tree is seperated from surrounding code.

From-SVN: r229618
2015-10-31 08:08:28 +00:00
Tom de Vries a543155b20 Use make_copy_constraint in ipa_pta_execute
2015-10-31  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (ipa_pta_execute): Use make_copy_constraint.

From-SVN: r229617
2015-10-31 08:08:18 +00:00
Jeff Law 9251aec67d nvptx.h (HARD_REGNO_NREGS): Avoid warning on unused args.
* config/nvptx/nvptx.h (HARD_REGNO_NREGS): Avoid warning on unused
	args.
	(MOVE_MAX): Set to 8.

Co-Authored-By: Nathan Sidwell <nathan@acm.org>

From-SVN: r229610
2015-10-30 22:30:20 +00:00
Cesar Philippidis 2631d4eb87 cgraph.c: Include context.h for offloading.
gcc/
	* cgraph.c: Include context.h for offloading.
	* varpool.c: Include context.h and omp-low.h.

From-SVN: r229608
2015-10-30 15:15:17 -07:00
Anatoly Sokolov d614335f77 Add contains_symbol_ref_p
From-SVN: r229607
2015-10-30 23:56:32 +03:00
Alan Lawrence 6a6360148a Share code from fold_array_ctor_reference with fold.
* gimple-fold.c (fold_array_ctor_reference): Move searching code to:
        * fold-const.c (get_array_ctor_element_at_index): New.
        (fold): Remove binary-search through CONSTRUCTOR, call previous.

        * fold-const.h (get_array_ctor_element_at_index): New.

From-SVN: r229605
2015-10-30 19:03:14 +00:00
Evgeny Stupachenko 3b1661a9b9 Makefile.in (OBJS): Add multiple_target.o.
2015-10-30  Evgeny Stupachenko  <evstupac@gmail.com>

gcc/
	* Makefile.in (OBJS): Add multiple_target.o.
	* attrib.c (make_attribute): Moved from config/i386/i386.c
	* config/i386/i386.c (make_attribute): Deleted.
	* multiple_target.c (create_dispatcher_calls): New.
	(get_attr_len): Ditto.
	(get_attr_str): Ditto.
	(separate_attrs): Ditto.
	(is_valid_asm_symbol): Ditto.
	(create_new_asm_name): Ditto.
	(create_target_clone): Ditto.
	(expand_target_clones): Ditto.
	(ipa_target_clone): Ditto.
	(ipa_dispatcher_calls): Ditto.
	* passes.def (pass_target_clone): Two new ipa passes.
	* tree-pass.h (make_pass_target_clone): Ditto.
	* doc/extend.texi (target_clones): New attribute description.
gcc/c-family/
	* c-common.c (handle_target_clones_attribute): New.
	(c_common_attribute_table): Add handle_target_clones_attribute.
	(handle_always_inline_attribute): Add check on target_clones attribute.
	(handle_target_attribute): Ditto.
gcc/testsuite/
	* gcc.dg/mvc1.c: New test for multiple targets cloning.
	* gcc.dg/mvc2.c: Ditto.
	* gcc.dg/mvc3.c: Ditto.
	* gcc.dg/mvc4.c: Ditto.
	* gcc.dg/mvc5.c: Ditto.
	* gcc.dg/mvc6.c: Ditto.
	* gcc.dg/mvc7.c: Ditto.
	* g++.dg/ext/mvc1.C: Ditto.
	* g++.dg/ext/mvc2.C: Ditto.
	* g++.dg/ext/mvc3.C: Ditto.
	* g++.dg/ext/mvc4.C: Ditto.

From-SVN: r229595
2015-10-30 18:17:43 +00:00