Commit Graph

179015 Commits

Author SHA1 Message Date
GCC Administrator 60580e350c Daily bump. 2022-08-11 00:17:49 +00:00
GCC Administrator ca41e54257 Daily bump. 2022-08-10 00:17:50 +00:00
GCC Administrator 5cf7314304 Daily bump. 2022-08-09 00:17:43 +00:00
GCC Administrator a3c2870e2f Daily bump. 2022-08-08 00:17:32 +00:00
GCC Administrator fc63785f0c Daily bump. 2022-08-07 00:17:40 +00:00
GCC Administrator a5f248dbde Daily bump. 2022-08-06 00:17:45 +00:00
GCC Administrator eab75725cb Daily bump. 2022-08-05 00:17:34 +00:00
Peter Bergner 0158831c81 rs6000: Update testsuite to use -mdejagnu-cpu= and -mdejagnu-tune= options
This patch updates the POWER testsuite test cases using -mcpu= and -mtune=
to use the preferred -mdejagnu-cpu= and -mdejagnu-tune= options.  This also
obviates the need for the dg-skip-if directive, since the user cannot
override the -mcpu= value being used to compile the test case.

2022-03-25  Peter Bergner  <bergner@linux.ibm.com>

gcc/testsuite/

	* g++.dg/pr65240-1.C: Use -mdejagnu-cpu=.  Remove dg-skip-if.
	* g++.dg/pr65240-2.C: Likewise.
	* g++.dg/pr65240-3.C: Likewise.
	* g++.dg/pr65240-4.C: Likewise.
	* g++.dg/pr65242.C: Likewise.
	* g++.dg/pr67211.C: Likewise.
	* g++.dg/pr69667.C: Likewise.
	* g++.dg/pr71294.C: Likewise.
	* g++.dg/pr84279.C: Likewise.
	* g++.dg/torture/ppc-ldst-array.C: Likewise.
	* gfortran.dg/nint_p7.f90: Likewise.
	* gfortran.dg/pr102860.f90: Likewise.
	* gcc.target/powerpc/fusion.c: Use -mdejagnu-cpu= and -mdejagnu-tune=.
	* gcc.target/powerpc/fusion2.c: Likewise.
	* gcc.target/powerpc/test_mffsl.c: Likewise.
	* gfortran.dg/pr47614.f: Likewise.
	* gfortran.dg/pr58968.f: Likewise.

(cherry picked from commit 81faedaa8e)
2022-08-03 22:23:06 -05:00
GCC Administrator 087ec71423 Daily bump. 2022-08-04 00:17:49 +00:00
Jonathan Wakely de802e4736 libstdc++: Add valid range checks to std::span constructors [PR98421]
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/98421
	* include/std/span (span(Iter, size_type), span(Iter, Iter)):
	Add valid range checks.
	* testsuite/23_containers/span/cons_1_assert_neg.cc: New test.
	* testsuite/23_containers/span/cons_2_assert_neg.cc: New test.

(cherry picked from commit ef7becc9c8)
2022-08-03 11:53:50 +01:00
Jonathan Wakely f05b125a8d libstdc++: Avoid try-catch and O(N) size in std::list::merge for old ABI
The current std::list::merge code calls size() before starting to merge
any elements, so that the _M_size members can be updated after the merge
finishes. The work is done in a try-block so that the sizes can still be
updated in an exception handler if any element comparison throws.

The _M_size members only exist for the cxx11 ABI, so the initial call to
size() and the try-catch are only needed for that ABI. For the old ABI
the size() call performs an O(N) list traversal to get a value that
isn't even used, and catching exceptions just to rethrow them isn't
needed either.

In r11-10123 this code was refactored to use an RAII guard type, but for
the gcc-10 branch a less invasive change using preprocessor conditionals
seems more appropriate.

libstdc++-v3/ChangeLog:

	* include/bits/list.tcc (list::merge) [!USE_CXX11_ABI]: Remove
	call to size() and try-catch block.
