Commit Graph

154182 Commits

Author SHA1 Message Date
Jan Hubicka
d225aa745d * predict.c (unlikely_executed_stmt_p): Cleanup.
From-SVN: r249069
2017-06-09 18:34:29 +00:00
Jan Hubicka
e813ee3485 * predict.c (unlikely_executed_stmt_p): Cleanup.
From-SVN: r249068
2017-06-09 18:32:47 +00:00
Tamar Christina
f66e642373 aarch64.md (lrint<GPF:mode><GPI:mode>2): New.
2017-06-09  Tamar Christina  <tamar.christina@arm.com>

	* config/aarch64/aarch64.md (lrint<GPF:mode><GPI:mode>2): New.

gcc/testsuite/
2017-06-09  Tamar Christina  <tamar.christina@arm.com>

	* gcc.target/aarch64/lrint-matherr.h: New.
	* gcc.target/aarch64/inline-lrint_1.c: New.
	* gcc.target/aarch64/inline-lrint_2.c: New.
	* gcc.target/aarch64/no-inline-lrint_1.c: New.
	* gcc.target/aarch64/no-inline-lrint_2.c: New.

From-SVN: r249064
2017-06-09 13:33:35 +00:00
Richard Biener
2866f21d19 tree-ssa-loop-im.c (execute_sm): Do not force multi-threaded model if the ref is always written to.
2017-06-09  Richard Biener  <rguenther@suse.de>

	* tree-ssa-loop-im.c (execute_sm): Do not force multi-threaded
	model if the ref is always written to.

From-SVN: r249063
2017-06-09 13:31:27 +00:00
Tamar Christina
37b68a4389 arm.c (arm_rtx_costs_internal): Make sdiv more expensive than udiv.
2017-06-09  Tamar Christina  <tamar.christina@arm.com>

	* config/arm/arm.c (arm_rtx_costs_internal): Make sdiv more expensive than udiv.


gcc/testsuite/
2017-06-09  Tamar Christina  <tamar.christina@arm.com>

	* gcc.target/arm/sdiv_costs_1.c: New.

