]> gcc.gnu.org Git - gcc.git/log
gcc.git
3 years agoc++: Don't try to parse a function declaration as deduction guide [PR97663]
Jakub Jelinek [Tue, 3 Nov 2020 20:42:51 +0000 (21:42 +0100)]
c++: Don't try to parse a function declaration as deduction guide [PR97663]

While these function declarations have NULL decl_specifiers->type,
they have still type specifiers specified from which the default int
in the return type is added, so we shouldn't try to parse those as
deduction guides.

2020-11-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/97663
* parser.c (cp_parser_init_declarator): Don't try to parse
C++17 deduction guides if there are any type specifiers even when
type is NULL.

* g++.dg/cpp1z/class-deduction75.C: New test.

(cherry picked from commit cd41e4a1864c10c7f9141284e82e5cc0a3007806)

3 years agowide-int: Fix up set_bit_large
Jakub Jelinek [Wed, 28 Oct 2020 09:24:20 +0000 (10:24 +0100)]
wide-int: Fix up set_bit_large

> >> wide_int new_lb = wi::set_bit (r.lower_bound (0), 127)
> >>
> >> and creates the value:
> >>
> >> p new_lb
> >> {<wide_int_storage> = {val = {-65535, -1, 0}, len = 2, precision = 128},
> >> static is_sign_extended = true}
> >
> > This is non-canonical and so invalid, if the low HWI has the MSB set
> > and the high HWI is -1, it should have been just
> > val = {-65535}, len = 1, precision = 128}
> >
> > I guess the bug is that wi::set_bit_large doesn't call canonize.
>
> Yeah, looks like a micro-optimisation gone wrong.

2020-10-28  Jakub Jelinek  <jakub@redhat.com>

* wide-int.cc (wi::set_bit_large): Call canonize unless setting
msb bit and clearing bits above it.

(cherry picked from commit e41011e5edcd9606573d3450d98512450dddca77)

3 years agocombine: Fix up simplify_shift_const_1 for nested ROTATEs [PR97386]
Jakub Jelinek [Tue, 13 Oct 2020 17:13:26 +0000 (19:13 +0200)]
combine: Fix up simplify_shift_const_1 for nested ROTATEs [PR97386]

The following testcases are miscompiled (the first one since my improvements
to rotate discovery on GIMPLE, the other one for many years) because
combiner optimizes nested ROTATEs with narrowing SUBREG in between (i.e.
the outer rotate is performed in shorter precision than the inner one) to
just one ROTATE of the rotated constant.  While that (under certain
conditions) can work for shifts, it can't work for rotates where we can only
do that with rotates of the same precision.

2020-10-13  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/97386
* combine.c (simplify_shift_const_1): Don't optimize nested ROTATEs if
they have different modes.

* gcc.c-torture/execute/pr97386-1.c: New test.
* gcc.c-torture/execute/pr97386-2.c: New test.

(cherry picked from commit 1a98b22b0468214ae8463d075dacaeea1d46df15)

3 years agoopenmp: Set cfun->calls_alloca when needed in OpenMP outlined regions [PR97294]
Jakub Jelinek [Thu, 8 Oct 2020 09:10:34 +0000 (11:10 +0200)]
openmp: Set cfun->calls_alloca when needed in OpenMP outlined regions [PR97294]

The following testcase FAILs, because we don't mark the child OpenMP function
as cfun->calls_alloca when it does call alloca.  When optimizing, during DCE we
reset those flags and recompute them again, but with -O0 DCE is not performed.

Fixed by calling notice_special_calls when moving insns to the child function.

cfun->calls_alloca is normally set during gimplification and most of the
alloca calls omp-low.c does go through the gimplifier, but one spot didn't
and built the gcall directly, so that one needs to set calls_alloca too.

2020-10-08  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/97294
* tree-cfg.c (move_block_to_fn): Call notice_special_calls on
call stmts being moved into dest_cfun.
* omp-low.c (lower_rec_input_clauses): Set cfun->calls_alloca when
adding __builtin_alloca_with_align call without gimplification.

* gcc.dg/asan/pr97294.c: New test.

(cherry picked from commit a30fcfb3b848e4b895cb47378b4a250184af3afe)

3 years agopowerpc, libcpp: Fix gcc build with clang on power8 [PR97163]
Jakub Jelinek [Sat, 26 Sep 2020 08:07:41 +0000 (10:07 +0200)]
powerpc, libcpp: Fix gcc build with clang on power8 [PR97163]

libcpp has two specialized altivec implementations of search_line_fast,
one for power8+ and the other one otherwise.
Both use __attribute__((altivec(vector))) and the GCC builtins rather than
altivec.h and the APIs from there, which is fine, but should be restricted
to when libcpp is built with GCC, so that it can be relied on.
The second elif is
and thus e.g. when built with clang it isn't picked, but the first one was
just guarded with
and so according to the bugreporter clang fails miserably on that.

The following patch fixes that by adding the same GCC_VERSION requirement
as the second version.  I don't know where the 4.5 in there comes from and
the exact version doesn't matter that much, as long as it is above 4.2 that
clang pretends to be and smaller or equal to 4.8 as the oldest gcc we
support as bootstrap compiler ATM.
Furthermore, the patch fixes the comment, the version it is talking about is
not pre-GCC 5, but actually the GCC 5+ one.

2020-09-26  Jakub Jelinek  <jakub@redhat.com>

PR bootstrap/97163
* lex.c (search_line_fast): Only use _ARCH_PWR8 Altivec version
for GCC >= 4.5.

(cherry picked from commit cd547f0ddcd3a54e5b73bcda5ac0f0c46808db8b)

3 years agolibstdc++: Make std::copy_n work with negative sizes
Jonathan Wakely [Thu, 4 Jun 2020 12:52:21 +0000 (13:52 +0100)]
libstdc++: Make std::copy_n work with negative sizes

Since it was added in C++11, std::copy_n should do nothing given a
negative size, but for random access iterators we add the size to the
iterator, possibly resulting in undefined behaviour.

This also fixes a bug in the random_access_iterator_wrapper helper.

libstdc++-v3/ChangeLog:

* include/bits/stl_algo.h (copy_n): Only call __copy_n for positive
values.
* testsuite/util/testsuite_iterators.h
(random_access_iterator_wrapper::operator+=): Fix range check for
negative values.
* testsuite/25_algorithms/copy_n/5.cc: New test.

(cherry picked from commit e1008cd1d8504775e6a5e39325e396e61b39b84c)

3 years agolibstdc++: Implement LWG 561 for std::inserter
Jonathan Wakely [Fri, 27 Mar 2020 23:55:48 +0000 (23:55 +0000)]
libstdc++: Implement LWG 561 for std::inserter

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h (inserter): Do not deduce
iterator type (LWG 561).
* testsuite/24_iterators/insert_iterator/dr561.cc: New test.

(cherry picked from commit 2203a80a72cb582364245b6997d0724a5f84e062)

3 years agoImprove tests for std::vector<bool> printer
Jonathan Wakely [Thu, 20 Jun 2019 09:04:55 +0000 (10:04 +0100)]
Improve tests for std::vector<bool> printer

The current tests wouldn't notice if the vector<bool> contents were
printed in reverse, because it would read the same forwards and
backwards. Change the content so the tests would fail if that happened.

* testsuite/libstdc++-prettyprinters/simple.cc: Use non-palindromic
vector<bool> for test.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

(cherry picked from commit 94872d7f99ceb9da9ecb90064d59d4518c9a6f37)

3 years agoHave std::vector printer's iterator return bool for vector<bool>
Michael Weghorn [Wed, 19 Jun 2019 22:57:06 +0000 (22:57 +0000)]
Have std::vector printer's iterator return bool for vector<bool>

Have the pretty-printer for 'std::vector<bool>' return a
value of type 'bool' rather than an 'int'.

This way, the type is clear and that can be used for better
display and a 'gdb.Value' constructed from the returned value
will have type 'bool' again, not e.g. 'long long' as happened
previously (at least with GDB 8.2.1 on amd64).