2022-08-03 11:50:08 +01:00
Tim Adye d1b51c1531 libstdc++: Optimize std::any_cast by replacing indirect call
This significantly improves the performance of std::any_cast, by
avoiding an indirect call to the _S_manage function through a function
pointer. Before we make that indirect call we've already established
that the contained value has the expected type, which means we also know
the manager type, and so can call one of its members directly.

We also know the precise type in the any::emplace functions, because
we've just constructed that type, so we can use the new member there
too. That doesn't seem to affect performance, but we might as well use
the new _S_access function anyway.

Signed-off-by: Tim Adye <Tim.Adye@cern.ch>
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/std/any (any::_Manager::_S_access): New static
	function to access the contained value.
	(any::emplace, __any_caster): Use _S_access member of the
	manager type.

(cherry picked from commit f6bb145c0b)
2022-08-03 11:42:42 +01:00
Jonathan Wakely 45a31caac6 libstdc++: Remove precondition checks from ranges::subrange
The assertion in the subrange constructor causes semantic changes,
because the call to ranges::distance performs additional operations that
are not part of the constructor's specification. That will fail to
compile if the iterator is move-only, because the argument to
ranges::distance is passed by value. It will modify the subrange if the
iterator is not a forward iterator, because incrementing the copy also
affects the _M_begin member. Those problems could be prevented by using
if-constexpr to only do the assertion for copyable forward iterators,
but the call to ranges::distance can also prevent the constructor being
usable in constant expressions. If the member initializers are usable in
constant expressions, but iterator increments of equality comparisons
are not, then the checks done by __glibcxx_assert might
make constant evaluation fail.

This change removes the assertion.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/std/ranges (subrange(i, s, n)): Remove assertion.
	* testsuite/std/ranges/subrange/constexpr.cc: New test.

(cherry picked from commit a88fc03ba7)
2022-08-03 11:34:30 +01:00
Jonathan Wakely 18eecb8c4a libstdc++: Disable gthreads weak symbols for glibc 2.34 [PR103133]
Since Glibc 2.34 all pthreads symbols are defined directly in libc not
libpthread, and since Glibc 2.32 we have used __libc_single_threaded to
avoid unnecessary locking in single-threaded programs. This means there
is no reason to avoid linking to libpthread now, and so no reason to use
weak symbols defined in gthr-posix.h for all the pthread_xxx functions.

libstdc++-v3/ChangeLog:

	PR libstdc++/100748
	PR libstdc++/103133
	* config/os/gnu-linux/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK):
	Define for glibc 2.34 and later.

(cherry picked from commit 80fe172ba9)
2022-08-03 10:52:41 +01:00
GCC Administrator 9fa411d759 Daily bump. 2022-08-03 00:17:42 +00:00
Lewis Hyatt 8d783f0f69 c: Fix location for _Pragma tokens [PR97498]
The handling of #pragma GCC diagnostic uses input_location, which is not always
as precise as needed; in particular the relative location of some tokens and a
_Pragma directive will crucially determine whether a given diagnostic is enabled
or suppressed in the desired way. PR97498 shows how the C frontend ends up with
input_location pointing to the beginning of the line containing a _Pragma()
directive, resulting in the wrong behavior if the diagnostic to be modified
pertains to some tokens found earlier on the same line. This patch fixes that by
addressing two issues:

    a) libcpp was not assigning a valid location to the CPP_PRAGMA token
    generated by the _Pragma directive.
    b) C frontend was not setting input_location to something reasonable.

With this change, the C frontend is able to change input_location to point to
the _Pragma token as needed.

This is just a two-line fix (one for each of a) and b)), the testsuite changes
were needed only because the location on the tested warnings has been somewhat
improved, so the tests need to look for the new locations.

gcc/c/ChangeLog:

	PR preprocessor/97498
	* c-parser.c (c_parser_pragma): Set input_location to the
	location of the pragma, rather than the start of the line.

