opts.c (finish_options): If -fsplit-stack, disable implicit -forder-blocks-and-partition.
gcc/:
* opts.c (finish_options): If -fsplit-stack, disable implicit
-forder-blocks-and-partition.
* doc/invoke.texi (Optimize Options): Document that when using
-fsplit-stack -forder-blocks-and-partition is not implicitly
enabled.
gcc/go/:
* go-lang.c (go_langhook_post_options): If -fsplit-stack is turned
on, disable implicit -forder-blocks-and-partition.
gcc/testsuite/:
* gcc.dg/tree-prof/split-1.c: New test.
* class.c (build_vtbl_initializer): Mark dvirt_fn as cold.
* decl.c (cxx_init_decl_processing, push_throw_library_fn): Likewise.
(excpet.c): Mark terminate as cold.
* gcc.dg/predict-14.c: Avoid cold function detection.
* gcc.target/i386/umod-3.c: Likewise.
Tom de Vries [Fri, 9 Jun 2017 13:11:52 +0000 (13:11 +0000)]
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.
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.
Martin Liska [Fri, 9 Jun 2017 12:54:53 +0000 (14:54 +0200)]
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.
Richard Biener [Fri, 9 Jun 2017 09:40:45 +0000 (09:40 +0000)]
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.
Richard Biener [Fri, 9 Jun 2017 09:36:06 +0000 (09:36 +0000)]
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.
Martin Liska [Fri, 9 Jun 2017 07:38:52 +0000 (09:38 +0200)]
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.
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)) = ...".
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.
Jakub Jelinek [Thu, 8 Jun 2017 18:55:04 +0000 (20:55 +0200)]
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.
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.
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.
Olivier Hainque [Thu, 8 Jun 2017 14:08:56 +0000 (14:08 +0000)]
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.
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.
Jan Hubicka [Thu, 8 Jun 2017 13:16:44 +0000 (15:16 +0200)]
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.
Carl Love [Wed, 7 Jun 2017 22:23:15 +0000 (22:23 +0000)]
rs6000-c: The return type of the following built-in functions was implemented as int not...
gcc/ChangeLog:
2017-06-07 Carl Love <cel@us.ibm.com>
* config/rs6000/rs6000-c: The return type of the following
built-in functions was implemented as int not long long. Fix sign
of return value for the unsigned version of vec_mulo and vec_mule.
vector unsigned long long vec_bperm (vector unsigned long long,
vector unsigned char)
vector signed long long vec_mule (vector signed int,
vector signed int)
vector unsigned long long vec_mule (vector unsigned int,
vector unsigned int)
vector signed long long vec_mulo (vector signed int,
vector signed int)
vector unsigned long long vec_mulo (vector unsigned int,
vector unsigned int)
* doc/extend.texi: Fix the documentation for the built-in
functions.
gcc/testsuite/ChangeLog:
2017-06-07 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/builtins-3.c: Fix vec_mule, vec_mulo test cases.
---
Jonathan Wakely [Wed, 7 Jun 2017 15:43:35 +0000 (16:43 +0100)]
PR libstdc++/81002 fix std::basic_regex range constructor
PR libstdc++/81002
* include/bits/regex.h (basic_regex): Adjust call to __compile_nfa
so iterator type is deduced.
* include/bits/regex_compiler.h (__compile_nfa): Reorder template
parameters to allow iterator type to be deduced.
* testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New.
Now rs6000_nonimmediate_operand is just nonimmediate_operand.
* config/rs6000/predicates.md (rs6000_nonimmediate_operand): Delete.
* config/rs6000/rs6000.md (*movsi_internal1, movsi_from_sf,
*mov<mode>_softfloat, and an anonymous splitter): Use
nonimmediate_operand instead of rs6000_nonimmediate_operand.
Jonathan Wakely [Wed, 7 Jun 2017 12:35:08 +0000 (13:35 +0100)]
Add C++17 deduction guide for std::basic_string (P0433R2, partial)
* include/bits/alloc_traits.h (__is_allocator, _RequireAllocator):
New trait and alias for detecting Allocator-like types.
* include/bits/basic_string.h (basic_string): Add deduction guide
from P0433.
* include/ext/alloc_traits.h (__gnu_cxx::__alloc_traits): Add template
parameter with default template argument that causes substitution
failures for types that cannot be allocators.
* testsuite/21_strings/basic_string/cons/char/deduction.cc: New.
* testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc: New.
* graphds.c (add_edge): Intitialize edge's attached data.
(foll_in_subgraph, dfs_fst_edge, dfs_next_edge): New function
pointer parameter. Call pointed function on each edge during
graph traversing. Skip traversing the edge when the function
returns true.
(graphds_dfs, graphds_scc): Ditto.
(for_each_edge): New parameter. Pass the new parameter to callback
function.
* graphds.h (skip_edge_callback): New function pointer type.
(graphds_dfs, graphds_scc): New function pointer parameter.
(graphds_edge_callback, for_each_edge): New parameter.
Bin Cheng [Wed, 7 Jun 2017 11:28:17 +0000 (11:28 +0000)]
tree-vect-data-refs.c (vect_mark_for_runtime_alias_test): Factor out code checking if runtime alias check is possible to below ...
* tree-vect-data-refs.c (vect_mark_for_runtime_alias_test): Factor
out code checking if runtime alias check is possible to below ...
Call the new function.
* tree-data-ref.c (runtime_alias_check_p): ... to new function.
* tree-data-ref.h (runtime_alias_check_p): New decalaration.
Bin Cheng [Wed, 7 Jun 2017 10:56:54 +0000 (10:56 +0000)]
tree-vect-loop-manip.c (vect_do_peeling): Don't skip vector loop if versioning is required.
* tree-vect-loop-manip.c (vect_do_peeling): Don't skip vector loop
if versioning is required.
* tree-vect-loop.c (vect_analyze_loop_2): Merge niter check for loop
peeling with the check for versioning.
Bin Cheng [Wed, 7 Jun 2017 10:53:02 +0000 (10:53 +0000)]
tree-vectorizer.h (vect_build_loop_niters): New parameter.
* tree-vectorizer.h (vect_build_loop_niters): New parameter.
* tree-vect-loop-manip.c (vect_build_loop_niters): New parameter.
Set true to new parameter if new ssa variable is defined.
(vect_gen_vector_loop_niters): Refactor. Set range information
for the new vector loop bound variable.
(vect_do_peeling): Ditto.
Bin Cheng [Wed, 7 Jun 2017 10:45:03 +0000 (10:45 +0000)]
tree-ssa-loop-ivopts.c (ivopts_estimate_reg_pressure): New reg_pressure model function.
* tree-ssa-loop-ivopts.c (ivopts_estimate_reg_pressure): New
reg_pressure model function.
(ivopts_global_cost_for_size): Delete.
(determine_set_costs, iv_ca_recount_cost): Call new model function
ivopts_estimate_reg_pressure.
Sebastian Huber [Wed, 7 Jun 2017 09:49:27 +0000 (09:49 +0000)]
RTEMS: Use TLS for Ada run-time
Do not use the RTEMS-specific task variables for the Ada run-time since
they are not available in RTEMS 4.12 or later. Use thread-local storage
instead.
gcc/ada
* Makefile.in (rtems): Use TLS implementation for s-tpopsp.adb.
* s-tpopsp-rtems.adb: Delete.