2019-06-19  Michael Weghorn  <m.weghorn@posteo.de>
    Jonathan Wakely  <jwakely@redhat.com>

PR libstdc++/90945
* python/libstdcxx/v6/printers.py (StdVectorPrinter._iterator): Use
values of type bool for vector<bool> elements.
* testsuite/libstdc++-prettyprinters/simple.cc: Test vector<bool>.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.

Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 36d0dada6773d7fd7c5ace64c90e723930a3b81e)

3 years agolibstdc++: Fix outdated comment about std::string instantiations (PR 94854)
Jonathan Wakely [Wed, 29 Apr 2020 17:57:34 +0000 (18:57 +0100)]
libstdc++: Fix outdated comment about std::string instantiations (PR 94854)

PR libstdc++/94854
* include/bits/basic_string.tcc: Update comment about explicit
instantiations.

3 years agolibstdc++: Fix net::system_context stop condition
Jonathan Wakely [Tue, 11 Aug 2020 15:16:21 +0000 (16:16 +0100)]
libstdc++: Fix net::system_context stop condition

libstdc++-v3/ChangeLog:

* include/experimental/executor (system_context::_M_run()):
Fix predicate.
(system_context::join()): Do not join unless joinable.
* testsuite/experimental/net/system_context/1.cc: New test.

(cherry picked from commit 61759518adc7679a6f46369543e30a761a16490a)

3 years agolibstdc++: Fix failing tests for AIX
Jonathan Wakely [Tue, 11 Aug 2020 15:16:22 +0000 (16:16 +0100)]
libstdc++: Fix failing tests for AIX

These two tests fail on AIX because <sys/thread.h> defines struct thread
in the global namespace (despite it not being a reserved name). That
means the using-declaration that adds it to the global namespace causes
a redeclaration error.

libstdc++-v3/ChangeLog:

* testsuite/30_threads/thread/cons/84535.cc: Use a custom
namespace.
* testsuite/30_threads/thread/cons/lwg2097.cc: Likewise.

(cherry picked from commit fe8d7fec4db838cae536eeef1965db83959cf6ee)

3 years agolibstdc++: Fix directory_iterator exception specification
Jonathan Wakely [Tue, 27 Oct 2020 14:49:37 +0000 (14:49 +0000)]
libstdc++: Fix directory_iterator exception specification

libstdc++-v3/ChangeLog:

* src/c++17/fs_dir.cc (fs::directory_iterator::operator*):
Add noexcept. Do not throw on precondition violation.

(cherry picked from commit 044b04348cfdc12848f1c6d5a8f45087c3075390)

3 years agolibstdc++: Add noexcept to declaration of path::_List members
Jonathan Wakely [Tue, 27 Oct 2020 14:48:50 +0000 (14:48 +0000)]
libstdc++: Add noexcept to declaration of path::_List members

libstdc++-v3/ChangeLog:

* include/bits/fs_path.h (path::_List::begin, path::_List::end):
Add noexcept to match definitions in src/c++17/fs_path.cc.

(cherry picked from commit fe9d058ca28e0e3a50c44096ce112763057e686e)

3 years agomaintainer-scripts: Disable multilib when generating libstdc++ docs
Jonathan Wakely [Thu, 8 Apr 2021 13:48:23 +0000 (14:48 +0100)]
maintainer-scripts: Disable multilib when generating libstdc++ docs

This allows the docs to be generated on hosts without the necessary
files present for multilib support.

maintainer-scripts/ChangeLog:

* generate_libstdcxx_web_docs: Add --disable-multilib to
configure command.

(cherry picked from commit acbbb82ea3e2ae145e59ffca6f1ec0699b5f7383)

3 years agolibstdc++: Fix spelling of __MINGW32__ macros
Jonathan Wakely [Wed, 10 Feb 2021 16:37:39 +0000 (16:37 +0000)]
libstdc++: Fix spelling of __MINGW32__ macros

libstdc++-v3/ChangeLog:

* testsuite/27_io/filesystem/operations/proximate.cc: Fix typo
in __MINGW32__ macro name.
* testsuite/27_io/filesystem/path/compare/lwg2936.cc: Likewise.
* testsuite/27_io/filesystem/path/generation/proximate.cc:
Likewise.
* testsuite/27_io/filesystem/path/generation/relative.cc:
Likewise.
* testsuite/util/testsuite_fs.h: Likewise.

(cherry picked from commit 6a6f74be9d6891cb0c17c493b1f9bca20673e6a0)

3 years agolibstdc++: Use correct error category for Windows error codes
Jonathan Wakely [Wed, 10 Feb 2021 16:45:38 +0000 (16:45 +0000)]
libstdc++: Use correct error category for Windows error codes

When the result of GetLastError() is stored in a std::error_code it
should use std::system_category(), not std::generic_category() that is
used for POSIX errno values.

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (fs::create_hard_link, fs::equivalent)
(fs::remove): Use std::system_category() for error codes from
GetLastError().
* src/filesystem/ops.cc (fs::create_hard_link, fs::remove):
Likewise.

(cherry picked from commit 313e2dc377d07d5fae5a3fd666ad7000d7e8771d)

3 years agolibstdc++: Handle EPERM for filesystem access errors on MacOS [PR 99537]
Jonathan Wakely [Thu, 11 Mar 2021 16:43:51 +0000 (16:43 +0000)]
libstdc++: Handle EPERM for filesystem access errors on MacOS [PR 99537]

Contrary to what POSIX says, some directory operations on MacOS can fail
with EPERM instead of EACCES, so we need to handle both.

libstdc++-v3/ChangeLog:

PR libstdc++/99533
* src/c++17/fs_dir.cc (recursive_directory_iterator): Use new
helper function to check for permission denied errors.
* src/filesystem/dir.cc (recursive_directory_iterator):
Likewise.
* src/filesystem/dir-common.h (is_permission_denied_error): New
helper function.

(cherry picked from commit 8cfb387388a90730ab36ac24d9049677db633a11)

3 years agolibstdc++: Initialize std::normal_distribution::_M_saved [PR 99536]
Jonathan Wakely [Thu, 11 Mar 2021 16:43:51 +0000 (16:43 +0000)]
libstdc++: Initialize std::normal_distribution::_M_saved [PR 99536]

This avoids a false positive -Wmaybe-uninitialized warning, by
initializing _M_saved on construction.

libstdc++-v3/ChangeLog:

PR libstdc++/99536
* include/bits/random.h (normal_distribution): Use
default-initializer for _M_saved and _M_saved_available.

(cherry picked from commit 67e397660611990efd98f9e4106c1ee81f6803a4)

3 years agolibstdc++: Include scope ID in net::internet::address_v6::to_string()
Jonathan Wakely [Fri, 12 Feb 2021 15:08:29 +0000 (15:08 +0000)]
libstdc++: Include scope ID in net::internet::address_v6::to_string()

libstdc++-v3/ChangeLog:

* include/experimental/internet (address_v6::to_string): Include
scope ID in string.
(address_v6::loopback): Fix to be constexpr in C++14.
* testsuite/experimental/net/internet/address/v6/members.cc:
Test to_string() results.

(cherry picked from commit d1a821b93c45bfe7606b5dee8d160c7172b37e3e)

3 years agolibstdc++: Fix errors in <experimental/internet>
Jonathan Wakely [Fri, 12 Feb 2021 13:01:20 +0000 (13:01 +0000)]
libstdc++: Fix errors in <experimental/internet>

libstdc++-v3/ChangeLog:

* include/experimental/internet (address_v6::any): Avoid using
memcpy in constexpr function.
(address_v6::loopback): Likewise.
(make_address_v6): Fix missing return statements on error paths.
* include/experimental/io_context: Avoid -Wdangling-else
warning.
* testsuite/experimental/net/internet/address/v4/members.cc:
Remove unused variables.
* testsuite/experimental/net/internet/address/v6/members.cc:
New test.

(cherry picked from commit 970ba719250ec06767e0617658bb92a64fde0f3f)