From-SVN: r249062
2017-06-09 13:22:39 +00:00
Jonathan Wakely
53d01fd9e9 Support move-only deleters in std::shared_ptr (LWG 2802)
* doc/xml/manual/intro.xml: Document LWG 2802, 2873 and 2942 changes.
	* include/bits/shared_ptr.h (shared_ptr): Use rvalues for deleters
	(LWG 2802).
	* include/bits/shared_ptr_base.h (_Sp_ebo_helper, _Sp_counted_deleter
	(_Sp_counted_deleter::_Impl, __shared_count, __shared_ptr): Likewise.
	* testsuite/20_util/shared_ptr/cons/lwg2802.cc: New.

From-SVN: r249061
2017-06-09 14:20:37 +01:00
Tom de Vries
37f30285a9 Add "sorry, target cannot support label values" for nvptx
2017-06-09  Tom de Vries  <tom@codesourcery.com>

	PR target/80855
	* config/nvptx/nvptx.md (define_expand "mov<QHSDISDFM>"): Error out with
	"target cannot support label values" when encountering LABEL_REF.

	* gcc.target/nvptx/label-values.c: New test.

From-SVN: r249060
2017-06-09 13:11:52 +00:00
Thomas Preud'homme
051508d769 [ARM] Allow arm_arch_*_ok to test several macros
2017-06-09  Thomas Preud'homme  <thomas.preudhomme@arm.com>

    gcc/testsuite/
    * lib/target-supports.exp (check_effective_target_arm_arch_FUNC_ok):
    Test for null definitions instead of them being undefined.  Add entry
    for ARMv7VE.  Reindent entry for ARMv8-M Baseline.  Add comment warning
    about using the effective target for architecture extension.
    (check_effective_target_arm_arch_v7ve_ok): Remove.
    (add_options_for_arm_arch_v7ve): Likewise.

From-SVN: r249059
2017-06-09 12:55:38 +00:00
Martin Liska
4f751c5437 Speed-up indirect-call instrumentation
2017-06-09  Martin Liska  <mliska@suse.cz>

	* tree-profile.c (gimple_gen_ic_profiler): Update comment.
	(gimple_gen_ic_func_profiler): Emit direct comparison
	of __gcov_indirect_call_callee with NULL.
	(gimple_gen_time_profiler): Change probability from
	PROB_VERY_UNLIKELY to PROB_UNLIKELY.
2017-06-09  Martin Liska  <mliska@suse.cz>

	* libgcov-profiler.c (__gcov_indirect_call_profiler_v2):
	Reset __gcov_indirect_call_callee to NULL.

From-SVN: r249058
2017-06-09 12:54:53 +00:00
Jan Hubicka
f05d82a711 profile.c (edge_gcov_counts): Turn to pointer.
* profile.c (edge_gcov_counts): Turn to pointer.
	(compute_branch_probabilities, compute_branch_probabilities): Update.
	(branch_prob): Do not clear edge_gcov_count.
	* profile.h (edge_gcov_counts): Turn to pointer.
	(edge_gcov_count): Update.

From-SVN: r249057
2017-06-09 11:45:46 +00:00
Jan Hubicka
ffb9d1b140 profile.c (edge_gcov_counts): Turn to pointer.
* profile.c (edge_gcov_counts): Turn to pointer.
	(compute_branch_probabilities, compute_branch_probabilities): Update.
	* profile.h (edge_gcov_counts): Turn to pointer.
	(edge_gcov_count): Update.

From-SVN: r249056
2017-06-09 11:38:35 +00:00
Jan Hubicka
323eb0898c * gimple.h (gimple_check_failed): Mark cold.
From-SVN: r249055
2017-06-09 11:36:59 +00:00
Jonathan Wakely
225ab2b07b Add deduction guides for sequence containers (P0433R2, partial)
* include/bits/forward_list.h (forward_list): Add deduction guide.
	* include/bits/stl_deque.h (deque): Likewise.
	* include/bits/stl_list.h (list): Likewise.
	* include/bits/stl_vector.h (vector): Likewise.
	* testsuite/23_containers/deque/cons/deduction.cc: New.
	* testsuite/23_containers/forward_list/cons/deduction.cc: New.
	* testsuite/23_containers/list/cons/deduction.cc: New.
	* testsuite/23_containers/vector/cons/deduction.cc: New.

From-SVN: r249054
2017-06-09 12:04:53 +01:00
Richard Biener
01a8cacc96 re PR tree-optimization/66623 (Unsafe FP math reduction used in strict math mode)
2017-06-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/66623
	* tree-vect-loop.c (vect_is_simple_reduction): Cleanup,
	refactor check_reduction into two parts, properly computing
	whether we have to check reduction validity for outer loop
	vectorization.

	* gcc.dg/vect/pr66623.c: New testcase.

From-SVN: r249053
2017-06-09 09:40:45 +00:00
Richard Biener
6d1115c545 re PR tree-optimization/79483 ([graphite] ICE: verify_ssa failed (error: definition in block 31 does not dominate use in block 28))
2017-06-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79483
	* graphite-scop-detection.c (order): New global.
	(get_order): Compute bb to order mapping that satisfies code
	generation constraints.
	(cmp_pbbs): New helper.
	(build_scops): Start domwalk at entry block, sort generated
	pbbs.

	* gcc.dg/graphite/pr79483.c: New testcase.

From-SVN: r249052
2017-06-09 09:36:06 +00:00
Richard Biener
6ba856d450 re PR ipa/81007 (ICE with virtual function in broken class)
2017-06-09  Richard Biener  <rguenther@suse.de>

	PR middle-end/81007
	* ipa-polymorphic-call.c
	(ipa_polymorphic_call_context::restrict_to_inner_class):
	Skip FIELD_DECLs with error_mark_node type.
	* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
	last again.

	* g++.dg/pr81007.C: New testcase.

From-SVN: r249051
2017-06-09 09:35:05 +00:00
Tamar Christina
903c723b9d Reverted r249005 until PowerPC and AIX issues sorted.
From-SVN: r249050
2017-06-09 08:10:51 +00:00
Jakub Jelinek
48e692477f hard-reg-1-nov.c (mpx_test): Use "esp" instead of "rsp" for -m32.
* gcc.target/i386/mpx/hard-reg-1-nov.c (mpx_test): Use "esp"
	instead of "rsp" for -m32.
	* gcc.target/i386/mpx/hard-reg-2-lbv.c: Require sse2_runtime effective
	target, add -msse2 to dg-options.
	* gcc.target/i386/mpx/hard-reg-2-nov.c: Likewise.
	* gcc.target/i386/mpx/hard-reg-2-ubv.c: Likewise.

From-SVN: r249049
2017-06-09 10:02:00 +02:00
Martin Liska
d88382176e Come up with selftests for predict.c.
2017-06-09  Martin Liska  <mliska@suse.cz>

	* predict.c (struct branch_predictor): New struct.
	(test_prediction_value_range): New test.
	(predict_c_tests): New function.
	* selftest-run-tests.c (selftest::run_tests): Run the function.
	* selftest.h: Declare new tests.

From-SVN: r249048
2017-06-09 07:38:52 +00:00
Ian Lance Taylor
1ee77fbdea compiler: additional lvalue/rvalue context fixes
Fix lvalue/rvalue context mixup Set_and_use_temporary_expression's
    do_get_backend() method. Enhance Mark_lvalue_varexprs to handle
    conversions and temporary reference expressions, since occasionally
    the front end emits code such as "deref(conv(tempref)) = ...".
    
    Reviewed-on: https://go-review.googlesource.com/45141

From-SVN: r249047
2017-06-09 04:35:57 +00:00
Segher Boessenkool
120ef1d50a rs6000: Don't add an immediate to r0 (PR80966)
If there is a large stack frame the rs6000 -fstack-limit code would
calculate the new stack pointer value using two insns (an addis and
an addi), with r0 as temporary.  Such instructions do not exist.

This patch changes add<mode>3 to expand using a different strategy in
such cases; to FAIL if there is no way to do it (namely, if the source
is r0 and there is no way to get a temporary reg); and it changes
rs6000_emit_allocate_stack to assert gen_add3_insn did in fact emit
instructions.


	PR target/80966
	* config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Assert that
	gen_add3_insn did not fail.
	* config/rs6000/rs6000.md (add<mode>3): If asked to add a constant to
	r0, construct that number in a temporary reg and add that reg to r0.
	If asked to put the result in r0 as well, fail.

gcc/testsuite/
	* gcc.target/powerpc/stack-limit.c: New testcase.

From-SVN: r249046
2017-06-09 05:46:08 +02:00
GCC Administrator
ff67045361 Daily bump.
From-SVN: r249045
2017-06-09 00:16:23 +00:00
Will Schmidt
271be653c4 rs6000.c (rs6000_gimple_fold_builtin): Add handling for early expansion of vec_eqv.
[gcc]

2017-06-08  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add handling
	for early expansion of vec_eqv.

[gcc/testsuite]

2017-06-08  Will Schmidt  <will_schmidt@vnet.ibm.com>

	* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-char.c: New.
	* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-float.c: New.
	* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-floatdouble.c: New.
	* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-int.c: New.
	* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-longlong.c: New.
	* testsuite/gcc.target/powerpc/fold-vec-logical-eqv-short.c: New.

From-SVN: r249040
2017-06-08 20:51:42 +00:00
Jakub Jelinek
8ab7005b14 re PR c/81006 (ICE with zero-size array and #pragma omp task depend)
PR c/81006
	* c-typeck.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
	to sizetype before size_binop.

	* semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE
	to sizetype before size_binop.

	* c-c++-common/gomp/pr81006.c: New test.

From-SVN: r249035
2017-06-08 21:10:49 +02:00
Ian Lance Taylor
20e96b489e libgo: update to 1.8.3 release
Reviewed-on: https://go-review.googlesource.com/45150

From-SVN: r249033
2017-06-08 19:02:12 +00:00
Jakub Jelinek
34361776fb re PR c++/81011 (ICE with #pragma omp task and inaccessible copy-constructor)
PR c++/81011
	* cp-gimplify.c (cxx_omp_finish_clause): When changing clause
	to OMP_CLAUSE_SHARED, also clear OMP_CLAUSE_SHARED_FIRSTPRIVATE
	and OMP_CLAUSE_SHARED_READONLY flags.

	* g++.dg/gomp/pr81011.C: New test.

From-SVN: r249031
2017-06-08 20:55:04 +02:00
Jakub Jelinek
0d05f68547 re PR middle-end/81005 (-fsanitize=null and -fsanitize=alignment doesn't check aggregate arguments of calls)
PR middle-end/81005
	* ubsan.c (instrument_null): Avoid pointless code temporary.
	(pass_ubsan::execute): Instrument aggregate arguments of calls.

	* c-c++-common/ubsan/align-10.c: New test.
	* c-c++-common/ubsan/null-13.c: New test.

From-SVN: r249030
2017-06-08 20:53:16 +02:00
Ian Lance Taylor
3159d897bd compiler: lvalue context fixes in Unary_expression::do_get_backend
A couple of the Backend::var_expression invocations in
    Unary_expression::do_get_backend were selecting "lvalue" context
    incorrectly (these var exprs were not in an assignment or LHS
    position); fix is to change back to "rvalue" context.
    
    Reviewed-on: https://go-review.googlesource.com/45136

From-SVN: r249029
2017-06-08 18:42:04 +00:00
Uros Bizjak
2163b9bcc6 re PR target/81015 (Bad codegen for __builtin_clz(unsigned short))
PR target/81015
	Revert:
	2016-12-14  Uros Bizjak  <ubizjak@gmail.com>

	PR target/59874
	* config/i386/i386.md (*ctzhi2): New insn_and_split pattern.
	(*clzhi2): Ditto.

testsuite/ChangeLog:

	PR target/81015
	* gcc.target/i386/pr59874-1.c (foo): Call __builtin_ctzs.
	* gcc.target/i386/pr59874-2.c (foo): Call __builtin_clzs.
	* gcc.target/i386/pr81015.c: New test.

From-SVN: r249028
2017-06-08 19:28:19 +02:00
Tom de Vries
73f49ad743 Remove NO_TRAMPOLINES
2017-06-08  Tom de Vries  <tom@codesourcery.com>

	* gcc.c-torture/compile/930506-2.c: Use dg-require-effective-target
	trampolines instead of NO_TRAMPOLINES.
	* gcc.c-torture/execute/20000822-1.c: Same.
	* gcc.c-torture/execute/920428-2.c: Same.
	* gcc.c-torture/execute/920501-7.c: Same.
	* gcc.c-torture/execute/920612-2.c: Same.
	* gcc.c-torture/execute/921017-1.c: Same.
	* gcc.c-torture/execute/921215-1.c: Same.
	* gcc.c-torture/execute/931002-1.c: Same.
	* gcc.c-torture/execute/comp-goto-2.c: Same.
	* gcc.c-torture/execute/nestfunc-1.c: Same.
	* gcc.c-torture/execute/nestfunc-2.c: Same.
	* gcc.c-torture/execute/nestfunc-3.c: Same.
	* gcc.c-torture/execute/nestfunc-5.c: Same.
	* gcc.c-torture/execute/nestfunc-6.c: Same.
	* gcc.c-torture/execute/pr24135.c: Same.
	* gcc.dg/Wtrampolines.c: Same.
	* gcc.dg/torture/stackalign/comp-goto-1.c: Same.
	* gcc.dg/torture/stackalign/nested-5.c: Same.
	* gcc.dg/torture/stackalign/nested-6.c: Same.
	* gcc.dg/torture/stackalign/non-local-goto-3.c: Same.
	* gcc.dg/torture/stackalign/non-local-goto-4.c: Same.
	* gcc.dg/torture/stackalign/non-local-goto-5.c: Same.
	* gcc.dg/trampoline-1.c: Same.
	* gcc.dg/tree-prof/pr44777.c: Same.
	* gcc.target/i386/pr67770.c: Same.
	* lib/gcc.exp (gcc_target_compile): Remove appending of
	-DNO_TRAMPOLINES to additional_flags.
	* lib/objc.exp (objc_target_compile): Same.

From-SVN: r249027
2017-06-08 17:16:10 +00:00
Tom de Vries
b9835925b1 Fix no_trampolines test in check_effective_target_trampolines
2017-06-08  Tom de Vries  <tom@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_trampolines): Test for
	'gcc,no_trampolines' instead of 'no_trampolines'.

From-SVN: r249026
2017-06-08 17:15:56 +00:00
Jan Hubicka
5591f0dd96 predict.c (unlikely_executed_edge_p): Move ahead.
* predict.c (unlikely_executed_edge_p): Move ahead.
	(probably_never_executed_edge_p): Use it.

From-SVN: r249025
2017-06-08 16:41:35 +00:00
Ian Lance Taylor
dadcc51c88 compiler: fix undefined symbol error with unexported method
When an interface I1 in an imported package has an unexported method,
    and is then embedded into another interface I2, in a different
    package, that has other methods, and a type T2 is converted to I2, we
    failed to ever define the required interface method table.  Naturally
    T2 must implement the unexported method, and must therefore either be
    defined in the same package as I1, or embed a type from that package.
    In this case the compiler was assuming that that package would define
    the interface method table, but of course, since I2 was not defined in
    that package, that did not happen.
    
    The fix is to only assume that the interface method table will be
    defined elsewhere in the case where T2 and I2 are defined in the same
    package.  The compiler ensures that all such interface method tables
    are created, in Gogo::build_interface_method_tables.  This requires
    knowing the package in which an interface type is defined, a simple
    tweak to the importer.
    
    Testing this revealed that the special case for stub methods created
    for the embedded unexported methods of T2 needs to be done for
    function declarations as it currently is for function definitions, so
    that the newly created interface method tables use the correct name.
    
    Testing that revealed that the code to determine the pkgpath symbol
    for such stub methods was wrong.  It assumed that one could call
    pkgpath_for_symbol on the pkgpath to get the pkgpath symbol.  Would
    that it twere so simple.  Instead, add a function to look up the
    package, which must be known, and fetch the pkgpath symbol.
    
    The test for this is https://golang.org/cl/45085.
    
    Reviewed-on: https://go-review.googlesource.com/45086

From-SVN: r249024
2017-06-08 16:40:21 +00:00
Alexander Ivchenko
77db6c1549 re PR middle-end/79988 ([CHKP] ICE in tree check: accessed operand 5 of call_expr with 4 operands in ix86_expand_builtin, at config/i386/i386.c:36851)
2017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>

       PR middle-end/79988
       * tree-chkp.c (chkp_gimple_call_builtin_p): Remove
       gimple_call_builtin_p call.

017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>

        PR middle-end/79988
        * gcc.target/i386/mpx/pr79988.c: New test.

From-SVN: r249023
2017-06-08 16:05:59 +00:00
Jan Hubicka
e6026dc04c system.h (fancy_abort): Annotate by ATTRIBUTE_COLD.
* system.h (fancy_abort): Annotate by ATTRIBUTE_COLD.
	* rtl.h (rtl_check_failed_bounds, rtl_check_failed_type1,
	rtl_check_failed_type2, rtl_check_failed_code1,
	rtl_check_failed_code2, rtl_check_failed_code_mode,
	rtl_check_failed_block_symbol, cwi_check_failed_bounds,
	rtvec_check_failed_bounds, rtl_check_failed_flag,
	_fatal_insn_not_found, _fatal_insn): Likewise.
	* tree.h (tree_contains_struct_check_failed,
	tree_check_failed, tree_not_check_failed,
	tree_class_check_failed, tree_range_check_failed,
	tree_not_class_check_failed, tree_int_cst_elt_check_failed,
	tree_vec_elt_check_failed, phi_node_elt_check_failed,
	tree_operand_check_failed, omp_clause_check_failed,
	omp_clause_operand_check_failed, omp_clause_range_check_failed):
	Likewise.

	* cp-tree.h (lang_check_failed): Annotate by ATTRIBUTE_COLD.

From-SVN: r249022
2017-06-08 15:24:38 +00:00
Jan Hubicka
ee4e85b78f cgraph.c (cgraph_edge::maybe_hot_p): Do not check flag_branch_probabilities.
* cgraph.c (cgraph_edge::maybe_hot_p): Do not check
	flag_branch_probabilities.
	* ipa-inline.c (edge_badness): Likewise.
	* ipa-profile.c (ipa_propagate_frequency_1): Likewise.
	* postreload-gcse.c (eliminate_partially_redundant_load): Likewise.
	* predict.c (maybe_hot_frequency_p): Likewise.
	(probably_never_executed): Likewise.
	* sched-ebb.c (schedule_ebbs): Likewise.
	* sched-rgn.c (find_single_block_region): Likewise.
	* tracer.c (tail_duplicate): Likewise.

From-SVN: r249020
2017-06-08 15:15:51 +00:00
Jan Hubicka
ae5512dd4f opts.c (finish_options): x_flag_reorder_blocks_and_partition no longer requires x_flag_profile_use.
* opts.c (finish_options): x_flag_reorder_blocks_and_partition no
	longer requires x_flag_profile_use.

From-SVN: r249019
2017-06-08 14:47:26 +00:00
Jonathan Wakely
853ed6bc10 PR libstdc++/81017 add noexcept to std::function move operations
PR libstdc++/81017
	* include/bits/std_function.h (function::function(function&&))
	(function::operator=(funtion&&)): Add noexcept.
	* testsuite/20_util/function/assign/move.cc: Check for noexcept.
	* testsuite/20_util/function/cons/move.cc: Likewise.

From-SVN: r249018
2017-06-08 15:27:45 +01:00
Jan Hubicka
0b6bc90422 cfgrtl.c (cfg_layout_initialize): Check crtl->has_bb_partition instead of flag_reorder_blocks_and_partition.
* cfgrtl.c (cfg_layout_initialize): Check crtl->has_bb_partition
	instead of flag_reorder_blocks_and_partition.
	* dbxout.c (dbxout_function_end): Likewise.
	* dwarf2out.c (gen_subprogram_die): Likewise.
	* haifa-sched.c (sched_create_recovery_edges): Likewise.
	* hw-doloop.c (reorg_loops): Likewise.
	* varasm.c (assemble_start_function,
	assemble_end_function): Likewise.
	(decide_function_section): Do not check for
	flag_reorder_blocks_and_partition.

From-SVN: r249017
2017-06-08 14:23:43 +00:00
Olivier Hainque
1ac644c8d0 t-vxworks (LIBGCC2_INCLUDES): Add path to wrn/coreip to the set of -I options...
2017-06-08  Olivier Hainque  <hainque@adacore.com>

        * config/t-vxworks (LIBGCC2_INCLUDES): Add path to wrn/coreip to
        the set of -I options, support for direct inclusions of net/uio.h
        by VxWorks header files via ioLib.h.

From-SVN: r249016
2017-06-08 14:08:56 +00:00
Alexander Ivchenko
0036534fa3 tree-chkp.c (chkp_get_hard_register_var_fake_base_address): New function.
gcc/ChangeLog:

2017-05-09  Alexander Ivchenko  <aivchenk@gmail.com>

        * tree-chkp.c (chkp_get_hard_register_var_fake_base_address):
        New function.
        (chkp_get_hard_register_fake_addr_expr): Ditto.
        (chkp_build_addr_expr): Add check for hard reg case.
        (chkp_parse_array_and_component_ref): Ditto.
        (chkp_find_bounds_1): Ditto.
        (chkp_process_stmt): Don't generate bounds store for
        hard reg case.


gcc/testsuite/ChangeLog:

2017-05-09  Alexander Ivchenko  <aivchenk@gmail.com>

        * gcc.target/i386/mpx/hard-reg-2-lbv.c: New test.
        * gcc.target/i386/mpx/hard-reg-2-nov.c: New test.
        * gcc.target/i386/mpx/hard-reg-2-ubv.c: New test.

From-SVN: r249015
2017-06-08 14:07:21 +00:00
Jan Hubicka
b69d9ac6a9 predict.c (maybe_hot_bb_p): Do not check profile status.
* predict.c (maybe_hot_bb_p): Do not check profile status.
	(maybe_hot_edge_p): Likewise.
	(probably_never_executed): Check for zero counts even if profile
	is not read.
	(unlikely_executed_edge_p): New function.
	(unlikely_executed_stmt_p): New function.
	(unlikely_executed_bb_p): New function.
	(set_even_probabilities): Use unlikely predicates.
	(combine_predictions_for_bb): Likewise.
	(predict_paths_for_bb): Likewise.
	(predict_paths_leading_to_edge): Likewise.
	(determine_unlikely_bbs): New function.
	(estimate_bb_frequencies): Use it.
	(compute_function_frequency): Use zero counts even if profile is
	not read.
	* profile-count.h: Fix typo.

	* g++.dg/tree-ssa/counts-1.C: New testcase.
	* gcc.dg/tree-ssa/counts-1.c: New testcase.

From-SVN: r249013
2017-06-08 13:16:44 +00:00
Julia Koval
c46f905165 Add mov[us]wb store intrinsics.
gcc/
	* config/i386/avx512bwintrin.h (_mm512_mask_cvtepi16_storeu_epi8,
	_mm512_mask_cvtsepi16_storeu_epi8,
	_mm512_mask_cvtusepi16_storeu_epi8): New intrinsics.
	* config/i386/avx512vlbwintrin.h (_mm256_mask_cvtepi16_storeu_epi8,
	_mm_mask_cvtsepi16_storeu_epi8, _mm256_mask_cvtsepi16_storeu_epi8,
	_mm_mask_cvtusepi16_storeu_epi8, _mm256_mask_cvtusepi16_storeu_epi8,
	_mm_mask_cvtepi16_storeu_epi8): New intrinsics.
	* config/i386/i386-builtin-types.def (PV8Q, V8QI): New pointer type.
	(VOID_FTYPE_PV32QI_V32HI_USI, VOID_FTYPE_PV8QI_V8HI_UQI,
	VOID_FTYPE_PV16QI_V16HI_UHI): New function types.
	* config/i386/i386-builtin.def (__builtin_ia32_pmovwb128mem_mask,
	__builtin_ia32_pmovwb256mem_mask, __builtin_ia32_pmovswb128mem_mask,
	__builtin_ia32_pmovswb256mem_mask, __builtin_ia32_pmovuswb128mem_mask,
	__builtin_ia32_pmovuswb256mem_mask,
	__builtin_ia32_pmovuswb512mem_mask, __builtin_ia32_pmovswb512mem_mask)
	__builtin_ia32_pmovwb512mem_mask): New builtins.

gcc/testsuite/
	* gcc.target/i386/avx512bw-vpmovswb-1.c: Add new intrinsics to test.
	* gcc.target/i386/avx512bw-vpmovswb-2.c: Ditto.
	* gcc.target/i386/avx512bw-vpmovuswb-1.c: Ditto.
	* gcc.target/i386/avx512bw-vpmovuswb-2.c: Ditto.
	* gcc.target/i386/avx512bw-vpmovwb-1.c: Ditto.
	* gcc.target/i386/avx512bw-vpmovwb-2.c: Ditto.

From-SVN: r249012
2017-06-08 13:04:43 +00:00
Marek Polacek
5ed418891b re PR sanitizer/80932 (UBSAN: false positive as a result of distribution: c1*(c2*v1-c3*v2)=>c1*c2*v1-c1*c3*v2)
PR sanitize/80932
	* c-c++-common/ubsan/pr80932.c: Test with ints, not with long ints.

From-SVN: r249010
2017-06-08 12:38:27 +00:00
Julia Koval
8055904e9e [PR73350][PR80862] Improve subst for RC-capable insns.
PR target/73350,80862
gcc/
	* config/i386/subst.md (round): Fix round pattern.
	* config/i386/i386.c (ix86_erase_embedded_rounding):
	Fix erasing rounding for the fixed pattern.

gcc/testsuite/
	* gcc.target/i386/pr73350.c: New test.

From-SVN: r249009
2017-06-08 11:24:50 +00:00
Jan Hubicka
1972030cf1 * cfgbuild.c (find_many_sub_basic_blocks): Fix thinko.
From-SVN: r249008
2017-06-08 09:34:32 +00:00
Olivier Hainque
724faf7b59 vx_crtbegin_auto.c: Update year in copyright notice.
2017-06-08  Olivier Hainque  <hainque@adacore.com>

        * vx_crtbegin_auto.c: Update year in copyright notice.
        * vx_crtbegin.c: Likewise.
        * vx_crtbegin.inc: Likewise. 
        * vx_crtend.c:  Likewise.

From-SVN: r249007
2017-06-08 08:20:39 +00:00
Martin Liska
a82be9d5f1 gcov: Add block_info::block_info (PR gcov-profile/80911).
2017-06-08  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/80911
	* gcov.c (block_info::block_info): New constructor.

From-SVN: r249006
2017-06-08 07:51:07 +00:00
Tamar Christina
94fc87ecdf re PR middle-end/77925 (Add __builtin_issubnormal)
2017-06-08  Tamar Christina  <tamar.christina@arm.com>

	PR middle-end/77925
	PR middle-end/77926
	PR middle-end/66462

	* gcc/builtins.c (fold_builtin_fpclassify): Remove.
	(fold_builtin_interclass_mathfn): Remove.
	(expand_builtin): Add builtins to lowering list.
	(fold_builtin_n): Remove fold_builtin_varargs.
	(fold_builtin_varargs): Remove.
	* gcc/builtins.def (BUILT_IN_ISZERO, BUILT_IN_ISSUBNORMAL): New.
	* gcc/real.h (get_min_float): New.
	(real_format): Add is_ieee_compatible field.
	* gcc/real.c (get_min_float): New.
	(ieee_single_format): Set is_ieee_compatible flag.
	* gcc/gimple-low.c (lower_stm): Define BUILT_IN_FPCLASSIFY,
	CASE_FLT_FN (BUILT_IN_ISINF), BUILT_IN_ISINFD32, BUILT_IN_ISINFD64,
	BUILT_IN_ISINFD128, BUILT_IN_ISNAND32, BUILT_IN_ISNAND64,
	BUILT_IN_ISNAND128, BUILT_IN_ISNAN, BUILT_IN_ISNORMAL, BUILT_IN_ISZERO,
	BUILT_IN_ISSUBNORMAL, CASE_FLT_FN (BUILT_IN_FINITE), BUILT_IN_FINITED32
	BUILT_IN_FINITED64, BUILT_IN_FINITED128, BUILT_IN_ISFINITE.
	(lower_builtin_fpclassify, is_nan, is_normal, is_infinity): New.
	(is_zero, is_subnormal, is_finite, use_ieee_int_mode): Likewise.
	(lower_builtin_isnan, lower_builtin_isinfinite): Likewise.
	(lower_builtin_isnormal, lower_builtin_iszero): Likewise.
	(lower_builtin_issubnormal, lower_builtin_isfinite): Likewise.
	(emit_tree_cond, get_num_as_int, emit_tree_and_return_var): New.
	(mips_single_format): Likewise.
	(motorola_single_format): Likewise.
	(spu_single_format): Likewise.
	(ieee_double_format): Likewise.
	(mips_double_format): Likewise.
	(motorola_double_format): Likewise.
	(ieee_extended_motorola_format): Likewise.
	(ieee_extended_intel_128_format): Likewise.
	(ieee_extended_intel_96_round_53_format): Likewise.
	(ibm_extended_format): Likewise.
	(mips_extended_format): Likewise.
	(ieee_quad_format): Likewise.
	(mips_quad_format): Likewise.
	(vax_f_format): Likewise.
	(vax_d_format): Likewise.
	(vax_g_format): Likewise.
	(decimal_single_format): Likewise.
	(decimal_quad_format): Likewise.
	(iee_half_format): Likewise.
	(mips_single_format): Likewise.
	(arm_half_format): Likewise.
	(real_internal_format): Likewise.
	* gcc/doc/extend.texi: Add documentation for built-ins.
	* gcc/c/c-typeck.c (convert_arguments): Add BUILT_IN_ISZERO
	and BUILT_IN_ISSUBNORMAL.

gcc/testsuite/
2017-06-08  Tamar Christina  <tamar.christina@arm.com>

	* gcc.target/aarch64/builtin-fpclassify.c: New codegen test.
	* gcc.dg/fold-notunord.c: Removed.
	* gcc.dg/torture/floatn-tg-4.h: Add tests for iszero and issubnormal.
	* gcc.dg/torture/float128-tg-4.c: Likewise.
	* gcc.dg/torture/float128x-tg-4: Likewise.
	* gcc.dg/torture/float16-tg-4.c: Likewise.
	* gcc.dg/torture/float32-tg-4.c: Likewise.
	* gcc.dg/torture/float32x-tg-4.c: Likewise.
	* gcc.dg/torture/float64-tg-4.c: Likewise.
	* gcc.dg/torture/float64x-tg-4.c: Likewise.
	* gcc.dg/pr28796-1.c: Add -O2.
	* gcc.dg/builtins-43.c: Check lower instead of gimple.
	* gcc.dg/tg-tests.h: Add iszero and issubnormal.
	* gcc.dg/pr77925.c: Add to test safe cases.

From-SVN: r249005
2017-06-08 07:38:42 +00:00
Richard Biener
fb4bc6ff6c re PR tree-optimization/80928 (SLP vectorization does not handle induction in outer loop vectorization)
2017-06-08  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/80928
	* gcc.dg/vect/slp-perm-8.c: Do not expect check loop to be vectorized.

From-SVN: r249004
2017-06-08 07:32:52 +00:00