]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
3 years agoDaily bump.
GCC Administrator [Wed, 12 Jan 2022 00:17:22 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 11 Jan 2022 00:17:51 +0000 (00:17 +0000)] 
Daily bump.

3 years agoProperly enable -freorder-blocks-and-partition on 64-bit Windows
Eric Botcazou [Mon, 10 Jan 2022 11:40:10 +0000 (12:40 +0100)] 
Properly enable -freorder-blocks-and-partition on 64-bit Windows

The PR uncovered that -freorder-blocks-and-partition was working by accident
on 64-bit Windows, i.e. the middle-end was supposed to disable it with SEH.
After the change installed on mainline, the middle-end properly disables it,
which is too bad since a significant amount of work went into it for SEH.

gcc/
PR target/103465
* coretypes.h (unwind_info_type): Swap UI_SEH and UI_TARGET.

3 years agoDaily bump.
GCC Administrator [Mon, 10 Jan 2022 00:17:25 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 9 Jan 2022 00:17:19 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 8 Jan 2022 00:17:21 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFortran: fix passing return value to class(*) dummy argument
Harald Anlauf [Sun, 23 May 2021 18:51:14 +0000 (20:51 +0200)] 
Fortran: fix passing return value to class(*) dummy argument

gcc/fortran/ChangeLog:

PR fortran/100551
* trans-expr.c (gfc_conv_procedure_call): Adjust check for
implicit conversion of actual argument to an unlimited polymorphic
procedure argument.

gcc/testsuite/ChangeLog:

PR fortran/100551
* gfortran.dg/pr100551.f90: New test.

(cherry picked from commit fe03f4fc9548b3fdbff3c8284a994feaa7d6307d)

3 years agoDaily bump.
GCC Administrator [Fri, 7 Jan 2022 00:17:18 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 6 Jan 2022 00:17:23 +0000 (00:17 +0000)] 
Daily bump.

3 years agolibstdc++: Fix std::char_traits<C>::move for constexpr
Jonathan Wakely [Thu, 18 Nov 2021 12:39:20 +0000 (12:39 +0000)] 
libstdc++: Fix std::char_traits<C>::move for constexpr

The constexpr branch in __gnu_cxx::char_traits::move compares the string
arguments to see if they overlap, but relational comparisons between
unrelated pointers are not core constant expressions.

I want to replace the comparisons with a loop using pointer equality to
determine whether the end of the source string is in the destination
string. However, that doesn't work with GCC, due to PR c++/89074 so
allocate a temporary buffer instead and copy out into that first, so
that overlapping source and destination don't matter. The allocation
isn't supported by the current Intel icc so use the loop as a fallback.

libstdc++-v3/ChangeLog:

* include/bits/char_traits.h (__gnu_cxx::char_traits::move):
Do not compare unrelated pointers during constant evaluation.
* testsuite/21_strings/char_traits/requirements/constexpr_functions_c++20.cc:
Improve tests for char_traits::move.

(cherry picked from commit ca243ada71656651a8753e88164a1f0f019be1c3)

3 years agolibstdc++: Fix example preprocessor command in FAQ [PR103877]
Jonathan Wakely [Tue, 4 Jan 2022 15:54:16 +0000 (15:54 +0000)] 
libstdc++: Fix example preprocessor command in FAQ [PR103877]

libstdc++-v3/ChangeLog:

PR libstdc++/103877
* doc/xml/faq.xml: Add '-x c++' to preprocessor command.
* doc/html/faq.html: Regenerate.

(cherry picked from commit cebe875f6f44b905a0d56a2007b5a638a33a893c)

3 years agolibstdc++: Initialize member in std::match_results [PR103549]
Jonathan Wakely [Sat, 4 Dec 2021 11:38:25 +0000 (11:38 +0000)] 
libstdc++: Initialize member in std::match_results [PR103549]

This fixes a -Wuninitialized warning for std::cmatch m1, m2; m1=m2;

Also name the template parameters in the forward declaration, to get rid
of the <template-parameter-1-1> noise in diagnostics.

libstdc++-v3/ChangeLog:

PR libstdc++/103549
* include/bits/regex.h (match_results): Give names to template
parameters in first declaration.
(match_results::_M_begin): Add default member-initializer.

(cherry picked from commit 87710ec7b213245ecb194b778e97ae3a6790394f)

3 years agolibstdc++: Make Asan detection work for Clang [PR103453]
Jonathan Wakely [Tue, 30 Nov 2021 13:14:38 +0000 (13:14 +0000)] 
libstdc++: Make Asan detection work for Clang [PR103453]

Clang doesn't define __SANITIZE_ADDRESS__ so use its __has_feature check
to detect Asan instead.

libstdc++-v3/ChangeLog:

PR libstdc++/103453
* config/allocator/malloc_allocator_base.h
(_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define for Clang.
* config/allocator/new_allocator_base.h
(_GLIBCXX_SANITIZE_STD_ALLOCATOR): Likewise.

(cherry picked from commit cca6090b13ab503bef1cfa327e2d107789d6bd30)

3 years agolibstdc++: Fix std::error_code pretty printer for versioned namespace
Jonathan Wakely [Wed, 5 Jan 2022 14:06:43 +0000 (14:06 +0000)] 
libstdc++: Fix std::error_code pretty printer for versioned namespace

libstdc++-v3/ChangeLog:

* python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Strip
versioned namespace from the type name that is printed.

(cherry picked from commit 1918067e2d0d79ccaf1e4ed98096060fc235e772)

3 years agolibstdc++: Fix std::allocator<void> for versioned namespace
Jonathan Wakely [Sat, 28 Aug 2021 10:05:58 +0000 (11:05 +0100)] 
libstdc++: Fix std::allocator<void> for versioned namespace

Removing the allocator<void> specialization for the versioned namespace
breaks _Extptr_allocator<void> because the allocator<void>
specialization was still declared in <bits/memoryfwd.h>, making it an
incomplete type.  It wrong to remove that specialization anyway, because
it is still needed pre-C++20.

This removes the #if ! _GLIBCXX_INLINE_VERSION check, so that
allocator<void> is still explicitly specialized for the versioned
namespace, consistent with the normal unversioned namespace mode.

To make _Extptr_allocator<void> usable as a ProtoAllocator, this change
adds a default constructor and converting constructor. That is
consistent with std::allocator<void> since C++20 (and harmless to do for
earlier standards).

I'm also explicitly specializing allocator_traits<allocator<void>> so
that it doesn't need to use allocator<void>::construct and destroy.
Doing that allows those members to be removed, further simplifying
allocator<void>.  That new explicit specialization can delete the
allocate, deallocate and max_size members, which are always ill-formed
for allocator<void>.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/alloc_traits.h (allocator_traits): Add explicit
specialization for allocator<void>. Improve doxygen comments.
* include/bits/allocator.h (allocator<void>): Restore for the
versioned namespace.
(allocator<void>::construct, allocator<void>::destroy): Remove.
* include/ext/extptr_allocator.h (_Extptr_allocator<void>):
Add default constructor and converting constructor.

(cherry picked from commit 754fca77e82a59d85c735a5aff49ee2b1ec4c6df)

3 years agolibstdc++: Add another testcase for std::unique_ptr printer [PR103086]
Jonathan Wakely [Tue, 23 Nov 2021 21:35:40 +0000 (21:35 +0000)] 
libstdc++: Add another testcase for std::unique_ptr printer [PR103086]

libstdc++-v3/ChangeLog:

PR libstdc++/103086
* testsuite/libstdc++-prettyprinters/cxx11.cc: Check unique_ptr
with non-empty pointer and non-empty deleter.

(cherry picked from commit c59ec55c3459fba619e05ee7f59480b71e85ffd7)

3 years agolibstdc++: Fix pretty printing of std::unique_ptr [PR103086]
Jonathan Wakely [Thu, 4 Nov 2021 22:50:02 +0000 (22:50 +0000)] 
libstdc++: Fix pretty printing of std::unique_ptr [PR103086]

Since std::tuple started using [[no_unique_address]] the tuple<T*, D>
member of std::unique_ptr<T, D> has two _M_head_impl subobjects, in
different base classes. That means this printer code is ambiguous:

    tuple_head_type = tuple_impl_type.fields()[1].type   # _Head_base
    head_field = tuple_head_type.fields()[0]
    if head_field.name == '_M_head_impl':
        self.pointer = tuple_member['_M_head_impl']

In older versions of GDB it happened to work by chance, because GDB
returned the last _M_head_impl member and std::tuple's base classes are
stored in reverse order, so the last one was the T* element of the
tuple. Since GDB 11 it returns the first _M_head_impl, which is the
deleter element.

The fix is for the printer to stop using an ambiguous field name and
cast the tuple to the correct base class before accessing the
_M_head_impl member.

Instead of fixing this in both UniquePointerPrinter and StdPathPrinter a
new unique_ptr_get function is defined to do it correctly. That is
defined in terms of new tuple_get and _tuple_impl_get functions.

It would be possible to reuse _tuple_impl_get to access each element in
StdTuplePrinter._iterator.__next__, but that already does the correct
casting, and wouldn't be much simpler anyway.

libstdc++-v3/ChangeLog:

PR libstdc++/103086
* python/libstdcxx/v6/printers.py (_tuple_impl_get): New helper
for accessing the tuple element stored in a _Tuple_impl node.
(tuple_get): New function for accessing a tuple element.
(unique_ptr_get): New function for accessing a unique_ptr.
(UniquePointerPrinter, StdPathPrinter): Use unique_ptr_get.
* python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker): Cast
tuple to its base class before accessing _M_head_impl.

(cherry picked from commit a634928f5c8a281442ac8f5fb1636aed048ed72c)

3 years agoDaily bump.
GCC Administrator [Wed, 5 Jan 2022 00:17:50 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 4 Jan 2022 00:17:29 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 3 Jan 2022 00:17:18 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 2 Jan 2022 00:17:17 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 1 Jan 2022 00:17:14 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 31 Dec 2021 00:17:18 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 30 Dec 2021 00:17:32 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 29 Dec 2021 00:17:22 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 28 Dec 2021 00:17:27 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFortran: fix check for pointer dummy arguments with INTENT(IN)
Harald Anlauf [Thu, 9 Dec 2021 21:57:13 +0000 (22:57 +0100)] 
Fortran: fix check for pointer dummy arguments with INTENT(IN)

gcc/fortran/ChangeLog:

PR fortran/103418
* check.c (variable_check): Replace previous check of procedure
dummy arguments with INTENT(IN) attribute when passed to intrinsic
procedures by gfc_check_vardef_context.
* expr.c (gfc_check_vardef_context): Correct check of INTENT(IN)
dummy arguments for the case of sub-components of a CLASS pointer.

gcc/testsuite/ChangeLog:

PR fortran/103418
* gfortran.dg/move_alloc_8.f90: Adjust error messages.
* gfortran.dg/pointer_intent_9.f90: New test.

(cherry picked from commit bb6a1ebb8585b85879735d0d6df9535885fad165)

3 years agoFortran: PACK intrinsic should not try to read from zero-sized array
Harald Anlauf [Mon, 13 Dec 2021 19:50:19 +0000 (20:50 +0100)] 
Fortran: PACK intrinsic should not try to read from zero-sized array

libgfortran/ChangeLog:

PR libfortran/103634
* intrinsics/pack_generic.c (pack_internal): Handle case when the
array argument of PACK has one or more extents of size zero to
avoid invalid reads.

gcc/testsuite/ChangeLog:

PR libfortran/103634
* gfortran.dg/intrinsic_pack_6.f90: New test.

(cherry picked from commit 1c613165a55b212c59a83796b20a1d555e096504)

3 years agoFortran: BOZ literal constants are not interoperable
Harald Anlauf [Mon, 20 Dec 2021 21:12:33 +0000 (22:12 +0100)] 
Fortran: BOZ literal constants are not interoperable

gcc/fortran/ChangeLog:

PR fortran/103778
* check.c (is_c_interoperable): A BOZ literal constant is not
interoperable.

gcc/testsuite/ChangeLog:

PR fortran/103778
* gfortran.dg/illegal_boz_arg_3.f90: New test.

(cherry picked from commit ff0ad4b5e16b8828a6147ae2d5fec8068ef0778e)

3 years agoFortran: NULL() is not interoperable
Harald Anlauf [Wed, 17 Nov 2021 21:21:24 +0000 (22:21 +0100)] 
Fortran: NULL() is not interoperable

gcc/fortran/ChangeLog:

PR fortran/101329
* check.c (is_c_interoperable): Reject NULL() as it is not
interoperable.

gcc/testsuite/ChangeLog:

PR fortran/101329
* gfortran.dg/pr101329.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit 3535be6c6f440909798d1c78e862a657f7adaf63)

3 years agoDaily bump.
GCC Administrator [Mon, 27 Dec 2021 00:17:16 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 26 Dec 2021 00:17:09 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 25 Dec 2021 00:17:20 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 24 Dec 2021 00:17:38 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 23 Dec 2021 00:17:16 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 22 Dec 2021 00:17:22 +0000 (00:17 +0000)] 
Daily bump.

3 years agolibphobos: Fix definition of stat_t for MIPS64 (PR103604)
Iain Buclaw [Tue, 21 Dec 2021 13:07:37 +0000 (14:07 +0100)] 
libphobos: Fix definition of stat_t for MIPS64 (PR103604)

Backported specific change from commit r12-6003.

libphobos/ChangeLog:

PR d/103604
* libdruntime/core/sys/posix/sys/stat.d (struct stat_t): Fix
definition for MIPS64.

(cherry picked from commit 96a09dec2421af3e201f5a54dadb35f00917ea5b)

3 years agoDaily bump.
GCC Administrator [Tue, 21 Dec 2021 00:17:11 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 20 Dec 2021 00:17:18 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFortran: catch failed simplification of bad stride expression
Harald Anlauf [Tue, 7 Dec 2021 17:46:52 +0000 (18:46 +0100)] 
Fortran: catch failed simplification of bad stride expression

gcc/fortran/ChangeLog:

PR fortran/103588
* array.c (gfc_ref_dimen_size): Do not generate internal error on
failed simplification of stride expression; just return failure.

gcc/testsuite/ChangeLog:

PR fortran/103588
* gfortran.dg/pr103588.f90: New test.

(cherry picked from commit 652c28736209f10bac1aa7ecb31f9056b518dacf)

3 years agoFortran: improve checking of array specifications
Harald Anlauf [Thu, 2 Dec 2021 21:33:49 +0000 (22:33 +0100)] 
Fortran: improve checking of array specifications

gcc/fortran/ChangeLog:

PR fortran/103505
* array.c (match_array_element_spec): Try to simplify array
element specifications to improve early checking.
* expr.c (gfc_try_simplify_expr): New.  Try simplification of an
expression via gfc_simplify_expr.  When an error occurs, roll
back.
* gfortran.h (gfc_try_simplify_expr): Declare it.

gcc/testsuite/ChangeLog:

PR fortran/103505
* gfortran.dg/pr103505.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit f46d32dd29b7623915e31b0508e2e925526fa7d8)

3 years agoFortran: reject BOZ type argument to SIZEOF().
Harald Anlauf [Sat, 18 Dec 2021 22:21:35 +0000 (23:21 +0100)] 
Fortran: reject BOZ type argument to SIZEOF().

gcc/fortran/ChangeLog:

PR fortran/103412
* check.c (gfc_check_sizeof): Reject BOZ type argument.

gcc/testsuite/ChangeLog:

PR fortran/103412
* gfortran.dg/illegal_boz_arg_2.f90: New test.

(cherry picked from commit fd74a2ee40456a1d1621e88738f8e57536194080)

3 years agoDaily bump.
GCC Administrator [Sun, 19 Dec 2021 00:17:11 +0000 (00:17 +0000)] 
Daily bump.

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

3 years agoFortran: dimensions of an array have to be non-negative
Harald Anlauf [Tue, 7 Dec 2021 22:06:41 +0000 (23:06 +0100)] 
Fortran: dimensions of an array have to be non-negative

gcc/fortran/ChangeLog:

PR fortran/103610
* array.c (spec_dimen_size): Fix simplification of SHAPE:
dimensions must be non-negative.

gcc/testsuite/ChangeLog:

PR fortran/103610
* gfortran.dg/shape_11.f90: New test.

(cherry picked from commit 5f7cdea34e118776d0ccd2ff3dda0f5acab18a94)

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

3 years agoFortran: fix checking of elemental functions of type CLASS
Harald Anlauf [Fri, 10 Dec 2021 21:41:24 +0000 (22:41 +0100)] 
Fortran: fix checking of elemental functions of type CLASS

gcc/fortran/ChangeLog:

PR fortran/103606
* resolve.c (resolve_fl_procedure): Do not access CLASS components
before class container has been built.

gcc/testsuite/ChangeLog:

PR fortran/103606
* gfortran.dg/pr103606.f90: New test.

(cherry picked from commit 7e913caad081ea85da4f257265f2d3383cdbe8d5)

3 years agoFortran: prevent NULL pointer dereference in check of passed do-loop variable
Harald Anlauf [Tue, 14 Dec 2021 20:57:04 +0000 (21:57 +0100)] 
Fortran: prevent NULL pointer dereference in check of passed do-loop variable

gcc/fortran/ChangeLog:

PR fortran/103717
* frontend-passes.c (doloop_code): Prevent NULL pointer
dereference when checking for passing a do-loop variable to a
contained procedure with an interface mismatch.

gcc/testsuite/ChangeLog:

PR fortran/103717
* gfortran.dg/do_check_19.f90: New test.

(cherry picked from commit ca39102e10643a6b3f07d06934cc0907ba83d9ee)

3 years agomh-mingw: Set __USE_MINGW_ACCESS in missed C++ flags variables
Martin Storsjö [Fri, 9 Apr 2021 11:46:36 +0000 (14:46 +0300)] 
mh-mingw: Set __USE_MINGW_ACCESS in missed C++ flags variables

This is similar to what was done in
eea4e2ff0a3f5e7f37df204c070cc5d9ef339e6e (where it was added to
STAGE*_CXXFLAGS), but this adds the flag to the CXXFLAGS and
BOOT_CXXFLAGS variables too (as it's already added to CFLAGS and
BOOT_CFLAGS).

2021-04-09  Martin Storsjö  <martin@martin.st>

config/ChangeLog:
* mh-mingw: Set __USE_MINGW_ACCESS in missed C++ flags
variables

(cherry picked from commit 89e95ad2e7679322b2f5ee9070ff2721d5ca1d6d)

3 years agoi386: Fix emissing of __builtin_cpu_supports.
Martin Liska [Mon, 13 Dec 2021 14:34:30 +0000 (15:34 +0100)] 
i386: Fix emissing of __builtin_cpu_supports.

PR target/103661

gcc/ChangeLog:

* config/i386/i386-builtins.c (fold_builtin_cpu): Compare to 0
as API expects that non-zero values are returned (do that
it mask == 31).
For "avx512vbmi2" argument, we return now 1 << 31, which is a
negative integer value.

(cherry picked from commit 127c7178d5ec502d95862fd823537cbca1a0cb99)

3 years agoDaily bump.
GCC Administrator [Thu, 16 Dec 2021 00:17:17 +0000 (00:17 +0000)] 
Daily bump.

3 years agors6000: Remove builtin mask check from builtin_decl [PR102347]
Kewen Lin [Tue, 30 Nov 2021 03:22:32 +0000 (21:22 -0600)] 
rs6000: Remove builtin mask check from builtin_decl [PR102347]

As the discussion in PR102347, currently builtin_decl is invoked so
early, it's when making up the function_decl for builtin functions,
at that time the rs6000_builtin_mask could be wrong for those
builtins sitting in #pragma/attribute target functions, though it
will be updated properly later when LTO processes all nodes.

This patch is to align with the practice i386 port adopts, also
align with r10-7462 by relaxing builtin mask checking in some places.

gcc/ChangeLog:

PR target/102347
* config/rs6000/rs6000-call.c (rs6000_builtin_decl): Remove builtin mask
check.

gcc/testsuite/ChangeLog:

PR target/102347
* gcc.target/powerpc/pr102347.c: New test.

(cherry picked from commit 6c7d489a1e6592bc73db03678c1231748fd7a126)

3 years agoDaily bump.
GCC Administrator [Wed, 15 Dec 2021 00:17:19 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 14 Dec 2021 00:17:15 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 13 Dec 2021 00:17:11 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 12 Dec 2021 00:17:37 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFortran: improve expansion of constant array expressions within constructors
Harald Anlauf [Sat, 27 Nov 2021 20:43:52 +0000 (21:43 +0100)] 
Fortran: improve expansion of constant array expressions within constructors

gcc/fortran/ChangeLog:

PR fortran/102787
* array.c (expand_constructor): When encountering a constant array
expression or array section within a constructor, simplify it to
enable better expansion.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit 6b8ecbc6d6652d061d7c72c64352d51eca2df6ca)

3 years agoFortran: generate error message for negative elements in SHAPE array
Harald Anlauf [Thu, 14 Oct 2021 18:19:50 +0000 (20:19 +0200)] 
Fortran: generate error message for negative elements in SHAPE array

gcc/fortran/ChangeLog:

PR fortran/102717
* simplify.c (gfc_simplify_reshape): Replace assert by error
message for negative elements in SHAPE array.

gcc/testsuite/ChangeLog:

PR fortran/102717
* gfortran.dg/reshape_shape_2.f90: New test.

(cherry picked from commit b47490c572c5938f887b54240af6096a7c90f640)

3 years agoFortran: improve check of arguments to the RESHAPE intrinsic
Harald Anlauf [Fri, 26 Nov 2021 20:00:35 +0000 (21:00 +0100)] 
Fortran: improve check of arguments to the RESHAPE intrinsic

gcc/fortran/ChangeLog:

PR fortran/103411
* check.c (gfc_check_reshape): Improve check of size of source
array for the RESHAPE intrinsic against the given shape when pad
is not given, and shape is a parameter.  Try other simplifications
of shape.

gcc/testsuite/ChangeLog:

PR fortran/103411
* gfortran.dg/pr68153.f90: Adjust test to improved check.
* gfortran.dg/reshape_7.f90: Likewise.
* gfortran.dg/reshape_9.f90: New test.

(cherry picked from commit 4d540c7a4a7fb87b04d06e1ee7f9b004116279a4)

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

3 years agoFortran: perform array subscript checks only for valid INTEGER bounds
Harald Anlauf [Tue, 7 Dec 2021 20:34:31 +0000 (21:34 +0100)] 
Fortran: perform array subscript checks only for valid INTEGER bounds

gcc/fortran/ChangeLog:

PR fortran/103607
* frontend-passes.c (do_subscript): Ensure that array bounds are
of type INTEGER before performing checks on array subscripts.

gcc/testsuite/ChangeLog:

PR fortran/103607
* gfortran.dg/pr103607.f90: New test.

(cherry picked from commit 9eec77c0df9e5c67454a2e8f83246104458ba4f0)

3 years agod: Align methods to MINIMUM_METHOD_BOUNDARY.
Iain Buclaw [Fri, 10 Dec 2021 00:30:19 +0000 (01:30 +0100)] 
d: Align methods to MINIMUM_METHOD_BOUNDARY.

Aligns all D defined methods to MINIMUM_METHOD_BOUNDARY, improving
interoperability with C++ methods.

gcc/d/ChangeLog:

* decl.cc (get_symbol_decl): Align methods to MINIMUM_METHOD_BOUNDARY.

(cherry picked from commit 213b7d9cf76d73f7b716a6f9119971cb65bd85e2)

3 years agoDaily bump.
GCC Administrator [Fri, 10 Dec 2021 00:17:13 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Thu, 9 Dec 2021 00:17:15 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Wed, 8 Dec 2021 00:17:13 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Tue, 7 Dec 2021 00:17:15 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Mon, 6 Dec 2021 00:17:11 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 5 Dec 2021 00:17:17 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 4 Dec 2021 00:17:48 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Fri, 3 Dec 2021 00:17:51 +0000 (00:17 +0000)] 
Daily bump.

3 years agolibphobos: Push all callee-save registers on the stack before GC scan
Iain Buclaw [Thu, 2 Dec 2021 00:53:51 +0000 (01:53 +0100)] 
libphobos: Push all callee-save registers on the stack before GC scan

This is the library fix for PR103520 that also prevents the garbage
collector from releasing live memory.  However this requires that the
host compiler has been patched with this fix, so the GC will remain
disabled in the D front-end for now until enough time has passed for
this to have trickled down into enough releases.

libphobos/ChangeLog:

* libdruntime/core/thread.d (callWithStackShell): Push all callee-save
registers on the stack using inline assembly.

(cherry picked from commit 2fb6a57f9ffa9ac964931b439b6d1600a698e377)

3 years agoDaily bump.
GCC Administrator [Thu, 2 Dec 2021 00:17:16 +0000 (00:17 +0000)] 
Daily bump.

3 years agoipa-sra: Check also ECF_LOOPING_CONST_OR_PURE when evaluating calls
Martin Jambor [Wed, 1 Dec 2021 13:25:16 +0000 (14:25 +0100)] 
ipa-sra: Check also ECF_LOOPING_CONST_OR_PURE when evaluating calls

in PR 103267 Honza found out that IPA-SRA does not look at
ECF_LOOPING_CONST_OR_PURE when evaluating if a call can have side
effects.  Fixed with this patch.  The testcase infinitely loops in a
const function, so it would not make a good addition to the testsuite.

gcc/ChangeLog:

2021-11-29  Martin Jambor  <mjambor@suse.cz>

PR ipa/103267
* ipa-sra.c (scan_function): Also check ECF_LOOPING_CONST_OR_PURE flag.

(cherry picked from commit e5440bc08e07fd491dcccd47e1b86a5985ee117c)

3 years agoDaily bump.
GCC Administrator [Wed, 1 Dec 2021 00:18:01 +0000 (00:18 +0000)] 
Daily bump.

3 years agoFix -freorder-blocks-and-partition glitch with Windows SEH (continued)
Eric Botcazou [Tue, 30 Nov 2021 09:17:09 +0000 (10:17 +0100)] 
Fix -freorder-blocks-and-partition glitch with Windows SEH (continued)

This fixes a thinko in the fix for the -freorder-blocks-and-partition
glitch with SEH on 64-bit Windows:
  https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565208.html

Even if no exceptions are active, e.g. in C, we need to consider calls.

gcc/
PR target/103274
* config/i386/i386.c (ix86_output_call_insn): Beef up comment about
nops emitted with SEH.
* config/i386/winnt.c (i386_pe_seh_unwind_emit): When switching to
the cold section, emit a nop before the directive if the previous
active instruction is a call.

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

3 years agoDaily bump.
GCC Administrator [Mon, 29 Nov 2021 00:17:23 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sun, 28 Nov 2021 00:17:12 +0000 (00:17 +0000)] 
Daily bump.

3 years agoDaily bump.
GCC Administrator [Sat, 27 Nov 2021 00:17:25 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFortran: do not attempt simplification of [LU]BOUND for pointer/allocatable
Harald Anlauf [Tue, 23 Nov 2021 20:39:36 +0000 (21:39 +0100)] 
Fortran: do not attempt simplification of [LU]BOUND for pointer/allocatable

gcc/fortran/ChangeLog:

PR fortran/103392
* simplify.c (simplify_bound): Do not try to simplify
LBOUND/UBOUND for arrays with POINTER or ALLOCATABLE attribute.

gcc/testsuite/ChangeLog:

PR fortran/103392
* gfortran.dg/bound_simplification_7.f90: New test.

(cherry picked from commit 16e95050f71e9fa408e9bd8ccd415b0e7adc66e5)

3 years agolibstdc++: Use std::addressof in ranges::uninitialized_xxx [PR101571]
Jonathan Wakely [Thu, 22 Jul 2021 13:37:24 +0000 (14:37 +0100)] 
libstdc++: Use std::addressof in ranges::uninitialized_xxx [PR101571]

Make the ranges::uninitialized_xxx algorithms use std::addressof to
protect against iterator types that overload operator&.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101571
* include/bits/ranges_uninitialized.h (_DestroyGuard): Change
constructor parameter to reference and use addressof.
* testsuite/util/testsuite_iterators.h: Define deleted operator&
overloads for test iterators.

(cherry picked from commit aca7a0253d6e3116f846ad530b19d89644a64267)

3 years agolibstdc++: Don't check always-true condition [PR101965]
Jonathan Wakely [Thu, 19 Aug 2021 12:05:54 +0000 (13:05 +0100)] 
libstdc++: Don't check always-true condition [PR101965]

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101965
* include/std/charconv (__to_chars_i): Remove redundant check.

(cherry picked from commit 85a709595005b5df4b2ee9d81717a5df19c0023f)

3 years agolibstdc++: Constrain std::make_any [PR102894]
Jonathan Wakely [Fri, 22 Oct 2021 21:55:00 +0000 (22:55 +0100)] 
libstdc++: Constrain std::make_any [PR102894]

std::make_any should be constrained so it can only be called if the
construction of the return value would be valid.

libstdc++-v3/ChangeLog:

PR libstdc++/102894
* include/std/any (make_any): Add SFINAE constraint.
* testsuite/20_util/any/102894.cc: New test.

(cherry picked from commit 0c1f737a485f05c591c94b50acfb416c45a4c916)

3 years agolibstdc++: Add missing 'constexpr' to std::tuple [PR102270]
Jonathan Wakely [Wed, 15 Sep 2021 20:53:35 +0000 (21:53 +0100)] 
libstdc++: Add missing 'constexpr' to std::tuple [PR102270]

This backport to gcc-10 also includes r12-3637.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/102270
* include/std/tuple (_Head_base, _Tuple_impl): Add
_GLIBCXX20_CONSTEXPR to allocator-extended constructors.
(tuple<>::swap(tuple&)): Add _GLIBCXX20_CONSTEXPR.
* testsuite/20_util/tuple/cons/102270.cc: New test.
* testsuite/util/testsuite_allocator.h (SimpleAllocator): Add
constexpr to constructor so it can be used for C++20 tests.

3 years agolibstdc++: Make allocator equality comparable in tests
Jonathan Wakely [Mon, 9 Aug 2021 10:36:07 +0000 (11:36 +0100)] 
libstdc++: Make allocator equality comparable in tests

libstdc++-v3/ChangeLog:

* testsuite/23_containers/unordered_map/cons/default.cc: Add
equality comparison operators to allocator.
* testsuite/23_containers/unordered_set/cons/default.cc:
Likewise.

(cherry picked from commit 2eff2a3cb521c58212885a3dca638764285b5691)

3 years agolibstdc++: fix is_default_constructible for hash containers [PR 100863]
Jonathan Wakely [Tue, 20 Jul 2021 14:20:41 +0000 (15:20 +0100)] 
libstdc++: fix is_default_constructible for hash containers [PR 100863]

The recent change to _Hashtable_ebo_helper for this PR broke the
is_default_constructible trait for a hash container with a non-default
constructible allocator. That happens because the constructor needs to
be user-provided in order to initialize the member, and so is not
defined as deleted when the type is not default constructible.

By making _Hashtable derive from _Enable_special_members we can ensure
that the default constructor for the std::unordered_xxx containers is
deleted when it would be ill-formed. This makes the trait give the
correct answer.

This backport to gcc-10 includes the fix for PR 101583.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100863
* include/bits/hashtable.h (_Hashtable): Conditionally delete
default constructor by deriving from _Enable_default_constructor.
Construct that base-class explicitly in all non-forwarding,
non-defaulted constructors.
* testsuite/23_containers/unordered_map/cons/default.cc: New test.
* testsuite/23_containers/unordered_set/cons/default.cc: New test.

(cherry picked from commit 89ec3b67dbe856a447d068b053bc19559f136f43)

3 years agolibstdc++: Value-initialize objects held by EBO helpers [PR 100863]
Jonathan Wakely [Wed, 2 Jun 2021 11:34:48 +0000 (12:34 +0100)] 
libstdc++: Value-initialize objects held by EBO helpers [PR 100863]

The allocator, hash function and equality function should all be
value-initialized by the default constructor of an unordered container.
Do it in the EBO helper, so we don't have to get it right in multiple
places.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/100863
PR libstdc++/65816
* include/bits/hashtable_policy.h (_Hashtable_ebo_helper):
Value-initialize subobject.
* testsuite/23_containers/unordered_map/allocator/default_init.cc:
Remove XFAIL.
* testsuite/23_containers/unordered_set/allocator/default_init.cc:
Remove XFAIL.

(cherry picked from commit f8f0193b5b83f6e85d65015e79c803295baf5166)

3 years agolibstdc++: Improve std::forward static assert message
Jonathan Wakely [Tue, 28 Sep 2021 11:35:29 +0000 (12:35 +0100)] 
libstdc++: Improve std::forward static assert message

The previous message told you something was wrong, but not why it
happened or why it's bad. This changes it to explain that the function
is being misused.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/move.h (forward(remove_reference_t<T>&&)):
Improve text of static_assert.
* testsuite/20_util/forward/c_neg.cc: Adjust dg-error.
* testsuite/20_util/forward/f_neg.cc: Likewise.

(cherry picked from commit a11052d98db2f2a61841f0c5ee84de4ca1b3e296)

3 years agolibstdc++: Optimize std::seed_seq construction
Antony Polukhin [Tue, 17 Aug 2021 12:50:53 +0000 (13:50 +0100)] 
libstdc++: Optimize std::seed_seq construction

When std::seed_seq is constructed from random access iterators we can
detect the internal vector size in O(1). Reserving memory for elements
in such cases may avoid multiple memory allocations.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/random.tcc (seed_seq::seed_seq): Reserve capacity
if distance is O(1).
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
line number.

Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
(cherry picked from commit 174f9257a75dec93221eca26c236e0a6346c9dfd)

3 years agolibstdc++: Add additional overload of std::lerp [PR101870]
Jonathan Wakely [Thu, 12 Aug 2021 16:35:25 +0000 (17:35 +0100)] 
libstdc++: Add additional overload of std::lerp [PR101870]

The [cmath.syn] p1 wording about additional overloads sufficient to
handle any arithmetic types also applies to std::lerp. This adds a new
overload of std::lerp that does the required promotions to support
arguments of arbitrary arithmetic types.

A new __promoted_t alias template is added, which the C++17 function
templates std::hypot and std::lerp can use to avoid instantiating the
__promote_3 class template.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/101870
* include/c_global/cmath (hypot): Use __promoted_t.
(lerp): Add new overload accepting any arithmetic types.
* include/ext/type_traits.h (__promoted_t): New alias template.
* testsuite/26_numerics/lerp.cc: Moved to...
* testsuite/26_numerics/lerp/1.cc: ...here.
* testsuite/26_numerics/lerp/constexpr.cc: New test.
* testsuite/26_numerics/lerp/version.cc: New test.

(cherry picked from commit 9017326e19fe278d5f62898cca4682b17f8e8e07)

3 years agolibstdc++: Fix test that fails for C++98 mode
Jonathan Wakely [Fri, 26 Nov 2021 12:07:13 +0000 (12:07 +0000)] 
libstdc++: Fix test that fails for C++98 mode

When I backported r11-2760 as r10-8644 I simplified it and didn't add
the new _GLIBCXX11_DEPRECATED macro. That means that the macro used on
the old iostream members does nothing for C++98 mode, and so the test
fails. This adjusts the test to only expect warnigns for C++11 and
later.

libstdc++-v3/ChangeLog:

* testsuite/27_io/types/1.cc: Add c++11 target selector to
warnings.

3 years agolibstdc++: Fix tests that fail in C++98 mode
Jonathan Wakely [Tue, 11 May 2021 16:14:26 +0000 (17:14 +0100)] 
libstdc++: Fix tests that fail in C++98 mode

The header synopsis test fails to define NOTHROW for C++98.

The shared_ptr test should be skipped for C++98.

The debug mode one should work for C++98 too, it just needs to avoid
C++11 syntax that isn't valid in C++98.

libstdc++-v3/ChangeLog:

* testsuite/20_util/headers/memory/synopsis.cc: Define C++98
alternative for macro.
* testsuite/20_util/shared_ptr/creation/99006.cc: Add effective
target keyword.
* testsuite/25_algorithms/copy/debug/99402.cc: Avoid C++11
syntax.

(cherry picked from commit 37407a2ae701c0a93377106a2938ab5474062fc3)

3 years agolibstdc++: Skip failing std::array test for debug mode
Jonathan Wakely [Fri, 26 Nov 2021 11:53:27 +0000 (11:53 +0000)] 
libstdc++: Skip failing std::array test for debug mode

The __gnu_debug::array type isn't three-way comparable in constant
expressions. The __gnu-debug::array type has been removed in gcc-11
anyway, so just skip the test rather than fixing it.

libstdc++-v3/ChangeLog:

* testsuite/23_containers/array/comparison_operators/96851.cc:
Skip test in debug mode.

3 years agolibstdc++: Add missing header to <bits/stl_iterator.h>
Jonathan Wakely [Fri, 26 Nov 2021 00:34:52 +0000 (00:34 +0000)] 
libstdc++: Add missing header to <bits/stl_iterator.h>

When included from <debug/functions.h> it's possible for
<bits/stl_iterator.h> to be included without its prerequisites having
been included first. For gcc-11 this was fixed as part of r11-7604, this
fixes it for gcc-10 too.

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h: Include required header for
std::iterator class template and iterator category tags.

3 years agolibstdc++: Do not use memset in constexpr calls to ranges::fill_n [PR101608]
Jonathan Wakely [Wed, 24 Nov 2021 13:17:54 +0000 (13:17 +0000)] 
libstdc++: Do not use memset in constexpr calls to ranges::fill_n [PR101608]

libstdc++-v3/ChangeLog:

PR libstdc++/101608
* include/bits/ranges_algobase.h (__fill_n_fn): Check for
constant evaluation before using memset.
* testsuite/25_algorithms/fill_n/constrained.cc: Check
byte-sized values as well.

(cherry picked from commit 82c3657dd74896b39937bb0a2aaeba9b8ca105fd)

3 years agoDaily bump.
GCC Administrator [Fri, 26 Nov 2021 00:17:27 +0000 (00:17 +0000)] 
Daily bump.

3 years agoFix looping flag discovery in ipa-pure-const
Jan Hubicka [Sat, 20 Nov 2021 23:35:22 +0000 (00:35 +0100)] 
Fix looping flag discovery in ipa-pure-const

The testcase shows situation where there is non-trivial cycle in the callgraph
involving a noreturn call.  This cycle is important for const function discovery
but not important for pure.  IPA pure const uses same strongly connected
components for both propagations which makes it to get suboptimal result
(does not detect the pure flag). However local pure const gets the situation
right becaue it processes functions in right order.  This hits rarely
executed code in propagate_pure_const that merge results with previously
known state that has long standing bug in it that makes it to throw away
the looping flag.

Bootstrapped/regtested x86_64-linux.

gcc/ChangeLog:

2021-11-21  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/103052
* ipa-pure-const.c (propagate_pure_const): Fix merging of loping flag.

gcc/testsuite/ChangeLog:

2021-11-21  Jan Hubicka  <hubicka@ucw.cz>

PR ipa/103052
* gcc.c-torture/execute/pr103052.c: New test.

(cherry picked from commit a0e99d5bb741d3db74a67d492f47b28217fbf88a)

3 years agoDaily bump.
GCC Administrator [Thu, 25 Nov 2021 00:17:32 +0000 (00:17 +0000)] 
Daily bump.

3 years agojit: Initialize function::m_blocks in ctor
Martin Liska [Wed, 24 Nov 2021 09:15:34 +0000 (10:15 +0100)] 
jit: Initialize function::m_blocks in ctor

This resolves the problem reported here:
https://mail.gnu.org/archive/html/bug-gnu-emacs/2021-11/msg00606.html
https://bugzilla.opensuse.org/show_bug.cgi?id=1192951

gcc/jit/ChangeLog:

* jit-playback.c (function): Initialize m_blocks vector.

(cherry picked from commit c2e681059bcd7f76f13029988f133858dc82c205)

3 years agoDaily bump.
GCC Administrator [Wed, 24 Nov 2021 00:17:25 +0000 (00:17 +0000)] 
Daily bump.