1. 28 May, 2020 8 commits
    • aarch64: Fix segfault in aarch64_expand_epilogue [PR95361] · c082cb8a
      The stack frame for the function in the testcase consisted of two
      SVE save slots.  Both saves had been shrink-wrapped, but for different
      blocks, meaning that the stack allocation and deallocation were
      separate from the saves themselves.  Before emitting the deallocation,
      we tried to attach a REG_CFA_DEF_CFA note to the preceding instruction,
      to redefine the CFA in terms of the stack pointer.  But in this case
      there was no preceding instruction.
      
      This in practice only happens for SVE because:
      
      (a) We don't try to shrink-wrap wb_candidate* registers even when
          we've decided to treat them as normal saves and restores.
          I have a fix for that.
      
      (b) Even with (a) fixed, we're (almost?) guaranteed to emit
          a stack tie for frames that are 64k or larger, so we end
          up hanging the REG_CFA_DEF_CFA note on that instead.
      
      We should only need to redefine the CFA if it was previously
      defined in terms of the frame pointer.  In other cases the CFA
      should already be defined in terms of the stack pointer,
      so redefining it is unnecessary but usually harmless.
      
      2020-05-28  Richard Sandiford  <richard.sandiford@arm.com>
      
      gcc/
      	PR testsuite/95361
      	* config/aarch64/aarch64.c (aarch64_expand_epilogue): Only
      	redefine the CFA if we have CFI operations.
      
      gcc/testsuite/
      	PR testsuite/95361
      	* gcc.target/aarch64/sve/pr95361.c: New test.
      Richard Sandiford committed
    • Fortran : "type is( real(kind(1.)) )" spurious syntax error PR94397 · f2fe2ad8
      Based on a patch in the comments of the PR. That patch fixed this
      problem but caused the test cases for PR93484 to fail. It has been
      changed to reduce initialisation expressions if the expression is
      not EXPR_VARIABLE and not EXPR_CONSTANT.
      
      2020-05-28  Steven G. Kargl  <kargl@gcc.gnu.org>
      	    Mark Eggleston  <markeggleston@gcc.gnu.org>
      
      gcc/fortran/
      
      	PR fortran/94397
      	* match.c (gfc_match_type_spec): New variable ok initialised
      	to true. Set ok with the return value of gfc_reduce_init_expr
      	called only if the expression is not EXPR_CONSTANT and is not
      	EXPR_VARIABLE. Add !ok to the check for type not being integer
      	or the rank being greater than zero.
      
      2020-05-28  Mark Eggleston  <markeggleston@gcc.gnu.org>
      
      gcc/testsuite/
      
      	PR fortran/94397
      	* gfortran.dg/pr94397.F90: New test.
      
      (cherry picked from commit 3ea6977d0f1813d982743a09660eec1760e981ec)
      Mark Eggleston committed
    • i386: Fix V2SF horizontal addsub insn · 04b13483
      PFPNACC insn is incorrectly modelled to perform addition and subtraction
      of two operands, but in reality it performs horizontal addition and
      subtraction:
      
      Instruction: PFPNACC dest,src
      
      Description:
      dest[31:0] <- dest[31:0] - dest[63:32];
      dest[63:32] <- src[31:0] + src[63:32];
      
      2020-05-28  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/ChangeLog:
      	* config/i386/mmx.md (mmx_haddsubv2sf3): Correct
      	RTL template to model horizontal subtraction and addition.
      Uros Bizjak committed
    • i386: Remove %q modifier from two pmov insn templates [PR95355] · 31d827e9
      2020-05-28  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/ChangeLog:
      	PR target/95355
      	* config/i386/sse.md
      	(<mask_codefor>avx512f_<code>v16qiv16si2<mask_name>):
      	Remove %q operand modifier from insn template.
      	(avx512f_<code>v8hiv8di2<mask_name>): Ditto.
      
      gcc/testsuite/ChangeLog:
      	PR target/95355
      	* gcc.target/i386/pr95355.c: New test.
      Uros Bizjak committed
    • Add documentation for missing params. · 26a42e9d
      The patch fixes various issues spotted by check-params-in-docs.py
      script. I'm going to install the patch.
      
      gcc/ChangeLog:
      
      	PR web/95380
      	* doc/invoke.texi: Add missing params, remove max-once-peeled-insns and
      	rename ipcp-unit-growth to ipa-cp-unit-growth.
      
      (cherry picked from commit 48e872db11b27604f4993f9be8f67f40b1a40468)
      Martin Liska committed
    • Fortran : ICE in gfc_trans_label_assign PR50392 · 4e2c7f9a
      A function may contain an assigned goto.  If the the return variable
      is an integer a statement can be assigned to it.  Prior to this fix
      this resulted in an ICE.
      
      2020-05-28  Tobias Burnus  <tobias@codesourcery.com>
      
      gcc/fortran/
      
      	PR fortran/50392
      	* trans-decl.c (gfc_get_symbol_decl): Remove unnecessary block
      	delimiters.  Add auxiliary variables if a label is assigned to
      	a return variable. (gfc_gat_fake_result): If the symbol has an
      	assign attribute set declaration from the symbol's backend
      	declaration.
      
      2020-05-28  Mark Eggleston  <markeggleston@gnu.gcc.org>
      
      gcc/testsuite/
      
      	PR fortran/50392
      	* gfortran.dg/pr50392.f: New test.
      
      (cherry picked from commit a7fd43c38f7469a3ef5ee30e889d60e1376d4dfc)
      Mark Eggleston committed
    • Daily bump. · e8c25021
      GCC Administrator committed
    • libstdc++: Fix common_iterator::operator-> [PR95322] · fc78e991
      This patch fixes the definition of common_iterator::operator-> when the
      underlying iterator's operator* returns a non-reference.
      
      The first problem is that the class __detail::_Common_iter_proxy is used
      unqualified.  Fixing that revealed another problem: the class's template
      friend declaration of common_iterator doesn't match up with the
      definition of common_iterator, because the friend declaration isn't
      constrained.
      
      If we try to make the friend declaration match up by adding constraints,
      we run into frontend bug PR93467.  So we currently can't correctly
      express this friend relation between __detail::_Common_iter_proxy and
      common_iterator.
      
      As a workaround to this frontend bug, this patch moves the definition of
      _Common_iter_proxy into the class template of common_iterator so that we
      could instead express the friend relation via the injected-class-name.
      
      (This bug was found when attempting to use views::common to work around
      the compile failure with the testcase in PR95322.)
      
      libstdc++-v3/ChangeLog:
      
      	PR libstdc++/95322
      	* include/bits/stl_iterator.h (__detail::_Common_iter_proxy):
      	Remove and instead define it ...
      	(common_iterator::_Proxy): ... here.
      	(common_iterator::operator->): Use it.
      	* testsuite/24_iterators/common_iterator/2.cc: New test.
      	* testsuite/std/ranges/adaptors/95322.cc: New test.
      
      (cherry picked from commit 3bf5e7657b752cc2352778e8c20ac9cdddca4f93)
      Patrick Palka committed
  2. 27 May, 2020 6 commits
    • PR fortran/95104 - Segfault on a legal WAIT statement · 50cd4503
      Referencing a unit in a WAIT statement that has not been opened before
      resulted in a NULL pointer dereference.  Check for this condition.
      
      2020-05-26  Harald Anlauf  <anlauf@gmx.de>
      
      libgfortran/
      	PR libfortran/95104
      	* io/transfer.c (st_wait_async): Do not dereference NULL pointer.
      
      gcc/testsuite/
      	PR libfortran/95104
      	* gfortran.dg/pr95104.f90: New test.
      
      Co-Authored-By: Steven G. Kargl  <kargl@gcc.gnu.org>
      (cherry picked from commit 56f03cd12be26828788a27f6f3c250041a958e45)
      Harald Anlauf committed
    • c++: Handle multiple aggregate overloads [PR95319]. · a6deb68d
      Here, when considering the two 'insert' overloads, we look for aggregate
      conversions from the same initializer-list to B<3> or
      initializer_list<B<3>>.  But since my fix for reshape_init overhead on the
      PR14179 testcase we reshaped the initializer-list directly, leading to an
      error when we then tried to reshape it differently for the second overload.
      
      gcc/cp/ChangeLog:
      
      	PR c++/95319
      	* decl.c (reshape_init_array_1): Don't reuse in overload context.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/95319
      	* g++.dg/cpp0x/initlist-array12.C: New test.
      
      (cherry picked from commit 6efa97ea1d2fe6df1fbb9df78faaa2248a8618d7)
      Jason Merrill committed
    • Add new git-backport.py script. · ee6fe844
      contrib/ChangeLog:
      
      	* git-backport.py: New file.
      Martin Liska committed
    • c++: operator<=> and -Wzero-as-null-pointer-constant [PR95242] · fac77bd8
      In C++20, if there is no viable operator< available, lhs < rhs gets
      rewritten to (lhs <=> rhs) < 0, where operator< for the comparison
      categories is intended to accept literal 0 on the RHS but not other
      integers.  We don't want this to produce a warning from
      -Wzero-as-null-pointer-constant.
      
      gcc/cp/ChangeLog:
      
      	* call.c (build_new_op_1): Suppress
      	warn_zero_as_null_pointer_constant across comparison of <=> result
      	to 0.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/cpp2a/spaceship-synth2.C: Add
      	-Wzero-as-null-pointer-constant.
      
      (cherry picked from commit 6c66c692043d680a5efcd9616b94f9629c417038)
      Jason Merrill committed
    • c++: Fix stdcall attribute in template. [PR95222] · 0c473d8f
      Another case that breaks with my fix for PR90750: we shouldn't move type
      attributes in TYPENAME context either, as there's no decl for them to move
      to.
      
      gcc/cp/ChangeLog:
      
      	PR c++/95222
      	* decl.c (grokdeclarator): Don't shift attributes in TYPENAME
      	context.
      
      gcc/testsuite/ChangeLog:
      
      	PR c++/95222
      	* g++.dg/ext/tmplattr10.C: New test.
      
      (cherry picked from commit 7e7d9fcff56385812764cba63e1ebf6f4c6c0320)
      Jason Merrill committed
    • Daily bump. · 71e2bcc2
      GCC Administrator committed
  3. 26 May, 2020 3 commits
    • Fixes a hang on an invalid ID in a WAIT statement. · 3633bc27
      gcc/fortran/ChangeLog:
      
      2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR libfortran/95191
      	* libgfortran.h (libgfortran_error_codes): Add
      	LIBERROR_BAD_WAIT_ID.
      
      libgfortran/ChangeLog:
      
      2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR libfortran/95191
      	* io/async.c (async_wait_id): Generate error if ID is higher
      	than the highest current ID.
      	* runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID.
      
      libgomp/ChangeLog:
      
      2020-05-23  Thomas Koenig  <tkoenig@gcc.gnu.org>
      
      	PR libfortran/95191
      	* testsuite/libgomp.fortran/async_io_9.f90: New test.
      
      (cherry picked from commit 8df7ee67f6fdc780e9453f2baa8d1bf62c000761)
      Thomas Koenig committed
    • x86-vxworks malloc aligns to 8 bytes like solaris · b425be2c
      Vxworks 7's malloc, like Solaris', only ensures 8-byte alignment of
      returned pointers on 32-bit x86, though GCC's stddef.h defines
      max_align_t with 16-byte alignment for __float128.  This patch enables
      on x86-vxworks the same memory_resource workaround used for x86-solaris.
      
      The testsuite also had a workaround, defining BAD_MAX_ALIGN_T and
      xfailing the test; extend those to x86-vxworks as well, and remove the
      check for char-aligned requested allocation to be aligned like
      max_align_t.  With that change, the test passes on x86-vxworks; I'm
      guessing that's the same reason for the test not to pass on
      x86-solaris (and on x86_64-solaris -m32), so with the fix, I'm
      tentatively removing the xfail.
      
      
      for libstdc++-v3/ChangeLog
      
      	PR libstdc++/77691
      	* include/experimental/memory_resource
      	(__resource_adaptor_imp::do_allocate): Handle max_align_t on
      	x86-vxworks as on x86-solaris.
      	(__resource_adaptor_imp::do_deallocate): Likewise.
      	* testsuite/experimental/memory_resource/new_delete_resource.cc:
      	Drop xfail.
      	(BAD_MAX_ALIGN_T): Define on x86-vxworks as on x86-solaris.
      	(test03): Drop max-align test for char-aligned alloc.
      
      (cherry picked from commit 883246530f1bb10d854f455e1c3d55b93675690a)
      Alexandre Oliva committed
    • Daily bump. · 5aec2fd3
      GCC Administrator committed
  4. 25 May, 2020 6 commits
    • testsuite: Support { target c++20 } in tests. · c1eb1c4d
      gcc/testsuite/ChangeLog
      2020-05-12  Jason Merrill  <jason@redhat.com>
      
      	* lib/target-supports.exp (check_effective_target_c++20_only)
      	(check_effective_target_c++20): New.
      Jason Merrill committed
    • c++: constexpr and lambda capture [PR90212] · aa613a81
      This is the same issue as PR86429, just in potential_constant_expression_1
      rather than cxx_eval_constant_expression.  As in that case, when we're
      trying to evaluate a constant expression within a lambda, we don't have a
      constant closure object to refer to, but we can try to refer directly to the
      captured variable.
      
      gcc/cp/ChangeLog
      2020-05-05  Jason Merrill  <jason@redhat.com>
      
      	PR c++/90212
      	* constexpr.c (potential_constant_expression_1): In a lambda
      	function, consider a captured variable directly.
      Jason Merrill committed
    • c++: Local class DMI using local static [PR90749] · c79e664b
      For default member initializers in templates it's important to push into the
      right context during get_nsdmi.  But for a local class that's not possible,
      and trying leaves the function context we need to be in, so don't try.
      
      gcc/cp/ChangeLog
      2020-05-01  Jason Merrill  <jason@redhat.com>
      
      	PR c++/90479
      	* init.c (get_nsdmi): Don't push_to_top_level for a local class.
      Jason Merrill committed
    • c++: -fmerge-all-constants vs. destructors [PR91529] · 01ff88c5
      cp_finish_decl avoids setting TREE_READONLY on TREE_STATIC variables that
      have non-constant construction or destruction, but -fmerge-all-constants was
      converting an automatic variable to static while leaving TREE_READONLY set.
      
      Fixed by clearing the flag in cp_finish_decl in the presence of
      -fmerge-all-constants.
      
      gcc/cp/ChangeLog
      2020-05-01  Jason Merrill  <jason@redhat.com>
      
      	PR c++/91529
      	* decl.c (cp_finish_decl): Also clear TREE_READONLY if
      	-fmerge-all-constants.
      Jason Merrill committed
    • c++: generic lambda and -fsanitize=vla-bound [PR93822] · 4cee8136
      Within the generic lambda the VLA capture proxy VAR_DECL has DECL_VALUE_EXPR
      which is a NOP_EXPR to the VLA type of the proxy.  The problem here was that
      when instantiating we were tsubsting that type twice, once for the type of
      the DECL and once for the type of the NOP_EXPR, and getting two
      different (though equivalent) types.  Then gimplify_type_sizes fixed up the
      type of the DECL, but that didn't affect the type of the NOP_EXPR, leading
      to sadness.
      
      Fixed by directly reusing the type from the DECL.
      
      gcc/cp/ChangeLog
      2020-05-01  Jason Merrill  <jason@redhat.com>
      
      	PR c++/93822
      	* pt.c (tsubst_decl): Make sure DECL_VALUE_EXPR continues to have
      	the same type as the variable.
      Jason Merrill committed
    • Daily bump. · ca502d7b
      GCC Administrator committed
  5. 24 May, 2020 5 commits
    • i386: Fix <rounding_insn><mode>2 expander [PR95255] · 217a2241
      2020-05-24  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/ChangeLog:
      	PR target/95255
      	* config/i386/i386.md (<rounding_insn><mode>2): Do not try to
      	expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines.
      
      gcc/testsuite/ChangeLog:
      	PR target/95255
      	* gcc.target/i386/pr95255.c: New test.
      Uros Bizjak committed
    • Darwin: Make sanitizer local vars linker-visible. · 25a9db6c
      Another case where we need a linker-visible symbol in order
      to preserve the ld64 atom model.  If these symbols are emitted
      as 'local' the linker cannot see that they are separate from any
      global weak entry that precedes them.  This will cause the linker
      to complain that there is (apparently) direct access to such a
      weak global.
      
      This is a short-term fix for the problem - ideally we need a more
      generic handling for all the relevant cases.
      
      	Backport 804254edb48f87d726a1bc9e95af04076c030e35
      
      gcc/ChangeLog:
      
      	* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL):
      	Make ubsan_{data,type},ASAN linker-visible.
      Iain Sandoe committed
    • x86: Handle -mavx512vpopcntdq for -march=native · af216f79
      Add -mavx512vpopcntdq for -march=native if AVX512VPOPCNTDQ is available.
      
      	PR target/95258
      	* config/i386/driver-i386.c (host_detect_local_cpu): Detect
      	AVX512VPOPCNTDQ.
      
      (cherry picked from commit 808b611bfb4b05703ea174e50874c711dca44c98)
      H.J. Lu committed
    • coroutines: Implicitly movable objects should use move CTORs for co_return. · 135c679c
      This is a case where the standard contains conflicting information.
      after discussion between implementators, the accepted intent is of
      [class.copy.elision].  This amends the handling of co_return statements
      to follow that.
      
      	Backport 5ef067eb14d40337507077a8a1265a04daa8ebc1 and f898793b4545483adaf62c5efbc78cee518884e6
      
      gcc/cp/ChangeLog:
      
      	* coroutines.cc (finish_co_return_stmt): Implement rules
      	from [class.copy.elision] /3.
      
      gcc/testsuite/ChangeLog:
      
      	* g++.dg/coroutines/co-return-syntax-10-movable.C: New test.
      Iain Sandoe committed
    • Daily bump. · 647f3c4a
      GCC Administrator committed
  6. 23 May, 2020 3 commits
    • libstdc++: Remove incorrect static specifiers · 415d3cd7
      These functions were originally static members of the path class, but
      the 'static' specifiers were not removed when they were moved to
      namespace scope. This causes ODR violations when the functions are
      called from functions defined in the header. Change them to 'inline'
      instead.
      
      Backport from mainline
      2020-05-23  Jonathan Wakely  <jwakely@redhat.com>
      
      	* include/bits/fs_path.h (__detail::_S_range_begin)
      	(__detail::_S_range_end): Remove unintentional static specifiers.
      	* include/experimental/bits/fs_path.h (__detail::_S_range_begin)
      	(__detail::_S_range_end): Likewise.
      Jonathan Wakely committed
    • libstdc++: Fix function that can't be constexpr in C++11 (PR 95289) · 3ba39107
      The body of this function isn't just a return statement, so it can't be
      constexpr until C++14.
      
      Backport from mainline
      2020-05-23  Jonathan Wakely  <jwakely@redhat.com>
      
      	PR libstdc++/95289
      	* include/debug/helper_functions.h (__get_distance): Only declare
      	as a constexpr function for C++14 and up.
      	* testsuite/25_algorithms/copy/debug/95289.cc: New test.
      Jonathan Wakely committed
    • Daily bump. · a3e3e25e
      GCC Administrator committed
  7. 22 May, 2020 3 commits
  8. 21 May, 2020 6 commits
    • i386: Avoid reversing a non-trapping comparison to a trapping one [PR95169] · ddfb80ad
      2020-05-21  Uroš Bizjak  <ubizjak@gmail.com>
      
      gcc/ChangeLog:
      	PR target/95169
      	* config/i386/i386-expand.c (ix86_expand_int_movcc):
      	 Avoid reversing a non-trapping comparison to a trapping one.
      
      gcc/testsuite/ChangeLog:
      	PR target/95169
      	* gcc.target/i386/pr95169.c: New test.
      Uros Bizjak committed
    • Add outline-atomics to target attribute. · a321683b
      	* common/config/aarch64/aarch64-common.c (aarch64_handle_option):
      	Handle OPT_moutline_atomics.
      	* config/aarch64/aarch64.c: Add outline-atomics to
      	aarch64_attributes.
      
      	* doc/extend.texi: Document the newly added target attribute.
      
      	* gcc.target/aarch64/target_attr_20.c: New test.
      	* gcc.target/aarch64/target_attr_21.c: New test.
      
      (cherry picked from commit 9e02b45ffc60e0078bde3c56a14f00c54b7f8039)
      Martin Liska committed
    • libgcc: Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16 · 9b7d71fd
      Move FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16 to avoid
      changing libgcc ABI.
      
      gcc/
      
      	PR target/95212
      	* config/i386/i386-builtins.c (processor_features): Move
      	F_AVX512VP2INTERSECT after F_AVX512BF16.
      	(isa_names_table): Likewise.
      
      libgcc/
      
      	PR target/95212
      	* config/i386/cpuinfo.h (processor_features): Move
      	FEATURE_AVX512VP2INTERSECT after FEATURE_AVX512BF16.
      
      (cherry picked from commit 5855bdfa06fb25c0880af89cb2bfdcdf342beac2)
      H.J. Lu committed
    • libstdc++: Fix net::basic_socket::close(error_code&) · e3eec8a1
      Also add some missing member functions, nodiscard attributes, and
      noexcept-specifiers.
      
      Backport from mainline
      2020-05-21  Jonathan Wakely  <jwakely@redhat.com>
      
      	* include/experimental/executor (use_future_t::use_future_t()): Fix
      	incorrect noexcept-specifier.
      	* include/experimental/internet (basic_resolver_results): Adjust
      	whitespace.
      	* include/experimental/socket (__basic_socket_impl::release): Add
      	member function.
      	(basic_socket(io_context&, const endpoint_type&)): Fix argument to
      	target constructor.
      	(basic_socket::release(), basic_socket::release(error_code&)): Add
      	missing member functions.
      	(basic_socket::is_open()): Add nodiscard attribute.
      	(basic_socket::close(error_code&)): Pass argument to base function.
      	(basic_socket_acceptor::release())
      	(basic_socket_acceptor::release(error_code&)): Add missing member
      	functions.
      	(basic_socket_acceptor::is_open()): Add nodiscard attribute.
      	(basic_socket_streambuf::error()): Add noexcept.
      	(basic_socket_iostream::error()): Likewise.
      	* testsuite/experimental/net/socket/basic_socket.cc: New test.
      Jonathan Wakely committed
    • libstdc++: Avoid constraint recursion with iterator_traits (PR 93983) · 566ba721
      Checking whether a filesystem::path constructor argument is an iterator
      requires instantiating std::iterator_traits. In C++20 that checks for
      satisfaction of std::iterator_traits constraints, which checks if the
      type is copyable, which can end up recursing back to the path
      constructor. The fix in LWG 3420 is to reorder the cpp17-iterator
      concept's constraints to check if the type looks vaguely like an
      iterator before checking copyable. That avoids the recursion for types
      which definitely aren't iterators, but isn't foolproof.
      
      Backport from mainline
      2020-05-21  Jonathan Wakely  <jwakely@redhat.com>
      
      	PR libstdc++/93983
      	* include/bits/iterator_concepts.h (__detail::__cpp17_iterator):
      	Reorder constraints to avoid recursion when constructors use
      	iterator_traits (LWG 3420).
      	* testsuite/24_iterators/customization_points/lwg3420.cc: New test.
      Jonathan Wakely committed
    • x86: Update VPCLMULQDQ check · efcf41fc
      Update VPCLMULQDQ check to support processors with AVX version of
      VPCLMULQDQ.
      
      	Backport from master
      	PR target/91695
      	* config/i386/cpuinfo.c (get_available_features): Fix VPCLMULQDQ
      	check.
      
      (cherry picked from commit 1e46a443f25d26816536c0c480211714b123a1d5)
      H.J. Lu committed