3 years agolibstdc++: Fix doxygen comment for std::any_of
Nuno Lopes [Tue, 13 Oct 2020 19:21:55 +0000 (20:21 +0100)]
libstdc++: Fix doxygen comment for std::any_of

libstdc++-v3/ChangeLog:

* include/bits/stl_algo.h (any_of): Fix incorrect description
in comment.

(cherry picked from commit 5204cc561a8d3c1a671969715ceb507ece8edef7)

3 years agolibstdc++: Fix documentation for return values of copy algos
Jonathan Wakely [Mon, 12 Oct 2020 17:14:01 +0000 (18:14 +0100)]
libstdc++: Fix documentation for return values of copy algos

The doxygen comments for these algos all incorrectly claim to use
(first - last) as the difference from the start of the output range to
the return value. As reported on the mailing list by Johannes Choo, it
should be (last - first).

libstdc++-v3/ChangeLog:

* include/bits/stl_algobase.h (copy, move, copy_backward)
(move_backward): Fix documentation for returned iterator.

(cherry picked from commit ae3967caffea9c9b9f0f9dfe42a4f59e715e1a61)

3 years agolibstdc++: Add assertions for preconditions in sampling distributions [PR 82584]
Jonathan Wakely [Thu, 8 Oct 2020 14:14:58 +0000 (15:14 +0100)]
libstdc++: Add assertions for preconditions in sampling distributions [PR 82584]

These three distributions all require 0 < S where S is the sum of the
weights. When the sum is zero there's an undefined FP division by zero.
Add assertions to help users diagnose the problem.

libstdc++-v3/ChangeLog:

PR libstdc++/82584
* include/bits/random.tcc
(discrete_distribution::param_type::_M_initialize)
(piecewise_constant_distribution::param_type::_M_initialize)
(piecewise_linear_distribution::param_type::_M_initialize):
Add assertions for positive sums..
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
line.

(cherry picked from commit b2a96bf9dce41ee777b1669e4a8b4c6df3ff3613)

3 years agolibstdc++: Fix incorrect test for std::error_code comparisons
Jonathan Wakely [Wed, 3 Feb 2021 15:49:36 +0000 (15:49 +0000)]
libstdc++: Fix incorrect test for std::error_code comparisons

The tests for std::error_code comparisons assumed that a default
constructed object uses std::generic_category(). That's true for a
default constructed std::error_condition, but not std::error_code.

Fix the three-way comparisons to correctly depend on the result of
comparing the categories, and add another test for comparing two objects
with the same category and different values.

libstdc++-v3/ChangeLog:

* testsuite/19_diagnostics/error_code/operators/not_equal.cc:
Add comparison with same category and different values.
* testsuite/19_diagnostics/error_code/operators/less.cc:
Likewise. Fix comparison involving different categories.
* testsuite/19_diagnostics/error_condition/operators/less.cc:
Add comment.

(cherry picked from commit a6f08be383f846a0474ea8d1da9222b802c36c7c)

3 years agolibstdc++: Fix test failure on AIX
Jonathan Wakely [Wed, 25 Nov 2020 16:58:05 +0000 (16:58 +0000)]
libstdc++: Fix test failure on AIX

This fixes a failure on AIX 7.2:

FAIL: 17_intro/names.cc (test for excess errors)
Excess errors:
/home/jwakely/src/gcc/libstdc++-v3/testsuite/17_intro/names.cc:99: error: expected identifier before '(' token
/usr/include/sys/var.h:187: error: expected unqualified-id before '{' token
/usr/include/sys/var.h:187: error: expected ')' before '{' token
/usr/include/sys/var.h:337: error: expected unqualified-id before ';' token
/usr/include/sys/var.h:337: error: expected ')' before ';' token

libstdc++-v3/ChangeLog:

* testsuite/17_intro/names.cc: Do not test 'v' on AIX.

(cherry picked from commit 1a8d1f54de371de88b2604d8c0e4e01306be8870)

3 years agolibstdc++: Add noexcept to std::begin etc as per LWG 2280 and 3537
Jonathan Wakely [Mon, 22 Mar 2021 15:15:12 +0000 (15:15 +0000)]
libstdc++: Add noexcept to std::begin etc as per LWG 2280 and 3537

This implements the proposed changes for LWG 3537 (which we're allowed
to do as an extension whatever the outcome of the issue). I noticed we
didn't implement LWG 2280 completely, as the std::begin and std::end
overloads for arrays were not noexcept.

libstdc++-v3/ChangeLog:

* include/bits/range_access.h (begin(T (&)[N]), end(T (&)[N])):
Add missing 'noexcept' as per LWG 2280.
(rbegin(T (&)[N]), rend(T (&)[N]), rbegin(initializer_list<T>))
(rend(initializer_list<T>)): Add 'noexcept' as per LWG 3537.
* testsuite/24_iterators/range_access.cc: Check for expected
noexcept specifiers. Check result types of generic std::begin
and std::end overloads.
* testsuite/24_iterators/range_access_cpp14.cc: Check for
expected noexcept specifiers.
* testsuite/24_iterators/range_access_cpp17.cc: Likewise.

(cherry picked from commit 00b46c00c8d9003c61e8f817668ad3380e16fedb)

3 years agoDaily bump.
GCC Administrator [Tue, 20 Apr 2021 00:18:49 +0000 (00:18 +0000)]
Daily bump.

3 years agod: Fix ICE in when formating a string with '%' or '`' characters (PR98457)
Iain Buclaw [Mon, 19 Apr 2021 16:45:32 +0000 (18:45 +0200)]
d: Fix ICE in when formating a string with '%' or '`' characters (PR98457)

The percentage character was being confused for a format specifier in
pp_format(), whilst the backtick character was confused for the
beginning of a quoted string in expand_d_format().

Both are now properly escaped to avoid the ICE.

gcc/d/ChangeLog:

PR d/98457
* d-diagnostic.cc (expand_d_format): Handle escaped backticks.
(escape_d_format): New funtion.
(verror): Call escape_d_format on prefixing strings.
(vdeprecation): Likewise.

gcc/testsuite/ChangeLog:

PR d/98457
* gdc.dg/pr98457.d: New test.

(cherry picked from commit dc7d1c74ffb1cc85e67984632f581d526c783770)

3 years agolibstdc++: Bodge tests that fail with COW strings
Jonathan Wakely [Mon, 19 Apr 2021 11:21:22 +0000 (12:21 +0100)]
libstdc++: Bodge tests that fail with COW strings

On the gcc-9 branch, the old std::basic_string does not use
std::allocator_traits to access members of the allocator. That causes
some tests to fail when using the minimal test allocator. Use a
different test allocator instead.

libstdc++-v3/ChangeLog:

* testsuite/27_io/filesystem/path/generic/94242.cc: Do not test
with minimal allocator when using COW strings.
* testsuite/experimental/filesystem/path/generic/generic_string.cc:
Likewise.

3 years agolibstdc++: Fix filesystem::path construction from COW string [PR 99805]
Jonathan Wakely [Wed, 7 Apr 2021 15:05:42 +0000 (16:05 +0100)]
libstdc++: Fix filesystem::path construction from COW string [PR 99805]

Calling the non-const data() member on a COW string makes it "leaked",
possibly resulting in reallocating the string to ensure a unique owner.

The path::_M_split_cmpts() member parses its _M_pathname string using
string_view objects and then calls _M_pathname.data() to find the offset
of each string_view from the start of the string. However because
_M_pathname is non-const that will cause a COW string to reallocate if
it happens to be shared with another string object. This results in the
offsets calculated for each component being wrong (i.e. undefined)
because the string views no longer refer to substrings of the
_M_pathname member. The fix is to use the parse.offset(c) member which
gets the offset safely.

The bug only happens for the path(string_type&&) constructor and only
for COW strings. When constructed from an lvalue string the string's
contents are copied rather than just incrementing the refcount, so
there's no reallocation when calling the non-const data() member. The
testsuite changes check the lvalue case anyway, because we should
probably change the deep copying to just be a refcount increment (by
adding a path(const string_type&) constructor or an overload for
__effective_range(const string_type&), for COW strings only).

