gcc.git
6 years ago[NDS32] Implement more C ISR extension.
Chung-Ju Wu [Sun, 12 Aug 2018 07:38:40 +0000 (07:38 +0000)]
[NDS32] Implement more C ISR extension.

gcc/
* config.gcc (nds32*): Add nds32_isr.h and nds32_init.inc in
extra_headers.
* common/config/nds32/nds32-common.c (nds32_handle_option): Handle
OPT_misr_secure_ case.
* config/nds32/nds32-isr.c: Implementation of backward compatibility.
* config/nds32/nds32-protos.h (nds32_isr_function_critical_p): New.
* config/nds32/nds32.c (nds32_attribute_table): Add critical and
secure attribute.
* config/nds32/nds32.h (nds32_isr_nested_type): Add NDS32_CRITICAL.
(nds32_isr_info): New field security_level.
(TARGET_ISR_VECTOR_SIZE_4_BYTE): New macro.
* config/nds32/nds32.md (return_internal): Consider critical attribute.
* config/nds32/nds32.opt (misr-secure): New option.
* config/nds32/nds32_init.inc: New file.
* config/nds32/nds32_isr.h: New file.

libgcc/
* config/nds32/t-nds32-isr: Rearrange object dependency.
* config/nds32/initfini.c: Add dwarf2 unwinding support.
* config/nds32/isr-library/adj_intr_lvl.inc: Consider new extensions
and registers usage.
* config/nds32/isr-library/excp_isr.S: Ditto.
* config/nds32/isr-library/intr_isr.S: Ditto.
* config/nds32/isr-library/reset.S: Ditto.
* config/nds32/isr-library/restore_all.inc: Ditto.
* config/nds32/isr-library/restore_mac_regs.inc: Ditto.
* config/nds32/isr-library/restore_partial.inc: Ditto.
* config/nds32/isr-library/restore_usr_regs.inc: Ditto.
* config/nds32/isr-library/save_all.inc: Ditto.
* config/nds32/isr-library/save_mac_regs.inc: Ditto.
* config/nds32/isr-library/save_partial.inc: Ditto.
* config/nds32/isr-library/save_usr_regs.inc: Ditto.
* config/nds32/isr-library/vec_vid*.S: Consider 4-byte vector size.

From-SVN: r263493