libcpp/ChangeLog:

	PR preprocessor/97498
	* directives.c (destringize_and_run): Override the location of
	the CPP_PRAGMA token from a _Pragma directive to the location of
	the expansion point, as is done for the tokens lexed from it.

gcc/testsuite/ChangeLog:

	PR preprocessor/97498
	* c-c++-common/pr97498.c: New test.
	* gcc.dg/pragma-message.c: Adapt for improved warning locations.

(cherry picked from commit 0587cef3d7)
2022-08-02 18:24:36 -04:00
Peter Bergner a221c4b8e5 rs6000: Adjust -mdejagnu-cpu to filter out -mtune [PR106345]
As PR106345 shows, when configuring compiler with an explicit
option --with-tune=<value>, it would cause some test cases to
fail if their test points are sensitive to tune setting, such
as: group_ending_nop, loop align etc.  It doesn't help that
even to specify one explicit -mcpu=.

This patch is to adjust the behavior of -mdejagnu-cpu by
filtering out all -mcpu= and -mtune= options, then test cases
would use <cpu> as tune as the one specified by -mdejagnu-cpu.

2022-07-25  Peter Bergner  <bergner@linux.ibm.com>
	    Kewen Lin  <linkw@linux.ibm.com>

	PR testsuite/106345

gcc/ChangeLog:

	* config/rs6000/rs6000.h (DRIVER_SELF_SPECS): Adjust -mdejagnu-cpu
	to filter out all -mtune options.

(cherry picked from commit 75d20d6c84)
2022-08-01 21:25:03 -05:00
Kewen Lin a2ead00af2 rs6000: Preserve REG_EH_REGION when replacing load/store [PR106091]
As test case in PR106091 shows, rs6000 specific pass swaps
doesn't preserve the reg_note REG_EH_REGION when replacing
some load insn at the end of basic block, it causes the
flow info verification to fail unexpectedly.  Since memory
reference rtx may trap, this patch is to ensure we copy
REG_EH_REGION reg_note while replacing swapped aligned load
or store.

	PR target/106091

gcc/ChangeLog:

	* config/rs6000/rs6000-p8swap.c (replace_swapped_aligned_store): Copy
	REG_EH_REGION when replacing one store insn having it.
	(replace_swapped_aligned_load): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/pr106091.c: New test.

(cherry picked from commit f428660193)
2022-08-01 21:23:30 -05:00
GCC Administrator 8df6262fa0 Daily bump. 2022-08-02 00:17:41 +00:00
GCC Administrator 02fc061686 Daily bump. 2022-08-01 00:17:43 +00:00
GCC Administrator 42de1e05cb Daily bump. 2022-07-31 00:17:29 +00:00
GCC Administrator e4d7b0d723 Daily bump. 2022-07-30 00:17:19 +00:00
GCC Administrator 24b0d9b4a3 Daily bump. 2022-07-29 00:17:33 +00:00
GCC Administrator 4c7bb975fa Daily bump. 2022-07-28 00:17:25 +00:00
GCC Administrator 41488e4bb6 Daily bump. 2022-07-27 00:17:50 +00:00
Harald Anlauf a872c61729 Fortran: error recovery from calculation of storage size of a symbol [PR103504]
gcc/fortran/ChangeLog:

	PR fortran/103504
	* interface.c (get_sym_storage_size): Array bounds and character
	length can only be of integer type.

gcc/testsuite/ChangeLog:

	PR fortran/103504
	* gfortran.dg/pr103504.f90: New test.

(cherry picked from commit 600956c81c)
2022-07-26 20:47:40 +02:00
GCC Administrator 42b5f41626 Daily bump. 2022-07-26 00:17:43 +00:00
Sebastian Huber ea169d4d86 RTEMS: Do not define _GNU_SOURCE by default
gcc/ChangeLog:

	* config/rs6000/rtems.h (CPLUSPLUS_CPP_SPEC): Undef.