libstdc++-v3/ChangeLog:

PR libstdc++/99805
* src/c++17/fs_path.cc (path::_M_split_cmpts): Do not call
non-const member on _M_pathname, to avoid copy-on-write.
* testsuite/27_io/filesystem/path/decompose/parent_path.cc:
Check construction from strings that might be shared.

(cherry picked from commit e06d3f5dd7d0c6b4a20fe813e6ee5addd097f560)

3 years agolibstdc++: Replace use of reserved name that clashes [PR 97362]
Jonathan Wakely [Sat, 10 Oct 2020 20:22:12 +0000 (21:22 +0100)]
libstdc++: Replace use of reserved name that clashes [PR 97362]

The name __deref is defined as a macro by Windows headers.

This renames the __deref() helper function to __ref. It doesn't actually
dereference an iterator. it just has the same type as the iterator's
reference type.

libstdc++-v3/ChangeLog:

PR libstdc++/97362
* doc/html/manual/source_code_style.html: Regenerate.
* doc/xml/manual/appendix_contributing.xml: Add __deref to
BADNAMES.
* include/debug/functions.h (_Irreflexive_checker::__deref):
Rename to __ref.

(cherry picked from commit 2137aa92412da363d52ef699987441be28b239d0)

3 years agolibstdc++: Fix declarations of memalign etc. for freestanding [PR 97570]
Jonathan Wakely [Mon, 26 Oct 2020 12:02:50 +0000 (12:02 +0000)]
libstdc++: Fix declarations of memalign etc. for freestanding [PR 97570]

libstdc++-v3/ChangeLog:

PR libstdc++/97570
* libsupc++/new_opa.cc: Declare size_t in global namespace.
Remove unused header.

(cherry picked from commit 93e9a7bcd5434a24c945de33cd7fa01a25f68418)

3 years agolibstdc++: Fix errors from Library Fundamentals TS headers in C++11 [PR 98319]
Jonathan Wakely [Wed, 16 Dec 2020 13:37:17 +0000 (13:37 +0000)]
libstdc++: Fix errors from Library Fundamentals TS headers in C++11 [PR 98319]

Currently the <experimental/random>, <experimental/source_location> and
<experimental/utility> headers can be included in C++98 and C++11 modes,
but gives errors. With this change they can be included, but define
nothing.

libstdc++-v3/ChangeLog:

PR libstdc++/98319
* include/experimental/memory_resource: Add system_header pragma
and only define contents for C++14 and later.
* include/experimental/random: Only define contents for C++14
and later.
* include/experimental/source_location: Likewise.
* include/experimental/utility: Likewise.
* testsuite/experimental/feat-lib-fund.cc: Include all LFTS
headers that are present. Allow test to run for all modes.

(cherry picked from commit ab9bd93271061f436c10e35e261ecb73e2108ccc)

3 years agolibstdc++: Fix bootstrap with -fno-rtti [PR 99077]
Jonathan Wakely [Fri, 12 Feb 2021 10:37:56 +0000 (10:37 +0000)]
libstdc++: Fix bootstrap with -fno-rtti [PR 99077]

When libstdc++ is built without RTTI the __ios_failure type is just an
alias for std::ios_failure, so trying to construct it from an int won't
compile. This changes the RTTI-enabled __ios_failure type to have the
same constructor parameters as std::ios_failure, so that the constructor
takes the same arguments whether RTTI is enabled or not.

The __throw_ios_failure function now constructs the error_code, instead
of the __ios_failure constructor. As a drive-by fix that error_code is
constructed with std::generic_category() not std::system_category(),
because the int comes from errno which corresponds to the generic
category.

libstdc++-v3/ChangeLog:

PR libstdc++/99077
* src/c++11/cxx11-ios_failure.cc (__ios_failure(const char*, int)):
Change int parameter to error_code, to match std::ios_failure.
(__throw_ios_failure(const char*, int)): Construct error_code
from int parameter.

(cherry picked from commit 4591f7e5329dcc6ee9af2f314a050936d470ab5b)

3 years agolibstdc++: Document when C++11/14/17 support became stable [PR 99058]
Jonathan Wakely [Thu, 11 Feb 2021 15:35:23 +0000 (15:35 +0000)]
libstdc++: Document when C++11/14/17 support became stable [PR 99058]

libstdc++-v3/ChangeLog:

PR libstdc++/99058
* doc/xml/manual/status_cxx2011.xml: Document when support
became stable.
* doc/xml/manual/status_cxx2014.xml: Likewise.
* doc/xml/manual/status_cxx2017.xml: Likewise.
* doc/html/manual/status.html: Regenerate.

(cherry picked from commit ce43c906049b828c0472d8499b52ac6233c869d0)

3 years agoFix another -freorder-blocks-and-partition glitch with Windows SEH
Eric Botcazou [Mon, 19 Apr 2021 08:13:36 +0000 (10:13 +0200)]
Fix another -freorder-blocks-and-partition glitch with Windows SEH

Since GCC 8, the -freorder-blocks-and-partition pass can split a function
into hot and cold parts, thus generating 2 FDEs for a single function in
DWARF for exception purposes and doing an equivalent trick for Windows SEH.

Now the Windows system unwinder does not support arbitrarily large frames
and there is even a hard limit on the encoding of the CFI, which changes
the stack allocation strategy when it is topped and which must be reflected
everywhere.

gcc/
* config/i386/winnt.c (i386_pe_seh_cold_init): Properly deal with
frames larger than the SEH maximum frame size.
gcc/testsuite/
* gnat.dg/opt92.adb: New test.

3 years agoDaily bump.
GCC Administrator [Mon, 19 Apr 2021 00:18:47 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 18 Apr 2021 00:18:43 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 17 Apr 2021 00:18:42 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 16 Apr 2021 00:19:01 +0000 (00:19 +0000)]
Daily bump.

3 years agobackport TIGERLAKE part to GCC9.
Hongtao Liu [Tue, 20 Aug 2019 07:06:03 +0000 (07:06 +0000)]
backport TIGERLAKE part to GCC9.

2019-08-20  Lili Cui  <lili.cui@intel.com>

gcc/
* common/config/i386/i386-common.c
(processor_names): Add tigerlake.
(processor_alias_table): Ditto.
* config.gcc (x86_64_archs): Ditto.
* config/i386/driver-i386.c
(host_detect_local_cpu): Detect tigerlake, add "has_avx" to
classify processor.
* config/i386/i386-c.c (ix86_target_macros_internal): Handle
PROCESSOR_TIGERLAKE.
* config/i386/i386.c (m_TIGERLAKE): Define.
(m_CORE_AVX512): Add m_TIGERLAKE.
(processor_cost_table): Add skylake_cost for tigerlake.
(processor_model): Add M_INTEL_COREI7_TIGERLAKE.
(arch_names_table): Add tigerlake.
(get_builtin_code_for_version): Handle PROCESSOR_TIGERLAKE.
* config/i386/i386.h (TARGET_TIGERLAKE): Define.
(enum processor_type): Add PROCESSOR_TIGERLAKE.
(PTA_TIGERLAKE): Define.
* doc/extend.texi (__builtin_cpu_is): Add tigerlake.
* doc/invoke.texi (-march=cpu-type): Ditto.

gcc/testsuite/
* gcc.target/i386/funcspec-56.inc: Handle new march.
* g++.target/i386/mv16.C: Handle new march.

libgcc/
* config/i386/cpuinfo.h (enum processor_subtypes): Add
INTEL_COREI7_TIGERLAKE.

From-SVN: r274693

3 years agoDaily bump.
GCC Administrator [Thu, 15 Apr 2021 00:19:05 +0000 (00:19 +0000)]
Daily bump.

3 years agoSync gcc-changelog scripts.
Martin Liska [Wed, 14 Apr 2021 13:39:10 +0000 (15:39 +0200)]
Sync gcc-changelog scripts.