6 years agoDaily bump.
GCC Administrator [Sun, 12 Aug 2018 00:16:29 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263492

6 years agopa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
John David Anglin [Sat, 11 Aug 2018 21:37:55 +0000 (21:37 +0000)]
pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.

gcc
* config/pa/pa.md (UNSPEC_MEMORY_BARRIER): New unspec enum.
Update comment for atomic instructions.
(atomic_storeqi, atomic_storehi, atomic_storesi, atomic_storesf,
atomic_loaddf, atomic_loaddf_1, atomic_storedf, atomic_storedf_1):
Remove.
(atomic_loaddi): Revise fence expansion to only emit fence prior to
load for __ATOMIC_SEQ_CST model.
(atomic_loaddi_1): Remove float register target.
(atomic_storedi): Handle CONST_INT values.
(atomic_storedi_1): Remove float register source.  Add special case
for zero value.
(memory_barrier): New expander and insn.

libgcc
* config/pa/linux-atomic.c: Update comment.
(FETCH_AND_OP_2, OP_AND_FETCH_2, FETCH_AND_OP_WORD, OP_AND_FETCH_WORD,
COMPARE_AND_SWAP_2, __sync_val_compare_and_swap_4,
SYNC_LOCK_TEST_AND_SET_2, __sync_lock_test_and_set_4): Use
__ATOMIC_RELAXED for atomic loads.
(SYNC_LOCK_RELEASE_1): New define.  Use __sync_synchronize() and
unordered store to release lock.
(__sync_lock_release_8): Likewise.
(SYNC_LOCK_RELEASE_2): Remove define.

From-SVN: r263488

6 years agore PR tree-optimization/86835 (Bogus "is used uninitialized" warning with -ffast...
Jakub Jelinek [Sat, 11 Aug 2018 11:29:12 +0000 (13:29 +0200)]
re PR tree-optimization/86835 (Bogus "is used uninitialized" warning with -ffast-math)

PR tree-optimization/86835
* tree-ssa-math-opts.c (insert_reciprocals): Even when inserting
new_stmt after def_gsi, make sure to insert new_square_stmt after
that stmt, not 2 stmts before it.

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

From-SVN: r263487

6 years agoPR c++/86728 - C variadic generic lambda.
Jason Merrill [Sat, 11 Aug 2018 10:47:03 +0000 (06:47 -0400)]
PR c++/86728 - C variadic generic lambda.

* parser.c (cp_parser_parameter_declaration): Don't turn 'auto' into
a pack if it's followed by a declarator-id.

From-SVN: r263484

6 years agoDaily bump.
GCC Administrator [Sat, 11 Aug 2018 00:16:30 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263483

6 years agoPR libstdc++/68210 adjust operator new and delete for LWG 206
Jonathan Wakely [Fri, 10 Aug 2018 20:20:27 +0000 (21:20 +0100)]
PR libstdc++/68210 adjust operator new and delete for LWG 206

Ensure that nothrow versions of new and delete call the ordinary
versions of new or delete, instead of calling malloc or free directly.

These files are all compiled with -std=gnu++14 so can use noexcept and
nullptr to make the code more readable.

PR libstdc++/68210
* doc/xml/manual/intro.xml: Document LWG 206 change.
* libsupc++/del_op.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
* libsupc++/del_opa.cc: Likewise.
* libsupc++/del_opant.cc: Likewise.
* libsupc++/del_opnt.cc: Likewise. Call operator delete(ptr) instead
of free(ptr).
* libsupc++/del_ops.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
* libsupc++/del_opsa.cc: Likewise.
* libsupc++/del_opva.cc: Likewise.
* libsupc++/del_opvant.cc: Likewise.
* libsupc++/del_opvnt.cc: Likewise. Call operator delete[](ptr)
instead of operator delete(ptr).
* libsupc++/del_opvs.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
* libsupc++/del_opvsa.cc: Likewise.
* libsupc++/new_op.cc: Use __builtin_expect in check for zero size.
* libsupc++/new_opa.cc: Use nullptr instead of literal 0.
* libsupc++/new_opant.cc: Likewise. Replace _GLIBCXX_USE_NOEXCEPT
with noexcept.
* libsupc++/new_opnt.cc: Likewise. Call operator new(sz) instead of
malloc(sz).
* libsupc++/new_opvant.cc: Use nullptr and noexcept.
* libsupc++/new_opvnt.cc: Likewise. Call operator new[](sz) instead of
operator new(sz, nothrow).
* testsuite/18_support/new_nothrow.cc: New test.

From-SVN: r263478

6 years agoFix formatting in ChangeLog
Jonathan Wakely [Fri, 10 Aug 2018 19:04:01 +0000 (20:04 +0100)]
Fix formatting in ChangeLog

From-SVN: r263476

6 years agore PR fortran/57160 (short-circuit IF only with -ffrontend-optimize)
Janus Weil [Fri, 10 Aug 2018 14:08:53 +0000 (16:08 +0200)]
re PR fortran/57160 (short-circuit IF only with -ffrontend-optimize)

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

PR fortran/57160
* invoke.texi (frontend-optimize): Mention short-circuiting.
* options.c (gfc_post_options): Disable -ffrontend-optimize with -Og.
* resolve.c (resolve_operator): Warn about short-circuiting only with
-ffrontend-optimize.
* trans-expr.c (gfc_conv_expr_op): Use short-circuiting operators only
with -ffrontend-optimize. Without that flag, make sure that both
operands are evaluated.

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

PR fortran/57160
* gfortran.dg/actual_pointer_function_1.f90: Fix invalid test case.
* gfortran.dg/inline_matmul_23.f90: Add option "-ffrontend-optimize".
* gfortran.dg/short_circuiting_2.f90: New test case.
* gfortran.dg/short_circuiting_3.f90: New test case.

From-SVN: r263471

6 years agoRemove not needed __builtin_expect due to malloc predictor.
Martin Liska [Fri, 10 Aug 2018 11:40:40 +0000 (13:40 +0200)]
Remove not needed __builtin_expect due to malloc predictor.

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

* libsupc++/new_op.cc (new): Remove __builtin_expect as malloc
        predictor can handle that.
* libsupc++/new_opa.cc: Likewise.
* libsupc++/new_opnt.cc (new): Likewise.

From-SVN: r263470

6 years agoFix wrongly removed line.
Martin Liska [Fri, 10 Aug 2018 11:38:12 +0000 (13:38 +0200)]
Fix wrongly removed line.

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

* MAINTAINERS: Revert change in previous commit and
        join lines.

From-SVN: r263469

6 years agoFix extra line in MAINTAINERS.
Martin Liska [Fri, 10 Aug 2018 10:36:12 +0000 (12:36 +0200)]
Fix extra line in MAINTAINERS.

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

* MAINTAINERS: Remove extra line.

From-SVN: r263468

6 years agoi386: do not use SImode mul-highpart on 64-bit (PR 82418)
Alexander Monakov [Fri, 10 Aug 2018 10:13:37 +0000 (13:13 +0300)]
i386: do not use SImode mul-highpart on 64-bit (PR 82418)

PR target/82418
* config/i386/i386.md (<s>mul<mode>3_highpart): Use DWIH mode iterator
instead of SWI48.

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

From-SVN: r263467

6 years agoIntroduce __builtin_expect_with_probability (PR target/83610).
Martin Liska [Fri, 10 Aug 2018 09:43:06 +0000 (11:43 +0200)]
Introduce __builtin_expect_with_probability (PR target/83610).

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

        PR target/83610
* builtin-types.def (BT_FN_LONG_LONG_LONG_DOUBLE): Add new
        function type.
* builtins.c (expand_builtin_expect_with_probability):
        New function.
(expand_builtin_expect_with_probability): New function.
(build_builtin_expect_predicate): Add new argumnet probability
        for BUILT_IN_EXPECT_WITH_PROBABILITY.
(fold_builtin_expect):
(fold_builtin_2):
(fold_builtin_3):
* builtins.def (BUILT_IN_EXPECT_WITH_PROBABILITY):
* builtins.h (fold_builtin_expect): Set new argument.
* doc/extend.texi: Document __builtin_expect_with_probability.
* doc/invoke.texi: Likewise.
* gimple-fold.c (gimple_fold_call): Pass new argument.
* ipa-fnsummary.c (find_foldable_builtin_expect): Handle
        also BUILT_IN_EXPECT_WITH_PROBABILITY.
* predict.c (get_predictor_value): New function.
(expr_expected_value): Add new argument probability. Assume
        that predictor and probability are always non-null.
(expr_expected_value_1): Likewise.  For __builtin_expect and
        __builtin_expect_with_probability set probability.  Handle
        combination in binary expressions.
(tree_predict_by_opcode): Simplify code by simply calling
        get_predictor_value.
(pass_strip_predict_hints::execute): Add handling of
        BUILT_IN_EXPECT_WITH_PROBABILITY.
* predict.def (PRED_BUILTIN_EXPECT_WITH_PROBABILITY): Add
        new predictor.
* tree.h (DECL_BUILT_IN_P): New function.
2018-08-10  Martin Liska  <mliska@suse.cz>

        PR target/83610
* gcc.dg/predict-17.c: New test.
* gcc.dg/predict-18.c: New test.
* gcc.dg/predict-19.c: New test.

From-SVN: r263466

6 years agoStrip only selected predictors after early tree passes (PR tree-optimization/85799).
Martin Liska [Fri, 10 Aug 2018 09:31:51 +0000 (11:31 +0200)]
Strip only selected predictors after early tree passes (PR tree-optimization/85799).

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

        PR tree-optimization/85799
* passes.def: Add argument for pass_strip_predict_hints.
* predict.c (class pass_strip_predict_hints): Add new argument
        early_p.
(strip_predictor_early): New function.
(pass_strip_predict_hints::execute): Call the function to
        strip predictors.
(strip_predict_hints): New function.
* predict.def: Fix comment.
2018-08-10  Martin Liska  <mliska@suse.cz>

        PR tree-optimization/85799
* gcc.dg/pr85799.c: New test.

From-SVN: r263465

6 years agoClarify source of tm.texi to copy for GFDL grant
Thomas Preud'homme [Fri, 10 Aug 2018 08:48:34 +0000 (08:48 +0000)]
Clarify source of tm.texi to copy for GFDL grant

When tm.texi.in is updated in the source tree, the following message
gets displayed:

Verify that you have permission to grant a GFDL license for all
new text in tm.texi, then copy it to <gcc src dir>/gcc/doc/tm.texi.

Having been myself and some colleagues confused several time by that
message as to what tm.texi to copy, I think it would be clearer to
indicate the absolute path for the source as well. This patch achieves
that.

2018-08-10  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

    gcc/
    * Makefile.in: Clarify which tm.texi to copy over to assert the
    right to grant a GFDL license for all.

From-SVN: r263464

6 years agolibstdc++-v3: Have aligned_alloc() on Newlib
Sebastian Huber [Fri, 10 Aug 2018 06:27:35 +0000 (06:27 +0000)]
libstdc++-v3: Have aligned_alloc() on Newlib

While building for Newlib, some configure checks must be hard coded.
The aligned_alloc() is supported since 2015 in Newlib.

libstdc++-v3/

PR target/85904
* configure.ac: Define HAVE_ALIGNED_ALLOC if building for
Newlib.
* configure: Regenerate.

From-SVN: r263461

6 years agoDaily bump.
GCC Administrator [Fri, 10 Aug 2018 00:16:29 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263460

6 years agoDefine aliases for containers using polymorphic_allocator
Jonathan Wakely [Thu, 9 Aug 2018 23:25:53 +0000 (00:25 +0100)]
Define aliases for containers using polymorphic_allocator

These aliases are placed in the top-level header, e.g. <vector> not
<bits/stl_vector.h>. This ensures that they refer to whichever of
std::vector or __debug::vector or __profile::vector is in use when the
header is included.

* include/std/deque (std::pmr::deque): Declare alias.
* include/std/forward_list (std::pmr::forward_list): Likewise.
* include/std/list (std::pmr::list): Likewise.
* include/std/map (std::pmr::map, std::pmr::multimap): Likewise.
* include/std/regex (std::pmr::match_results, std::pmr::cmatch)
(std::pmr::smatch, std::pmr::wcmatch, std::pmr::wsmatch): Likewise.
* include/std/set (std::pmr::set, std::pmr::multiset): Likewise.
* include/std/string (std::pmr::basic_string, std::pmr::string)
(std::pmr::u16string, std::pmr::u32string, std::pmr::wstring):
Likewise.
* include/std/unordered_map (std::pmr::unordered_map)
(std::pmr::unordered_multimap): Likewise.
* include/std/unordered_set (std::pmr::unordered_set)
(std::pmr::unordered_multiset): Likewise.
* include/std/vector (std::pmr::vector): Likewise.
* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: New test.
* testsuite/23_containers/deque/types/pmr_typedefs.cc: New test.
* testsuite/23_containers/forward_list/pmr_typedefs.cc: New test.
* testsuite/23_containers/list/pmr_typedefs.cc: New test.
* testsuite/23_containers/map/pmr_typedefs.cc: New test.
* testsuite/23_containers/multimap/pmr_typedefs.cc: New test.
* testsuite/23_containers/multiset/pmr_typedefs.cc: New test.
* testsuite/23_containers/set/pmr_typedefs.cc: New test.
* testsuite/23_containers/unordered_map/pmr_typedefs.cc: New test.
* testsuite/23_containers/unordered_multimap/pmr_typedefs.cc: New
test.
* testsuite/23_containers/unordered_multiset/pmr_typedefs.cc: New
test.
* testsuite/23_containers/unordered_set/pmr_typedefs.cc: New test.
* testsuite/23_containers/vector/pmr_typedefs.cc: New test.
* testsuite/28_regex/match_results/pmr_typedefs.cc: New test.

From-SVN: r263456

6 years agom68k.c (m68k_adjust_decorated_operand): Remove unused variable.
Jeff Law [Thu, 9 Aug 2018 17:18:43 +0000 (11:18 -0600)]
m68k.c (m68k_adjust_decorated_operand): Remove unused variable.

* config/m68k/m68k.c (m68k_adjust_decorated_operand): Remove
unused variable.

From-SVN: r263455

6 years agore PR middle-end/86897 (gcc.dg/uninit-suppress_2.c FAILs)
Jeff Law [Thu, 9 Aug 2018 17:11:45 +0000 (11:11 -0600)]
re PR middle-end/86897 (gcc.dg/uninit-suppress_2.c FAILs)

PR middle-end/86897
* gcc.dg/uninit-suppress_2.c: Disable DOM.

From-SVN: r263454

6 years agoAdd missing PR to Nios fix for CVE-2017-5753
Richard Earnshaw [Thu, 9 Aug 2018 16:53:48 +0000 (16:53 +0000)]
Add missing PR to Nios fix for CVE-2017-5753

I nearly missed this patch for my accumulated back-porting list since
it didn't have the PR number in it.

Just adding it so that I can track things properly.  The original
commit landed as r263301.

From-SVN: r263453

6 years agom68k-protos.h (m68k_final_prescan_insn): Remove prototype.
Andreas Schwab [Thu, 9 Aug 2018 16:25:12 +0000 (16:25 +0000)]
m68k-protos.h (m68k_final_prescan_insn): Remove prototype.

* config/m68k/m68k-protos.h (m68k_final_prescan_insn): Remove
prototype.

From-SVN: r263452

6 years agoAllow inner-loop reductions with variable-length vectors
Richard Sandiford [Thu, 9 Aug 2018 16:03:25 +0000 (16:03 +0000)]
Allow inner-loop reductions with variable-length vectors

While working on PR 86871, I noticed we were being overly restrictive
when handling variable-length vectors.  For:

  for (i : ...)
    {
      res = ...;
      for (j : ...)
        res op= ...;
      a[i] = res;
    }

we don't need a reduction operation (although we do for double
reductions like:

  res = ...;
  for (i : ...)
    for (j : ...)
      res op= ...;
  a[i] = res;

which must still be rejected).

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

gcc/
* tree-vect-loop.c (vectorizable_reduction): Allow inner-loop
reductions for variable-length vectors.

gcc/testsuite/
* gcc.target/aarch64/sve/reduc_8.c: New test.

From-SVN: r263451

6 years agodiagnostics: add line numbers to source (PR other/84889)
David Malcolm [Thu, 9 Aug 2018 15:32:13 +0000 (15:32 +0000)]
diagnostics: add line numbers to source (PR other/84889)

This patch adds a left margin to the lines of source (and annotations)
printed by diagnostic_show_locus, so that e.g. rather than:

test.c: In function 'test':
test.c:12:15: error: 'struct foo' has no member named 'm_bar'; did you mean 'bar'?
   return ptr->m_bar;
               ^~~~~
               bar

we print:

test.c: In function 'test':
test.c:12:15: error: 'struct foo' has no member named 'm_bar'; did you mean 'bar'?
12 |   return ptr->m_bar;
   |               ^~~~~
   |               bar

Similarly, for a multiline case (in C++ this time), this:

bad-binary-ops.C: In function 'int test_2()':
bad-binary-ops.C:26:4: error: no match for 'operator+' (operand types are 's' and 't')
   return (some_function ()
           ~~~~~~~~~~~~~~~~
    + some_other_function ());
    ^~~~~~~~~~~~~~~~~~~~~~~~

becomes:

bad-binary-ops.C: In function 'int test_2()':
bad-binary-ops.C:26:4: error: no match for 'operator+' (operand types are 's' and 't')
25 |   return (some_function ()
   |           ~~~~~~~~~~~~~~~~
26 |    + some_other_function ());
   |    ^~~~~~~~~~~~~~~~~~~~~~~~

I believe this slightly improves the readability of the output, in that it:
- distinguishes between the user's source code vs the annotation lines
  that we're adding (the underlinings and fix-it hints here)
- shows the line numbers in another place (potentially helpful for
  multiline diagnostics, where the user can see the line numbers directly,
  rather than have to figure them out relative to the caret: in the 2nd
  example, note how the diagnostic is reported at line 26, but the first
  line printed is actually line 25)

I'm not sure that this is the precise format we want to go with [1], but
I think it's an improvement over the status quo, and we're in stage 1
of gcc 9, so there's plenty of time to shake out issues.

I've turned it on by default; it can be disabled via
-fno-diagnostics-show-line-numbers (it's also turned off in the testsuite, to
avoid breaking numerous existing test cases).

[1] Some possible variants:
  - maybe just "LL|" rather than "LL | "
  - maybe ':' rather than '|'
  - maybe we should have some leading indentation, to better split up
    the diagnostics visually via the left-hand column
  - etc

gcc/ChangeLog:
PR other/84889
* common.opt (fdiagnostics-show-line-numbers): New option.
* diagnostic-show-locus.c (class layout): Add fields
"m_show_line_numbers_p" and "m_linenum_width";
(num_digits): New function.
(test_num_digits): New function.
(layout::layout): Initialize new fields.  Update m_x_offset
logic to handle any left margin.
(layout::print_source_line): Print line number when requested.
(layout::start_annotation_line): New member function.
(layout::print_annotation_line): Call it.
(layout::print_leading_fixits): Likewise.
(layout::print_trailing_fixits): Likewise.  Update calls to
move_to_column for new parameter.
(layout::get_x_bound_for_row): Add "add_left_margin" param and use
it to potentially call start_annotation_line.
(layout::show_ruler): Call start_annotation_line.
(selftest::test_line_numbers_multiline_range): New selftest.
(selftest::diagnostic_show_locus_c_tests): Call test_num_digits
and selftest::test_line_numbers_multiline_range.
* diagnostic.c (diagnostic_initialize): Initialize
show_line_numbers_p.
* diagnostic.h (struct diagnostic_context): Add field
"show_line_numbers_p".
* doc/invoke.texi (Diagnostic Message Formatting Options): Add
-fno-diagnostics-show-line-numbers.
* dwarf2out.c (gen_producer_string): Add
OPT_fdiagnostics_show_line_numbers to the ignored options.
* lto-wrapper.c (merge_and_complain): Likewise to the "pick
one setting" options.
(append_compiler_options): Likewise to the dropped options.
(append_diag_options): Likewise to the passed-on options.
* opts.c (common_handle_option): Handle the new option.
* toplev.c (general_init): Set up global_dc->show_line_numbers_p.

gcc/testsuite/ChangeLog:
PR other/84889
* gcc.dg/plugin/diagnostic-test-show-locus-bw-line-numbers.c: New
test.
* gcc.dg/plugin/diagnostic-test-show-locus-color-line-numbers.c:
New test.
* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new tests.
* lib/prune.exp: Add -fno-diagnostics-show-line-numbers to
TEST_ALWAYS_FLAGS.

From-SVN: r263450

6 years agoextend.texi (PowerPC AltiVec Built-in Functions Available on ISA 2.07): Correct spell...
Kelvin Nilsen [Thu, 9 Aug 2018 15:01:55 +0000 (15:01 +0000)]
extend.texi (PowerPC AltiVec Built-in Functions Available on ISA 2.07): Correct spelling of bcdsub to be __builtin_bcdsub.

gcc/ChangeLog:

2018-08-09  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* doc/extend.texi (PowerPC AltiVec Built-in Functions Available on
ISA 2.07): Correct spelling of bcdsub to be __builtin_bcdsub.  Add
third argument of type "const signed char" to descriptions of
__builtin_bcdadd, __builtin_bcdadd_lt, __builtin_bcdadd_eq,
__builtin_bcdadd_gt, __builtin_bcdadd_ov, __builtin_bcdsub,
__builtin_bcdsub_lt, __builtin_bcdsub_eq, __builtin_bcdsub_gt,
__builtin_bcdsub_ov functions.

From-SVN: r263449

6 years agoRestore flow_bb_inside_loop_p tests (PR 86858)
Richard Sandiford [Thu, 9 Aug 2018 14:45:02 +0000 (14:45 +0000)]
Restore flow_bb_inside_loop_p tests (PR 86858)

The series to remove vinfo_for_stmt also removed tests of
flow_bb_inside_loop_p if the call was simply testing whether the
statement was in the vectorisation region.  I'd tried to keep calls
that were testing whether the statement was in a particular loop
(inner or outer), but messed up in vect_is_simple_reduction and
removed calls that were actually needed.  This patch restores them.

I double-checked the other removed calls and I think these are
the only ones affected.

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

gcc/
PR tree-optimization/86858
* tree-vect-loop.c (vect_is_simple_reduction): Restore
flow_bb_inside_loop_p calls.

gcc/testsuite/
PR tree-optimization/86858
* gcc.dg/vect/pr86858.c: New test.

From-SVN: r263448

6 years agoFix invalid assumption in vect_transform_stmt (PR 86871)
Richard Sandiford [Thu, 9 Aug 2018 14:37:24 +0000 (14:37 +0000)]
Fix invalid assumption in vect_transform_stmt (PR 86871)

The handling of outer-loop uses of inner-loop definitions assumed
that anything that wasn't a PHI would be a gassign.  It's also
possible for it to be a gcall.

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

gcc/
PR tree-optimization/86871
* tree-vect-stmts.c (vect_transform_stmt): Use gimple_get_lhs
instead of gimple_assign_lhs.

gcc/testsuite/
PR tree-optimization/86871
* gcc.dg/vect/pr86871.c: New test.

From-SVN: r263447

6 years agoaarch64 - PR target/86887 Fix missing register constraints in carryin patterns
Richard Earnshaw [Thu, 9 Aug 2018 13:39:17 +0000 (13:39 +0000)]
aarch64 - PR target/86887 Fix missing register constraints in carryin patterns

Some of the carryin insn patterns are missing a register constraint.
That means that the register allocator can pick practically anything
to hold that value, including memory locations, or registers of the
wrong class.

PR target/86887
* config/aarch64/aarch64.md (add<mode>3_carryinC_zero): Add missing
register constraint to operand 0.
(add<mode>3_carryinC): Likewise.
(add<mode>3_carryinV_zero, add<mode>3_carryinV): Likewise.

From-SVN: r263446

6 years agop784.C: Add -fpermissive.
Paolo Carlini [Thu, 9 Aug 2018 11:49:26 +0000 (11:49 +0000)]
p784.C: Add -fpermissive.

2018-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.old-deja/g++.mike/p784.C: Add -fpermissive.

From-SVN: r263445

6 years agoRemove extra line in common.opt (PR c/86895).
Martin Liska [Thu, 9 Aug 2018 10:37:02 +0000 (12:37 +0200)]
Remove extra line in common.opt (PR c/86895).

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

        PR c/86895
* common.opt: Remove extra line.

From-SVN: r263444

6 years agoS/390: Fix target attribute tests
Andreas Krebbel [Thu, 9 Aug 2018 08:47:39 +0000 (08:47 +0000)]
S/390: Fix target attribute tests

These broke after removing G5 and G6 CPUs from the processor
enumeration.

gcc/testsuite/ChangeLog:

2018-08-09  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/target-attribute/tattr-arch-tune-1.c: Decrement
arch and tune numbers by 2.
* gcc.target/s390/target-attribute/tattr-arch-tune-2.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-1.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-10.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-11.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-12.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-13.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-14.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-15.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-16.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-17.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-18.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-19.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-2.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-20.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-21.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-22.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-23.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-24.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-25.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-26.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-27.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-28.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-29.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-3.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-30.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-31.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-32.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-4.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-5.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-6.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-7.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-8.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m31-9.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-1.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-10.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-11.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-12.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-13.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-14.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-15.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-16.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-17.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-18.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-19.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-2.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-20.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-21.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-22.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-23.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-24.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-25.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-26.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-27.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-28.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-29.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-3.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-30.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-31.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-32.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-33.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-4.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-5.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-6.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-7.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-8.c: Likewise.
* gcc.target/s390/target-attribute/tattr-m64-9.c: Likewise.

From-SVN: r263443

6 years agoFix typos in params.def.
Martin Liska [Thu, 9 Aug 2018 08:08:44 +0000 (10:08 +0200)]
Fix typos in params.def.

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

* params.def (PARAM_ALIGN_LOOP_ITERATIONS): Remove double dots
        at the end of a line, make first letter capital and end up
        a sentence with a dot.
(PARAM_LOOP_INTERCHANGE_STRIDE_RATIO): Likewise.
(PARAM_LOOP_BLOCK_TILE_SIZE): Likewise.
(PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Likewise.
(PARAM_GRAPHITE_MAX_ARRAYS_PER_SCOP): Likewise.
(PARAM_MAX_ISL_OPERATIONS): Likewise.
(PARAM_GRAPHITE_ALLOW_CODEGEN_ERRORS): Likewise.
(PARAM_PROFILE_FUNC_INTERNAL_ID): Likewise.
(PARAM_INDIR_CALL_TOPN_PROFILE): Likewise.
(PARAM_SLP_MAX_INSNS_IN_BB): Likewise.
(PARAM_IPA_CP_EVAL_THRESHOLD): Likewise.
(PARAM_IPA_CP_RECURSION_PENALTY): Likewise.
(PARAM_IPA_CP_SINGLE_CALL_PENALTY): Likewise.
(PARAM_IPA_CP_LOOP_HINT_BONUS): Likewise.
(PARAM_IPA_CP_ARRAY_INDEX_HINT_BONUS): Likewise.
(PARAM_TREE_REASSOC_WIDTH): Likewise.
(PARAM_HSA_GEN_DEBUG_STORES): Likewise.
(PARAM_MAX_SPECULATIVE_DEVIRT_MAYDEFS): Likewise.
(PARAM_MAX_VRP_SWITCH_ASSERTIONS): Likewise.

From-SVN: r263442

6 years agoS/390: Fix PR84332 ICE with stack clash protection
Andreas Krebbel [Thu, 9 Aug 2018 07:06:23 +0000 (07:06 +0000)]
S/390: Fix PR84332 ICE with stack clash protection

Our implementation of the stack probe requires the probe interval to
be used as displacement in an address operand.  The maximum probe
interval currently is 64k.  This would exceed short displacements.
Trim that value down to 4k if that happens.  This might result in too
many probes being generated only on the oldest supported machine level
z900.

gcc/ChangeLog:

2018-08-09  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/84332
* config/s390/s390.c (s390_option_override_internal): Reduce the
stack-clash-protection-probe-interval param if it would be too big
for z900.

gcc/testsuite/ChangeLog:

2018-08-09  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/84332
* gcc.target/s390/pr84332.c: New testcase.

From-SVN: r263441

6 years agoDaily bump.
GCC Administrator [Thu, 9 Aug 2018 00:16:31 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263439

6 years ago2018-08-08 François Dumont <fdumont@gcc.gnu.org>
François Dumont [Wed, 8 Aug 2018 20:28:21 +0000 (20:28 +0000)]
2018-08-08  François Dumont  <fdumont@gcc.gnu.org>

* include/bits/stl_algo.h
(__rotate(_Ite, _Ite, _Ite, forward_iterator_tag))
(__rotate(_Ite, _Ite, _Ite, bidirectional_iterator_tag))
(__rotate(_Ite, _Ite, _Ite, random_access_iterator_tag)): Move code duplication...
(rotate(_Ite, _Ite, _Ite)): ...here.
(__stable_partition_adaptive(_FIt, _FIt, _Pred, _Dist, _Pointer, _Dist)):
Simplify rotate call.
(__rotate_adaptive(_BIt1, _BIt1, _BIt1, _Dist, _Dist, _Bit2, _Dist)):
Likewise.
(__merge_without_buffer(_BIt, _BIt, _BIt, _Dist, _Dist, _Comp)):
Likewise.

From-SVN: r263433

6 years agom68k: handle more cases of TLS symbols with offset
Andreas Schwab [Wed, 8 Aug 2018 20:01:26 +0000 (20:01 +0000)]
m68k: handle more cases of TLS symbols with offset

PR target/46179
* config/m68k/m68k.h (FINAL_PRESCAN_INSN): Don't define.
* config/m68k/m68k.c (handle_move_double): Don't call
m68k_final_prescan_insn.
(m68k_adjust_decorated_operand): Renamed from
m68k_final_prescan_insn, remove first and third operand and
simplify.
(print_operand): Call it.
(print_operand_address): Call it.

PR target/46179
* gcc.target/m68k/tls-dimode.c: New file.

From-SVN: r263432

6 years ago[PATCH] line-map include-from representation
Nathan Sidwell [Wed, 8 Aug 2018 18:13:00 +0000 (18:13 +0000)]
[PATCH] line-map include-from representation

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00554.html
Make linemap::included_from a location
libcpp/
* include/line-map.h (struct line_map_ordinary): Replace
included_from map index with included_at source_location.
(ORDINARY_MAP_INCLUDER_FILE_INDEX): Delete.
(LAST_SOURCE_LINE_LOCATION): Delete.
(LAST_SOURCE_LINE, LAST_SOURCE_COLUMN): Delete.
(linemap_included_from): New.
(linemap_included_from_linemap): Declare.
(MAIN_FILE_P): Adjust.
* line-map.c (linemap_included_from_linemap): New.
(lonemap_check_files_exited): Use linemap_included_at.
(linemap_add): Adjust inclusion setting.
(linemap_dump, linemap_dump_location): Adjust.
* directives.c (do_linemarker): Use linemap_included_at.
gcc/
* diagnostic.c (diagnostic_report_current_module): Use
linemap_included_from & linemap_included_from_linemap.
gcc/c-family/
* c-common.c (try_to_locate_new_include_inertion_point): Use
linemap_included_from_linemap.
* c-lex.c (fe_file_change): Use linemap_included_from.
* c-ppoutput.c (pp_file_change): Likewise.
gcc/fortran/
* cpp.c (cb_file_change): Use linemap_included_from.
gcc/testsuite/
* c-c++-common/inc-from-1a.h, c-c++-common/inc-from-1b.h,
c-c++-common/inc-from-1.c: New

From-SVN: r263429

6 years agoPrevent internal aligned_alloc clashing with libc version
Jonathan Wakely [Wed, 8 Aug 2018 15:16:43 +0000 (16:16 +0100)]
Prevent internal aligned_alloc clashing with libc version

If configure fails to detect aligned_alloc we will try to define our
own in new_opa.cc but that could clash with the libcversion in
<stdlib.h>. Use a namespace to keep them distinct.

* libsupc++/new_opa.cc (aligned_alloc): Declare inside namespace to
avoid clashing with an ::aligned_alloc function that was not detected
by configure.

From-SVN: r263409

6 years ago[libgomp, nvptx] Fall back to cuLinkAddData/cuLinkCreate if _v2 not found
Tom de Vries [Wed, 8 Aug 2018 14:26:37 +0000 (14:26 +0000)]
[libgomp, nvptx] Fall back to cuLinkAddData/cuLinkCreate if _v2 not found

Cuda driver api functions cuLinkAddData and cuLinkCreate are available starting
version 5.5.  In version 6.5, they are remapped onto _v2 versions.

The dlopen interface of the libgomp nvptx plugin uses the _v2 versions, so it
won't work with a cuda driver with driver api version lower than 6.5.

This patch fixes the problem by testing for the presence of the _v2 versions,
and falling back to the original versions in case of absence of the _v2
versions.

Build on x86_64 with nvptx accelerator and reg-tested libgomp, both with and
without --without-cuda-driver.

2018-08-08  Tom de Vries  <tdevries@suse.de>

* plugin/cuda-lib.def (cuLinkAddData_v2, cuLinkCreate_v2): Declare using
CUDA_ONE_CALL_MAYBE_NULL.
* plugin/plugin-nvptx.c (cuLinkAddData, cuLinkCreate): Undef and declare.
(cuLinkAddData_v2, cuLinkCreate_v2): Declare.
(link_ptx): Fall back to cuLinkAddData/cuLinkCreate if the _v2 versions
are not found.

From-SVN: r263408

6 years ago[libgomp, nvptx] Allow cuGetErrorString to be NULL
Tom de Vries [Wed, 8 Aug 2018 14:26:28 +0000 (14:26 +0000)]
[libgomp, nvptx] Allow cuGetErrorString to be NULL

Cuda driver api function cuGetErrorString is available in version 6.0 and
higher.

Currently, when the driver that is used does not contain this function, the
libgomp nvptx plugin will not build (PLUGIN_NVPTX_DYNAMIC == 0) or run
(PLUGIN_NVPTX_DYNAMIC == 1).

This patch fixes this problem by testing for the presence of the function, and
handling absence.

Build on x86_64 with nvptx accelerator and reg-tested libgomp, both with and
without --without-cuda-driver.

2018-08-08  Tom de Vries  <tdevries@suse.de>

* plugin/cuda-lib.def (cuGetErrorString): Use CUDA_ONE_CALL_MAYBE_NULL.
* plugin/plugin-nvptx.c (cuda_error): Handle if cuGetErrorString is not
present.

From-SVN: r263407

6 years ago[libgomp, nvptx] Remove hard-coded const in nvptx_open_device
Tom de Vries [Wed, 8 Aug 2018 14:26:19 +0000 (14:26 +0000)]
[libgomp, nvptx] Remove hard-coded const in nvptx_open_device

CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR is defined in cuda driver
api version 6.0 and higher.

Currently nvptx_open_device uses a hard-coded constant instead.

This patch fixes that by:
- defining CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR to the hardcoded
  constant at toplevel, if not present in cuda.h, and
- using CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR in nvptx_open_device

Build on x86_64 with nvptx accelerator and reg-tested libgomp.

2018-08-08  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c
(CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR): Define.
(nvptx_open_device): Use
CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR.

From-SVN: r263406

6 years ago[libgomp, nvptx] Note that cuGetErrorString is in CUDA_VERSION >= 6000
Tom de Vries [Wed, 8 Aug 2018 14:26:10 +0000 (14:26 +0000)]
[libgomp, nvptx] Note that cuGetErrorString is in CUDA_VERSION >= 6000

Cuda driver api function cuGetErrorString is available in version 6.0 and
higher.

This patch:
- removes a comment saying the declaration is not available in cuda.h 6.0
- fixes the presence test to use CUDA_VERSION < 6000
- moves the declaration to toplevel

Build on x86_64 with nvptx accelerator and reg-tested libgomp.

2018-08-08  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c (cuda_error): Move declaration of cuGetErrorString ...
(cuGetErrorString): ... here.  Guard with CUDA_VERSION < 6000.

From-SVN: r263405

6 years ago[AArch64] Add HXT Phecda core support
Hongbo Zhang [Wed, 8 Aug 2018 14:23:59 +0000 (14:23 +0000)]
[AArch64] Add HXT Phecda core support

HXT semiconductor's CPU core Phecda, as a variant of Qualcomm qdf24xx,
reuses the same tuning structure and pipeline with it.

Applied on behalf of: Hongbo Zhang <hongbo.zhang@linaro.org>

* config/aarch64/aarch64-cores.def: Add phecda core.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi: Add phecda core.

From-SVN: r263404

6 years agoFix Docbook markup for table entry
Jonathan Wakely [Wed, 8 Aug 2018 13:37:24 +0000 (14:37 +0100)]
Fix Docbook markup for table entry

* doc/xml/manual/using.xml: Fix markup for empty table entry.
* doc/html/*: Regenerate.

From-SVN: r263401

6 years agoAdd missing <experimental/numeric> header to docs
Jonathan Wakely [Wed, 8 Aug 2018 13:29:25 +0000 (14:29 +0100)]
Add missing <experimental/numeric> header to docs

* doc/xml/manual/using.xml: Add missing header to table and fix typo.
* doc/html/*: Regenerate.

From-SVN: r263398

6 years agoPR libstdc++/86597 directory_entry observers should clear error_code
Jonathan Wakely [Wed, 8 Aug 2018 13:09:19 +0000 (14:09 +0100)]
PR libstdc++/86597 directory_entry observers should clear error_code

PR libstdc++/86597
* include/bits/fs_dir.h (directory_entry::_M_file_type(error_code&)):
Clear error_code when cached type is used.
* testsuite/27_io/filesystem/directory_entry/86597.cc: New test.

From-SVN: r263397

6 years agoS/390: Fix PR85295
Andreas Krebbel [Wed, 8 Aug 2018 12:38:51 +0000 (12:38 +0000)]
S/390: Fix PR85295

gcc/ChangeLog:

2018-08-08  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/85295
* config/s390/constraints.md ("NxHD0", "NxSD0"): New constraint
definitions.
* config/s390/s390.md ("movti"): Add more alternatives for
constant to GPR copies.

gcc/testsuite/ChangeLog:

2018-08-08  Andreas Krebbel  <krebbel@linux.ibm.com>

PR target/85295
* gcc.target/s390/TI-constants-lra.c: New testcase.
* gcc.target/s390/TI-constants-nolra.c: New testcase.

From-SVN: r263396

6 years agoS/390: Fix whitespace problems in the backend
Andreas Krebbel [Wed, 8 Aug 2018 11:35:45 +0000 (11:35 +0000)]
S/390: Fix whitespace problems in the backend

2018-08-08  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/s390.c: Fix whitespace damage throughout the file.
* config/s390/s390.h: Likewise.
* config/s390/tpf.h: Likewise.

From-SVN: r263395

6 years agoS/390: Remove TARGET_CPU_ZARCH
Ilya Leoshkevich [Wed, 8 Aug 2018 11:25:31 +0000 (11:25 +0000)]
S/390: Remove TARGET_CPU_ZARCH

TARGET_CPU_ZARCH allowed to distinguish between g5/g6 and newer
machines.  Since the former are now gone, we can assume that
TARGET_CPU_ZARCH is always true.  As a side-effect, branch splitting
is now completely gone.  Some parts of literal pool splitting are also
gone, but it's still there: we need to support it because floating
point and vector instructions still cannot use relative addressing.

gcc/ChangeLog:

2018-08-08  Ilya Leoshkevich  <iii@linux.ibm.com>

* config/s390/s390.c (s390_loadrelative_operand_p):
        Remove TARGET_CPU_ZARCH usages.
(s390_rtx_costs): Likewise.
(s390_legitimate_constant_p): Likewise.
(s390_cannot_force_const_mem): Likewise.
(legitimate_reload_constant_p): Likewise.
(s390_preferred_reload_class): Likewise.
(legitimize_pic_address): Likewise.
(legitimize_tls_address): Likewise.
(s390_split_branches): Removed.
(s390_add_execute): Removed.
(s390_dump_pool): Remove TARGET_CPU_ZARCH usages.
(s390_mainpool_start): Likewise.
(s390_mainpool_finish): Likewise.
(s390_mainpool_cancel): Removed.
(s390_chunkify_start): Remove TARGET_CPU_ZARCH usages.
(s390_chunkify_cancel): Likewise.
(s390_return_addr_rtx): Likewise.
(s390_register_info): Remove split_branches_pending_p uages.
(s390_optimize_register_info): Likewise.
(s390_init_frame_layout): Remove TARGET_CPU_ZARCH and
        split_branches_pending_p usages.
(s390_can_eliminate): Remove TARGET_CPU_ZARCH usages.
(s390_load_got): Likewise.
(s390_expand_split_stack_prologue): Likewise.
(output_asm_nops): Likewise.
(s390_function_profiler): Likewise.
(s390_emit_call): Likewise.
(s390_conditional_register_usage): Likewise.
(s390_optimize_prologue): Likewise.
(s390_reorg): Remove TARGET_CPU_ZARCH and
        split_branches_pending_p usages.
(s390_option_override_internal): Remove TARGET_CPU_ZARCH
        usages.
(s390_output_indirect_thunk_function): Likewise.
* config/s390/s390.h (TARGET_CPU_ZARCH): Removed.
(TARGET_CPU_ZARCH_P): Removed.
(struct machine_function): Remove split_branches_pending_p.
* config/s390/s390.md: Remove TARGET_CPU_ZARCH usages.

From-SVN: r263394

6 years agoS/390: Remove support for g5 and g6 machines
Ilya Leoshkevich [Wed, 8 Aug 2018 10:55:56 +0000 (10:55 +0000)]
S/390: Remove support for g5 and g6 machines

g5 and g6 were deprecated since gcc 6.1.0 (commit 3bd8520f).

gcc/ChangeLog:

2018-08-08  Ilya Leoshkevich  <iii@linux.ibm.com>

* common/config/s390/s390-common.c (processor_flags_table):
        Remove flags.
* config.gcc: Remove with_arch/with_tune support.
* config/s390/2064.md: Remove cpu attribute comparisons.
* config/s390/driver-native.c (s390_host_detect_local_cpu):
        Remove MTN.
* config/s390/linux.h (ASM_SPEC):
        Remove -march support.
* config/s390/s390-c.c (s390_cpu_cpp_builtins_internal):
        Use a table to get an arch level.
* config/s390/s390-opts.h (enum processor_type):
        Remove enum values.
* config/s390/s390.c
        (processor_table): Remove entries, add arch_level values.
        (s390_issue_rate): Remove cases.
        (s390_option_override): Adjust
        s390_option_override_internal() call.
(s390_option_override_internal): Remove deprecation warning.
        (s390_valid_target_attribute_tree): Adjust
        s390_option_override_internal() call.
* config/s390/s390.h (struct s390_processor):
        Share with s390-c.c, add arch_level field.
* config/s390/s390.md:
        Remove occurrences in cpu attribute.
* config/s390/s390.opt: Remove -march/-mtune support.
* config/s390/tpf.h (ASM_SPEC): Remove -march support.
* doc/invoke.texi: Remove deprecation warning.

gcc/testsuite/ChangeLog:

2018-08-08  Ilya Leoshkevich  <iii@linux.ibm.com>

* gcc.target/s390/hotpatch-8.c: Remove.
* gcc.target/s390/hotpatch-9.c: Remove.
* gcc.target/s390/mnop-mcount-m31-fpic.c: Remove.
* gcc.target/s390/mnop-mcount-m31.c: Remove.

From-SVN: r263393

6 years agoP0595R1 - is_constant_evaluated
Jakub Jelinek [Wed, 8 Aug 2018 09:00:51 +0000 (11:00 +0200)]
P0595R1 - is_constant_evaluated

P0595R1 - is_constant_evaluated
cp/
* cp-tree.h (enum cp_built_in_function): New.
(maybe_constant_init): Add pretend_const_required argument.
* typeck2.c (store_init_value): Pass true as new argument to
maybe_constant_init.
* constexpr.c (constexpr_fn_retval): Check also DECL_BUILT_IN_CLASS
for BUILT_IN_UNREACHABLE.
(struct constexpr_ctx): Add pretend_const_required field.
(cxx_eval_builtin_function_call): Use DECL_IS_BUILTIN_CONSTANT_P
macro.  Handle CP_BUILT_IN_IS_CONSTANT_EVALUATED.  Check also
DECL_BUILT_IN_CLASS for BUILT_IN_UNREACHABLE.
(cxx_eval_outermost_constant_expr): Add pretend_const_required
argument, initialize pretend_const_required field in ctx.  If the
result is TREE_CONSTANT and non_constant_p, retry with
pretend_const_required false if it was true.
(is_sub_constant_expr): Initialize pretend_const_required_field in
ctx.
(cxx_constant_value): Pass true as pretend_const_required to
cxx_eval_outermost_constant_expr.
(maybe_constant_value): Pass false as pretend_const_required to
cxx_eval_outermost_constant_expr.
(fold_non_dependent_expr): Likewise.
(maybe_constant_init_1): Add pretend_const_required argument, pass it
down to cxx_eval_outermost_constant_expr.  Pass !allow_non_constant
instead of false as strict to cxx_eval_outermost_constant_expr.
(maybe_constant_init): Add pretend_const_required argument, pass it
down to maybe_constant_init_1.
(cxx_constant_init): Pass true as pretend_const_required to
maybe_constant_init_1.
* cp-gimplify.c (cp_gimplify_expr): Handle CALL_EXPRs to
CP_BUILT_IN_IS_CONSTANT_EVALUATED.
(cp_fold): Don't fold CP_BUILT_IN_IS_CONSTANT_EVALUATED calls.
* decl.c: Include langhooks.h.
(cxx_init_decl_processing): Register __builtin_is_constant_evaluated
built-in.
* tree.c (builtin_valid_in_constant_expr_p): Return true for
CP_BUILT_IN_IS_CONSTANT_EVALUATED.
* pt.c (declare_integer_pack): Initialize DECL_FUNCTION_CODE.
testsuite/
* g++.dg/cpp2a/is-constant-evaluated1.C: New test.

From-SVN: r263392

6 years agore PR c++/86836 (internal compiler error on structured bindings with shadow parameter...
Jakub Jelinek [Wed, 8 Aug 2018 08:32:51 +0000 (10:32 +0200)]
re PR c++/86836 (internal compiler error on structured bindings with shadow parameter on templated function)

PR c++/86836
* pt.c (tsubst_expr): For structured bindings, call tsubst_decomp_names
before tsubst_init, not after it.

* g++.dg/cpp1z/decomp46.C: New test.

From-SVN: r263391

6 years agore PR c++/86738 (gcc 8.2: Internal compiler error memcpy)
Jakub Jelinek [Wed, 8 Aug 2018 08:31:40 +0000 (10:31 +0200)]
re PR c++/86738 (gcc 8.2: Internal compiler error memcpy)

PR c++/86738
* constexpr.c (cxx_eval_binary_expression): For arithmetics involving
NULL pointer set *non_constant_p to true.
(cxx_eval_component_reference): For dereferencing of a NULL pointer,
set *non_constant_p to true and return t.

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

From-SVN: r263390

6 years ago[AArch64, Falkor] Switch to using Falkor-specific vector costs.
Luis Machado [Wed, 8 Aug 2018 07:54:14 +0000 (07:54 +0000)]
[AArch64, Falkor] Switch to using Falkor-specific vector costs.

The adjusted vector costs give Falkor a reasonable boost in performance for FP
benchmarks (both CPU2017 and CPU2006) and doesn't change INT benchmarks that
much. There are some regressions that will be investigated as follow on work.

Numbers from the CI run:

CPU2017:

(R) 605.mcf_s: -1.8%
(R) 620.omnetpp_s: -2%
    623.xalancbmk_s: 2%
    654.roms_s: 7%

(R) INT mean: -0.09%
    FP mean: 0.70%

CPU2006:

(R) 429.mc: -5%
(R) 471.omnetpp: -9.5% (potentially noise/fluctuations)
    483.xalancbmk: 6.02%
    410.bwaves: 5.03%
    433.milc: 2%
    434.zeusmp: 10.5%
(R) 436.cactusADM: -12.75%
    437.leslie3d: 5.94%
(R) 453.povray: -0.82%
    459.GemsFDTD: 16.87%
    465.tonto: 1%

(R) INT mean: -0.79%
    FP mean: 1.54%

gcc/ChangeLog:

2018-08-08  Luis Machado  <luis.machado@linaro.org>

* config/aarch64/aarch64.c (qdf24xx_vector_cost): New static global.
(qdf24xx_tunings): Set vector cost structure to qdf24xx_vector_cost.

From-SVN: r263389

6 years ago[aarch64] Adjust Falkor's sign extend reg+reg address cost
Luis Machado [Wed, 8 Aug 2018 07:45:11 +0000 (07:45 +0000)]
[aarch64] Adjust Falkor's sign extend reg+reg address cost

Adjust Falkor's register_sextend cost from 4 to 3.  This fixes a testsuite
failure in gcc.target/aarch64/extend.c:ldr_sxtw where GCC was generating
a sbfiz instruction rather than a load with sign extension.

No performance changes.

gcc/ChangeLog:

2018-08-08  Luis Machado  <luis.machado@linaro.org>

* config/aarch64/aarch64.c (qdf24xx_addrcost_table)
<register_sextend>: Set to 3.

From-SVN: r263388

6 years agoDaily bump.
GCC Administrator [Wed, 8 Aug 2018 00:16:28 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263387

6 years ago[OpenACC] cleanup trans-stmt.h
Cesar Philippidis [Tue, 7 Aug 2018 22:18:36 +0000 (15:18 -0700)]
[OpenACC] cleanup trans-stmt.h

gcc/fortran/
* trans-stmt.h: Remove stale reference to trans-openacc.c.

From-SVN: r263372

6 years ago[PATCH] Line map table allocation
Nathan Sidwell [Tue, 7 Aug 2018 21:28:51 +0000 (21:28 +0000)]
[PATCH] Line map table allocation

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00434.html
* line-map.c: (linemap_init): Set default allocator here.
(new_linemap): Rather than here.  Refactor allocation logic.

From-SVN: r263366

6 years agoPR libstdc++/86874 fix std::variant::swap regression
Jonathan Wakely [Tue, 7 Aug 2018 19:13:26 +0000 (20:13 +0100)]
PR libstdc++/86874 fix std::variant::swap regression

PR libstdc++/86874
* include/std/variant (_Copy_ctor_base::_M_destructive_move): Define
here instead of in _Move_assign_base.
(_Copy_ctor_base<true, _Types...>::_M_destructive_move): Define.
(_Copy_assign_base::operator=): Use _M_destructive_move when changing
the contained value to another alternative.
(_Move_assign_base::operator=): Likewise.
(_Move_assign_base::_M_destructive_move): Remove.
* testsuite/20_util/variant/86874.cc: New test.

From-SVN: r263365

6 years agoruntime: use poll rather than pollset for netpoll on AIX
Ian Lance Taylor [Tue, 7 Aug 2018 17:29:50 +0000 (17:29 +0000)]
runtime: use poll rather than pollset for netpoll on AIX

    Updates golang/go#26634

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

From-SVN: r263364

6 years agolibgo: uncomment trace.Stop() call in testing package
Ian Lance Taylor [Tue, 7 Aug 2018 17:28:22 +0000 (17:28 +0000)]
libgo: uncomment trace.Stop() call in testing package

    Fix up the testing package to insure that execution traces
    work properly (e.g. "-test.trace=<XXX>" command line option). The
    call to stop tracing and emit the output file was stubbed out.

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

From-SVN: r263363

6 years ago[AArch64] Fix -mlow-precision-div (PR 86838)
Richard Sandiford [Tue, 7 Aug 2018 17:22:19 +0000 (17:22 +0000)]
[AArch64] Fix -mlow-precision-div (PR 86838)

The "@" handling broke -mlow-precision-div, because the scalar forms of
the instruction were provided by a pattern that also provided FRECPX
(and so were parameterised on an unspec code as well as a mode),
while the SIMD versions had a dedicated FRECPE pattern.  This patch
moves the scalar FRECPE handling to the SIMD pattern too (as for FRECPS)
and uses a separate pattern for FRECPX.

The convention in aarch64-simd-builtins.def seemed to be to add
comments only if the mapping wasn't obvious (i.e. not just sticking
"aarch64_" on the beginning and "<mode>" on the end), so the patch
deletes the reference to the combined pattern instead of rewording it.

There didn't seem to be any coverage of -mlow-precision-div in the
testsuite, so the patch adds some tests for it.

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

gcc/
PR target/86838
* config/aarch64/iterators.md (FRECP, frecp_suffix): Delete.
* config/aarch64/aarch64-simd.md
(aarch64_frecp<FRECP:frecp_suffix><mode>): Fold FRECPE into...
(@aarch64_frecpe<mode>): ...here and the move FRECPX to...
(aarch64_frecpx<mode>): ...this new pattern.
* config/aarch64/aarch64-simd-builtins.def: Remove comment
about aarch64_frecp<FRECP:frecp_suffix><mode>.

gcc/testsuite/
PR target/86838
* gcc.target/aarch64/frecpe_1.c: New test.
* gcc.target/aarch64/frecpe_2.c: Likewise.

From-SVN: r263362

6 years agoPR c++/59480, DR 136
Paolo Carlini [Tue, 7 Aug 2018 16:40:18 +0000 (16:40 +0000)]
PR c++/59480, DR 136

/cp
2018-08-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59480, DR 136
* decl.c (check_no_redeclaration_friend_default_args): New.
(duplicate_decls): Use the latter; also check that a friend
declaration specifying default arguments is a definition.

/testsuite
2018-08-07  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/59480, DR 136
* g++.dg/other/friend8.C: New.
* g++.dg/other/friend9.C: Likewise.
* g++.dg/other/friend10.C: Likewise.
* g++.dg/other/friend11.C: Likewise.
* g++.dg/other/friend12.C: Likewise.
* g++.dg/other/friend13.C: Likewise.
* g++.dg/other/friend14.C: Likewise.
* g++.dg/other/friend15.C: Likewise.
* g++.dg/parse/defarg4.C: Compile with -fpermissive -w.
* g++.dg/parse/defarg8.C: Likewise.

From-SVN: r263361

6 years agoPR libstdc++/86861 Meet precondition for Solaris memalign
Jonathan Wakely [Tue, 7 Aug 2018 16:10:29 +0000 (17:10 +0100)]
PR libstdc++/86861 Meet precondition for Solaris memalign

Solaris memalign requires alignment to be at least sizeof(int), so
increase it as needed.

Also move the check for valid alignments from the fallback
implementation of aligned_alloc into operator new, as it's required for
all of aligned_alloc, memalign, posix_memalign and __aligned_malloc.
This adds a branch to check for undefined behaviour which we could just
ignore, so the check could just be removed. It should certainly be
removed if PR 86878 is implemented to issue a warning about calls with
invalid alignments.

PR libstdc++/86861
* libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] (aligned_alloc):
Replace macro with inline function.
[__sun]: Increase alignment to meet memalign precondition.
[!HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN]
(aligned_alloc): Move check for valid alignment to operator new.
Remove redundant check for non-zero size, it's enforced by the caller.
(operator new): Move check for valid alignment here. Use
__builtin_expect on check for zero size.

From-SVN: r263360

6 years agoFix PR number for HPPA speculation patch: PR target/86807 -> PR target/86785
Richard Earnshaw [Tue, 7 Aug 2018 14:33:09 +0000 (14:33 +0000)]
Fix PR number for HPPA speculation patch: PR target/86807 ->  PR target/86785

This just fixes the PR number in the ChangeLog.  Nothing we can do
about the SVN history.

From-SVN: r263358

6 years agore PR c++/79133 (lambda capture shadowing parameter & decltype confusion)
Ville Voutilainen [Tue, 7 Aug 2018 13:46:16 +0000 (16:46 +0300)]
re PR c++/79133 (lambda capture shadowing parameter & decltype confusion)

PR c++/79133

gcc/cp/

PR c++/79133
* name-lookup.c (check_local_shadow): Reject captures and parameters
with the same name.

testsuite/

PR c++/79133
* g++.dg/cpp0x/lambda/lambda-shadow3.C: New.
* g++.dg/cpp1y/lambda-generic-variadic18.C: Likewise.

From-SVN: r263357

6 years agoAdd malloc predictor (PR middle-end/83023).
Martin Liska [Tue, 7 Aug 2018 11:59:13 +0000 (13:59 +0200)]
Add malloc predictor (PR middle-end/83023).

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

        PR middle-end/83023
* predict.c (expr_expected_value_1): Handle DECL_IS_MALLOC,
        BUILT_IN_REALLOC and DECL_IS_OPERATOR_NEW.
* predict.def (PRED_MALLOC_NONNULL): New predictor.
* doc/extend.texi: Document that malloc attribute adds
        hit to compiler.
2018-08-07  Martin Liska  <mliska@suse.cz>

        PR middle-end/83023
* gcc.dg/predict-16.c: New test.
* g++.dg/predict-1.C: New test.

From-SVN: r263355

6 years agoDefine monotonic_buffer_resource members out-of-line
Jonathan Wakely [Tue, 7 Aug 2018 11:31:16 +0000 (12:31 +0100)]
Define monotonic_buffer_resource members out-of-line

Move the allocation logic into libstdc++.so so that it can be changed
without worrying about inlined code in existing binaries.

Leave do_allocate inline so that calls to it can be devirtualized, and
only the slow path needs to call into the library.

* config/abi/pre/gnu.ver: Export monotonic_buffer_resource members.
* include/std/memory_resource (monotonic_buffer_resource::release):
Call _M_release_buffers to free buffers.
(monotonic_buffer_resource::do_allocate): Call _M_new_buffer to
allocate a new buffer from upstream.
(monotonic_buffer_resource::_M_new_buffer): Declare.
(monotonic_buffer_resource::_M_release_buffers): Declare.
(monotonic_buffer_resource::_Chunk): Replace definition with
declaration as opaque type.
* src/c++17/memory_resource.cc (monotonic_buffer_resource::_Chunk):
Define.
(monotonic_buffer_resource::_M_new_buffer): Define.
(monotonic_buffer_resource::_M_release_buffers): Define.

From-SVN: r263354

6 years agoFix gcc.dg/vect/no-section-anchors-vect-69.c on SPARC etc. (PR tree-optimization...
Steve Ellcey [Tue, 7 Aug 2018 08:51:29 +0000 (08:51 +0000)]
Fix gcc.dg/vect/no-section-anchors-vect-69.c on SPARC etc. (PR tree-optimization/80925)

2018-08-07  Steve Ellcey  <sellcey@cavium.com>
    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

PR tree-optimization/80925
* gcc.dg/vect/no-section-anchors-vect-69.c: Expect 3 loops
vectorized on !vect_hw_misalign targets.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
From-SVN: r263352

6 years agoAdd missing gcc-interface/ to 2018-07-31 ChangeLog entry
Alexandre Oliva [Tue, 7 Aug 2018 05:54:11 +0000 (05:54 +0000)]
Add missing gcc-interface/ to 2018-07-31 ChangeLog entry

From-SVN: r263351

6 years agoDaily bump.
GCC Administrator [Tue, 7 Aug 2018 00:16:33 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263350

6 years ago[libgomp, nvptx] Handle CUDA_ONE_CALL_MAYBE_NULL
Tom de Vries [Mon, 6 Aug 2018 22:13:56 +0000 (22:13 +0000)]
[libgomp, nvptx] Handle CUDA_ONE_CALL_MAYBE_NULL

This patch adds handling of functions that may not be present in the cuda
driver.

Such a function can be declared using CUDA_ONE_CALL_MAYBE_NULL in cuda-lib.def,
it can be called with the usual convenience macros, but before calling its
presence needs to be tested using new macro CUDA_CALL_EXISTS.

When using the dlopen interface (PLUGIN_NVPTX_DYNAMIC == 1), we allow
non-present functions by allowing dlsym to return NULL.  Otherwise
(PLUGIN_NVPTX_DYNAMIC == 0) we declare the non-present function to be weak.

Build and reg-tested libgomp on x86_64 with nvidia accelerator, with and without
--disable-cuda-driver, in combination with a trigger patch that adds a
non-existing function foo to cuda-lib.def:
...
CUDA_ONE_CALL_MAYBE_NULL (foo)
...
and declares it in plugin-nvptx.c:
...
CUresult foo (void);
...
and then uses it in nvptx_init after the init_cuda_lib call:
...
  if (CUDA_CALL_EXISTS (foo))
    CUDA_CALL (foo);
...

Also build and reg-tested on x86_64 with nvidia accelerator, with and without
--disable-cuda-driver, in combination with a trigger patch that replaces all
CUDA_ONE_CALLs in cuda-lib.def with CUDA_ONE_CALL_MAYBE_NULL, and guards two
CUDA_CALLs with CUDA_CALL_EXISTS, one for a regular fn, and one for a fn that is
a define in cuda/cuda.h.

2018-08-07  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c (DO_PRAGMA): Define.
(struct cuda_lib_s): Add def/undef of CUDA_ONE_CALL_MAYBE_NULL.
(init_cuda_lib): Add new param to CUDA_ONE_CALL_1.  Add arg to
corresponding call in CUDA_ONE_CALL.  Add def/undef of
CUDA_ONE_CALL_MAYBE_NULL.
(CUDA_CALL_EXISTS): Define.

From-SVN: r263346

6 years ago[libgomp, nvptx] Minimize lifetime of CUDA_ONE_CALL defines
Tom de Vries [Mon, 6 Aug 2018 22:13:46 +0000 (22:13 +0000)]
[libgomp, nvptx] Minimize lifetime of CUDA_ONE_CALL defines

This patch makes sure that the lifetimes of the CUDA_ONE_CALL macro (which is
defined twice in plugin-nvptx.c) are minimized, to make it obvious that the
definitions are used only in the lib-cuda.def include.

Build on x86_64 with nvptx accelerator and reg-tested libgomp.

2018-08-07  Tom de Vries  <tdevries@suse.de>

* plugin/plugin-nvptx.c (struct cuda_lib_s, init_cuda_lib): Put
CUDA_ONE_CALL defines right before the cuda-lib.def include, and the
corresponding undefs right after.

From-SVN: r263345

6 years agore PR target/86807 (spu port needs updating for CVE-2017-5753)
John David Anglin [Mon, 6 Aug 2018 21:47:54 +0000 (21:47 +0000)]
re PR target/86807 (spu port needs updating for CVE-2017-5753)

PR target/86807
* config/pa/pa.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

From-SVN: r263344

6 years agotree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Pass down the vr_values instance...
Jeff Law [Mon, 6 Aug 2018 20:13:20 +0000 (14:13 -0600)]
tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Pass down the vr_values instance to cprop_into_stmt.

* tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Pass down
the vr_values instance to cprop_into_stmt.
(cprop_into_stmt): Pass vr_values instance down to cprop_operand.
(cprop_operand): Also query EVRP to determine if OP is a constant.

From-SVN: r263342

6 years ago[PATCH] Diagnostic included-from loop
Nathan Sidwell [Mon, 6 Aug 2018 16:52:38 +0000 (16:52 +0000)]
[PATCH] Diagnostic included-from loop

https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00416.html
* diagnostic.c (diagnostic_report_current_module): Reroll
included-at loop.  Translate text.

From-SVN: r263341

6 years agore PR c++/86767 (continue statements in constexpr functions causes unbounded looping)
Marek Polacek [Mon, 6 Aug 2018 16:46:13 +0000 (16:46 +0000)]
re PR c++/86767 (continue statements in constexpr functions causes unbounded looping)

PR c++/86767
* constexpr.c (cxx_eval_statement_list): Handle continue.

* g++.dg/cpp1y/constexpr-86767.C: New test.

From-SVN: r263340

6 years agoFix memory leak in selftest::test_expansion_to_rtl
David Malcolm [Mon, 6 Aug 2018 16:25:27 +0000 (16:25 +0000)]
Fix memory leak in selftest::test_expansion_to_rtl

"make selftest-valgrind" shows:

187 bytes in 1 blocks are definitely lost in loss record 567 of 669
    at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x1F08260: xcalloc (xmalloc.c:162)
    by 0xB24F32: init_emit() (emit-rtl.c:5843)
    by 0xC10080: prepare_function_start() (function.c:4803)
    by 0xC10254: init_function_start(tree_node*) (function.c:4877)
    by 0x1CDF92A: selftest::test_expansion_to_rtl() (function-tests.c:595)
    by 0x1CE007C: selftest::function_tests_c_tests() (function-tests.c:676)
    by 0x1E010E7: selftest::run_tests() (selftest-run-tests.c:98)
    by 0x1062D1E: toplev::run_self_tests() (toplev.c:2225)
    by 0x1062F40: toplev::main(int, char**) (toplev.c:2303)
    by 0x1E5B90A: main (main.c:39)

The allocation in question is:

  crtl->emit.regno_pointer_align
    = XCNEWVEC (unsigned char, crtl->emit.regno_pointer_align_length);

This patch fixes this leak (and makes the output of
"make selftest-valgrind" clean) by calling free_after_compilation at the
end of the selftest in question.

gcc/ChangeLog:
* function-tests.c (selftest::test_expansion_to_rtl): Call
free_after_compilation.

From-SVN: r263339

6 years agopr86763.C (dg-additional-options): Add -lrt for target *-*-linux-gnu.
Uros Bizjak [Mon, 6 Aug 2018 15:49:05 +0000 (17:49 +0200)]
pr86763.C (dg-additional-options): Add -lrt for target *-*-linux-gnu.

* g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt
for target *-*-linux-gnu.

From-SVN: r263338

6 years agoEnable clobber high for tls descs on Aarch64
Alan Hayward [Mon, 6 Aug 2018 15:33:00 +0000 (15:33 +0000)]
Enable clobber high for tls descs on Aarch64

gcc/
* config/aarch64/aarch64.md: Add clobber highs to tls_desc.

gcc/testsuite/
* gcc.target/aarch64/sve/tls_preserve_1.c: New test.
* gcc.target/aarch64/sve/tls_preserve_2.c: New test.
* gcc.target/aarch64/sve/tls_preserve_3.c: New test.

From-SVN: r263337

6 years agoS/390: Don't unroll memory blk op loops
Andreas Krebbel [Mon, 6 Aug 2018 15:01:00 +0000 (15:01 +0000)]
S/390: Don't unroll memory blk op loops

gcc/ChangeLog:

2018-08-06  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/s390.c (s390_loop_unroll_adjust): Prevent small
loops with memory block operations from getting unrolled.

gcc/testsuite/ChangeLog:

2018-08-06  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/nomemloopunroll-1.c: New test.

From-SVN: r263336

6 years ago[spu, commit] Define TARGET_HAVE_SPECULATION_SAFE_VALUE
Ulrich Weigand [Mon, 6 Aug 2018 14:40:56 +0000 (14:40 +0000)]
[spu, commit] Define TARGET_HAVE_SPECULATION_SAFE_VALUE

The SPU processor is not affected by speculation, so this macro can
safely be defined as speculation_safe_value_not_needed.

gcc/ChangeLog:

PR target/86807
* config/spu/spu.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
Define to speculation_safe_value_not_needed.

From-SVN: r263335

6 years agoreload1.c (forget_old_reloads_1): Adjust CLOBBER_HIGH assert.
Jeff Law [Mon, 6 Aug 2018 13:49:10 +0000 (07:49 -0600)]
reload1.c (forget_old_reloads_1): Adjust CLOBBER_HIGH assert.

* reload1.c (forget_old_reloads_1): Adjust CLOBBER_HIGH
assert.

From-SVN: r263333

6 years agore PR target/86662 (msp430-elf segfault with -flto and -mlarge)
Jozef Lawrynowicz [Mon, 6 Aug 2018 10:29:17 +0000 (10:29 +0000)]
re PR target/86662 (msp430-elf segfault with -flto and -mlarge)

PR target/86662

        * gcc/tree.c (build_common_tree_nodes): Initialize integer_types array
        with all enabled __intN types.

        * gcc/testsuite/gcc.target/msp430/pr86662.c: New test.

From-SVN: r263332

6 years agoRemaining support for clobber high
Alan Hayward [Mon, 6 Aug 2018 09:57:03 +0000 (09:57 +0000)]
Remaining support for clobber high

gcc/
* alias.c (record_set): Check for clobber high.
* cfgexpand.c (expand_gimple_stmt): Likewise.
* combine-stack-adj.c (single_set_for_csa): Likewise.
* combine.c (find_single_use_1): Likewise.
(set_nonzero_bits_and_sign_copies): Likewise.
(get_combine_src_dest): Likewise.
(is_parallel_of_n_reg_sets): Likewise.
(try_combine): Likewise.
(record_dead_and_set_regs_1): Likewise.
(reg_dead_at_p_1): Likewise.
(reg_dead_at_p): Likewise.
* dce.c (deletable_insn_p): Likewise.
(mark_nonreg_stores_1): Likewise.
(mark_nonreg_stores_2): Likewise.
* df-scan.c (df_find_hard_reg_defs): Likewise.
(df_uses_record): Likewise.
(df_get_call_refs): Likewise.
* dwarf2out.c (mem_loc_descriptor): Likewise.
* haifa-sched.c (haifa_classify_rtx): Likewise.
* ira-build.c (create_insn_allocnos): Likewise.
* ira-costs.c (scan_one_insn): Likewise.
* ira.c (equiv_init_movable_p): Likewise.
(rtx_moveable_p): Likewise.
(interesting_dest_for_shprep): Likewise.
* jump.c (mark_jump_label_1): Likewise.
* postreload-gcse.c (record_opr_changes): Likewise.
* postreload.c (reload_cse_simplify): Likewise.
(struct reg_use): Add source expr.
(reload_combine): Check for clobber high.
(reload_combine_note_use): Likewise.
(reload_cse_move2add): Likewise.
(move2add_note_store): Likewise.
* print-rtl.c (print_pattern): Likewise.
* recog.c (decode_asm_operands): Likewise.
(store_data_bypass_p): Likewise.
(if_test_bypass_p): Likewise.
* regcprop.c (kill_clobbered_value): Likewise.
(kill_set_value): Likewise.
* reginfo.c (reg_scan_mark_refs): Likewise.
* reload1.c (maybe_fix_stack_asms): Likewise.
(eliminate_regs_1): Likewise.
(elimination_effects): Likewise.
(mark_not_eliminable): Likewise.
(scan_paradoxical_subregs): Likewise.
(forget_old_reloads_1): Likewise.
* reorg.c (find_end_label): Likewise.
(try_merge_delay_insns): Likewise.
(redundant_insn): Likewise.
(own_thread_p): Likewise.
(fill_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(dbr_schedule): Likewise.
* resource.c (update_live_status): Likewise.
(mark_referenced_resources): Likewise.
(mark_set_resources): Likewise.
* rtl.c (copy_rtx): Likewise.
* rtlanal.c (reg_referenced_p): Likewise.
(single_set_2): Likewise.
(noop_move_p): Likewise.
(note_stores): Likewise.
* sched-deps.c (sched_analyze_reg): Likewise.
(sched_analyze_insn): Likewise.

From-SVN: r263331

6 years agocse support for clobber_high
Alan Hayward [Mon, 6 Aug 2018 09:54:28 +0000 (09:54 +0000)]
cse support for clobber_high

gcc/
* cse.c (invalidate_reg): New function extracted from...
(invalidate): ...here.
(canonicalize_insn): Check for clobber high.
(invalidate_from_clobbers): invalidate clobber highs.
(invalidate_from_sets_and_clobbers): Likewise.
(count_reg_usage): Check for clobber high.
(insn_live_p): Likewise.
* cselib.c (cselib_expand_value_rtx_1):Likewise.
(cselib_invalidate_regno): Check for clobber in setter.
(cselib_invalidate_rtx): Pass through setter.
(cselib_invalidate_rtx_note_stores):
(cselib_process_insn): Check for clobber high.
* cselib.h (cselib_invalidate_rtx): Add operand.

From-SVN: r263330

6 years agolra support for clobber_high
Alan Hayward [Mon, 6 Aug 2018 09:51:01 +0000 (09:51 +0000)]
lra support for clobber_high

gcc/
* lra-eliminations.c (lra_eliminate_regs_1): Check for clobber high.
(mark_not_eliminable): Likewise.
* lra-int.h (struct lra_insn_reg): Add clobber high marker.
* lra-lives.c (process_bb_lives): Check for clobber high.
* lra.c (new_insn_reg): Remember clobber highs.
(collect_non_operand_hard_regs): Check for clobber high.
(lra_set_insn_recog_data): Likewise.
(add_regs_to_insn_regno_info): Likewise.
(lra_update_insn_regno_info): Likewise.

From-SVN: r263329

6 years agoAdd func to check if register is clobbered by clobber_high
Alan Hayward [Mon, 6 Aug 2018 09:38:29 +0000 (09:38 +0000)]
Add func to check if register is clobbered by clobber_high

gcc/
* rtl.h (reg_is_clobbered_by_clobber_high): Add declarations.
* rtlanal.c (reg_is_clobbered_by_clobber_high): Add function.

From-SVN: r263328

6 years agoGeneration support for CLOBBER_HIGH
Alan Hayward [Mon, 6 Aug 2018 09:16:24 +0000 (09:16 +0000)]
Generation support for CLOBBER_HIGH

Ensure clobber high is a register expression.
Info is passed through for the error case.

gcc/
* emit-rtl.c (verify_rtx_sharing): Check for CLOBBER_HIGH.
(copy_insn_1): Likewise.
(gen_hard_reg_clobber_high): New gen function.
* genconfig.c (walk_insn_part): Check for CLOBBER_HIGH.
* genemit.c (gen_exp): Likewise.
(gen_emit_seq): Pass through info.
(gen_insn): Check for CLOBBER_HIGH.
(gen_expand): Pass through info.
(gen_split): Likewise.
(output_add_clobbers): Likewise.
* genrecog.c (validate_pattern): Check for CLOBBER_HIGH.
(remove_clobbers): Likewise.
* rtl.h (gen_hard_reg_clobber_high): New declaration.

From-SVN: r263327

6 years agoAdd CLOBBER_HIGH expression
Alan Hayward [Mon, 6 Aug 2018 09:07:57 +0000 (09:07 +0000)]
Add CLOBBER_HIGH expression

Includes documentation.

2018-08-06  Alan Hayward  <alan.hayward@arm.com>

* doc/rtl.texi (clobber_high): Add.
(parallel): Add in clobber high
* rtl.c (rtl_check_failed_code3): Add function.
* rtl.def (CLOBBER_HIGH): Add expression.
* rtl.h (RTL_CHECKC3): Add macro.
(rtl_check_failed_code3): Add declaration.
(XC3EXP): Add macro.

From-SVN: r263326

6 years agoMAINTAINERS: Update my email address.
Naveen H.S [Mon, 6 Aug 2018 07:22:57 +0000 (07:22 +0000)]
MAINTAINERS: Update my email address.

* MAINTAINERS: Update my email address.

From-SVN: r263325

6 years agoDaily bump.
GCC Administrator [Mon, 6 Aug 2018 00:16:32 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r263324

6 years agolibbacktrace: Suppress the default action-if-found for AC_CHECK_LIBS.
Iain Buclaw [Sun, 5 Aug 2018 20:24:59 +0000 (20:24 +0000)]
libbacktrace: Suppress the default action-if-found for AC_CHECK_LIBS.

Zlib is not a dependency of libbacktrace, and so it shouldn't be added
to LIBS.

libbacktrace/

* configure.ac: Move define of HAVE_ZLIB into check for -lz.
* Makefile.in: Regenerate.
* config.h.in: Likewise.
* configure: Likewise.

From-SVN: r263320

6 years agostl_iterator.h: Fix comment.
François Dumont [Sun, 5 Aug 2018 15:33:58 +0000 (15:33 +0000)]
stl_iterator.h: Fix comment.

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

* include/bits/stl_iterator.h: Fix comment.

From-SVN: r263318

6 years agoi386: Set cfun->machine->max_used_stack_alignment if needed
H.J. Lu [Sun, 5 Aug 2018 12:46:13 +0000 (12:46 +0000)]
i386: Set cfun->machine->max_used_stack_alignment if needed

cfun->machine->max_used_stack_alignment is used to decide how stack frame
should be aligned.  This is independent of any psABIs nor 32-bit vs 64-bit.
It is always safe to compute max_used_stack_alignment.  We compute it only
if 128-bit aligned load/store may be generated on misaligned stack slot
which will lead to segfault.

gcc/

PR target/86386
* config/i386/i386.c (ix86_finalize_stack_frame_flags): Set
cfun->machine->max_used_stack_alignment if needed.

gcc/testsuite/

PR target/86386
* gcc.target/i386/pr86386.c: New file.

From-SVN: r263317

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

From-SVN: r263316

6 years agoPR tree-optimization/86571 - AIX NaNQ and NaNS output format conflicts with __builtin...
Martin Sebor [Sat, 4 Aug 2018 22:14:41 +0000 (22:14 +0000)]
PR tree-optimization/86571 - AIX NaNQ and NaNS output format conflicts with __builtin_sprintf

gcc/ChangeLog:

PR tree-optimization/86571
* gimple-ssa-sprintf.c (format_floating): Extend upper bound of
NaN output to 4.

From-SVN: r263312

6 years ago[testsuite, guality] Use absolute line number in pass/fail line
Tom de Vries [Sat, 4 Aug 2018 21:42:53 +0000 (21:42 +0000)]
[testsuite, guality] Use absolute line number in pass/fail line

2018-08-04  Tom de Vries  <tdevries@suse.de>

* lib/gcc-gdb-test.exp: Use absolute line number in pass/fail line.

From-SVN: r263311

6 years ago[libgomp, nvptx, --without-cuda-driver] Don't use system cuda driver
Tom de Vries [Sat, 4 Aug 2018 20:07:22 +0000 (20:07 +0000)]
[libgomp, nvptx, --without-cuda-driver] Don't use system cuda driver

Using libgomp configure option --with-cuda-driver=<dir> we can indicate what
cuda driver to use to build the libgomp nvptx plugin.  Without such an option,
the system cuda driver is used, if available.  If not availabe, a dlopen
interface is used instead.

However, when we use --without-cuda-driver (or the equivalent
--with-cuda-driver=no) the system cuda driver is still used if available.

This patch fixes that, making sure that --without-cuda-driver selects the dlopen
interface.

Build on x86_64 with nvptx accelerator and tested libgomp testsuite, with and
without option --without-cuda-driver.

2018-08-04  Tom de Vries  <tdevries@suse.de>

* plugin/configfrag.ac: For --without-cuda-driver, set
CUDA_DRIVER_INCLUDE and CUDA_DRIVER_LIB to no.  Handle
CUDA_DRIVER_INCLUDE == no and CUDA_DRIVER_LIB == no.
* configure: Regenerate.

From-SVN: r263310