(cherry picked from commit 556b816b82)
2022-07-25 15:02:49 +02:00
GCC Administrator 85c14be404 Daily bump. 2022-07-25 00:17:35 +00:00
GCC Administrator 3f070b3561 Daily bump. 2022-07-24 00:17:24 +00:00
Jonathan Wakely 01c25003d2 libstdc++: Add missing prerequisite to generated header [PR106162]
The ${host_builddir}/largefile-config.h header can't be written until
its parent directory has been created, so it needs to have the creation
of that directory as a prerequisite.

libstdc++-v3/ChangeLog:

	PR libstdc++/106162
	* include/Makefile.am (largefile-config.h): Add
	stamp-${host_alias} prerequisite.
	* include/Makefile.in: Regenerate.

(cherry picked from commit 8a6ee426c2)
2022-07-23 12:29:32 +01:00
Jonathan Wakely 32bbf76e43 libstdc++: Fix inconsistent noexcept-specific for valarray begin/end
These declarations should be noexcept after I added it to the
definitions in <valarray>.

libstdc++-v3/ChangeLog:

	* include/bits/range_access.h (begin(valarray), end(valarray)):
	Add noexcept.

(cherry picked from commit 2b2d97fc54)
2022-07-23 11:13:47 +01:00
GCC Administrator 4182b95aa6 Daily bump. 2022-07-23 00:17:24 +00:00
Patrick Palka 2cad5c5c2d libstdc++: Fix backward compatibility of P2325R3 backport [PR106320]
The 11 and 10 partial backports of P2325R3, r11-9555-g92d612cccc1eec and
r10-10808-g22b86cdc4d7fdd, unnecessarily preserved some changes from the
paper that made certain view specializations no longer default
constructible, changes which aren't required to reap the overall benefits
of the paper and which are backward incompatible with pre-P2325R3 code in
practice.

This patch reverts the problematic changes, specifically it relaxes the
constraints on various views' default constructors added by the paper
so that we keep only the constraints that were already implicitly
imposed by the NSDMIs of the view.  Thus for example this patch retains
the default_initializable<_Vp> constraint on transform_view's default
constructor since its '_Vp _M_base = _Vp()' NSDMI already requires this
constraint, and it removes the default_initializable<_Fp> constraint
since the corresponding member '__detail::__box<_Fp> _M_fun' doesn't
require default constructibility (specializations of __box are always
default constructible).

After reverting these changes, all static_asserts from p2325.cc that
verify lack of default constructibility now fail as expected, matching
the pre-P2325R3 behavior.

	PR libstdc++/106320

libstdc++-v3/ChangeLog:

	* include/std/ranges (single_view): Relax constraints on
	default constructor so as to preserve pre-P2325R3 behavior.
	(filter_view): Likewise.
	(transform_view): Likewise.
	(take_while_view): Likewise.
	(drop_while_view): Likewise.
	* testsuite/std/ranges/adaptors/join.cc (test13): New test.
	* testsuite/std/ranges/p2325.cc: Fix S to be only non default
	constructible and not also non copy constructible.  XFAIL the
	tests that verify a non default constructible functor makes a
	view non default constructible (lines 94, 97 and 98).  XFAIL
	the test that effectively verifies a non default constructible
	element type makes single_view non default constructible (line
	114).

(cherry picked from commit 36dd51bf87)
2022-07-22 12:55:09 -04:00
Surya Kumari Jangala 2753c7d0cd regrename: Fix -fcompare-debug issue in check_new_reg_p [PR105041]
In check_new_reg_p, the nregs of a du chain is computed by obtaining the
MODE of the first element in the chain, and then calling
hard_regno_nregs() with the MODE. But the first element of the chain can
be a DEBUG_INSN whose mode need not be the same as the rest of the
elements in the du chain. This was resulting in fcompare-debug failure
as check_new_reg_p was returning a different result with -g for the same
candidate register. We can instead obtain nregs from the du chain
itself.