contrib/ChangeLog:

* gcc-changelog/git_commit.py: Sync with master.
* gcc-changelog/git_email.py: Likewise.
* gcc-changelog/git_update_version.py: Likewise.
* gcc-changelog/setup.cfg: Likewise.
* gcc-changelog/test_email.py: Likewise.
* gcc-changelog/test_patches.txt: Likewise.

3 years agoDaily bump.
GCC Administrator [Wed, 14 Apr 2021 00:18:45 +0000 (00:18 +0000)]
Daily bump.

3 years agoFurther increase the limit on the size of accepted Ada files
Eric Botcazou [Tue, 13 Apr 2021 15:10:45 +0000 (17:10 +0200)]
Further increase the limit on the size of accepted Ada files

It turns out that the limit on the size of accepted Ada files had been
already lowered earlier, namely when location ranges had been introduced.
Now we do not make use of location ranges in Ada so we can recoup the loss.

gcc/ada/
* gcc-interface/misc.c (gnat_init): Set default range bits to 0.
* gcc-interface/trans.c (extract_encoding): Delete.
(decode_name): Likewise.
(File_Name_to_gnu): New function.
(gigi): Call it to translate file names.  Replace assertion on
1-1 mapping between files and line maps with conditional error.

3 years agoFix thinko in libcpp preparation patch for modules
Eric Botcazou [Tue, 13 Apr 2021 09:57:55 +0000 (11:57 +0200)]
Fix thinko in libcpp preparation patch for modules

The problem is that the new IS_MACRO_LOC macro:

inline bool
IS_MACRO_LOC (location_t loc)
{
  return !IS_ORDINARY_LOC (loc) && !IS_ADHOC_LOC (loc);
}

is not fully correct since the position of the macro lines is not fixed:

/* Returns the lowest location [of a token resulting from macro
   expansion] encoded in this line table.  */
inline location_t
LINEMAPS_MACRO_LOWEST_LOCATION (const line_maps *set)
{
  return LINEMAPS_MACRO_USED (set)
         ? MAP_START_LOCATION (LINEMAPS_LAST_MACRO_MAP (set))
         : MAX_LOCATION_T + 1;
}

In Ada, LINEMAPS_MACRO_USED is false so LINEMAPS_MACRO_LOWEST_LOCATION is
MAX_LOCATION_T + 1, but IS_MACRO_LOC nevertheless returns true for anything
in the range [LINE_MAP_MAX_LOCATION; MAX_LOCATION_T], thus yielding an ICE
in linemap_macro_map_lookup for very large files.

libcpp/
* include/line-map.h (IS_MACRO_LOC): Delete.
* line-map.c (linemap_location_from_macro_expansion_p): Test
LINEMAPS_MACRO_LOWEST_LOCATION of the linemap.

3 years agoDaily bump.
GCC Administrator [Tue, 13 Apr 2021 00:18:39 +0000 (00:18 +0000)]
Daily bump.

3 years agoPR47785: Add support for handling Xassembler/Wa options with LTO.
Prathamesh Kulkarni [Mon, 24 Feb 2020 06:25:45 +0000 (11:55 +0530)]
PR47785: Add support for handling Xassembler/Wa options with LTO.

Skip the test if arm7a is not supported at link time. This is the case
if the toolchain targets an M-profile CPU by default and does not have
A-profile multilib: the link step fails because it tries to mix
M-profile startup files with A-profile testcase.

gcc/

2020-02-24  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
    Kugan Vivekandarajah  <kugan.vivekanandarajah@linaro.org>

PR driver/47785
* gcc.c (putenv_COLLECT_AS_OPTIONS): New function.
(driver::main): Call putenv_COLLECT_AS_OPTIONS.
* opts-common.c (parse_options_from_collect_gcc_options): New function.
(prepend_xassembler_to_collect_as_options): Likewise.
* opts.h (parse_options_from_collect_gcc_options): Declare prototype.
(prepend_xassembler_to_collect_as_options): Likewise.
* lto-opts.c (lto_write_options): Stream assembler options
in COLLECT_AS_OPTIONS.
* lto-wrapper.c (xassembler_options_error): New static variable.
(get_options_from_collect_gcc_options): Move parsing options code to
parse_options_from_collect_gcc_options and call it.
(merge_and_complain): Validate -Xassembler options.
(append_compiler_options): Handle OPT_Xassembler.
(run_gcc): Append command line -Xassembler options to
collect_gcc_options.
* doc/invoke.texi: Add documentation about using Xassembler
options with LTO.

gcc/testsuite/

2020-02-24  Christophe Lyon  <christophe.lyon@linaro.org>

PR lto/78353
* gcc.target/arm/pr78353-1.c: Add arm_arch_v7a_multilib effective
target.
* gcc.target/arm/pr78353-2.c: Likewise.

2020-02-24  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
    Kugan Vivekandarajah  <kugan.vivekanandarajah@linaro.org>

* gcc.target/arm/pr78353-1.c: New test.
* gcc.target/arm/pr78353-2.c: Likewise.

(cherry picked from commit f1a681a174cdfb82e62c246d6f4add9a25fc2e43)

3 years agotree-optimization/99694 - fix value-numbering PHIs
Richard Biener [Mon, 22 Mar 2021 10:09:46 +0000 (11:09 +0100)]
tree-optimization/99694 - fix value-numbering PHIs

This avoids endless cycling when a PHI node with unchanged backedge
value (the PHI result appearing there) is subject to CSE since doing
that effectively alters the hash entry.  The way to avoid this is
to ignore such edges when processing the PHI node.

2021-03-22  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99694
* tree-ssa-sccvn.c (visit_phi): Ignore edges with the
PHI result.

* gcc.dg/torture/pr99694.c: New testcase.

(cherry picked from commit b931e4792b8696f3da69f70988720c4d1ec6142a)

3 years agoc/99224 - avoid ICEing on invalid __builtin_next_arg
Richard Biener [Wed, 24 Feb 2021 08:18:05 +0000 (09:18 +0100)]
c/99224 - avoid ICEing on invalid __builtin_next_arg

This avoids crashes with __builtin_next_arg on non-parameters.  For
the specific testcase we arrive with an anonymous SSA_NAME so that
SSA_NAME_VAR becomes NULL and we crash.

2021-02-24  Richard Biener  <rguenther@suse.de>

PR c/99224
* builtins.c (fold_builtin_next_arg): Avoid NULL arg.

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

(cherry picked from commit 084963dcaca2f0836366fdb001561e29ecbfb483)

3 years agolto/96591 - walk VECTOR_CST elements in walk_tree
Richard Biener [Mon, 8 Feb 2021 08:52:56 +0000 (09:52 +0100)]
lto/96591 - walk VECTOR_CST elements in walk_tree

This implements walking of VECTOR_CST elements in walk_tree, mimicing
the walk of COMPLEX_CST elements.  Without this free-lang-data fails
to see some types in case they are only refered to via tree constants
used only as VECTOR_CST elements.

2021-02-08  Richard Biener  <rguenther@suse.de>

PR lto/96591
* tree.c (walk_tree_1): Walk VECTOR_CST elements.

* g++.dg/lto/pr96591_0.C: New testcase.

(cherry picked from commit d4536e431316b4568e236afd7a6017e5efd1b0a1)

3 years agolto/96385 - avoid unused global UNDEFs in debug objects
Richard Biener [Mon, 3 Aug 2020 13:05:37 +0000 (15:05 +0200)]
lto/96385 - avoid unused global UNDEFs in debug objects

Unused global UNDEFs can have side-effects in some circumstances so
the following patch avoids them by treating them the same as other
to be discarded DEFs - make them local.

2020-08-03  Richard Biener  <rguenther@suse.de>

PR lto/96385
libiberty/
* simple-object-elf.c
(simple_object_elf_copy_lto_debug_sections): Localize global
UNDEFs and reuse the prevailing name.

(cherry picked from commit b32c5d0b72fda2588b4e170e75a9c64e4bf266c7)

