platform/upstream/gcc.git
5 years agore PR tree-optimization/87124 (ICE have integer_cst in SSA_VAL, at tree-ssa-sccvn...
Richard Biener [Tue, 28 Aug 2018 13:36:49 +0000 (13:36 +0000)]
re PR tree-optimization/87124 (ICE have integer_cst in SSA_VAL, at tree-ssa-sccvn.c:462 while building 541.leela_r from SPEC2017)

2018-08-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87124
* tree-ssa-sccvn.c (vn_lookup_simplify_result): Guard against
constants before looking up avail.

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

From-SVN: r263918

5 years agore PR fortran/80477 ([OOP] Polymorphic function result generates memory leak)
Paul Thomas [Tue, 28 Aug 2018 11:35:52 +0000 (11:35 +0000)]
re PR fortran/80477 ([OOP] Polymorphic function result generates memory leak)

2017-08-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/80477
* trans-expr.c (gfc_conv_procedure_call): Allocatable class
scalar results being passed to a derived type formal argument
are finalized if possible. Otherwise, rely on existing code for
deallocation. Make the deallocation of allocatable result
components conditional on finalization not taking place. Make
the freeing of data components after finalization conditional
on the data being NULL.
(gfc_trans_arrayfunc_assign): Change the gcc_assert to a
condition to return NULL_TREE.
(gfc_trans_assignment_1): If the assignment is class to class
and the rhs expression must be finalized but the assignment
is not marked as a polymorphic assignment, use the vptr copy
function instead of gfc_trans_scalar_assign.

PR fortran/86481
* trans-expr.c (gfc_conv_expr_reference): Do not add the post
block to the pre block if the expression is to be finalized.
* trans-stmt.c (gfc_trans_allocate): If the expr3 must be
finalized, load the post block into a finalization block and
add it right at the end of the allocation block.

2017-08-28  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/80477
* gfortran.dg/class_result_7.f90: New test.
* gfortran.dg/class_result_8.f90: New test.
* gfortran.dg/class_result_9.f90: New test.

PR fortran/86481
* gfortran.dg/allocate_with_source_25.f90: New test.

From-SVN: r263916

5 years agore PR middle-end/87099 (internal compiler error: segmentation fault)
Jakub Jelinek [Tue, 28 Aug 2018 11:13:04 +0000 (13:13 +0200)]
re PR middle-end/87099 (internal compiler error: segmentation fault)

PR middle-end/87099
* calls.c (maybe_warn_nonstring_arg): Punt early if
warn_stringop_overflow is zero.  Don't call get_range_strlen
on 3rd argument, keep iterating until lenrng[1] is INTEGER_CST.
Swap comparison operands to have constants on rhs.  Only use
lenrng[1] if non-NULL and INTEGER_CST.  Don't uselessly
increment lenrng[0].

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

From-SVN: r263915

5 years agoFix unguarded use of tree_to_shwi in tree-ssa-sccvn.c
Richard Sandiford [Tue, 28 Aug 2018 10:42:42 +0000 (10:42 +0000)]
Fix unguarded use of tree_to_shwi in tree-ssa-sccvn.c

Fixes many testsuite failures for SVE.

2018-08-28  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Fix unguarded
use of tree_to_shwi.  Remove duplicated test for the size being
a whole number of bytes.

From-SVN: r263914

5 years agoAdd target selectors to slp-37.c (PR87078)
Richard Sandiford [Tue, 28 Aug 2018 10:42:30 +0000 (10:42 +0000)]
Add target selectors to slp-37.c (PR87078)

This test was failing for Power 7 due to the lack of hw support
for unaligned accesses.

2018-08-28  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
PR testsuite/87078
* gcc.dg/vect/slp-37.c: Restrict scan tests to vect_hw_misalign.

From-SVN: r263913

5 years agore PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool...
Richard Biener [Tue, 28 Aug 2018 10:15:54 +0000 (10:15 +0000)]
re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875)

2018-08-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87117
* tree-ssa-sccvn.c (eliminate_dom_walker::eliminate_cleanup):
Handle removed stmt without LHS (GIMPLE_NOP).

From-SVN: r263912

5 years agore PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool...
Richard Biener [Tue, 28 Aug 2018 10:14:45 +0000 (10:14 +0000)]
re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875)

2018-08-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87117
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Exclude
void which is is_gimple_reg_type by checking for COMPLETE_TYPE_P.

* gcc.dg/pr87117-1.c: New testcase.

From-SVN: r263911

5 years agore PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool...
Richard Biener [Tue, 28 Aug 2018 10:13:18 +0000 (10:13 +0000)]
re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875)

2018-08-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87117
* tree-ssa-pre.c (compute_avail): Do not make expressions
with predicated values available.
(get_expr_value_id): Assert we do not run into predicated value
expressions.

* gcc.dg/pr87117-2.c: New testcase.

From-SVN: r263910

5 years agore PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool...
Richard Biener [Tue, 28 Aug 2018 09:33:16 +0000 (09:33 +0000)]
re PR tree-optimization/87117 (ICE in eliminate_dom_walker::eliminate_cleanup(bool) at gcc/gcc/tree-ssa-sccvn.c:5431 since r263875)

2018-08-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/87117
* tree-ssa-operands.c (add_stmt_operand): STRING_CST may
get virtual operands.
(get_expr_operands): Handle STRING_CST like other decls.

* gcc.dg/lvalue-5.c: New testcase.

From-SVN: r263908

5 years agoUpdate documentation of fndecl_built_in_p.
Martin Liska [Tue, 28 Aug 2018 07:23:12 +0000 (09:23 +0200)]
Update documentation of fndecl_built_in_p.

2018-08-28  Martin Liska  <mliska@suse.cz>

* tree.h: Update documentation of fndecl_built_in_p
functions.

From-SVN: r263907