2022-06-10  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc/
	PR rtl-optimization/105041
	* regrename.c (check_new_reg_p): Use nregs value from du chain.

gcc/testsuite/
	PR rtl-optimization/105041
	* gcc.target/powerpc/pr105041.c: New test.

(cherry picked from commit 3e16b4359e)
2022-07-22 04:50:02 -05:00
GCC Administrator 5b737e0320 Daily bump. 2022-07-22 00:17:28 +00:00
Ian Lance Taylor 8c3238510c libgo: don't include <linux/fs.h> when building gen-sysinfo.go
Removing this doesn't change anything at least with glibc 2.33.
The include was added in https://go.dev/cl/6100049 but it's not
clear why.

Fixes PR go/106266

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/417294
(cherry picked from commit f35d65517a)
2022-07-21 14:04:38 +02:00
Martin Liska 6bd956e31b libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream
9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include <linux/fs.h> to resolve fsconfig_command/mount_attr conflict with glibc 2.36

(cherry picked from commit 2701442d0c)
2022-07-21 14:04:37 +02:00
GCC Administrator 72f9b80650 Daily bump. 2022-07-21 00:17:41 +00:00
GCC Administrator 0970568b51 Daily bump. 2022-07-20 00:17:39 +00:00
GCC Administrator d6304c1c15 Daily bump. 2022-07-19 00:17:46 +00:00
GCC Administrator 142b66f30d Daily bump. 2022-07-18 00:17:35 +00:00
GCC Administrator 6b994278f9 Daily bump. 2022-07-17 00:17:36 +00:00
Steve Kargl 168a1ae79b Fortran: do not generate conflicting results under -ff2c [PR104313]
gcc/fortran/ChangeLog:

	PR fortran/104313
	* trans-decl.c (gfc_generate_return): Do not generate conflicting
	fake results for functions with no result variable under -ff2c.

gcc/testsuite/ChangeLog:

	PR fortran/104313
	* gfortran.dg/pr104313.f: New test.

(cherry picked from commit 517fb1a781)
2022-07-16 20:40:10 +02:00
GCC Administrator f9b5db8725 Daily bump. 2022-07-16 00:17:36 +00:00
GCC Administrator 50b5bd9936 Daily bump. 2022-07-15 00:17:42 +00:00
GCC Administrator b0bb0a8d75 Daily bump. 2022-07-14 00:17:34 +00:00
Martin Jambor 2691107f97
tree-sra: Fix union handling in build_reconstructed_reference
As the testcase in PR 105860 shows, the code that tries to re-use the
handled_component chains in SRA can be horribly confused by unions,
where it thinks it has found a compatible structure under which it can
chain the references, but in fact it found the type it was looking
for elsewhere in a union and generated a write to a completely wrong
part of an aggregate.

I don't remember whether the plan was to support unions at all in
build_reconstructed_reference but it can work, to an extent, if we
make sure that we start the search only outside the outermost union,
which is what the patch does (and the extra testcase verifies).

Additionally, this commit also contains sqashed in it a backport of
b984b84cbe which fixes the testcase
gcc.dg/tree-ssa/alias-access-path-13.c for many 32-bit targets.

gcc/ChangeLog:

2022-07-01  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/105860
	* tree-sra.c (build_reconstructed_reference): Start expr
	traversal only just below the outermost union.

gcc/testsuite/ChangeLog:

2022-07-01  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/105860
	* gcc.dg/tree-ssa/alias-access-path-13.c: New test.
	* gcc.dg/tree-ssa/pr105860.c: Likewise.

(cherry picked from commit b110e5283e)
2022-07-13 13:18:16 +02:00
GCC Administrator daf99eafae Daily bump. 2022-07-13 00:17:37 +00:00
GCC Administrator a96788c5db Daily bump. 2022-07-12 00:17:32 +00:00