3 years agoDaily bump.
GCC Administrator [Mon, 12 Apr 2021 00:18:46 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 11 Apr 2021 00:18:51 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 10 Apr 2021 00:18:42 +0000 (00:18 +0000)]
Daily bump.

3 years agolibstdc++: Fix bootstrap error due to inconsistent noexcept-specifier [PR 99983]
Jonathan Wakely [Fri, 9 Apr 2021 14:47:26 +0000 (15:47 +0100)]
libstdc++: Fix bootstrap error due to inconsistent noexcept-specifier [PR 99983]

The backport of r11-8062 as r9-9328 missed out a piece, which causes
bootstrap failures.

PR bootstrap/99983
* include/bits/hashtable.h (_Hashtable): Fix noexcept-specifier
on definition to match the one on the declaration.

3 years agolibstdc++: Fix invalid constexpr function in C++11 mode [PR 99985]
Jonathan Wakely [Fri, 9 Apr 2021 11:05:39 +0000 (12:05 +0100)]
libstdc++: Fix invalid constexpr function in C++11 mode [PR 99985]

I keep forgetting that a constexpr function in C++11 has to be a single
return statement.

libstdc++-v3/ChangeLog:

PR libstdc++/99985
* include/bits/hashtable.h (_Hashtable::_S_nothrow_move()): Fix
to be a valid constexpr function in C++11.
* testsuite/23_containers/unordered_set/cons/99985.cc: New test.

(cherry picked from commit 40ccb47b505b528244ee305923681c0ae3b6f4d5)

3 years agolibstdc++: Fix even more doxygen markup for group close commands
Jonathan Wakely [Thu, 8 Apr 2021 23:24:41 +0000 (00:24 +0100)]
libstdc++: Fix even more doxygen markup for group close commands

More fixes like r11-8009 and r11-8066.

libstdc++-v3/ChangeLog:

* include/bits/fs_fwd.h: Fix doxygen group command.
* include/bits/regex.h: Likewise.
* include/bits/streambuf_iterator.h: Likewise.
* include/bits/unique_lock.h: Likewise.
* include/std/chrono: Likewise.
* include/std/thread: Likewise.
* include/tr1/complex: Likewise.

(cherry picked from commit 72ddd861d3881eba141c41c1ccbb4e8b3be159a5)

3 years agoDaily bump.
GCC Administrator [Fri, 9 Apr 2021 00:19:20 +0000 (00:19 +0000)]
Daily bump.

3 years agolibstdc++: Fix Doxygen warnings
Jonathan Wakely [Tue, 6 Apr 2021 15:24:06 +0000 (16:24 +0100)]
libstdc++: Fix Doxygen warnings

libstdc++-v3/ChangeLog:

* include/bits/alloc_traits.h: Use markdown for code font.
* include/bits/basic_string.h: Fix @param names.
* include/bits/regex.h: Fix duplicate @retval names, and rename.
* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp: Add
group open to match existing group close.
* include/ext/pb_ds/priority_queue.hpp: Add blank line before group
open.

(cherry picked from commit daef4e4d934716b933fa445a0ec6650aeb642751)

3 years agolibstdc++: Fix more doxygen markup for group close commands
Jonathan Wakely [Thu, 8 Apr 2021 17:22:51 +0000 (18:22 +0100)]
libstdc++: Fix more doxygen markup for group close commands

Similar to r11-8009 but for /* @} */ comments this time, which should
be /** @} */ for Doxygen to recognize them.

libstdc++-v3/ChangeLog:

* include/bits/random.h: Fix doxygen group commands.
* include/bits/regex_constants.h: Likewise.
* include/tr1/random.h: Likewise.

(cherry picked from commit 014b6dbcaa80fc46c792c270244e7eeef7dce75f)

3 years agolibstdc++: Fix doxygen markup for group close commands
Jonathan Wakely [Tue, 6 Apr 2021 14:52:19 +0000 (15:52 +0100)]
libstdc++: Fix doxygen markup for group close commands

A change in Doxygen 1.8.16 means that "// @}" is no longer recognized by
Doxygen, so doesn't close a @{ group. A "///" comment needs to be used.

libstdc++-v3/ChangeLog:

* include/bits/atomic_base.h: Fix doxygen group close.
* include/bits/basic_ios.h: Likewise.
* include/bits/forward_list.h: Likewise.
* include/bits/fs_dir.h: Likewise.
* include/bits/fs_ops.h: Likewise.
* include/bits/fs_path.h: Likewise.
* include/bits/functional_hash.h: Likewise.
* include/bits/gslice.h: Likewise.
* include/bits/gslice_array.h: Likewise.
* include/bits/hashtable_policy.h: Likewise.
* include/bits/indirect_array.h: Likewise.
* include/bits/locale_classes.h: Likewise.
* include/bits/locale_facets.h: Likewise.
* include/bits/locale_facets_nonio.h: Likewise.
* include/bits/mask_array.h: Likewise.
* include/bits/refwrap.h: Likewise.
* include/bits/regex.h: Likewise.
* include/bits/regex_automaton.h: Likewise.
* include/bits/regex_compiler.h: Likewise.
* include/bits/regex_constants.h: Likewise.
* include/bits/regex_error.h: Likewise.
* include/bits/regex_executor.h: Likewise.
* include/bits/regex_scanner.h: Likewise.
* include/bits/shared_ptr.h: Likewise.
* include/bits/shared_ptr_atomic.h: Likewise.
* include/bits/slice_array.h: Likewise.
* include/bits/specfun.h: Likewise.
* include/bits/std_function.h: Likewise.
* include/bits/std_mutex.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_iterator.h: Likewise.
* include/bits/stl_iterator_base_types.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_numeric.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stream_iterator.h: Likewise.
* include/bits/streambuf_iterator.h: Likewise.
* include/bits/unique_ptr.h: Likewise.
* include/bits/unordered_map.h: Likewise.
* include/bits/unordered_set.h: Likewise.
* include/decimal/decimal: Likewise.
* include/experimental/any: Likewise.
* include/experimental/array: Likewise.
* include/experimental/bits/fs_dir.h: Likewise.
* include/experimental/bits/fs_fwd.h: Likewise.
* include/experimental/bits/fs_ops.h: Likewise.
* include/experimental/bits/fs_path.h: Likewise.
* include/experimental/buffer: Likewise.
* include/experimental/internet: Likewise.
* include/experimental/optional: Likewise.
* include/experimental/propagate_const: Likewise.
* include/experimental/socket: Likewise.
* include/ext/pb_ds/assoc_container.hpp: Likewise.
* include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:
Likewise.
* include/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp: Likewise.
* include/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp: Likewise.
* include/ext/pb_ds/detail/types_traits.hpp: Likewise.
* include/ext/pb_ds/exception.hpp: Likewise.
* include/ext/pb_ds/priority_queue.hpp: Likewise.
* include/ext/pb_ds/tag_and_trait.hpp: Likewise.
* include/ext/random: Likewise.
* include/std/any: Likewise.
* include/std/atomic: Likewise.
* include/std/bitset: Likewise.
* include/std/complex: Likewise.
* include/std/condition_variable: Likewise.
* include/std/fstream: Likewise.
* include/std/future: Likewise.
* include/std/istream: Likewise.
* include/std/iostream: Likewise.
* include/std/mutex: Likewise.
* include/std/numeric: Likewise.
* include/std/ostream: Likewise.
* include/std/ratio: Likewise.
* include/std/shared_mutex: Likewise.
* include/std/stdexcept: Likewise.
* include/std/streambuf: Likewise.
* include/std/valarray: Likewise.
* include/std/variant: Likewise.
* include/tr1/cmath: Likewise.
* include/tr1/regex: Likewise.
* include/tr2/dynamic_bitset: Likewise.
* libsupc++/atomic_lockfree_defines.h: Likewise.
* libsupc++/exception: Likewise.
* libsupc++/exception.h: Likewise.
* libsupc++/exception_ptr.h: Likewise.
* libsupc++/nested_exception.h: Likewise.