5 years agore PR tree-optimization/87110 ([9 Regresssion] tree check fail in to_wide, at tree...
Jeff Law [Tue, 28 Aug 2018 04:02:11 +0000 (22:02 -0600)]
re PR tree-optimization/87110 ([9 Regresssion] tree check fail in to_wide, at tree.h:5523)

PR tree-optimization/87110
* tree-ssa-dse.c (compute_trims): Handle non-constant
TYPE_SIZE_UNIT.

PR tree-optimization/87110
* gcc.c-torture/compile/pr87110.c: New test.

From-SVN: r263906

5 years agoPR tree-optimization/86914 - wrong code with strlen() of poor-man's flexible array...
Martin Sebor [Tue, 28 Aug 2018 00:25:50 +0000 (00:25 +0000)]
PR tree-optimization/86914 - wrong code with strlen() of poor-man's flexible array member plus offset

gcc/ChangeLog:

PR tree-optimization/86914
* tree-ssa-strlen.c (maybe_set_strlen_range): Avoid MEM_REF.

gcc/testsuite/ChangeLog:

PR tree-optimization/86914
* gcc.dg/strlenopt-57.c: New test.

From-SVN: r263905

5 years agoDaily bump.
GCC Administrator [Tue, 28 Aug 2018 00:16:36 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263904

5 years agoPR tree-optimization/87112 - ICE in fold_binary_loc on strnlen of mixed integer types
Martin Sebor [Tue, 28 Aug 2018 00:10:46 +0000 (00:10 +0000)]
PR tree-optimization/87112 - ICE in fold_binary_loc on strnlen of mixed integer types

gcc/ChangeLog:

PR tree-optimization/87112
* builtins.c (expand_builtin_strnlen): Convert c_strlen result to
the type of the bound argument.

gcc/testsuite/ChangeLog:

PR tree-optimization/87112
* gcc.dg/pr87112.c: New test.

From-SVN: r263900

5 years agoC++: fix-it hint for missing "typename" (PR c++/63392)
David Malcolm [Mon, 27 Aug 2018 23:33:02 +0000 (23:33 +0000)]
C++: fix-it hint for missing "typename" (PR c++/63392)

This patch adds a fix-it hint to missing "typename" errors in the C++
frontend, suggesting the insertion of "typename ".

This addresses part of PR c++/63392; however it does not improve the
error-recovery for such cases.

gcc/cp/ChangeLog:
PR c++/63392
* parser.c (cp_parser_diagnose_invalid_type_name): Add fix-it
hint.

gcc/testsuite/ChangeLog:
PR c++/63392
* g++.dg/diagnostic/missing-typename.C: New test.

From-SVN: r263899

5 years agotree-ssa-dse.c (compute_trims): Handle case where the reference's type does not have...
Jeff Law [Mon, 27 Aug 2018 20:31:14 +0000 (14:31 -0600)]
tree-ssa-dse.c (compute_trims): Handle case where the reference's type does not have a TYPE_SIZE_UNIT.

* tree-ssa-dse.c (compute_trims): Handle case where the reference's
type does not have a TYPE_SIZE_UNIT.

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

From-SVN: r263896

5 years agore PR c++/86993 (assignment of read-only variable error reported at wrong location)
Jakub Jelinek [Mon, 27 Aug 2018 18:36:23 +0000 (20:36 +0200)]
re PR c++/86993 (assignment of read-only variable error reported at wrong location)

PR c++/86993
* cp-tree.h (cxx_readonly_error): Add location_t argument.
* typeck2.c (cxx_readonly_error): Add LOC argument, pass it to
ERROR_FOR_ASSIGNMENT macro and readonly_error.  Add LOC argument
to ERROR_FOR_ASSIGNMENT macro, use error_at instead of error and
pass LOC to it.  Formatting fixes.
* typeck.c (cp_build_unary_op): Pass location to cxx_readonly_error.
(cp_build_modify_expr): Pass loc to cxx_readonly_error.
* semantics.c (finish_asm_stmt): Pass input_location to
cxx_readonly_error.

* g++.dg/diagnostic/pr86993.C: New test.

From-SVN: r263891

5 years agoaarch64-speculation.cc: Replace include of cfg.h with include of backend.h.
Steve Ellcey [Mon, 27 Aug 2018 16:39:44 +0000 (16:39 +0000)]
aarch64-speculation.cc: Replace include of cfg.h with include of backend.h.

2018-08-27  Steve Ellcey  <sellcey@cavium.com>

* config/aarch64/aarch64-speculation.cc: Replace include of cfg.h
with include of backend.h.

From-SVN: r263890

5 years agore PR tree-optimization/86927 (Gcc miscompiles at -O3 on valid code)
Richard Biener [Mon, 27 Aug 2018 14:17:03 +0000 (14:17 +0000)]
re PR tree-optimization/86927 (Gcc miscompiles at -O3 on valid code)

2018-08-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/86927
* tree-vect-loop.c (vect_create_epilog_for_reduction): Properly
use const cond reduction code.

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

From-SVN: r263888

5 years agomatch.pd: add single-use check for (x & y) ^ y -> ~x & y (PR 85758)
Alexander Monakov [Mon, 27 Aug 2018 14:08:50 +0000 (17:08 +0300)]
match.pd: add single-use check for (x & y) ^ y -> ~x & y (PR 85758)

PR tree-optimization/85758
* match.pd ((X & Y) ^ Y): Add :s qualifier to inner expression.

From-SVN: r263887

5 years agoReplace 8 spaces with a tabular in ChangeLog files.
Martin Liska [Mon, 27 Aug 2018 14:04:23 +0000 (14:04 +0000)]
Replace 8 spaces with a tabular in ChangeLog files.

From-SVN: r263886

5 years agoLess verbose fix-it hints for missing header files (PR 87091)
David Malcolm [Mon, 27 Aug 2018 14:02:05 +0000 (14:02 +0000)]
Less verbose fix-it hints for missing header files (PR 87091)

This patch tweaks maybe_add_include_fixit so that if we're emitting a note
about adding the header file, the note's primary location will be replaced
by that of the fix-it hint, to avoid repeating a location we've already
emitted (or one close to it).

For example, this simplifies:

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:27: error: msg 1
  87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
     |                           ^~~~~~
  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22: note: msg 2
   73 | # include <debug/vector>
  +++ |+#include <vector>
   74 | #endif
  ....
   87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |                      ^~~

to:

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:27: error: msg 1
  87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
     |                           ^~~~~~
  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:74:1: note: msg 2
   73 | # include <debug/vector>
  +++ |+#include <vector>
   74 | #endif

eliminating the repetition of line 87 in the note.

Doing so requires converting show_caret_p to a tri-state, to avoid
meaninglessly printing a caret for the first column in the next line
(and colorizing it):

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:74:1: note: msg 2
   73 | # include <debug/vector>
  +++ |+#include <vector>
   74 | #endif
      | ^

gcc/c-family/ChangeLog:
PR 87091
* c-common.c (c_cpp_error): Update for conversion of show_caret_p
to a tri-state.
(maybe_suggest_missing_token_insertion): Likewise.
(maybe_add_include_fixit): Add param "override_location".  If set,
and source-printing is enabled, then override the rich_location's
primary location with that of the insertion point for the fix-it
hint, marking it with SHOW_LINES_WITHOUT_RANGE.
* c-common.h (extern void maybe_add_include_fixit): Add bool
param.
* c-format.c (selftest::test_type_mismatch_range_labels): Update
for conversion of show_caret_p to a tri-state.
* c-warn.c (warn_for_restrict): Likewise.
* known-headers.cc
(suggest_missing_header::~suggest_missing_header): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.

gcc/c/ChangeLog:
PR 87091
* c-decl.c (implicitly_declare): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.
* c-objc-common.c (c_tree_printer): Update for conversion of
show_caret_p to a tri-state.

gcc/cp/ChangeLog:
PR 87091
* decl.c (grokdeclarator): Update for conversion of show_caret_p
to a tri-state.
* error.c (cp_printer): Likewise.
* name-lookup.c (maybe_suggest_missing_std_header): Update call to
maybe_add_include_fixit to suggest overriding the location, as it
is for a note.
* parser.c (cp_parser_string_literal): Update for conversion of
show_caret_p to a tri-state.
(cp_parser_elaborated_type_specifier): Likewise.
(set_and_check_decl_spec_loc): Likewise.
* pt.c (listify): Update call to maybe_add_include_fixit to not
override the location, as it is for an error.
* rtti.c (typeid_ok_p): Likewise.

gcc/ChangeLog:
PR 87091
* diagnostic-show-locus.c (class layout_range): Update for
conversion of show_caret_p to a tri-state.
(layout_range::layout_range): Likewise.
(make_range): Likewise.
(layout::maybe_add_location_range): Likewise.
(layout::should_print_annotation_line_p): Don't show annotation
lines for ranges that are SHOW_LINES_WITHOUT_RANGE.
(layout::get_state_at_point): Update for conversion of
show_caret_p to a tri-state.  Bail out early for
SHOW_LINES_WITHOUT_RANGE, so that such ranges don't affect
underlining or source colorization.
(gcc_rich_location::add_location_if_nearby): Update for conversion
of show_caret_p to a tri-state.
(selftest::test_one_liner_multiple_carets_and_ranges): Likewise.
(selftest::test_one_liner_fixit_replace_equal_secondary_range):
Likewise.
(selftest::test_one_liner_labels): Likewise.
* gcc-rich-location.c (gcc_rich_location::add_expr): Update for
conversion of show_caret_p to a tri-state.
* pretty-print.c (text_info::set_location): Likewise.
* pretty-print.h (text_info::set_location): Likewise.
* substring-locations.c (format_warning_n_va): Likewise.
* tree-diagnostic.c (default_tree_printer): Likewise.
* tree-pretty-print.c (newline_and_indent): Likewise.

gcc/fortran/ChangeLog:
PR 87091
* error.c (gfc_format_decoder): Update for conversion of
show_caret_p to a tri-state.

gcc/testsuite/ChangeLog:
PR 87091
* gcc.dg/empty.h: New file.
* gcc.dg/fixits-pr84852-1.c: Update for move of fix-it hint to
top of file and removal of redundant second printing of warning
location.
* gcc.dg/fixits-pr84852-2.c: Likewise.
* gcc.dg/missing-header-fixit-3.c: Likewise.
* gcc.dg/missing-header-fixit-4.c: New test.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c: Update for
conversion of show_caret_p to a tri-state.

libcpp/ChangeLog:
PR 87091
* include/line-map.h (enum range_display_kind): New enum.
(struct location_range): Replace field "m_show_caret_p" with
"m_range_display_kind", converting from bool to the new enum.
(class rich_location): Add example of line insertion fix-it hint.
(rich_location::add_range): Convert param "show_caret_p" from bool
to enum range_display_kind and rename to "range_display_kind",
giving it a default of SHOW_RANGE_WITHOUT_CARET.
(rich_location::set_range): Likewise, albeit without a default.
* line-map.c (rich_location::rich_location): Update for conversion
of show_caret_p to tri-state enum.
(rich_location::add_range): Likewise.
(rich_location::set_range): Likewise.

From-SVN: r263885

5 years agodiagnostics: show an extra line of context in line-insertion fix-it hints (PR 87091)
David Malcolm [Mon, 27 Aug 2018 13:46:32 +0000 (13:46 +0000)]
diagnostics: show an extra line of context in line-insertion fix-it hints (PR 87091)

This patch tweaks how we print line-insertion fix-it hints, so that
the line before the insertion point is also printed, to give the user
more context on the proposed change.

For example, it changes:

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22: note: message
  +++ |+#include <vector>
   74 | #endif
  ....
   87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |                      ^~~

to:

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22: note: message
   73 | # include <debug/vector>
  +++ |+#include <vector>
   74 | #endif
  ....
   87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |                      ^~~

gcc/ChangeLog:
PR 87091
* diagnostic-show-locus.c (get_line_span_for_fixit_hint): Show the
line above for line-insertion fix-it hints.
(selftest::test_fixit_insert_containing_newline): Update the
expected results, and add a test with line-numbering enabled.

gcc/testsuite/ChangeLog:
PR 87091
* g++.dg/pr85523.C: Extend expected output to show line
before line-insertion fix-it hint.
* gcc.dg/plugin/diagnostic-test-show-locus-bw-line-numbers.c
(test_fixit_insert_newline): Add previous line to expected output.
* gcc.dg/plugin/diagnostic-test-show-locus-bw.c: Likewise.
* gcc.dg/plugin/diagnostic-test-show-locus-color.c: Likewise.

From-SVN: r263884

5 years agoSanopt: ignore params with DECL_HAS_VALUE_EXPR_P (PR sanitizer/86962).
Martin Liska [Mon, 27 Aug 2018 13:21:28 +0000 (15:21 +0200)]
Sanopt: ignore params with DECL_HAS_VALUE_EXPR_P (PR sanitizer/86962).

2018-08-27  Martin Liska  <mliska@suse.cz>

        PR sanitizer/86962
* sanopt.c (sanitize_rewrite_addressable_params): Ignore
        params with DECL_HAS_VALUE_EXPR_P.
2018-08-27  Martin Liska  <mliska@suse.cz>

        PR sanitizer/86962
* gcc.dg/asan/pr86962.c: New test.

From-SVN: r263882

5 years agoAdd test for memcpy expansion with hint.
Martin Liska [Mon, 27 Aug 2018 13:18:43 +0000 (15:18 +0200)]
Add test for memcpy expansion with hint.

2018-08-27  Martin Liska  <mliska@suse.cz>

* config/i386/i386.c (ix86_expand_set_or_movmem): Dump
        selected expansion strategy.
2018-08-27  Martin Liska  <mliska@suse.cz>

* gcc.dg/tree-prof/val-prof-10.c: New test.

From-SVN: r263881

5 years agoCome up with fndecl_built_in_p.
Martin Liska [Mon, 27 Aug 2018 12:34:52 +0000 (14:34 +0200)]
Come up with fndecl_built_in_p.

2018-08-27  Martin Liska  <mliska@suse.cz>

* builtins.h (is_builtin_fn): Remove and fndecl_built_in_p.
* builtins.c (is_builtin_fn): Likewise.
* attribs.c (diag_attr_exclusions): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
(builtin_mathfn_code): Likewise.
(fold_builtin_expect): Likewise.
(fold_call_expr): Likewise.
(fold_builtin_call_array): Likewise.
(fold_call_stmt): Likewise.
(set_builtin_user_assembler_name): Likewise.
(is_simple_builtin): Likewise.
* calls.c (gimple_alloca_call_p): Likewise.
(maybe_warn_nonstring_arg): Likewise.
* cfgexpand.c (expand_call_stmt): Likewise.
* cgraph.c (cgraph_update_edges_for_call_stmt_node): Likewise.
(cgraph_edge::verify_corresponds_to_fndecl): Likewise.
(cgraph_node::verify_node): Likewise.
* cgraphclones.c (build_function_decl_skip_args): Likewise.
(cgraph_node::create_clone): Likewise.
* config/arm/arm.c (arm_insert_attributes): Likewise.
* config/i386/i386.c (ix86_gimple_fold_builtin): Likewise.
* dse.c (scan_insn): Likewise.
* expr.c (expand_expr_real_1): Likewise.
* fold-const.c (operand_equal_p): Likewise.
(fold_binary_loc): Likewise.
* gimple-fold.c (gimple_fold_stmt_to_constant_1): Likewise.
* gimple-low.c (lower_stmt): Likewise.
* gimple-pretty-print.c (dump_gimple_call): Likewise.
* gimple-ssa-warn-restrict.c (wrestrict_dom_walker::check_call): Likewise.
* gimple.c (gimple_build_call_from_tree): Likewise.
(gimple_call_builtin_p): Likewise.
(gimple_call_combined_fn): Likewise.
* gimplify.c (gimplify_call_expr): Likewise.
(gimple_boolify): Likewise.
(gimplify_modify_expr): Likewise.
(gimplify_addr_expr): Likewise.
* hsa-gen.c (gen_hsa_insns_for_call): Likewise.
* ipa-cp.c (determine_versionability): Likewise.
* ipa-fnsummary.c (compute_fn_summary): Likewise.
* ipa-param-manipulation.c (ipa_modify_formal_parameters): Likewise.
* ipa-split.c (visit_bb): Likewise.
(split_function): Likewise.
* ipa-visibility.c (cgraph_externally_visible_p): Likewise.
* lto-cgraph.c (input_node): Likewise.
* lto-streamer-out.c (write_symbol): Likewise.
* omp-low.c (setjmp_or_longjmp_p): Likewise.
(lower_omp_1): Likewise.
* predict.c (strip_predict_hints): Likewise.
* print-tree.c (print_node): Likewise.
* symtab.c (symtab_node::output_to_lto_symbol_table_p): Likewise.
* trans-mem.c (is_tm_irrevocable): Likewise.
(is_tm_load): Likewise.
(is_tm_simple_load): Likewise.
(is_tm_store): Likewise.
(is_tm_simple_store): Likewise.
(is_tm_abort): Likewise.
(tm_region_init_1): Likewise.
* tree-call-cdce.c (gen_shrink_wrap_conditions): Likewise.
* tree-cfg.c (verify_gimple_call): Likewise.
(move_stmt_r): Likewise.
(stmt_can_terminate_bb_p): Likewise.
* tree-eh.c (lower_eh_constructs_2): Likewise.
* tree-if-conv.c (if_convertible_stmt_p): Likewise.
* tree-inline.c (remap_gimple_stmt): Likewise.
(copy_bb): Likewise.
(estimate_num_insns): Likewise.
(fold_marked_statements): Likewise.
* tree-sra.c (scan_function): Likewise.
* tree-ssa-ccp.c (surely_varying_stmt_p): Likewise.
(optimize_stack_restore): Likewise.
(pass_fold_builtins::execute): Likewise.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise.
(mark_all_reaching_defs_necessary_1): Likewise.
* tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Likewise.
* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
(pass_forwprop::execute): Likewise.
* tree-ssa-loop-im.c (stmt_cost): Likewise.
* tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise.
* tree-ssa-sccvn.c (fully_constant_vn_reference_p): Likewise.
* tree-ssa-strlen.c (get_string_length): Likewise.
* tree-ssa-structalias.c (handle_lhs_call): Likewise.
(find_func_aliases_for_call): Likewise.
* tree-ssa-ter.c (find_replaceable_in_bb): Likewise.
* tree-stdarg.c (optimize_va_list_gpr_fpr_size): Likewise.
* tree-tailcall.c (find_tail_calls): Likewise.
* tree.c (need_assembler_name_p): Likewise.
(free_lang_data_in_decl): Likewise.
(get_call_combined_fn): Likewise.
* ubsan.c (is_ubsan_builtin_p): Likewise.
* varasm.c (incorporeal_function_p): Likewise.
* tree.h (DECL_BUILT_IN): Remove and replace with
        fndecl_built_in_p.
(DECL_BUILT_IN_P): Transfort to fndecl_built_in_p.
(fndecl_built_in_p): New.
2018-08-27  Martin Liska  <mliska@suse.cz>

* gcc-interface/decl.c (update_profile): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
* gcc-interface/gigi.h (call_is_atomic_load): Likewise.
* gcc-interface/utils.c (gnat_pushdecl): Likewise.
2018-08-27  Martin Liska  <mliska@suse.cz>

* c-common.c (check_function_restrict): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
(check_builtin_function_arguments): Likewise.
(reject_gcc_builtin): Likewise.
* c-warn.c (sizeof_pointer_memaccess_warning): Likewise.
2018-08-27  Martin Liska  <mliska@suse.cz>

* c-decl.c (locate_old_decl): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
(diagnose_mismatched_decls): Likewise.
(merge_decls): Likewise.
(warn_if_shadowing): Likewise.
(pushdecl): Likewise.
(implicitly_declare): Likewise.
* c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
* c-tree.h (C_DECL_ISNT_PROTOTYPE): Likewise.
* c-typeck.c (build_function_call_vec): Likewise.
(convert_arguments): Likewise.
2018-08-27  Martin Liska  <mliska@suse.cz>

* call.c (build_call_a): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
(build_cxx_call): Likewise.
* constexpr.c (constexpr_fn_retval): Likewise.
(cxx_eval_builtin_function_call): Likewise.
(cxx_eval_call_expression): Likewise.
(potential_constant_expression_1): Likewise.
* cp-gimplify.c (cp_gimplify_expr): Likewise.
(cp_fold): Likewise.
* decl.c (decls_match): Likewise.
(validate_constexpr_redeclaration): Likewise.
(duplicate_decls): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
* name-lookup.c (consider_binding_level): Likewise.
(cp_emit_debug_info_for_using): Likewise.
* semantics.c (finish_call_expr): Likewise.
* tree.c (builtin_valid_in_constant_expr_p): Likewise.
2018-08-27  Martin Liska  <mliska@suse.cz>

* go-gcc.cc (Gcc_backend::call_expression): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
2018-08-27  Martin Liska  <mliska@suse.cz>

* lto-lang.c (handle_const_attribute): Use new function
        fndecl_built_in_p and remove check for FUNCTION_DECL if
        possible.
* lto-symtab.c (lto_symtab_merge_p): Likewise.
(lto_symtab_merge_decls_1): Likewise.
(lto_symtab_merge_symbols): Likewise.
* lto.c (lto_maybe_register_decl): Likewise.
(read_cgraph_and_symbols): Likewise.

From-SVN: r263880

5 years agoImprove switch code emission for a balanced tree (PR tree-optimization/86847).
Martin Liska [Mon, 27 Aug 2018 12:21:11 +0000 (14:21 +0200)]
Improve switch code emission for a balanced tree (PR tree-optimization/86847).

2018-08-27  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/86847
* tree-switch-conversion.c (switch_decision_tree::dump_case_nodes):
        Dump also subtree probability.
(switch_decision_tree::do_jump_if_equal): New function.
(switch_decision_tree::emit_case_nodes): Handle special
        situations in balanced tree that can be emitted much simpler.
        Fix calculation of probabilities that happen in tree expansion.
* tree-switch-conversion.h (struct cluster): Add
        is_single_value_p.
(struct simple_cluster): Likewise.
(struct case_tree_node): Add new function has_child.
(do_jump_if_equal): New.
2018-08-27  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/86847
* gcc.dg/tree-ssa/switch-3.c: New test.
* gcc.dg/tree-ssa/vrp105.c: Remove.

From-SVN: r263879

5 years agoFix probability for bit-tests.
Martin Liska [Mon, 27 Aug 2018 12:18:24 +0000 (14:18 +0200)]
Fix probability for bit-tests.

2018-08-27  Martin Liska  <mliska@suse.cz>

* tree-switch-conversion.c (bit_test_cluster::find_bit_tests):
        Add new argument to bit_test_cluster constructor.
(bit_test_cluster::emit): Set bits really number of values
        handlel by a test.
(bit_test_cluster::hoist_edge_and_branch_if_true): Add
        probability argument.
* tree-switch-conversion.h (struct bit_test_cluster):
        Add m_handles_entire_switch.
2018-08-27  Martin Liska  <mliska@suse.cz>

* gcc.dg/tree-ssa/switch-2.c: New test.

From-SVN: r263878

5 years agoFix probabilities for jump table (PR tree-optimization/86702).
Martin Liska [Mon, 27 Aug 2018 12:17:54 +0000 (14:17 +0200)]
Fix probabilities for jump table (PR tree-optimization/86702).

2018-08-27  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/86702
* tree-switch-conversion.c (jump_table_cluster::emit):
        Make probabilities even for values in jump table
        according to number of cases handled.
(switch_decision_tree::compute_cases_per_edge): Pass
        argument to reset_out_edges_aux function.
(switch_decision_tree::analyze_switch_statement): Likewise.
* tree-switch-conversion.h (switch_decision_tree::reset_out_edges_aux):
        Make it static.

From-SVN: r263877

5 years agoAdd new gswitch related functions into tree-cfg.c.
Martin Liska [Mon, 27 Aug 2018 12:17:19 +0000 (14:17 +0200)]
Add new gswitch related functions into tree-cfg.c.

2018-08-27  Martin Liska  <mliska@suse.cz>

* cfgexpand.c (expand_asm_stmt): Use label_to_block and pass
        cfun argument explicitly.
* gimple-pretty-print.c (dump_gimple_switch): Likewise.
* hsa-gen.c (gen_hsa_insns_for_switch_stmt): Use new
        function gimple_switch_default_bb.
(convert_switch_statements):
(expand_builtins):
* ipa-fnsummary.c (set_switch_stmt_execution_predicate):
* stmt.c (label_to_block_fn): Use label_to_block and pass
        cfun argument explicitly and use gimple_switch_label_bb.
(expand_case): Likewise.
* tree-cfg.c (lower_phi_internal_fn): Use label_to_block and pass
        cfun argument explicitly. Likewise.
(make_edges_bb): Likewise.
(make_cond_expr_edges): Likewise.
(get_cases_for_edge): Likewise.
(make_gimple_switch_edges): Likewise.
(label_to_block_fn): Likewise.
(label_to_block): Likewise.
(make_goto_expr_edges): Likewise.
(make_gimple_asm_edges): Likewise.
(main_block_label): Likewise.
(group_case_labels_stmt): Likewise.
(find_taken_edge_computed_goto): Likewise.
(find_taken_edge_switch_expr): Likewise.
(gimple_verify_flow_info): Likewise.
(gimple_redirect_edge_and_branch): Likewise.
(gimple_switch_label_bb): New function.
(gimple_switch_default_bb): Likewise.
(gimple_switch_edge): Likewise.
(gimple_switch_default_edge): Likewise.
* tree-cfg.h (label_to_block_fn): Remove and replace ...
(label_to_block): ... with this.
(gimple_switch_label_bb): New.
(gimple_switch_default_bb): Likewise.
(gimple_switch_edge): Likewise.
(gimple_switch_default_edge): Likewise.
* tree-cfgcleanup.c (convert_single_case_switch): Use
        new gimple functions and pass new argument to label_to_block.
(cleanup_control_flow_bb):
* tree-eh.c (make_eh_dispatch_edges): Use label_to_block and pass
        cfun argument explicitly.
(make_eh_edges): Likewise.
(redirect_eh_dispatch_edge): Likewise.
(lower_resx): Likewise.
(lower_eh_dispatch): Likewise.
(maybe_remove_unreachable_handlers): Likewise.
(unsplit_eh): Likewise.
(cleanup_empty_eh): Likewise.
(verify_eh_edges): Likewise.
(verify_eh_dispatch_edge): Likewise.
* tree-ssa-dom.c (record_edge_info): Likewise.
* tree-ssa-forwprop.c (simplify_gimple_switch_label_vec): Likewise.
* tree-ssa-threadedge.c (thread_around_empty_blocks): Likewise.
(thread_through_normal_block): Likewise.
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
* tree-ssa-uninit.c (convert_control_dep_chain_into_preds):
* tree-switch-conversion.c (switch_conversion::collect): Use new
        gimple functions.
(switch_conversion::check_final_bb): Likewise.
(switch_conversion::gather_default_values): Pass new argument
        to label_to_block.
(switch_conversion::build_constructors): Likewise.
(switch_decision_tree::compute_cases_per_edge): Use new
        gimple_switch_edge function.
(switch_decision_tree::analyze_switch_statement): Pass new argument
        to label_to_block.
(switch_decision_tree::try_switch_expansion): Use
        gimple_switch_default_edge.
* tree-vrp.c (find_switch_asserts): Pass new argument
        to label_to_block.
* vr-values.c (vr_values::vrp_visit_switch_stmt): Likewise.
(vr_values::simplify_switch_using_ranges): Likewise.

From-SVN: r263876

5 years agocfganal.h (rev_post_order_and_mark_dfs_back_seme): Declare.
Richard Biener [Mon, 27 Aug 2018 10:55:53 +0000 (10:55 +0000)]
cfganal.h (rev_post_order_and_mark_dfs_back_seme): Declare.

2018-08-27  Richard Biener  <rguenther@suse.de>

* cfganal.h (rev_post_order_and_mark_dfs_back_seme): Declare.
* cfganal.c (rev_post_order_and_mark_dfs_back_seme): New function.

* tree-ssa-sccvn.h (struct vn_pval): New structure.
(struct vn_nary_op_s): Add unwind_to member.  Add
predicated_values flag and put result into a union together
with a linked list of vn_pval.
(struct vn_ssa_aux): Add name member to make maintaining
a map of SSA name to vn_ssa_aux possible.  Remove no longer
needed info, dfsnum, low, visited, on_sccstack, use_processed
and range_info_anti_range_p members.
(run_scc_vn, vn_eliminate, free_scc_vn, vn_valueize): Remove.
(do_rpo_vn, run_rpo_vn, eliminate_with_rpo_vn, free_rpo_vn):
New functions.
(vn_valueize): New global.
(vn_context_bb): Likewise.
(VN_INFO_RANGE_INFO, VN_INFO_ANTI_RANGE_P, VN_INFO_RANGE_TYPE,
VN_INFO_PTR_INFO): Remove.
* tree-ssa-sccvn.c: ... (rewrite)
(pass_fre::execute): For -O2+ initialize loops and run
RPO VN in optimistic mode (iterating).  For -O1 and -Og
run RPO VN in non-optimistic mode.
* params.def (PARAM_SCCVN_MAX_SCC_SIZE): Remove.
(PARAM_RPO_VN_MAX_LOOP_DEPTH): Add.
* doc/invoke.texi (sccvn-max-scc-size): Remove.
(rpo-vn-max-loop-depth): Document.
* tree-ssa-alias.c (walk_non_aliased_vuses): Stop walking
when valuezing the VUSE signals we walked out of the region.
* tree-ssa-pre.c (phi_translate_1): Ignore predicated values.
(phi_translate): Set VN context block to use for availability
lookup.
(compute_avail): Likewise.
(pre_valueize): New function.
(pass_pre::execute): Adjust to the RPO VN API.

* tree-ssa-loop-ivcanon.c: Include tree-ssa-sccvn.h.
(propagate_constants_for_unrolling): Remove.
(tree_unroll_loops_completely): Perform value-numbering
on the unrolled bodies loop parent.

* g++.dg/torture/20180705-1.C: New testcase.
* gcc.dg/tree-ssa/ssa-fre-67.c: Likewise.
* gcc.dg/tree-ssa/ssa-ccp-14.c: Scan FRE dump.
* gcc.dg/tree-ssa/ssa-fre-46.c: Use -O2.
* gcc.dg/tree-ssa/vrp92.c: Disable FRE.
* gcc.dg/pr83666.c: Drop --param=sccvn-max-scc-size option.
* gcc.dg/pr85195.c: Likewise.
* gcc.dg/pr85467.c: Likewise.
* gcc.dg/torture/pr81790.c: Likewise.

* gfortran.dg/reassoc_4.f: Change max-completely-peeled-insns
param to current default.

From-SVN: r263875

5 years agotree-ssa-pre.c (compute_antic): Re-use inverted postorder for partial antic compute.
Richard Biener [Mon, 27 Aug 2018 10:50:45 +0000 (10:50 +0000)]
tree-ssa-pre.c (compute_antic): Re-use inverted postorder for partial antic compute.

2018-08-27  Richard Biener  <rguenther@suse.de>

* tree-ssa-pre.c (compute_antic): Re-use inverted postorder
for partial antic compute.

From-SVN: r263874

5 years agore PR rtl-optimization/87065 (combine causes ICE in trunc_int_for_mode)
Jakub Jelinek [Mon, 27 Aug 2018 08:41:22 +0000 (10:41 +0200)]
re PR rtl-optimization/87065 (combine causes ICE in trunc_int_for_mode)

PR rtl-optimization/87065
* combine.c (simplify_if_then_else): Formatting fix.
(if_then_else_cond): Guard MULT optimization with SCALAR_INT_MODE_P
check.
(known_cond): Don't return const_true_rtx for vector modes.  Use
CONST0_RTX instead of const0_rtx.  Formatting fixes.

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

From-SVN: r263872

5 years agoDo not read gcda files multiple times (PR gcov-profile/87069).
Martin Liska [Mon, 27 Aug 2018 08:01:54 +0000 (10:01 +0200)]
Do not read gcda files multiple times (PR gcov-profile/87069).

2018-08-27  Martin Liska  <mliska@suse.cz>

        PR gcov-profile/87069
* gcov.c (process_file): Record files already processed
        and warn about a file being processed multiple times.

From-SVN: r263871

5 years agoPrint default options selection for -march,-mcpu and -mtune for aarch64 (PR driver...
Martin Liska [Mon, 27 Aug 2018 08:01:14 +0000 (10:01 +0200)]
Print default options selection for -march,-mcpu and -mtune for aarch64 (PR driver/83193).

2018-08-27  Martin Liska  <mliska@suse.cz>

        PR driver/83193
* config/aarch64/aarch64.c (aarch64_override_options_internal):
        Set default values for x_aarch64_*_string strings.
* config/aarch64/aarch64.opt: Remove --{march,mcpu,mtune}==
        prefix.  For -mabi do not print '=ABI' in help and use
        <option_value> format for -msve-vector-bits and -moverride
        options.

From-SVN: r263870

5 years agoframe-header-opt.c: Include "backend.h" rather than "cfg.h"
Jeff Law [Mon, 27 Aug 2018 02:54:32 +0000 (20:54 -0600)]
frame-header-opt.c: Include "backend.h" rather than "cfg.h"

* config/mips/frame-header-opt.c: Include "backend.h" rather than
"cfg.h"

From-SVN: r263869

5 years agoDaily bump.
GCC Administrator [Mon, 27 Aug 2018 00:17:00 +0000 (00:17 +0000)]
Daily bump.

From-SVN: r263867

5 years agoPR c++/87029, Implement -Wredundant-move.
Marek Polacek [Sun, 26 Aug 2018 16:45:51 +0000 (16:45 +0000)]
PR c++/87029, Implement -Wredundant-move.

* c.opt (Wredundant-move): New option.

* typeck.c (treat_lvalue_as_rvalue_p): New function.
(maybe_warn_pessimizing_move): Call convert_from_reference.
Warn about redundant moves.

* doc/invoke.texi: Document -Wredundant-move.

* g++.dg/cpp0x/Wredundant-move1.C: New test.
* g++.dg/cpp0x/Wredundant-move2.C: New test.
* g++.dg/cpp0x/Wredundant-move3.C: New test.
* g++.dg/cpp0x/Wredundant-move4.C: New test.

From-SVN: r263863

5 years agore PR c++/87080 (ice in cp_get_fndecl_from_callee, at cp/cvt.c:965)
Marek Polacek [Sun, 26 Aug 2018 16:31:27 +0000 (16:31 +0000)]
re PR c++/87080 (ice in cp_get_fndecl_from_callee, at cp/cvt.c:965)

PR c++/87080
* typeck.c (maybe_warn_pessimizing_move): Do nothing in a template.

* g++.dg/cpp0x/Wpessimizing-move5.C: New test.

From-SVN: r263862

5 years agoDaily bump.
GCC Administrator [Sun, 26 Aug 2018 00:16:54 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263860

5 years agore PR fortran/86704 (Segmentation fault when using matmul in combination with transpose)
Thomas Koenig [Sat, 25 Aug 2018 21:31:30 +0000 (21:31 +0000)]
re PR fortran/86704 (Segmentation fault when using matmul in combination with transpose)

2018-08-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR libfortran/86704
* m4/matmul_internal.m4: Correct calculation of needed buffer size
for arrays of shape (1,n).
* generated/matmul_c10.c: Regenerated
* generated/matmul_c16.c: Regenerated
* generated/matmul_c4.c: Regenerated
* generated/matmul_c8.c: Regenerated
* generated/matmul_i1.c: Regenerated
* generated/matmul_i16.c: Regenerated
* generated/matmul_i2.c: Regenerated
* generated/matmul_i4.c: Regenerated
* generated/matmul_i8.c: Regenerated
* generated/matmul_r10.c: Regenerated
* generated/matmul_r16.c: Regenerated
* generated/matmul_r4.c: Regenerated
* generated/matmul_r8.c: Regenerated
* generated/matmulavx128_c10.c: Regenerated
* generated/matmulavx128_c16.c: Regenerated
* generated/matmulavx128_c4.c: Regenerated
* generated/matmulavx128_c8.c: Regenerated
* generated/matmulavx128_i1.c: Regenerated
* generated/matmulavx128_i16.c: Regenerated
* generated/matmulavx128_i2.c: Regenerated
* generated/matmulavx128_i4.c: Regenerated
* generated/matmulavx128_i8.c: Regenerated
* generated/matmulavx128_r10.c: Regenerated
* generated/matmulavx128_r16.c: Regenerated
* generated/matmulavx128_r4.c: Regenerated
* generated/matmulavx128_r8.c: Regenerated

2018-08-25  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR libfortran/86704
* gfortran.dg/matmul_19.f90: New test.

From-SVN: r263856

5 years agore PR tree-optimization/87059 (internal compiler error: in set_value_range, at tree...
Martin Sebor [Sat, 25 Aug 2018 19:12:36 +0000 (19:12 +0000)]
re PR tree-optimization/87059 (internal compiler error: in set_value_range, at tree-vrp.c:289)

PR tree-optimization/87059
* builtins.c (expand_builtin_strncmp): Convert MIN_EXPR operand
to the same type as the other.
* fold-const.c (fold_binary_loc): Assert expectation.

From-SVN: r263855

5 years agore PR fortran/86545 (ICE in transfer_expr on invalid WRITE statement)
Janus Weil [Sat, 25 Aug 2018 15:41:34 +0000 (17:41 +0200)]
re PR fortran/86545 (ICE in transfer_expr on invalid WRITE statement)

fix PR 86545

2018-08-25  Janus Weil  <janus@gcc.gnu.org>

PR fortran/86545
* resolve.c (resolve_transfer): Correctly determine typespec for
generic function calls, in order to throw a proper error.

2018-08-25  Janus Weil  <janus@gcc.gnu.org>

PR fortran/86545
* gfortran.dg/generic_35.f90: New test case.

From-SVN: r263854

5 years agoCode clean-up on darwin.c
Iain Sandoe [Sat, 25 Aug 2018 09:11:47 +0000 (09:11 +0000)]
Code clean-up on darwin.c

* config/darwin.c (machopic_legitimize_pic_address): Clean up
extraneous parentheses, dead code section and formatting.

From-SVN: r263851

5 years agoDon't force visibility to hidden for Darwin > 8.
Iain Sandoe [Sat, 25 Aug 2018 09:02:28 +0000 (09:02 +0000)]
Don't force visibility to hidden for Darwin > 8.

PR libstdc++/70694
* configure.host (OPT_LDFLAGS): Don't append
-fvisibility-inlines-hidden for newer Darwin.

From-SVN: r263850

5 years agoDaily bump.
GCC Administrator [Sat, 25 Aug 2018 00:16:53 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263849

5 years agoSet start_location to 0 if we ran out of line map space
H.J. Lu [Fri, 24 Aug 2018 23:37:53 +0000 (23:37 +0000)]
Set start_location to 0 if we ran out of line map space

With profiledbootstrap and --with-build-config=bootstrap-lto, linemap_add
may create a macro map when we run out of line map space.  This patch
changes start_location to UNKNOWN_LOCATION (0) in this case.

Tested with profiledbootstrap and --with-build-config=bootstrap-lto on
Linux/x86-64.

PR bootstrap/86872
* line-map.c (pure_location_p): Return true if linemap_lookup
returns NULL.
(linemap_add): Set start_location to 0 if we run out of line map
space.

From-SVN: r263845

5 years agodiagnostics: tweaks to line-spans vs line numbering (PR 87091)
David Malcolm [Fri, 24 Aug 2018 21:17:48 +0000 (21:17 +0000)]
diagnostics: tweaks to line-spans vs line numbering (PR 87091)

This patch tweaks how line numbers are printed for a diagnostic
containing multiple line spans.

With this patch, rather than printing span headers:

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22: note: message
  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:74:1:
  ++ |+#include <vector>
  74 | #endif
  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22:
  87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
     |                      ^~~

we now print:

  ../x86_64-pc-linux-gnu/libstdc++-v3/include/vector:87:22: note: message
  +++ |+#include <vector>
   74 | #endif
  ....
   87 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |                      ^~~

and for sufficiently close lines, rather than print a gap:

  + |+#include <stdio.h>
  1 | test (int ch)
  ..
  3 |  putchar (ch);
    |  ^~~~~~~

we print the line itself:

  + |+#include <stdio.h>
  1 | test (int ch)
  2 | {
  3 |  putchar (ch);
    |  ^~~~~~~

gcc/ChangeLog:
PR 87091
* diagnostic-show-locus.c (layout::layout): Ensure the margin is
wide enough for jumps in the line-numbering to be visible.
(layout::print_gap_in_line_numbering): New member function.
(layout::calculate_line_spans): When using line numbering, merge
line spans that are only 1 line apart.
(diagnostic_show_locus): When printing line numbers, show gaps in
line numbering directly, rather than printing headers.
(selftest::test_diagnostic_show_locus_fixit_lines): Add test of
line-numbering with multiple line spans.
(selftest::test_fixit_insert_containing_newline_2): Add test of
line-numbering, in which the spans are close enough to be merged.

gcc/testsuite/ChangeLog:
PR 87091
* gcc.dg/missing-header-fixit-3.c: Update for changes to how
line spans are printed with -fdiagnostics-show-line-numbers.

From-SVN: r263843

5 years agogimple-ssa-evrp-analyze.c (set_ssa_range_info): Pass value_range to range_includes_ze...
Aldy Hernandez [Fri, 24 Aug 2018 18:37:51 +0000 (18:37 +0000)]
gimple-ssa-evrp-analyze.c (set_ssa_range_info): Pass value_range to range_includes_zero_p.

* gimple-ssa-evrp-analyze.c (set_ssa_range_info): Pass value_range
to range_includes_zero_p.  Do not special case VR_ANTI_RANGE.
* tree-vrp.c (range_is_nonnull): Remove.
(range_includes_zero_p): Accept value_range instead of min/max.
(extract_range_from_binary_expr_1): Do not early bail on
POINTER_PLUS_EXPR.
Use range_includes_zero_p instead of range_is_nonnull.
(extract_range_from_unary_expr): Use range_includes_zero_p instead
of range_is_nonnull.
(vrp_meet_1): Pass value_range to range_includes_zero_p.  Do not
special case VR_ANTI_RANGE.
(vrp_finalize): Same.
* tree-vrp.h (range_includes_zero_p): Pass value_range as argument
instead of min/max.
(range_is_nonnull): Remove.
* vr-values.c (vrp_stmt_computes_nonzero): Use
range_includes_zero_p instead of range_is_nonnull.
(extract_range_basic): Pass value_range to range_includes_zero_p
instead of range_is_nonnull.

From-SVN: r263842

5 years agonew(nothrow) is malloc-like
Marc Glisse [Fri, 24 Aug 2018 18:24:42 +0000 (20:24 +0200)]
new(nothrow) is malloc-like

2018-08-24  Marc Glisse  <marc.glisse@inria.fr>

PR libstdc++/86822
* libsupc++/new (operator new(size_t, nothrow_t), operator
new[](size_t, nothrow_t), operator new(size_t, align_val_t, nothrow_t),
operator new[](size_t, align_val_t, nothrow_t)): Add malloc attribute.

From-SVN: r263841

5 years agoruntime: remove the dummy arg of getcallersp
Ian Lance Taylor [Fri, 24 Aug 2018 18:15:04 +0000 (18:15 +0000)]
runtime: remove the dummy arg of getcallersp

    This is a port of https://golang.org/cl/109596 to the gofrontend, in
    preparation for updating libgo to 1.11.

    Original CL description:

        getcallersp is intrinsified, and so the dummy arg is no longer
        needed. Remove it, as well as a few dummy args that are solely
        to feed getcallersp.

    Reviewed-on: https://go-review.googlesource.com/131116

From-SVN: r263840

5 years agoForward declare debug containers so std::pmr aliases work
Jonathan Wakely [Fri, 24 Aug 2018 17:43:18 +0000 (18:43 +0100)]
Forward declare debug containers so std::pmr aliases work

Prior to this change, including a <debug/xxx> header when _GLIBCXX_DEBUG
is also defined would fail to compile in C++17 or later. The <debug/xxx>
header would include the standard <xxx> header which defined
std::pmr::xxx as an alias for std::xxx. But in Debug Mode std::xxx
refers to std::__debug::xxx which has not been defined yet (because it
is in <debug/xxx> after the inclusion of <xxx>).

This adds declarations of the debug containers before including the
non-Debug Mode <xxx> header, so that the std::pmr::xxx aliases work.

* include/debug/deque (std::__debug::deque): Declare.
* include/debug/forward_list (std::__debug::forward_list): Declare.
* include/debug/list (std::__debug::list): Declare.
* include/debug/map (std::__debug::map): Declare.
* include/debug/set (std::__debug::set): Declare.
* include/debug/unordered_map (std::__debug::unordered_map): Declare.
* include/debug/unordered_set (std::__debug::unordered_set): Declare.
* include/debug/vector (std::__debug::vector): Declare.
* testsuite/23_containers/deque/types/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/forward_list/pmr_typedefs_debug.cc: New
test.
* testsuite/23_containers/list/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/map/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/multimap/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/multiset/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/set/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc: New
test.
* testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc:
New test.
* testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc:
New test.
* testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc: New
test.
* testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
Adjust dg-error lineno.
* testsuite/23_containers/vector/types/pmr_typedefs_debug.cc: New
test.

From-SVN: r263839

5 years agore PR fortran/86837 (Optimization breaks an unformatted read with implicit loop)
Thomas Koenig [Fri, 24 Aug 2018 17:26:57 +0000 (17:26 +0000)]
re PR fortran/86837 (Optimization breaks an unformatted read with implicit loop)

2018-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/86837
* frontend-passes.c (var_in_expr_callback): New function.
(var_in_expr): New function.
(traverse_io_block): Use var_in_expr instead of
gfc_check_dependency for checking if the variable depends on the
previous interators.

2018-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/86837
* gfortran.dg/implied_do_io_6.f90: New test.

From-SVN: r263838

5 years agoAdd a testcase for PR middle-end/87092
H.J. Lu [Fri, 24 Aug 2018 16:58:27 +0000 (16:58 +0000)]
Add a testcase for PR middle-end/87092

PR middle-end/87092
* gcc.dg/pr87092.c: New test.

From-SVN: r263837

5 years agore PR c++/67012 (decltype(auto) with trailing return type)
Marek Polacek [Fri, 24 Aug 2018 15:48:43 +0000 (15:48 +0000)]
re PR c++/67012 (decltype(auto) with trailing return type)

PR c++/67012
PR c++/86942
* decl.c (grokdeclarator): Disallow functions with trailing return
        type with decltype(auto) as its type.  Also check the function if
        it's inner declarator doesn't exist

* g++.dg/cpp0x/auto52.C: New test.
* g++.dg/cpp1y/auto-fn52.C: New test.
* g++.dg/cpp1y/auto-fn53.C: New test.
* g++.dg/cpp1y/auto-fn54.C: New test.

From-SVN: r263836

5 years agoemit-rtl.c (init_emit_once): Do not emit MODE_POINTER_BOUNDS RTXes.
Uros Bizjak [Fri, 24 Aug 2018 14:42:32 +0000 (16:42 +0200)]
emit-rtl.c (init_emit_once): Do not emit MODE_POINTER_BOUNDS RTXes.

* emit-rtl.c (init_emit_once): Do not emit MODE_POINTER_BOUNDS RTXes.
* emit-rtl.h (rtl_data): Remove return_bnd.
* explow.c (trunc_int_for_mode): Do not handle POINTER_BOUNDS_MODE_P.
* function.c (diddle_return_value): Do not handle crtl->return_bnd.
* genmodes.c (complete_mode): Do not handle MODE_POINTER_BOUNDS.
(POINTER_BOUNDS_MODE): Remove definition.
(make_pointer_bounds_mode): Remove.
(get_mode_class): Do not handle MODE_POINTER_BOUNDS.
* machmode.h (POINTER_BOUNDS_MODE_P): Remove definition.
(scalare_mode::includes_p): Do not handle MODE_POINTER_BOUNDS.
* mode-classes.def: Do not define MODE_POINTER_BOUNDS.
* stor-layout.c (int_mode_for_mode): Do not handle MODE_POINTER_BOUNDS.
* tree-core.h (enum tree_index): Remove TI_POINTER_BOUNDS_TYPE.
* varasm.c (output_constant_pool_2): Do not handle MODE_POINTER_BOUNDS.

* config/i386/i386-modes.def (BND32, BND64): Remove.
* config/i386/i386.c (dbx_register_map): Remove bound registers.
(dbx64_register_map): Ditto.
(svr4_dbx_register_map): Ditto.
(indirect_thunk_bnd_needed): Remove.
(indirect_thunks_bnd_used): Ditto.
(indirect_return_bnd_needed): Ditto.
(indirect_return_via_cx_bnd): Ditto.
(enum indirect_thunk_prefix): Remove indirect_thunk_prefix_bnd.
(indirect_thunk_name): Remove handling of indirect_thunk_prefix_bnd.
(output_indirect_thunk): Ditto.  Remove need_prefix argument.
(output_indirect_thunk_function): Remove handling of
indirect_return_bnd_needed, indirect_return_via_cx_bnd,
indirect_thunk_bnd_needed and indirect_thunks_bnd_used variables.
(ix86_save_reg): Remove handling of crtl->return_bnd.
(ix86_legitimate_constant_p): Remove handling of POINTER_BOUNDS_MODE_P.
(ix86_print_operand_address_as): Remove handling of UNSPEC_BNDMK_ADDR
and UNSPEC_BNDLX_ADDR.
(ix86_output_indirect_branch_via_reg): Remove handling of
indirect_thunk_prefix_bnd.
(ix86_output_indirect_branch_via_push): Ditto.
(ix86_output_function_return): Ditto.
(ix86_output_indirect_function_return): Ditto.
(avoid_func_arg_motion): Do not handle UNSPEC_BNDSTX.
* config/i386/i386.h (FIXED_REGISTERS): Remove bound registers.
(CALL_USED_REGISTERS): Ditto.
(REG_ALLOC_ORDER): Update for removal of bound registers.
(HI_REGISTER_NAMES): Ditto.
* config/i386/i386.md (UNSPEC_BNDMK, UNSPEC_BNDMK_ADDR, UNSPEC_BNDSTX)
(UNSPEC_BNDLDX, UNSPEC_BNDLDX_ADDR, UNSPEC_BNDCL, UNSPEC_BNDCU)
(UNSPEC_BNDCN, UNSPEC_MPX_FENCE): Remove.
(BND0_REG, BND1_REG, BND2_REG, BND3_REG): Remove
(FIRST_PSEUDO_REG): Update.
(BND): Remove mode iterator.
* config/i386/predicates.md (bnd_mem_operator): Remove.

From-SVN: r263835

5 years agoDefine vect_perm for variable-length SVE
Richard Sandiford [Fri, 24 Aug 2018 13:06:56 +0000 (13:06 +0000)]
Define vect_perm for variable-length SVE

Variable-length SVE now supports enough permutes to define vect_perm.

The change to vect_perm_supported is currently a no-op because the
function is only called with a count of 3.

2018-08-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/testsuite/
* lib/target-supports.exp (vect_perm_supported): Only return
false for variable-length vectors if the permute size is not
a power of 2.
(check_effective_target_vect_perm)
(check_effective_target_vect_perm_byte)
(check_effective_target_vect_perm_short): Remove check for
variable-length vectors.
* gcc.dg/vect/slp-23.c: Add an XFAIL for variable-length SVE.
* gcc.dg/vect/slp-perm-10.c: Likewise.
* gcc.dg/vect/slp-perm-9.c: Add an XFAIL for variable-length vectors.

From-SVN: r263834

5 years agoAvoid is_constant calls in vectorizable_bswap
Richard Sandiford [Fri, 24 Aug 2018 13:06:09 +0000 (13:06 +0000)]
Avoid is_constant calls in vectorizable_bswap

The "new" VEC_PERM_EXPR handling makes it easy to support bswap
for variable-length vectors.

2018-08-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-stmts.c (vectorizable_bswap): Handle variable-length
vectors.

gcc/testsuite/
* gcc.target/aarch64/sve/bswap_1.c: New test.
* gcc.target/aarch64/sve/bswap_2.c: Likewise.
* gcc.target/aarch64/sve/bswap_3.c: Likewise.

From-SVN: r263833

5 years agoHandle SLP permutations for variable-length vectors
Richard Sandiford [Fri, 24 Aug 2018 13:05:36 +0000 (13:05 +0000)]
Handle SLP permutations for variable-length vectors

The SLP code currently punts for all variable-length permutes.
This patch makes it handle the easy case of N->N permutes in which
the number of vector lanes is a multiple of N.  Every permute then
uses the same mask, and that mask repeats (with a stride) every
N elements.

The patch uses the same path for constant-length vectors,
since it should be slightly cheaper in terms of compile time.

2018-08-24  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-slp.c (vect_transform_slp_perm_load): Separate out
the case in which the permute needs only a single element and
repeats for every vector of the result.  Extend that case to
handle variable-length vectors.
* tree-vect-stmts.c (vectorizable_load): Update accordingly.

gcc/testsuite/
* gcc.target/aarch64/sve/slp_perm_1.c: New test.
* gcc.target/aarch64/sve/slp_perm_2.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_3.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_4.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_5.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_6.c: Likewise.
* gcc.target/aarch64/sve/slp_perm_7.c: Likewise.

From-SVN: r263832

5 years agoDWARF: Call set_indirect_string on DW_MACINFO_start_file
H.J. Lu [Fri, 24 Aug 2018 11:28:40 +0000 (11:28 +0000)]
DWARF: Call set_indirect_string on DW_MACINFO_start_file

Since -gsplit-dwarf -g3 will output filename as indirect string, call
set_indirect_string on DW_MACINFO_start_file for -gsplit-dwarf -g3.

gcc/

PR debug/79342
* dwarf2out.c (save_macinfo_strings): Call set_indirect_string
on DW_MACINFO_start_file for -gsplit-dwarf -g3.

gcc/testsuite/

PR debug/79342
* gcc.dg/pr79342.: New test.

From-SVN: r263831

5 years agocfg.h (struct control_flow_graph): Add edge_flags_allocated and bb_flags_allocated...
Richard Biener [Fri, 24 Aug 2018 11:17:16 +0000 (11:17 +0000)]
cfg.h (struct control_flow_graph): Add edge_flags_allocated and bb_flags_allocated members.

2018-08-24  Richard Biener  <rguenther@suse.de>

* cfg.h (struct control_flow_graph): Add edge_flags_allocated and
bb_flags_allocated members.
(auto_flag): New RAII class for allocating flags.
(auto_edge_flag): New RAII class for allocating edge flags.
(auto_bb_flag): New RAII class for allocating bb flags.
* cfgloop.c (verify_loop_structure): Allocate temporary edge
flag dynamically.
* cfganal.c (dfs_enumerate_from): Remove use of visited sbitmap
in favor of temporarily allocated BB flag.
* hsa-brig.c: Re-order includes.
* hsa-dump.c: Likewise.
* hsa-regalloc.c: Likewise.
* print-rtl.c: Likewise.
* profile-count.c: Likewise.

From-SVN: r263830

5 years agors6000: Check that the base of a TOCREL is the TOC (PR86989)
Segher Boessenkool [Fri, 24 Aug 2018 10:49:27 +0000 (12:49 +0200)]
rs6000: Check that the base of a TOCREL is the TOC (PR86989)

There currently is nothing that prevents replacing the TOC_REGISTER in
a TOCREL unspec with something else, like a pseudo, or a memory ref.
This of course does not work.  Fix that.

Tested on powerpc64-linux {-m32,-m64}; committing.

Segher

2018-08-24  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/86989
* config/rs6000/rs6000.c (toc_relative_expr_p): Check that the base is
the TOC register.

---
 gcc/config/rs6000/rs6000.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index a967912..ed33912 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -7932,7 +7932,9 @@ toc_relative_expr_p (const_rtx op, bool strict, const_rtx *tocrel_base_ret,
     *tocrel_offset_ret = tocrel_offset;

   return (GET_CODE (tocrel_base) == UNSPEC
-   && XINT (tocrel_base, 1) == UNSPEC_TOCREL);
+   && XINT (tocrel_base, 1) == UNSPEC_TOCREL
+   && REG_P (XVECEXP (tocrel_base, 0, 1))
+   && REGNO (XVECEXP (tocrel_base, 0, 1)) == TOC_REGISTER);
 }

 /* Return true if X is a constant pool address, and also for cmodel=medium
--
1.8.3.1

From-SVN: r263829

5 years agoPR 87073/bootstrap
Aldy Hernandez [Fri, 24 Aug 2018 08:06:06 +0000 (08:06 +0000)]
PR 87073/bootstrap

PR 87073/bootstrap
* wide-int-range.cc (wide_int_range_div): Do not ignore result
from wide_int_range_multiplicative_op.

From-SVN: r263828

5 years agoDaily bump.
GCC Administrator [Fri, 24 Aug 2018 00:16:48 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263827

5 years agoPR tree-optimization/87072 - false warning: array subscript is above array bounds
Martin Sebor [Thu, 23 Aug 2018 19:39:18 +0000 (19:39 +0000)]
PR tree-optimization/87072 - false warning: array subscript is above array bounds

gcc/testsuite/ChangeLog:
* gcc.dg/Warray-bounds-35.c: New test.

From-SVN: r263822

5 years ago* async.h (ASYNC_IO): Revert _AIX test.
David Edelsohn [Thu, 23 Aug 2018 19:33:45 +0000 (19:33 +0000)]
* async.h (ASYNC_IO): Revert _AIX test.

From-SVN: r263821

5 years agoFix failure when -fno-rtti test is run in C++17 or later
Jonathan Wakely [Thu, 23 Aug 2018 19:27:54 +0000 (20:27 +0100)]
Fix failure when -fno-rtti test is run in C++17 or later

* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
Only define when RTTI is enabled.

From-SVN: r263820

5 years agotree-vect-data-refs.c (vect_grouped_store_supported): Fix typo "permutaion".
Prathamesh Kulkarni [Thu, 23 Aug 2018 18:22:10 +0000 (18:22 +0000)]
tree-vect-data-refs.c (vect_grouped_store_supported): Fix typo "permutaion".

2018-08-23  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* tree-vect-data-refs.c (vect_grouped_store_supported): Fix typo
"permutaion".

From-SVN: r263819

5 years agoFix typo 'exapnded' to 'expanded'
Giuliano Belinassi [Thu, 23 Aug 2018 17:01:09 +0000 (17:01 +0000)]
Fix typo 'exapnded' to 'expanded'

2018-08-23  Giuliano Belinassi  <giuliano.belinassi@usp.br>

gcc/
* genmatch.c (parser::parse_operation): Fix typo 'exapnded'
to 'expanded'.

gcc/ada/
* exp_unst.ads: Fix typo 'exapnded' to 'expanded'.

From-SVN: r263818

5 years agoscev: dump final value replacement expressions
Alexander Monakov [Thu, 23 Aug 2018 16:01:12 +0000 (19:01 +0300)]
scev: dump final value replacement expressions

* tree-scalar-evolution.c (final_value_replacement_loop): Dump
full GENERIC expression used for replacement.

From-SVN: r263817

5 years agoDefine debug mode function for C++98
Jonathan Wakely [Thu, 23 Aug 2018 15:23:31 +0000 (16:23 +0100)]
Define debug mode function for C++98

This function is declared unconditionally but was only defined for C++11
and later, leading to linker errors when the testsuite was run with
-std=gnu++98 -D_GLIBCXX_DEBUG added to the flags.

* include/debug/vector (__niter_base): Define for C++98.

From-SVN: r263816

5 years agoFix C++98 tests to not use C++11 features.
Jonathan Wakely [Thu, 23 Aug 2018 15:10:45 +0000 (16:10 +0100)]
Fix C++98 tests to not use C++11 features.

* testsuite/25_algorithms/partial_sort_copy/debug/irreflexive_neg.cc:
Fix C++98 test to not use C++11 features.
* testsuite/25_algorithms/fill_n/2.cc: Likewise.

From-SVN: r263815

5 years agoFix comments in testsuite script
Jonathan Wakely [Thu, 23 Aug 2018 15:10:35 +0000 (16:10 +0100)]
Fix comments in testsuite script

* scripts/check_compile: Fix comments.

From-SVN: r263814

5 years agotree-vrp.c (abs_extent_range): Remove.
Aldy Hernandez [Thu, 23 Aug 2018 13:25:36 +0000 (13:25 +0000)]
tree-vrp.c (abs_extent_range): Remove.

* tree-vrp.c (abs_extent_range): Remove.
(extract_range_into_wide_ints): Pass wide ints by reference.
(extract_range_from_binary_expr_1): Rewrite the *DIV_EXPR code.
Pass wide ints by reference in all calls to
extract_range_into_wide_ints.
* wide-int-range.cc (wide_int_range_div): New.
* wide-int-range.h (wide_int_range_div): New.
(wide_int_range_includes_zero_p): New.
(wide_int_range_zero_p): New.

From-SVN: r263813

5 years ago[AARCH64] use "arch_enabled" attribute for aarch64.
Matthew Malcomson [Thu, 23 Aug 2018 12:43:17 +0000 (12:43 +0000)]
[AARCH64] use "arch_enabled" attribute for aarch64.

arm.md has some attributes "arch" and "arch_enabled" to aid enabling
and disabling insn alternatives based on the architecture being
targeted.  This patch introduces a similar attribute in the aarch64
backend.  The new attribute will be used to enable a new alternative
for the atomic_store insn in a future patch, but is an atomic change
in itself.

The new attribute has values "any", "fp", "fp16", "simd", and "sve".
These attribute values have been taken from the pre-existing
attributes "fp", "fp16", "simd", and "sve".

The standalone "fp" attribute has been reintroduced in terms of the
"arch" attribute as it's needed for the xgene1.md scheduling file --
the use in this file can't be changed to check for `(eq_attr "arch"
"fp")` as the file is reused by the arm.md machine description whose
'arch' attribute doesn't have an 'fp' value.

2018-08-23  Matthew Malcomson  <matthew.malcomson@arm.com>

* config/aarch64/aarch64.md (arches): New enum.
(arch): New enum attr.
(arch_enabled): New attr.
(enabled): Now uses arch_enabled only.
(simd, sve, fp16): Removed attribute.
(fp): Attr now defined in terms of 'arch'.
(*mov<mode>_aarch64, *movsi_aarch64, *movdi_aarch64, *movti_aarch64,
*movhf_aarch64, <optab><fcvt_target><GPF:mode>2,
<FCVT_F2FIXED:fcvt_fixed_insn><GPF:mode>3,
<FCVT_FIXED2F:fcvt_fixed_insn><GPI:mode>3): Merge 'fp' and 'simd'
attributes into 'arch'.
(*movsf_aarch64, *movdf_aarch64, *movtf_aarch64, *add<mode>3_aarch64,
subdi3, neg<mode>2, <optab><mode>3, one_cmpl<mode>2,
*<NLOGICAL:optab>_one_cmpl<mode>3, *xor_one_cmpl<mode>3,
*aarch64_ashl_sisd_or_int_<mode>3, *aarch64_lshr_sisd_or_int_<mode>3,
*aarch64_ashr_sisd_or_int_<mode>3, *aarch64_sisd_ushl): Convert use of
'simd' attribute into 'arch'.
(load_pair_sw_<SX:mode><SX2:mode>, load_pair_dw_<DX:mode><DX2:mode>,
store_pair_sw_<SX:mode><SX2:mode>, store_pair_dw_<DX:mode><DX2:mode>):
Convert use of 'fp' attribute to 'arch'.
* config/aarch64/aarch64-simd.md (move_lo_quad_internal_<mode>,
move_lo_quad_internal_<mode>): (different modes) Merge 'fp' and 'simd'
into 'arch'.
(move_lo_quad_internal_be_<mode>, move_lo_quad_internal_be_<mode>):
(different modes) Merge 'fp' and 'simd' into 'arch'.
(*aarch64_combinez<mode>, *aarch64_combinez_be<mode>): Merge 'fp' and
'simd' into 'arch'.

From-SVN: r263811

5 years agoFix recent bug in canonicalize_comparison (PR87026)
Segher Boessenkool [Thu, 23 Aug 2018 12:40:14 +0000 (14:40 +0200)]
Fix recent bug in canonicalize_comparison (PR87026)

The new code testing which way a comparison is best expressed creates
a pseudoregister (by hand) and creates some insns with that.  Such
insns will no longer recog() when pseudo-registers are no longer
aloowed (after reload).  But we have an ifcvt pass after reload (ce3).

This patch simply returns if we cannot create pseudos.

PR rtl-optimization/87026
* expmed.c (canonicalize_comparison): If we can no longer create
pseudoregisters, don't.

From-SVN: r263810

5 years agoFix C++11-ism in C++98 member function
Jonathan Wakely [Thu, 23 Aug 2018 11:21:17 +0000 (12:21 +0100)]
Fix C++11-ism in C++98 member function

* include/debug/string (insert(__const_iterator, _InIter, _InIter)):
[!_GLIBCXX_USE_CXX11_ABI]: Replace use of C++11-only cbegin() with
begin(), for C++98 compatibility.

From-SVN: r263809

5 years agoFix testsuite failures for __gnu_debug::string with old ABI
Jonathan Wakely [Thu, 23 Aug 2018 10:51:52 +0000 (11:51 +0100)]
Fix testsuite failures for __gnu_debug::string with old ABI

The __gnu_debug string (mostly) implements the C++11 API, but when it
wraps the old COW string many of the member functions in the base class
have the wrong parameter types or return types. This makes the
__gnu_debug::string type adapt itself to the base class API. This
actually makes the debug string slightly more conforming than the
underlying string type when using the old ABI.

* include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
(basic_string::__const_iterator): Change access to protected.
[!_GLIBCXX_USE_CXX11_ABI] (basic_string::__const_iterator): Define
as typedef for iterator.
* include/debug/string (__const_iterator): Use typedef from base.
(insert(const_iterator, _CharT))
(replace(const_iterator, const_iterator, const basic_string&))
(replace(const_iterator, const_iterator, const _CharT*, size_type))
(replace(const_iterator, const_iterator, const CharT*))
(replace(const_iterator, const_iterator, size_type, _CharT))
(replace(const_iterator, const_iterator, _InputIter, _InputIter))
(replace(const_iterator, const_iterator, initializer_list<_CharT>)):
Change const_iterator parameters to __const_iterator.
(insert(iterator, size_type, _CharT)): Add C++98 overload.
(insert(const_iterator, _InputIterator, _InputIterator)): Change
const_iterator parameter to __const_iterator.
[!_GLIBCXX_USE_CXX11_ABI]: Add workaround for incorrect return type
of base's member function.
(insert(const_iterator, size_type, _CharT)) [!_GLIBCXX_USE_CXX11_ABI]:
Likewise.
(insert(const_iterator, initializer_list<_CharT>))
[!_GLIBCXX_USE_CXX11_ABI]: Likewise.
* testsuite/21_strings/basic_string/init-list.cc: Remove effective
target directive.

From-SVN: r263808

5 years ago[libiberty patch] Fix PGO bootstrap
Nathan Sidwell [Thu, 23 Aug 2018 10:21:21 +0000 (10:21 +0000)]
[libiberty patch] Fix PGO bootstrap

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01386.html
PR driver/87056
* pex-unix.c (pex_unix_exec_child): Duplicate bad_fn into local
scopes to avoid potential clobber.

Co-Authored-By: Martin Liska <mliska@suse.cz>
From-SVN: r263807

5 years agoPR target/86951 arm - Handle speculation barriers on pre-armv7 CPUs
Richard Earnshaw [Thu, 23 Aug 2018 09:47:34 +0000 (09:47 +0000)]
PR target/86951 arm - Handle speculation barriers on pre-armv7 CPUs

The AArch32 instruction sets prior to Armv7 do not define the ISB and
DSB instructions that are needed to form a speculation barrier.  While
I do not know of any instances of cores based on those instruction
sets being vulnerable to speculative side channel attacks it is
possible to run code built for those ISAs on more recent hardware
where they would become vulnerable.

This patch works around this by using a library call added to libgcc.
That code can then take any platform-specific actions necessary to
ensure safety.

For the moment I've only handled two cases: the library code being
built for armv7 or later anyway and running on Linux.

On Linux we can handle this by calling the kernel function that will
flush a small amount of cache.  Such a sequence ends with a ISB+DSB
sequence if running on an Armv7 or later CPU.

gcc:

PR target/86951
* config/arm/arm-protos.h (arm_emit_speculation_barrier): New
prototype.
* config/arm/arm.c (speculation_barrier_libfunc): New static
variable.
(arm_init_libfuncs): Initialize it.
(arm_emit_speculation_barrier): New function.
* config/arm/arm.md (speculation_barrier): Call
arm_emit_speculation_barrier for architectures that do not have
DSB or ISB.
(speculation_barrier_insn): Only match on Armv7 or later.

libgcc:

PR target/86951
* config/arm/lib1funcs.asm (speculation_barrier): New function.
* config/arm/t-arm (LIB1ASMFUNCS): Add it to list of functions
to build.

From-SVN: r263806

5 years agore PR ipa/87024 (ICE in fold_stmt_1)
Richard Biener [Thu, 23 Aug 2018 09:29:45 +0000 (09:29 +0000)]
re PR ipa/87024 (ICE in fold_stmt_1)

2018-08-23  Richard Biener  <rguenther@suse.de>

PR middle-end/87024
* tree-inline.c (copy_bb): Drop unused __builtin_va_arg_pack_len
calls.

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

From-SVN: r263805

5 years ago[AArch64] Improve SVE handling of single-vector permutes
Richard Sandiford [Thu, 23 Aug 2018 08:57:17 +0000 (08:57 +0000)]
[AArch64] Improve SVE handling of single-vector permutes

aarch64_vectorize_vec_perm_const was failing to set one_vector_p
if the permute had only a single input.  This in turn was hiding
a problem in the SVE TBL handling: it accepted single-vector
variable-length permutes, but sent them through the general
two-vector aarch64_expand_sve_vec_perm, which is only set up
to handle constant-length permutes.

2018-08-23  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64.c (aarch64_evpc_sve_tbl): Fix handling
of single-vector TBLs.
(aarch64_vectorize_vec_perm_const): Set one_vector_p when only
one input is given.

gcc/testsuite/
* gcc.dg/vect/no-vfa-vect-depend-2.c: Remove XFAIL.
* gcc.dg/vect/no-vfa-vect-depend-3.c: Likewise.
* gcc.dg/vect/pr65947-13.c: Update for vect_fold_extract_last.
* gcc.dg/vect/pr80631-2.c: Likewise.

From-SVN: r263804

5 years agoFix aarch64_evpc_tbl guard (PR 85910)
Richard Sandiford [Thu, 23 Aug 2018 08:51:38 +0000 (08:51 +0000)]
Fix aarch64_evpc_tbl guard (PR 85910)

This patch fixes a typo in aarch64_expand_vec_perm_const_1 that I
introduced as part of the SVE changes.  I don't know of any cases in
which it has any practical effect, since we'll eventually try to use
TBL as a variable permute instead.  Having the code is still an
important part of defining the interface properly and so we shouldn't
simply drop it.

2018-08-23  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR target/85910
* config/aarch64/aarch64.c (aarch64_expand_vec_perm_const_1): Fix
aarch64_evpc_tbl guard.

From-SVN: r263803

5 years agoSigned zero for {max,min}val intrinsics
Janne Blomqvist [Thu, 23 Aug 2018 08:35:17 +0000 (11:35 +0300)]
Signed zero for {max,min}val intrinsics

The Fortran standard specifies (e.g. F2018 7.4.3.2) that intrinsic
procedures shall treat positive and negative real zero as equivalent,
unless it is explicitly specified otherwise.  For {max,min}val there
is no such explicit mention.  Thus, remove code to handle signed
zeros.

2018-08-23  Janne Blomqvist  <blomqvist.janne@gmail.com>

* trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Delete
HONOR_SIGNED_ZEROS checks.

From-SVN: r263802

5 years agoRemove C++14-isms from C++11 tests
Jonathan Wakely [Thu, 23 Aug 2018 08:26:22 +0000 (09:26 +0100)]
Remove C++14-isms from C++11 tests

* testsuite/20_util/reference_wrapper/lwg2993.cc: Fix C++11 test to
not use C++14 feature.
* testsuite/23_containers/list/68222_neg.cc: Likewise.

From-SVN: r263801

5 years agoSkip tests that depend on the cxx11 std::string
Jonathan Wakely [Thu, 23 Aug 2018 08:26:16 +0000 (09:26 +0100)]
Skip tests that depend on the cxx11 std::string

* testsuite/21_strings/basic_string/init-list.cc:
Require cxx11-abi.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_match.cc:
Likewise.
* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
Likewise.

From-SVN: r263800

5 years agore PR fortran/86863 ([OOP][F2008] type-bound module procedure name not recognized)
Paul Thomas [Thu, 23 Aug 2018 06:27:54 +0000 (06:27 +0000)]
re PR fortran/86863 ([OOP][F2008] type-bound module procedure name not recognized)

2017-08-23  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/86863
* resolve.c (resolve_typebound_call): If the TBP is not marked
as a subroutine, check the specific symbol.

2017-08-23  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/86863
* gfortran.dg/submodule_32.f08: New test.

From-SVN: r263799

5 years agoDaily bump.
GCC Administrator [Thu, 23 Aug 2018 00:17:18 +0000 (00:17 +0000)]
Daily bump.

From-SVN: r263798

5 years agotree-ssa-dse.c (compute_trims): Avoid folding away undefined behaviour.
Bernd Edlinger [Wed, 22 Aug 2018 23:43:44 +0000 (23:43 +0000)]
tree-ssa-dse.c (compute_trims): Avoid folding away undefined behaviour.

* tree-ssa-dse.c (compute_trims): Avoid folding away undefined
behaviour.

From-SVN: r263793

5 years agoFix tests that fail in C++98 mode
Jonathan Wakely [Wed, 22 Aug 2018 23:43:43 +0000 (00:43 +0100)]
Fix tests that fail in C++98 mode

* testsuite/23_containers/deque/capacity/max_size.cc: Fix test for
C++98 mode.
* testsuite/23_containers/deque/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/list/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/vector/bool/modifiers/assign/1.cc: Likewise.
* testsuite/23_containers/vector/capacity/max_size.cc: Likewise.
* testsuite/23_containers/vector/modifiers/assign/1.cc: Likewise.

From-SVN: r263792

5 years agoPR libstdc++/87061 remove pmr type aliases for COW strings
Jonathan Wakely [Wed, 22 Aug 2018 22:54:33 +0000 (23:54 +0100)]
PR libstdc++/87061 remove pmr type aliases for COW strings

The pmr aliases for basic_string and match_results are incompatible with
the gcc4-compatible ABI because the Copy-On-Write basic_string class
doesn't support C++11 allocators.

PR libstdc++/87061
* include/experimental/regex [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::match_results, experimental::pmr::cmatch)
(experimental::pmr::smatch, experimental::pmr::wcmatch)
(experimental::pmr::wsmatch): Do not declare for gcc4-compatible ABI,
because COW strings don't support C++11 allocator model.
* include/experimental/string [!_GLIBCXX_USE_CXX11_ABI]
(experimental::pmr::basic_string, experimental::pmr::string)
(experimental::pmr::u16string, experimental::pmr::u32string)
(experimental::pmr::wstring): Likewise.
* include/std/regex [!_GLIBCXX_USE_CXX11_ABI] (pmr::match_results)
(pmr::cmatch, pmr::smatch, pmr::wcmatch, pmr::wsmatch): Likewise.
* include/std/string [!_GLIBCXX_USE_CXX11_ABI] (pmr::basic_string)
(pmr::string, pmr::u16string, pmr::u32string, pmr::wstring): Likewise.
* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Require
cxx11-abi.
* testsuite/28_regex/match_results/pmr_typedefs.cc: Likewise.

From-SVN: r263791

5 years agoPR libstdc++/78448 limit vector::max_size and deque::max_size
Jonathan Wakely [Wed, 22 Aug 2018 22:22:40 +0000 (23:22 +0100)]
PR libstdc++/78448 limit vector::max_size and deque::max_size

The container requirements imply that max_size() can't exceed the
maximum value of the container's difference_type. Enforce this for
std::vector and std::deque, and add checks to ensure the container
doesn't grow larger than that.

PR libstdc++/78448
* include/bits/deque.tcc (deque::_M_range_initialize): Use
_S_check_init_len to check size.
(deque::_M_push_back_aux, deque::_M_push_front_aux): Throw length
error if size would exceed max_size().
* include/bits/stl_deque.h (_Deque_base::size_type): Remove typedef.
(_Deque_base(_Deque_base&&, const allocator_type&, size_t)): Use
size_t instead of size_type.
(deq(size_type, const allocator_type&)
(deq(size_type, const value_type&, const allocator_type&)
(deque::_M_initialize_dispatch): Use _S_check_init_len to check size.
(deque::max_size): Call _S_max_size.
(deque::_S_check_init_len, deque::_S_max_size): New functions.
* include/bits/stl_vector.h (vector(size_type, const allocator_type&))
(vector(size_type, const value_type&, const allocator_type&))
(vector::_M_initialize_dispatch, vector::_M_range_initialize): Use
_S_check_init_len to check size.
(vector::max_size): Call _S_max_size.
(vector::_M_check_len): Prevent max from being expanded as a
function-like macro.
(vector::_S_check_init_len, vector::_S_max_size): New functions.
* include/bits/vector.tcc (vector::_M_assign_aux): Use
_S_check_init_len to check size.
* testsuite/23_containers/deque/capacity/max_size.cc: New test.
* testsuite/23_containers/vector/capacity/max_size.cc: New test.

From-SVN: r263789

5 years agogfortran.texi: Mention that asynchronous I/O does not work on systems which lack...
Thomas Koenig [Wed, 22 Aug 2018 21:29:49 +0000 (21:29 +0000)]
gfortran.texi: Mention that asynchronous I/O does not work on systems which lack condition...

2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

* gfortran.texi: Mention that asynchronous I/O does
not work on systems which lack condition variables, such
as AIX.

2018-08-22  Thomas Koenig  <tkoenig@gcc.gnu.org>

* async.h: Set ASYNC_IO to zero if _AIX is defined.
(struct adv_cond): If ASYNC_IO is zero, the struct has no members.
(async_unit): If ASYNC_IO is zero, remove unneeded members.

From-SVN: r263788

5 years agore PR fortran/86935 (Bad locus in ASSOCIATE statement)
Janus Weil [Wed, 22 Aug 2018 19:31:40 +0000 (21:31 +0200)]
re PR fortran/86935 (Bad locus in ASSOCIATE statement)

fix PR 86935

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

PR fortran/86935
* match.c (gfc_match_associate): Improve diagnostics for the ASSOCIATE
statement.

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

PR fortran/86935
* gfortran.dg/associate_3.f90: Update error message.
* gfortran.dg/associate_39.f90: New test case.

From-SVN: r263787

5 years agore PR libstdc++/68222 (_Safe_iterator provides operators the wrapped iterator can...
François Dumont [Wed, 22 Aug 2018 18:51:25 +0000 (18:51 +0000)]
re PR libstdc++/68222 (_Safe_iterator provides operators the wrapped iterator can't actually support)

2018-08-22  François Dumont  <fdumont@gcc.gnu.org>

PR libstdc++/68222
* include/debug/safe_iterator.h
(_Safe_iterator<_It, _Sq, _Cat>): Add category template parameter.
(_Safe_iterator<>::_Const_iterator): Remove.
(_Safe_iterator<>::_IsConstant): New.
(_Safe_iterator<>::_OtherIterator): New.
(_Safe_iterator<_It, _Sq, _Cat>::_Safe_iterator<_MutIte>(
const _Safe_iterator<_MutIte, _Sq, _Cat>&)): Add _IsConstant::__value in
__gnu_cxx::__enable_if condition.
(_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to): New.
(_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_from_begin): New.
(_Safe_iterator<_It, _Sq, _Cat>::_M_get_distance_to_end): New.
(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>): New.
(_Safe_iterator<_It, _Sq, _Cat>::operator--()): Move...
(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>
::operator--()): ...here.
(_Safe_iterator<_It, _Sq, _Cat>::operator--(int)): Move...
(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>
::operator--(int)): ...here.
(_Safe_iterator<_It, _Sq, _Cat>::_M_decrementable()): Move...
(_Safe_iterator<_It, _Sq, std::bidirectional_iterator_tag>
::_M_decrementable()): ...here.
(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>): New.
(_Safe_iterator<_It, _Sq, _Cat>::operator[](const difference_type&)):
Move...
(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
::operator[](const difference_type&)): ...here.
(_Safe_iterator<_It, _Sq, _Cat>::operator+=(const difference_type&)):
Move...
(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
::operator+=(const difference_type&)): ...here.
(_Safe_iterator<_It, _Sq, _Cat>::operator+(const difference_type&)):
Move...
(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
::operator+(const difference_type&)): ...here.
(_Safe_iterator<_It, _Sq, _Cat>::operator-=(const difference_type&)):
Move...
(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
::operator-=(const difference_type&)): ...here.
(_Safe_iterator<_It, _Sq, _Cat>::operator-(const difference_type&)):
Move...
(_Safe_iterator<_It, _Sq, std::random_access_iterator_tag>
::operator-(const difference_type&)): ...here.
(operator<(const _Safe_iterator<>&, const _Safe_iterator<>&)):
Constraint to random access iterators.
(operator<=(const _Safe_iterator<>&, const _Safe_iterator<>&)):
Likewise.
(operator>(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise.
(operator>=(const _Safe_iterator<>&, const _Safe_iterator<>&)):
Likewise.
(operator-(const _Safe_iterator<>&, const _Safe_iterator<>&)): Likewise.
(operator+(const difference_type&, const _Safe_iterator<>&)): Likewise.
(__check_dereferenceable(const _Safe_iterator<>&)): Remove.
(__get_distance): Remove.
(__get_distance_from_begin): Remove.
(__get_distance_to_end): Remove.
(struct __is_safe_random_iterator<_Safe_iterator<>>): Remove partial
specialization.
(__base(const _Safe_iterator<>&, std::input_iterator_tag)): Remove.
(__base(const _Safe_iterator<>&, std::random_access_iterator_tag)): Remove.
(__base(const _Safe_iterator<>&)): Constraint to random access iterator.
* include/debug/safe_iterator.tcc
(_Safe_iterator<>::_M_get_distance_from_begin()): New.
(_Safe_iterator<>::_M_get_distance_to_end()): New.
(_Safe_iterator<>::_M_get_distance_to(const _Safe_iterator<>&)): New.
(_Safe_iterator<_It, _Seq, std::random_access_iterator_tag>
::_M_valid_range): New.
* include/debug/safe_local_iterator.h
(_Safe_local_iterator<>::_Const_local_iterator): Remove.
(_Safe_local_iterator<>::_IsConstant): New.
(_Safe_local_iterator<>::_OtherIterator): New.
(_Safe_local_iterator<_It, _Cont>::_Safe_local_iterator<_MutIte, _Cont>(
const _Safe_local_iterator<_MutIte, _Seq>&)): Add _IsConstant::__value
in __gnu_cxx::__enable_if condition. If singular compare base iterator
with _MutIte rather than _It.
(_Safe_local_iterator<>::_S_constant): Make constexpr.
(_Safe_local_iterator<>::_M_get_distance_to): New.
(__check_dereferenceable(const _Safe_local_iterator<>&)): Remove.
(__get_distance(const _Safe_local_iterator<>&,
const _Safe_local_iterator<>&, std::input_iterator_tag)): Remove.
(__valid_range(const _Safe_local_iterator<>&,
const _Safe_local_iterator<>&)): New.
* include/debug/safe_local_iterator.tcc
(_Safe_local_iterator<>::_M_get_distance_to): New.
* include/debug/deque (std::__debug::deque<>): Add
::__gnu_debug::_Safe_iterator<> friend declaration.
* include/debug/forward_list (std::__debug::forward_list<>): Likewise.
* include/debug/list (std::__debug::list<>): Likewise.
* include/debug/map.h (std::__debug::map<>): Likewise.
* include/debug/multimap.h (std::__debug::multimap<>): Likewise.
* include/debug/set.h (std::__debug::set<>): Likewise.
* include/debug/multiset.h (std::__debug::multiset<>): Likewise.
* include/debug/string (std::__debug::basic_string<>): Likewise.
* include/debug/unordered_map (std::__debug::unordered_map<>): Likewise
and add ::__gnu_debug::_Safe_local_iterator<> friend declaration.
(std::__debug::unordered_multimap<>): Likewise.
* include/debug/unordered_set (std::__debug::unordered_set<>): Likewise.
(std::__debug::unordered_multiset<>): Likewise.
* include/debug/formatter.h: Adapt.
* include/debug/helper_functions.h
(__gnu_debug::_Safe_local_iterator<>): Add declaration.
(__get_distance<_Ite>(_Ite, _Ite, std::random_access_iterator_tag):
Pass parameter by copy.
(__get_distance<_Ite>(_Ite, _Ite, std::input_iterator_tag): Likewise.
(__get_distance<_Ite>(_Ite, _Ite): Likewise.
(__valid_range_aux<_Integral>): Pass _Integral by copy.
(__valid_range<_InputIterator>): Pass _InputIterator by copy.
(__valid_range<>(const _Safe_iterator<>&,
const _Safe_iterator<>&, typename _Distance_traits<>::__type&)):
Declare.
(__valid_range(const _Safe_local_iterator<>&,
const _Safe_local_iterator<>&, typename _Distance_traits<>::__type&)):
Declare.
(__valid_range<>(const _Safe_iterator<>&, const _Safe_iterator<>&)):
Declare.
(__valid_range(const _Safe_local_iterator<>&, const _Safe_local_iterator<>&)):
Declare.
(__can_advance): Adapt.
(struct __is_safe_random_iterator<>): Remove.
(struct _SIter_base<>): Remove.
* include/debug/functions.h: Include <bits/stl_iterator.h>.
(__check_dereferenceable): Remove.
(__foreign_iterator_aux4, __foreign_iterator_aux3): Adapt.
(__foreign_iterator_aux2, __foreign_iterator_aux): Adapt.
(__foreign_iterator): Adapt.
* include/debug/stl_iterator.h
(__is_safe_random_iterator<std::reverse_iterator<>>): Remove.
(__base(const std::reverse_iterator<_Safe_iterator<_It, _Sq>)):
Constraint for random access iterators.
(__niter_base): Adapt.
* testsuite/util/testsuite_containers.h:
Include <bits/boost_concept_check.h>.
(iterator_concept_checks<_It, _Mutable, _Category>): New.
(citerator<_Cont>::forward_members::forward_members()): Instantiate
latter for container iterator and const_iterator.
* testsuite/23_containers/list/68222_neg.cc: New.
* testsuite/23_containers/vector/cons/destructible_debug_neg.cc: Adapt
line number.
* testsuite/23_containers/unordered_set/debug/debug_functions.cc:
(test01): Remove.
* testsuite/23_containers/vector/debug/debug_functions.cc (test01):
Remove.

From-SVN: r263786

5 years agomodule.c (load_generic_interfaces): Move call to find_symbol() so that only occurs...
Andrew Benson [Wed, 22 Aug 2018 17:47:53 +0000 (17:47 +0000)]
module.c (load_generic_interfaces): Move call to find_symbol() so that only occurs if actually needed.

2018-08-22  Andrew Benson  <abensonca@gmail.com>

        * module.c (load_generic_interfaces): Move call to find_symbol()
        so that only occurs if actually needed.

From-SVN: r263784

5 years agoUpdate write after approval list
Andrew Benson [Wed, 22 Aug 2018 17:40:55 +0000 (17:40 +0000)]
Update write after approval list

2018-08-22  Andrew Benson  <abensonca@gmail.com>

        * MAINTAINERS: Add self to write after approval list.

From-SVN: r263783

5 years agore PR fortran/86888 ([F08] allocatable components of indirectly recursive type)
Janus Weil [Wed, 22 Aug 2018 17:10:00 +0000 (19:10 +0200)]
re PR fortran/86888 ([F08] allocatable components of indirectly recursive type)

fix PR 86888

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

PR fortran/86888
* decl.c (gfc_match_data_decl): Allow allocatable components of
indirectly recursive type.
* resolve.c (resolve_component): Remove two errors messages ...
(resolve_fl_derived): ... and replace them by a new one.

2018-08-22  Janus Weil  <janus@gcc.gnu.org>

PR fortran/86888
* gfortran.dg/alloc_comp_basics_6.f90: Update an error message and add
an additional case.
* gfortran.dg/alloc_comp_basics_7.f90: New test case.
* gfortran.dg/class_17.f03: Update error message.
* gfortran.dg/class_55.f90: Ditto.
* gfortran.dg/dtio_11.f90: Update error messages.
* gfortran.dg/implicit_actual.f90: Add an error message.
* gfortran.dg/typebound_proc_12.f90: Update error message.

From-SVN: r263782

5 years agoPR middle-end/87052 - STRING_CST printing incomplete in Gimple dumps
Martin Sebor [Wed, 22 Aug 2018 16:42:56 +0000 (16:42 +0000)]
PR middle-end/87052 - STRING_CST printing incomplete in Gimple dumps

gcc/testsuite/ChangeLog:

PR middle-end/87052
* gcc.dg/pr87052.c: New test.
* gcc.dg/tree-ssa/dump-3.c: Adjust.

gcc/ChangeLog:

PR middle-end/87052
* tree-pretty-print.c (pretty_print_string): Add argument.
(dump_generic_node): Call to pretty_print_string with string size.

From-SVN: r263781

5 years ago[ fix changelog ]
Segher Boessenkool [Wed, 22 Aug 2018 16:04:09 +0000 (18:04 +0200)]
[ fix changelog ]

2018-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

PR rtl-optimization/86771
* combine.c (try_combine): Do not allow splitting a resulting PARALLEL
of two SETs into those two SETs, one to be placed at i2, if that SETs
destination is modified between i2 and i3.

From-SVN: r263780