(cherry picked from commit f0b883464c58cb2f3f521776e65008b1fa75f79e)

3 years agolibstdc++: Fix Doxygen warning about ambiguous file name
Jonathan Wakely [Thu, 8 Apr 2021 13:47:47 +0000 (14:47 +0100)]
libstdc++: Fix Doxygen warning about ambiguous file name

libstdc++-v3/ChangeLog:

* include/std/string_view: Adjust Doxygen @file comment.

(cherry picked from commit 2c1557ac7b7652c63418abac1a1c4b7a9860a9f9)

3 years agolibstdc++: Fix unordered containers move constructors noexcept qualification
François Dumont [Mon, 20 Jan 2020 18:15:43 +0000 (19:15 +0100)]
libstdc++: Fix unordered containers move constructors noexcept qualification

_Hashtable move constructor is wrongly qualified as noexcept(true) regardless of
_Equal and _H1 copy constructor qualifications.
_Hashtable allocator-aware move constructor is missing its noexcept
qualification like the depending unordered containers ones.

This backport also includes the changes from r11-8062 and r11-2438.

libstdc++-v3/ChangeLog:

PR libstdc++/96029
* include/bits/hashtable.h
(_Hashtable(_Hashtable&& __ht, __node_alloc_type&& __a, true_type)):
Add noexcept qualification.
(_Hashtable(_Hashtable&&)): Fix noexcept qualification.
(_Hashtable(_Hashtable&&, const allocator_type&)): Add noexcept
qualification.
* include/bits/unordered_map.h
(unordered_map(unordered_map&&, const allocator_type&)): Add noexcept
qualification.
(unordered_multimap(unordered_multimap&&, const allocator_type&)):
Likewise.
* include/bits/unordered_set.h
(unordered_set(unordered_set&&, const allocator_type&)): Likewise.
(unordered_multiset(unordered_multiset&&, const allocator_type&)):
Likewise.
* include/debug/unordered_map
(unordered_map(unordered_map&&, const allocator_type&)): Likewise.
(unordered_multimap(unordered_multimap&&, const allocator_type&)):
Likewise.
* include/debug/unordered_set
(unordered_set(unordered_set&&, const allocator_type&)): Likewise.
(unordered_multiset(unordered_multiset&&, const allocator_type&)):
Likewise.
* testsuite/23_containers/unordered_map/allocator/default_init.cc:
New test.
* testsuite/23_containers/unordered_map/cons/noexcept_default_construct.cc:
New test.
* testsuite/23_containers/unordered_map/cons/noexcept_move_construct.cc:
New test.
* testsuite/23_containers/unordered_map/modifiers/move_assign.cc:
New test.
* testsuite/23_containers/unordered_multimap/cons/noexcept_default_construct.cc:
New test.
* testsuite/23_containers/unordered_multimap/cons/noexcept_move_construct.cc:
New test.
* testsuite/23_containers/unordered_multiset/cons/noexcept_default_construct.cc:
New test.
* testsuite/23_containers/unordered_multiset/cons/noexcept_move_construct.cc:
New test.
* testsuite/23_containers/unordered_set/allocator/default_init.cc:
New test.
* testsuite/23_containers/unordered_set/cons/noexcept_default_construct.cc:
New test.
* testsuite/23_containers/unordered_set/cons/noexcept_move_construct.cc:
New test.

(cherry picked from commit 12324b9a934654a5c3bf4a614853ded2e0a958af)

3 years agolibstdc++: Fix [multi]map/[multi]set move constructors noexcept qualification
François Dumont [Fri, 3 Jul 2020 06:13:19 +0000 (08:13 +0200)]
libstdc++: Fix [multi]map/[multi]set move constructors noexcept qualification

Container move constructors shall not consider their allocator move
constructor qualification.

For the backport to gcc-9 the _Rb_tree_impl move constructor must be
user-provided, because prior to the implementation of P1286R2 in
r10-4094, a defaulted special member with a different exception would be
deleted.

libstdc++-v3/ChangeLog:

PR libstdc++/96029
* include/bits/stl_tree.h (_Rb_tree_impl(_Rb_tree_impl&&)): Add noexcept
qualification based only on _Compare one.
* testsuite/23_containers/map/cons/noexcept_move_construct.cc: Add
static asserts.
* testsuite/23_containers/multimap/cons/noexcept_move_construct.cc:
Likewise.
* testsuite/23_containers/multiset/cons/noexcept_move_construct.cc:
Likewise.
* testsuite/23_containers/set/cons/noexcept_move_construct.cc: Likewise.

(cherry picked from commit c832cf1c1d114aed70c2f84566cf4d63de0a56d0)

3 years agosra: Fix bug in grp_write propagation (PR 97009)
Martin Jambor [Thu, 8 Apr 2021 16:57:48 +0000 (18:57 +0200)]
sra: Fix bug in grp_write propagation (PR 97009)

SRA represents parts of aggregates which are arrays accessed with
unknown index as "unscalarizable regions."  When there are two such
regions one within another and the outer is only read whereas the
inner is written to, SRA fails to propagate that write information
across assignments.  This means that a second aggregate can contain
data while SRA thinks it does not and the pass can wrongly eliminate
big chunks of assignment from that second aggregate into a third
aggregate, which is what happens in PR 97009.

Fixed by checking all children of unscalariable accesses for the
grp_write flag.

gcc/ChangeLog:

2021-03-31  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/97009
* tree-sra.c (access_or_its_child_written): New function.
(propagate_subaccesses_from_rhs): Use it instead of a simple grp_write
test.

gcc/testsuite/ChangeLog:

2021-03-31  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/97009
* gcc.dg/tree-ssa/pr97009.c: New test.

(cherry picked from commit 19d71674616e6494a60432a2a28adcd762a6c877)

3 years agoDaily bump.
GCC Administrator [Thu, 8 Apr 2021 00:19:05 +0000 (00:19 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 7 Apr 2021 00:18:59 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 6 Apr 2021 00:19:14 +0000 (00:19 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 5 Apr 2021 00:18:54 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 4 Apr 2021 00:18:56 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 3 Apr 2021 00:18:51 +0000 (00:18 +0000)]
Daily bump.

3 years agoPR fortran/99840 - ICE in gfc_simplify_matmul, at fortran/simplify.c:4777
Harald Anlauf [Thu, 1 Apr 2021 05:49:32 +0000 (07:49 +0200)]
PR fortran/99840 - ICE in gfc_simplify_matmul, at fortran/simplify.c:4777

The simplification of the transposition of a constant array shall properly
initialize and set the shape of the result.

gcc/fortran/ChangeLog:

PR fortran/99840
* simplify.c (gfc_simplify_transpose): Properly initialize
resulting shape.

gcc/testsuite/ChangeLog:

PR fortran/99840
* gfortran.dg/transpose_5.f90: New test.

(cherry picked from commit d7cef070bf43bfb3f3d77bac42eadea06c4b0281)

3 years agoDaily bump.
GCC Administrator [Fri, 2 Apr 2021 00:18:49 +0000 (00:18 +0000)]
Daily bump.

3 years agotree-optimization/99856 - fix overwideing pattern creation
Richard Biener [Thu, 1 Apr 2021 07:29:14 +0000 (09:29 +0200)]
tree-optimization/99856 - fix overwideing pattern creation

This fixes an omission of promoting a bit-precision required precision
to a vector element precision.

2021-04-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99856
* tree-vect-patterns.c (vect_recog_over_widening_pattern): Promote
precision to vector element precision.

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

(cherry picked from commit 1cfe48d35e31e905632e37ae6a9cb37d35f9a228)

3 years agoDaily bump.
GCC Administrator [Thu, 1 Apr 2021 00:19:08 +0000 (00:19 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 31 Mar 2021 00:18:50 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 30 Mar 2021 00:18:57 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 29 Mar 2021 00:18:40 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 28 Mar 2021 00:18:38 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 27 Mar 2021 00:18:42 +0000 (00:18 +0000)]
Daily bump.

3 years agoFix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 [PR99466]
Iain Buclaw [Sat, 13 Mar 2021 16:05:52 +0000 (17:05 +0100)]
Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795 [PR99466]

In get_emutls_init_templ_addr, only thread-local declarations that were
DECL_ONE_ONLY would have a public initializer symbol, ignoring variables
that were declared with __attribute__((weak)).

gcc/ChangeLog:

PR ipa/99466
* tree-emutls.c (get_emutls_init_templ_addr): Mark initializer of weak
TLS declarations as public.

gcc/testsuite/ChangeLog:

PR ipa/99466
* gcc.dg/tls/pr99466-1.c: New test.
* gcc.dg/tls/pr99466-2.c: New test.

(cherry picked from commit 8f5e18db259c8a9790feb1d73bb0348182264f15)

3 years agoDaily bump.
GCC Administrator [Fri, 26 Mar 2021 00:18:41 +0000 (00:18 +0000)]
Daily bump.

3 years agolibgomp HSA/GCN plugins: don't prepend the 'HSA_RUNTIME_LIB' path to 'libhsa-runtime6...
Thomas Schwinge [Thu, 25 Jun 2020 09:59:42 +0000 (11:59 +0200)]
libgomp HSA/GCN plugins: don't prepend the 'HSA_RUNTIME_LIB' path to 'libhsa-runtime64.so'

For unknown reasons, this had gotten added for the libgomp HSA plugin in commit
b8d89b03db5f212919e4571671ebb4f5f8b1e19d (r242749) "Remove build dependence on
HSA run-time", and later propagated into the GCN plugin.

libgomp/
* plugin/plugin-hsa.c (init_enviroment_variables): Don't prepend
the 'HSA_RUNTIME_LIB' path to 'libhsa-runtime64.so'.
* plugin/configfrag.ac (HSA_RUNTIME_LIB): Clean up.
* config.h.in: Regenerate.
* configure: Likewise.

(cherry picked from commit 7c1e856bedb4ae190c420ec2d2ca5e08730cf21d)

3 years agors6000: Correct Power8 cost of l2 cache size [PR97329]
Xionghu Luo [Thu, 25 Mar 2021 04:45:58 +0000 (23:45 -0500)]
rs6000: Correct Power8 cost of l2 cache size [PR97329]

This patch is a backport to gcc 9 from master.
L2 cache size for Power8 is 512kB, it was copied from Power7 before
public.  Tested no performance change for SPEC2017.

gcc/
2021-03-25  Xionghu Luo  <luoxhu@linux.ibm.com>

PR target/97329
* config/rs6000/rs6000.c (power8_costs): Change l2 cache
from 256 to 512.

(cherry picked from commit 08103e4d6ada9b57366f2df2a2b745babfab914c)

3 years agoDaily bump.
GCC Administrator [Thu, 25 Mar 2021 00:19:03 +0000 (00:19 +0000)]
Daily bump.

3 years agoFortran: Fix 'name' bound size [PR99688]
Tobias Burnus [Mon, 22 Mar 2021 08:49:48 +0000 (09:49 +0100)]
Fortran: Fix 'name' bound size [PR99688]

gcc/fortran/ChangeLog:

PR fortran/99688
* match.c (select_type_set_tmp, gfc_match_select_type) Fix 'name'
buffersize to avoid out of bounds.
* resolve.c (resolve_select_type): Likewise.

(cherry picked from commit 0e792ee11aa6ebb6f61e9ed33eb06e260f0ec703)

3 years agoDaily bump.
GCC Administrator [Wed, 24 Mar 2021 00:18:52 +0000 (00:18 +0000)]
Daily bump.

3 years agox86: Add __volatile__ to __cpuid and __cpuid_count
H.J. Lu [Mon, 22 Mar 2021 02:47:24 +0000 (19:47 -0700)]
x86: Add __volatile__ to __cpuid and __cpuid_count

Since CPUID instruction may return different values on hybrid core.
volatile is needed on asm statements in <cpuid.h>.

PR target/99704
* config/i386/cpuid.h (__cpuid): Add __volatile__.
(__cpuid_count): Likewise.

(cherry picked from commit 9c89c9e9c6b59260c7745c8714b69f94784a9c13)

3 years agoDaily bump.
GCC Administrator [Tue, 23 Mar 2021 00:18:52 +0000 (00:18 +0000)]
Daily bump.

3 years agoPR target/99702: Check RTL type before get value
Kito Cheng [Mon, 22 Mar 2021 08:32:45 +0000 (16:32 +0800)]
PR target/99702: Check RTL type before get value

gcc/ChangeLog:

PR target/99702
* config/riscv/riscv.c (riscv_expand_block_move): Get RTL value
after type checking.

gcc/testsuite/ChangeLog:

PR target/99702
* gcc.target/riscv/pr99702.c: New.

(cherry picked from commit 540dace2ed3949571f2ce6cb007354e69bda0cb2)

3 years agoDaily bump.
GCC Administrator [Mon, 22 Mar 2021 00:18:38 +0000 (00:18 +0000)]
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 21 Mar 2021 00:18:33 +0000 (00:18 +0000)]
Daily bump.

3 years agoPR fortran/97491 - Wrong restriction for VALUE arguments of pure procedures
Harald Anlauf [Tue, 27 Oct 2020 19:25:23 +0000 (20:25 +0100)]
PR fortran/97491 - Wrong restriction for VALUE arguments of pure procedures

A dummy argument with the VALUE attribute may be redefined in a PURE or
ELEMENTAL procedure.  Adjust the associated purity check.

gcc/fortran/ChangeLog:

* resolve.c (gfc_impure_variable): A dummy argument with the VALUE
attribute may be redefined without making a procedure impure.

gcc/testsuite/ChangeLog:

* gfortran.dg/value_8.f90: New test.

(cherry picked from commit a764c40079a493826a3678174f908941a383644e)

3 years agoDaily bump.
GCC Administrator [Sat, 20 Mar 2021 00:18:49 +0000 (00:18 +0000)]
Daily bump.

3 years agosubstitute @tie{} with a space for the man pages
Matthias Klose [Fri, 19 Mar 2021 10:03:02 +0000 (10:03 +0000)]
substitute @tie{} with a space for the man pages

contrib/

2021-03-19  Matthias Klose  <doko@ubuntu.com>

* texi2pod.pl: Substitute @tie{} with a space for the man pages.

(cherry picked from commit 3b0155305e5168b48d19f74e9bfcdf423a532ada)

3 years agoDaily bump.
GCC Administrator [Fri, 19 Mar 2021 00:18:39 +0000 (00:18 +0000)]
Daily bump.

3 years agoPR target/99314: Fix integer signedness issue for cpymem pattern expansion.
Sinan Lin [Thu, 4 Mar 2021 10:02:39 +0000 (18:02 +0800)]
PR target/99314: Fix integer signedness issue for cpymem pattern expansion.

Third operand of cpymem pattern is unsigned HOST_WIDE_INT, however we
are interpret that as signed HOST_WIDE_INT, that not a problem in
most case, but when the value is large than signed HOST_WIDE_INT, it
might screw up since we have using that value to calculate the buffer
size.

2021-03-05  Sinan Lin  <sinan@isrc.iscas.ac.cn>
    Kito Cheng  <kito.cheng@sifive.com>

gcc/ChangeLog:

* config/riscv/riscv.c (riscv_block_move_straight): Change type
to unsigned HOST_WIDE_INT for parameter and local variable with
HOST_WIDE_INT type.
(riscv_adjust_block_mem): Ditto.
(riscv_block_move_loop): Ditto.
(riscv_expand_block_move): Ditto.

(cherry picked from commit d9f0ade001533c9544bf2153b6baa8844ec0bee4)

3 years agoDaily bump.
GCC Administrator [Thu, 18 Mar 2021 00:18:43 +0000 (00:18 +0000)]
Daily bump.

This page took 0.907169 seconds and 5 git commands to generate.