]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
2 years agoifcvt: Don't introduce trapping or faulting reads in noce_try_sign_mask [PR106032]
Jakub Jelinek [Tue, 21 Jun 2022 09:40:16 +0000 (11:40 +0200)] 
ifcvt: Don't introduce trapping or faulting reads in noce_try_sign_mask [PR106032]

noce_try_sign_mask as documented will optimize
  if (c < 0)
    x = t;
  else
    x = 0;
into x = (c >> bitsm1) & t;
The optimization is done if either t is unconditional
(e.g. for
  x = t;
  if (c >= 0)
    x = 0;
) or if it is cheap.  We already check that t doesn't have side-effects,
but if t is conditional, we need to punt also if it may trap or fault,
as we make it unconditional.

I've briefly skimmed other noce_try* optimizations and didn't find one that
would suffer from the same problem.

2022-06-21  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/106032
* ifcvt.c (noce_try_sign_mask): Punt if !t_unconditional, and
t may_trap_or_fault_p, even if it is cheap.

* gcc.c-torture/execute/pr106032.c: New test.

(cherry picked from commit a0c30fe3b888f20215f3e040d21b62b603804ca9)

2 years agoexpand: Fix up expand_cond_expr_using_cmove [PR106030]
Jakub Jelinek [Tue, 21 Jun 2022 09:38:59 +0000 (11:38 +0200)] 
expand: Fix up expand_cond_expr_using_cmove [PR106030]

If expand_cond_expr_using_cmove can't find a cmove optab for a particular
mode, it tries to promote the mode and perform the cmove in the promoted
mode.

The testcase in the patch ICEs on arm because in that case we pass temp which
has the promoted mode (SImode) as target to expand_operands where the
operands have the non-promoted mode (QImode).
Later on the function uses paradoxical subregs:
  if (GET_MODE (op1) != mode)
    op1 = gen_lowpart (mode, op1);

  if (GET_MODE (op2) != mode)
    op2 = gen_lowpart (mode, op2);
to change the operand modes.

The following patch fixes it by passing NULL_RTX as target if it has
promoted mode.

2022-06-21  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/106030
* expr.c (expand_cond_expr_using_cmove): Pass NULL_RTX instead of
temp to expand_operands if mode has been promoted.

* gcc.c-torture/compile/pr106030.c: New test.

(cherry picked from commit 2df1df945fac85d7b3d084001414a66a2709d8fe)

2 years agolibgomp: Fix up target-31.c test [PR106045]
Jakub Jelinek [Tue, 21 Jun 2022 15:51:08 +0000 (17:51 +0200)] 
libgomp: Fix up target-31.c test [PR106045]

The i variable is used inside of the parallel in:
      #pragma omp simd safelen(32) private (v)
      for (i = 0; i < 64; i++)
        {
          v = 3 * i;
          ll[i] = u1 + v * u2[0] + u2[1] + x + y[0] + y[1] + v + h[0] + u3[i];
        }
where i is predetermined linear (so while inside of the body
it is safe, private per SIMD lane var) the final value is written to
the shared variable, and in:
      for (i = 0; i < 64; i++)
        if (ll[i] != u1 + 3 * i * u2[0] + u2[1] + x + y[0] + y[1] + 3 * i + 13 + 14 + i)
          #pragma omp atomic write
            err = 1;
which is a normal loop and so it isn't in any way privatized there.
So we have a data race, fixed by adding private (i) clause to the
parallel.

2022-06-21  Jakub Jelinek  <jakub@redhat.com>
    Paul Iannetta  <piannetta@kalrayinc.com>

PR libgomp/106045
* testsuite/libgomp.c/target-31.c: Add private (i) clause.

(cherry picked from commit 85d613da341b76308edea48359a5dbc7061937c4)

2 years agoDaily bump.
GCC Administrator [Wed, 3 May 2023 00:18:25 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 2 May 2023 00:18:25 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 1 May 2023 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 30 Apr 2023 00:18:21 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 29 Apr 2023 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

2 years agolibstdc++: Throw instead of segfaulting in std::thread constructor [PR 67791]
Jonathan Wakely [Tue, 24 Nov 2020 12:48:31 +0000 (12:48 +0000)] 
libstdc++: Throw instead of segfaulting in std::thread constructor [PR 67791]

This turns a mysterious segfault into an exception with a more useful
message. If the exception isn't caught, the user sees this instead of
just a segfault:

terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted
Aborted (core dumped)

libstdc++-v3/ChangeLog:

PR libstdc++/67791
* src/c++11/thread.cc (thread::_M_start_thread(_State_ptr, void (*)())):
Check that gthreads is available before calling __gthread_create.

(cherry picked from commit 4bbd5d0c5fb2b7527938ad44a6d8a2f2ef8bbe12)

2 years agoDaily bump.
GCC Administrator [Fri, 28 Apr 2023 00:18:57 +0000 (00:18 +0000)] 
Daily bump.

2 years agolibstdc++: Fix outdated docs about demangling exception messages
Jonathan Wakely [Tue, 4 Apr 2023 11:04:14 +0000 (12:04 +0100)] 
libstdc++: Fix outdated docs about demangling exception messages

The string returned by std::bad_exception::what() hasn't been a mangled
name since PR libstdc++/14493 was fixed for GCC 4.2.0, so remove the
docs showing how to demangle it.

libstdc++-v3/ChangeLog:

* doc/xml/manual/extensions.xml: Remove std::bad_exception from
example program.
* doc/html/manual/ext_demangling.html: Regenerate.

(cherry picked from commit 688d126b69215db29774c249b052e52d765782b3)

2 years agolibstdc++: Reduce Doxygen output for PDF
Jonathan Wakely [Wed, 26 Apr 2023 11:27:59 +0000 (12:27 +0100)] 
libstdc++: Reduce Doxygen output for PDF

Including the header source code in the doxygen-generated PDF file makes
it too large, and causes pdflatex to run out of memory. If we only set
SOURCE_BROWSER=YES for the HTML docs then we won't include the sources
in the PDF file.

There are several macros defined for std::valarray that are only used to
generate repetitive code and then #undef'd. Those aren't useful in the
doxygen docs, especially the ones that reuse the same name in different
files. Omitting them avoids warnings about duplicate labels in the
refman.tex file.

libstdc++-v3/ChangeLog:

* doc/doxygen/user.cfg.in (SOURCE_BROWSER): Only set to YES for
HTML docs.
* include/bits/gslice_array.h (_DEFINE_VALARRAY_OPERATOR): Omit
from doxygen docs.
* include/bits/indirect_array.h (_DEFINE_VALARRAY_OPERATOR):
Likewise.
* include/bits/mask_array.h (_DEFINE_VALARRAY_OPERATOR):
Likewise.
* include/bits/slice_array.h (_DEFINE_VALARRAY_OPERATOR):
Likewise.
* include/std/valarray (_DEFINE_VALARRAY_UNARY_OPERATOR)
(_DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT)
(_DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT)
(_DEFINE_BINARY_OPERATOR): Likewise.

(cherry picked from commit afa69618d1627435841c9164b019ef98000e0365)

2 years agolibstdc++: Fix dangling reference in filesystem::path::filename()
Jonathan Wakely [Fri, 28 Oct 2022 14:28:09 +0000 (15:28 +0100)] 
libstdc++: Fix dangling reference in filesystem::path::filename()

The new -Wdangling-reference warning noticed this.

libstdc++-v3/ChangeLog:

* include/bits/fs_path.h (path::filename()): Fix dangling
reference.

(cherry picked from commit 49237fe6ef677a81eae701f937546210c90b5914)

2 years agolibstdc++: Fix GDB Xmethod for std::shared_ptr::use_count() [PR109064]
Jonathan Wakely [Fri, 10 Mar 2023 11:06:25 +0000 (11:06 +0000)] 
libstdc++: Fix GDB Xmethod for std::shared_ptr::use_count() [PR109064]

libstdc++-v3/ChangeLog:

PR libstdc++/109064
* python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker):
Remove self-recursion in __init__. Add missing _supports.
* testsuite/libstdc++-xmethods/shared_ptr.cc: Check use_count()
and unique().

2 years agolibstdc++: Fix uses_allocator_construction_args for pair<T&&, U&&> [PR108952]
Jonathan Wakely [Mon, 27 Feb 2023 22:34:57 +0000 (22:34 +0000)] 
libstdc++: Fix uses_allocator_construction_args for pair<T&&, U&&> [PR108952]

This implements LWG 3527 which fixes the handling of pair<T&&, U&&> in
std::uses_allocator_construction_args.

libstdc++-v3/ChangeLog:

PR libstdc++/108952
* include/std/memory (uses_allocator_construction_args):
Implement LWG 3527.
* testsuite/20_util/pair/astuple/get-2.cc: New test.
* testsuite/20_util/scoped_allocator/108952.cc: New test.
* testsuite/20_util/uses_allocator/lwg3527.cc: New test.

(cherry picked from commit 8e342c04550466ab088c33746091ce7f3498ee44)

2 years agolibstdc++: Fix name of <experimental/optional> in comment
Jonathan Wakely [Wed, 15 Feb 2023 13:29:56 +0000 (13:29 +0000)] 
libstdc++: Fix name of <experimental/optional> in comment

libstdc++-v3/ChangeLog:

* include/experimental/optional: Fix header name in comment.

(cherry picked from commit 38f321793ae18d25399f0396ac1371caa7cc7043)

2 years agolibstdc++: Fix std::common_iterator assignment [PR100823]
Jonathan Wakely [Wed, 20 Jul 2022 15:51:44 +0000 (16:51 +0100)] 
libstdc++: Fix std::common_iterator assignment [PR100823]

This fixes the following conformance problems reported in the PR:

- Move constructor and move assignment should be defined.
- Copy assignment from a valueless object should be allowed.

Assignment is completely rewritten by this patch, as the previous
version had a number of problems. The converting assignment failed to
handle the case of assigning a new value to a valueless object, which
should work. It only accepted lvalue arguments, so wasn't usable to
implement the move assignment operator. Finally, it enforced the
precondition that the argument is not valueless, which is correct for
the converting assignment but not for the copy assignment.

A new _M_assign member is added to handle all cases of assignment
(copying from an lvalue, moving from an rvalue, and converting from a
different type). The not valueless precondition is checked in the
converting assignment before calling _M_assign, so isn't enforced for
copy and move assignment. The new function no longer uses a switch, so
handles valueless objects as the LHS or RHS of the assignment.

libstdc++-v3/ChangeLog:

PR libstdc++/100823
* include/bits/stl_iterator.h (common_iterator): Define move
constructor and move assignment operator.
(common_iterator::_M_assign): New function implementing
assignment.
(common_iterator::operator=): Use _M_assign.
(common_iterator::_S_valueless): New constant.
* testsuite/24_iterators/common_iterator/100823.cc: New test.

(cherry picked from commit 56c999860bbbb2fd5091ba0985e2e5eaa90c6478)

2 years agolibstdc++: Fix minor bugs in std::common_iterator
Jonathan Wakely [Wed, 20 Jul 2022 11:49:28 +0000 (12:49 +0100)] 
libstdc++: Fix minor bugs in std::common_iterator

The noexcept-specifier for some std::common_iterator constructors was
incorrectly using an rvalue as the first argument of
std::is_nothrow_assignable_v. This gave the wrong answer for some types,
e.g. std::common_iterator<int*, S>, because an rvalue of scalar type
cannot be assigned to.

Also fix the friend declaration to use the same constraints as on the
definition of the class template. G++ fails to diagnose this error, due
to PR c++/96830.

Finally, the copy constructor was using std::move for its argument
in some cases, which should be removed.

libstdc++-v3/ChangeLog:

* include/bits/stl_iterator.h (common_iterator): Fix incorrect
uses of is_nothrow_assignable_v. Fix inconsistent constraints on
friend declaration. Do not move argument in copy constructor.
* testsuite/24_iterators/common_iterator/1.cc: Check for
noexcept constructibnle/assignable.

(cherry picked from commit 3b5567c3ec7e5759bdecc6a6fc0be2b65a93636e)

2 years agolibstdc++: Fix unsafe use of dirent::d_name [PR107814]
Jonathan Wakely [Tue, 22 Nov 2022 19:15:53 +0000 (19:15 +0000)] 
libstdc++: Fix unsafe use of dirent::d_name [PR107814]

Copy the fix for PR 104731 to the equivalent experimental::filesystem
test.

libstdc++-v3/ChangeLog:

PR libstdc++/107814
* testsuite/experimental/filesystem/iterators/error_reporting.cc:
Use a static buffer with space after it.

(cherry picked from commit 1cac00d013856fea4cee0f13c4959c8e21afd2d9)

2 years agoDaily bump.
GCC Administrator [Thu, 27 Apr 2023 00:17:59 +0000 (00:17 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 26 Apr 2023 00:19:27 +0000 (00:19 +0000)] 
Daily bump.

2 years agotestsuite: remove stray ';' [PR109608]
Jason Merrill [Tue, 25 Apr 2023 15:12:33 +0000 (11:12 -0400)] 
testsuite: remove stray ';' [PR109608]

GCC 10 is still pedantic about empty declarations.

PR testsuite/109608

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-pmf3.C: Remove stray ';'.

2 years agoDaily bump.
GCC Administrator [Tue, 25 Apr 2023 00:19:47 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 24 Apr 2023 00:19:30 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 23 Apr 2023 00:18:57 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 22 Apr 2023 00:19:16 +0000 (00:19 +0000)] 
Daily bump.

2 years agoc-family: -Wsequence-point and COMPONENT_REF [PR107163]
Jason Merrill [Thu, 23 Mar 2023 19:57:39 +0000 (15:57 -0400)] 
c-family: -Wsequence-point and COMPONENT_REF [PR107163]

The patch for PR91415 fixed -Wsequence-point to treat shifts and ARRAY_REF
as sequenced in C++17, and COMPONENT_REF as well.  But this is unnecessary
for COMPONENT_REF, since the RHS is just a FIELD_DECL with no actual
evaluation, and in this testcase handling COMPONENT_REF as sequenced blows
up fast in a deep inheritance tree.  Instead, look through it.

PR c++/107163

gcc/c-family/ChangeLog:

* c-common.c (verify_tree): Don't use sequenced handling
for COMPONENT_REF.

gcc/testsuite/ChangeLog:

* g++.dg/warn/Wsequence-point-5.C: New test.

2 years agoc++: constexpr PMF conversion [PR105996]
Jason Merrill [Thu, 23 Mar 2023 20:50:09 +0000 (16:50 -0400)] 
c++: constexpr PMF conversion [PR105996]

Here, we were calling build_reinterpret_cast regardless of whether there was
actually a cast, and that now sets REINTERPRET_CAST_P.  But that
optimization seems dodgy anyway, as it involves NOP_EXPR from one
RECORD_TYPE to another and we try to reserve NOP_EXPR for fundamental types.
And the generated code seems the same, so let's drop it.  And also strip
location wrappers.

PR c++/105996

gcc/cp/ChangeLog:

* typeck.c (build_ptrmemfunc): Drop 0-offset optimization
and location wrappers.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-pmf3.C: New test.

2 years agoc++: constant, array, lambda, template [PR108975]
Jason Merrill [Fri, 17 Mar 2023 21:26:40 +0000 (17:26 -0400)] 
c++: constant, array, lambda, template [PR108975]

When a lambda refers to a constant local variable in the enclosing scope, we
tentatively capture it, but if we end up pulling out its constant value, we
go back at the end of the lambda and prune any unneeded captures.  Here
while parsing the template we decided that the dim capture was unneeded,
because we folded it away, but then we brought back the use in the template
trees that try to preserve the source representation with added type info.
So then when we tried to instantiate that use, we couldn't find what it was
trying to use, and crashed.

Fixed by not trying to prune when parsing a template; we'll prune at
instantiation time.

PR c++/108975

gcc/cp/ChangeLog:

* lambda.c (prune_lambda_captures): Don't bother in a template.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/lambda/lambda-const11.C: New test.

2 years agoc++: namespace-scoped friend in local class [PR69410]
Jason Merrill [Fri, 17 Mar 2023 13:43:48 +0000 (09:43 -0400)] 
c++: namespace-scoped friend in local class [PR69410]

do_friend was only considering class-qualified identifiers for the
qualified-id case, but we also need to skip local scope when there's an
explicit namespace scope.

PR c++/69410

gcc/cp/ChangeLog:

* friend.c (do_friend): Handle namespace as scope argument.
* decl.c (grokdeclarator): Pass down in_namespace.

gcc/testsuite/ChangeLog:

* g++.dg/lookup/friend24.C: New test.

2 years agoc++: &enum::enumerator [PR101869]
Jason Merrill [Thu, 16 Mar 2023 17:11:32 +0000 (13:11 -0400)] 
c++: &enum::enumerator [PR101869]

We don't want to call build_offset_ref with an enum.

PR c++/101869

gcc/cp/ChangeLog:

* semantics.c (finish_qualified_id_expr): Don't try to build a
pointer-to-member if the scope is an enumeration.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/enum43.C: New test.

2 years agoDaily bump.
GCC Administrator [Fri, 21 Apr 2023 00:19:13 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 20 Apr 2023 00:18:47 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 19 Apr 2023 00:19:40 +0000 (00:19 +0000)] 
Daily bump.

2 years agoPR target/108589 - Check REG_P for AARCH64_FUSE_ADDSUB_2REG_CONST1
Philipp Tomsich [Mon, 30 Jan 2023 22:40:26 +0000 (23:40 +0100)] 
PR target/108589 - Check REG_P for AARCH64_FUSE_ADDSUB_2REG_CONST1

This adds a check for REG_P on SET_DEST for the new idiom recognizer
for AARCH64_FUSE_ADDSUB_2REG_CONST1.  The reported ICE is only
observable with checking=rtl.

Bootstrapped/regtested aarch64-linux, committed.

PR target/108589

gcc/ChangeLog:

* config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Check
REG_P on SET_DEST.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/pr108589.c: New test.

(cherry picked from commit a39c6ec97906766ad65d15d4856fd41121ee7a45)

2 years agoaarch64: disable LDP via tuning structure for -mcpu=ampere1
Philipp Tomsich [Thu, 23 Mar 2023 18:47:57 +0000 (19:47 +0100)] 
aarch64: disable LDP via tuning structure for -mcpu=ampere1

AmpereOne (-mcpu=ampere1) breaks LDP instructions into two uops.
Given the chance that this causes instructions to slip into the next
decoding cycle and the additional overheads when handling
cacheline-crossing LDP instructions, we disable the generation of LDP
isntructions through the tuning structure from instruction combining
(such as in peephole2).

Given the code-density benefits in builtins and prologue/epilogue
expansion, we allow LDPs there.

This commit:
 * adds a new tuning option AARCH64_EXTRA_TUNE_NO_LDP_COMBINE
 * allows -moverride=tune=... to override this

These changes are benchmark-driven, yielding the following changes
(with a net-overall improvement):
   503.bwaves_r.      -0.88%
   507.cactuBSSN_r     0.35%
   508.namd_r          3.09%
   510.parest_r       -2.99%
   511.povray_r        5.54%
   519.lbm_r          15.83%
   521.wrf_r           0.56%
   526.blender_r       2.47%
   527.cam4_r          0.70%
   538.imagick_r       0.00%
   544.nab_r          -0.33%
   549.fotonik3d_r.   -0.42%
   554.roms_r          0.00%
   -------------------------
   = total             1.79%

Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Co-Authored-By: Di Zhao <di.zhao@amperecomputing.com>
gcc/ChangeLog:

* config/aarch64/aarch64-tuning-flags.def (AARCH64_EXTRA_TUNING_OPTION):
Add AARCH64_EXTRA_TUNE_NO_LDP_COMBINE.
* config/aarch64/aarch64.c (aarch64_operands_ok_for_ldpstp):
Check for the above tuning option when processing loads.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/ampere1-no_ldp_combine.c: New test.

(cherry picked from commit f200c56787f2c6f93ffb739d57d01a294ab72f68)

2 years agoaarch64: update ampere1 vectorization cost
Philipp Tomsich [Mon, 17 Apr 2023 23:26:32 +0000 (01:26 +0200)] 
aarch64: update ampere1 vectorization cost

The original submission of AmpereOne (-mcpu=ampere1) costs occurred
prior to exhaustive testing of vectorizable workloads against
hardware.

Adjust the vector costs to achieve the best results and more closely
match the underlying hardware.

gcc/ChangeLog:

* config/aarch64/aarch64.c: Update vector costs for ampere1.

Co-Authored-By: Jiangning Liu <jiangning.liu@amperecomputing.com>
Co-Authored-By: Manolis Tsamis <manolis.tsamis@vrull.eu>
(cherry picked from commit ff1f2f2412bda118f7ddc10e69bd4284d9b24b9e)

2 years agoaarch64: Add support for Ampere-1A (-mcpu=ampere1a) CPU
Philipp Tomsich [Mon, 7 Nov 2022 13:22:21 +0000 (14:22 +0100)] 
aarch64: Add support for Ampere-1A (-mcpu=ampere1a) CPU

This patch adds support for Ampere-1A CPU:
 - recognize the name of the core and provide detection for -mcpu=native,
 - updated extra_costs,
 - adds a new fusion pair for (A+B+1 and A-B-1).

Ampere-1A and Ampere-1 have more timing difference than the extra
costs indicate, but these don't propagate through to the headline
items in our extra costs (e.g. the change in latency for scalar sqrt
doesn't have a corresponding table entry).

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (AARCH64_CORE): Add ampere1a.
* config/aarch64/aarch64-cost-tables.h: Add ampere1a_extra_costs.
* config/aarch64/aarch64-fusion-pairs.def (AARCH64_FUSION_PAIR):
Define a new fusion pair for A+B+1/A-B-1 (i.e., add/subtract two
registers and then +1/-1).
* config/aarch64/aarch64-tune.md: Regenerate.
* config/aarch64/aarch64.c (aarch_macro_fusion_pair_p): Implement
idiom-matcher for the new fusion pair.
* doc/invoke.texi: Add ampere1a.

(cherry picked from commit 590a06afbf0e96813b5879742f38f3665512c854)

2 years agoaarch64: update Ampere-1 core definition
Philipp Tomsich [Sun, 7 Aug 2022 22:30:52 +0000 (00:30 +0200)] 
aarch64: update Ampere-1 core definition

This brings the extensions detected by -mcpu=native on Ampere-1 systems
in sync with the defaults generated for -mcpu=ampere1.

Note that some early kernel versions on Ampere1 may misreport the
presence of PAUTH and PREDRES (i.e., -mcpu=native will add 'nopauth'
and 'nopredres').

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (AARCH64_CORE): Update
Ampere-1 core entry.

(cherry picked from commit db2f5d661239737157cf131de7d4df1c17d8d88d)

2 years agoaarch64: fix off-by-one in reading cpuinfo
Philipp Tomsich [Mon, 3 Oct 2022 19:59:50 +0000 (21:59 +0200)] 
aarch64: fix off-by-one in reading cpuinfo

Fixes: 341573406b39
Don't subtract one from the result of strnlen() when trying to point
to the first character after the current string.  This issue would
cause individual characters (where the 128 byte buffers are stitched
together) to be lost.

gcc/ChangeLog:

* config/aarch64/driver-aarch64.c (readline): Fix off-by-one.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/cpunative/info_18: New test.
* gcc.target/aarch64/cpunative/native_cpu_18.c: New test.

(cherry picked from commit b1cfbccc41de6aec950c0f662e7e85ab34bfff8a)

2 years agoaarch64: enable Ampere-1 CPU
Philipp Tomsich [Thu, 20 May 2021 19:57:48 +0000 (21:57 +0200)] 
aarch64: enable Ampere-1 CPU

This adds support and a basic tuning model for the Ampere Computing
"Ampere-1" CPU.

The Ampere-1 implements the ARMv8.6 architecture in A64 mode and is
modelled as a 4-wide issue (as with all modern micro-architectures,
the chosen issue rate is a compromise between the maximum dispatch
rate and the maximum rate of uops issued to the scheduler).

This adds the -mcpu=ampere1 command-line option and the relevant cost
information/tuning tables for the Ampere-1.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (AARCH64_CORE): New Ampere-1
core.
* config/aarch64/aarch64-tune.md: Regenerate.
* config/aarch64/aarch64-cost-tables.h: Add extra costs for
Ampere-1.
* config/aarch64/aarch64.c: Add tuning structures for Ampere-1.
* doc/invoke.texi: Add documentation for Ampere-1 core.

(cherry picked from commit 67b0d47e20e655c0dd53a76ea88aab60fafb2059)

2 years agoDaily bump.
GCC Administrator [Tue, 18 Apr 2023 00:18:56 +0000 (00:18 +0000)] 
Daily bump.

2 years agors6000: Fix vector parity support [PR108699]
Kewen Lin [Tue, 4 Apr 2023 02:47:44 +0000 (21:47 -0500)] 
rs6000: Fix vector parity support [PR108699]

The failures on the original failed case builtin-bitops-1.c
and the associated test case pr108699.c here show that the
current support of parity vector mode is wrong on Power.
The hardware insns vprtyb[wdq] which operate on the least
significant bit of each byte per element, they doesn't match
what RTL opcode parity needs, but the current implementation
expands it with them wrongly.

This patch is to fix the handling with one more insn vpopcntb.

PR target/108699

gcc/ChangeLog:

* config/rs6000/altivec.md (*p9v_parity<mode>2): Rename to ...
(rs6000_vprtyb<mode>2): ... this.
* config/rs6000/rs6000-builtin.def (VPRTYBD): Replace parityv2di2 with
rs6000_vprtybv2di2.
(VPRTYBW): Replace parityv4si2 with rs6000_vprtybv4si2.
(VPRTYBQ): Replace parityv1ti2 with rs6000_vprtybv1ti2.
* config/rs6000/vector.md (parity<mode>2 with VEC_IP): Expand with
popcountv16qi2 and the corresponding rs6000_vprtyb<mode>2.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/p9-vparity.c: Add scan-assembler-not for vpopcntb
to distinguish parity byte from parity.
* gcc.target/powerpc/pr108699.c: New test.

(cherry picked from commit cdd2d6643f7fef40e335a7027edfea7276cde608)

2 years agoDaily bump.
GCC Administrator [Mon, 17 Apr 2023 00:18:56 +0000 (00:18 +0000)] 
Daily bump.

2 years agoFortran: fix compile-time simplification of SET_EXPONENT [PR109511]
Harald Anlauf [Fri, 14 Apr 2023 18:45:19 +0000 (20:45 +0200)] 
Fortran: fix compile-time simplification of SET_EXPONENT [PR109511]

gcc/fortran/ChangeLog:

PR fortran/109511
* simplify.c (gfc_simplify_set_exponent): Fix implementation of
compile-time simplification of intrinsic SET_EXPONENT for argument
X < 1 and for I < 0.

gcc/testsuite/ChangeLog:

PR fortran/109511
* gfortran.dg/set_exponent_1.f90: New test.

(cherry picked from commit fa4cb42870df60deb8888dbd51e2ddc6d6ab9e6a)

2 years agoDaily bump.
GCC Administrator [Sun, 16 Apr 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 15 Apr 2023 00:18:27 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 14 Apr 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 13 Apr 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 12 Apr 2023 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 11 Apr 2023 00:17:58 +0000 (00:17 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 10 Apr 2023 00:18:00 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 9 Apr 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 8 Apr 2023 00:18:05 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 7 Apr 2023 00:18:51 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 6 Apr 2023 00:18:02 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 5 Apr 2023 00:18:20 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 4 Apr 2023 00:17:55 +0000 (00:17 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 3 Apr 2023 00:18:13 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 2 Apr 2023 00:18:38 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 1 Apr 2023 00:18:57 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 31 Mar 2023 00:18:04 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 30 Mar 2023 00:18:02 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 29 Mar 2023 00:17:55 +0000 (00:17 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 28 Mar 2023 00:18:01 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 27 Mar 2023 00:18:17 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 26 Mar 2023 00:19:07 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 25 Mar 2023 00:19:25 +0000 (00:19 +0000)] 
Daily bump.

2 years agoFortran: simplification of NEAREST for large argument [PR109186]
Harald Anlauf [Sun, 19 Mar 2023 20:29:46 +0000 (21:29 +0100)] 
Fortran: simplification of NEAREST for large argument [PR109186]

gcc/fortran/ChangeLog:

PR fortran/109186
* simplify.c (gfc_simplify_nearest): Fix off-by-one error in setting
up real kind-specific maximum exponent for mpfr.

gcc/testsuite/ChangeLog:

PR fortran/109186
* gfortran.dg/nearest_6.f90: New test.

(cherry picked from commit 4410a08b80cc40342eeaa5b6af824cd4352b218c)

2 years agoFortran: procedures with BIND(C) attribute require explicit interface [PR85877]
Harald Anlauf [Fri, 17 Mar 2023 21:24:49 +0000 (22:24 +0100)] 
Fortran: procedures with BIND(C) attribute require explicit interface [PR85877]

gcc/fortran/ChangeLog:

PR fortran/85877
* resolve.c (resolve_fl_procedure): Check for an explicit interface
of procedures with the BIND(C) attribute (F2018:15.4.2.2).

gcc/testsuite/ChangeLog:

PR fortran/85877
* gfortran.dg/pr85877.f90: New test.

(cherry picked from commit 5426ab34643d9e6502f3ee572891a03471fa33ed)

2 years agoDaily bump.
GCC Administrator [Fri, 24 Mar 2023 00:18:32 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 23 Mar 2023 00:19:09 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 22 Mar 2023 00:18:41 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 21 Mar 2023 00:18:25 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 20 Mar 2023 00:18:48 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 19 Mar 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 18 Mar 2023 00:18:14 +0000 (00:18 +0000)] 
Daily bump.

2 years agoFortran: fix bounds check for copying of class expressions [PR106945]
Harald Anlauf [Sat, 11 Mar 2023 14:37:37 +0000 (15:37 +0100)] 
Fortran: fix bounds check for copying of class expressions [PR106945]

In the bounds check for copying of class expressions, the number of elements
determined from a descriptor, returned as type gfc_array_index_type (i.e. a
signed type), should be converted to the type of the passed element count,
which is of type size_type_node (i.e. unsigned), for use in comparisons.

gcc/fortran/ChangeLog:

PR fortran/106945
* trans-expr.c (gfc_copy_class_to_class): Convert element counts in
bounds check to common type for comparison.

gcc/testsuite/ChangeLog:

PR fortran/106945
* gfortran.dg/pr106945.f90: New test.

(cherry picked from commit 2cf5f485e0351bb1faf46196a99e524688f3966e)

2 years agoFortran: fix ICE with bind(c) in block data [PR104332]
Harald Anlauf [Thu, 9 Mar 2023 17:59:08 +0000 (18:59 +0100)] 
Fortran: fix ICE with bind(c) in block data [PR104332]

gcc/fortran/ChangeLog:

PR fortran/104332
* resolve.c (resolve_symbol): Avoid NULL pointer dereference while
checking a symbol with the BIND(C) attribute.

gcc/testsuite/ChangeLog:

PR fortran/104332
* gfortran.dg/bind_c_usage_34.f90: New test.

(cherry picked from commit e20e5d9dc11b64e8eabce6803c91cb5768207083)

2 years agoDaily bump.
GCC Administrator [Fri, 17 Mar 2023 00:18:37 +0000 (00:18 +0000)] 
Daily bump.

2 years agolibstdc++: Fix std::filesystem errors with -fkeep-inline-functions [PR108636]
Jonathan Wakely [Thu, 2 Feb 2023 14:06:40 +0000 (14:06 +0000)] 
libstdc++: Fix std::filesystem errors with -fkeep-inline-functions [PR108636]

With -fkeep-inline-functions there are linker errors when including
<filesystem>. This happens because there are some filesystem::path
constructors defined inline which call non-exported functions defined in
the library. That's usually not a problem, because those constructors
are only called by code that's also inside the library. But when the
header is compiled with -fkeep-inline-functions those inline functions
are emitted even though they aren't called. That then creates an
undefined reference to the other library internals. The fix is to just
move the private constructors into the library where they are called.
That way they are never even seen by users, and so not compiled even if
-fkeep-inline-functions is used.

libstdc++-v3/ChangeLog:

PR libstdc++/108636
* include/bits/fs_path.h (path::path(string_view, _Type))
(path::_Cmpt::_Cmpt(string_view, _Type, size_t)): Move inline
definitions to ...
* src/c++17/fs_path.cc: ... here.
* testsuite/27_io/filesystem/path/108636.cc: New test.

(cherry picked from commit db8d6fc572ec316ccfcf70b1dffe3be0b1b37212)

2 years agoDaily bump.
GCC Administrator [Thu, 16 Mar 2023 00:18:36 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 15 Mar 2023 00:18:22 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 14 Mar 2023 00:19:09 +0000 (00:19 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 13 Mar 2023 00:18:54 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 12 Mar 2023 00:18:11 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 11 Mar 2023 00:18:11 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Fri, 10 Mar 2023 00:18:43 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 9 Mar 2023 00:18:24 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Wed, 8 Mar 2023 00:18:39 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Tue, 7 Mar 2023 00:18:24 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Mon, 6 Mar 2023 00:18:27 +0000 (00:18 +0000)] 
Daily bump.

2 years agoFortran: fix corner case of IBITS intrinsic [PR108937]
Harald Anlauf [Mon, 27 Feb 2023 20:37:11 +0000 (21:37 +0100)] 
Fortran: fix corner case of IBITS intrinsic [PR108937]

gcc/fortran/ChangeLog:

PR fortran/108937
* trans-intrinsic.c (gfc_conv_intrinsic_ibits): Handle corner case
LEN argument of IBITS equal to BITSIZE(I).

gcc/testsuite/ChangeLog:

PR fortran/108937
* gfortran.dg/ibits_2.f90: New test.

(cherry picked from commit 6cce953ebec274f1468d5d3a0697cf05bb43b8f6)

2 years agoFortran: reject invalid CHARACTER length of derived type components [PR96024]
Harald Anlauf [Tue, 21 Feb 2023 21:06:33 +0000 (22:06 +0100)] 
Fortran: reject invalid CHARACTER length of derived type components [PR96024]

gcc/fortran/ChangeLog:

PR fortran/96024
* resolve.c (resolve_component): The type of a CHARACTER length
expression must be INTEGER.

gcc/testsuite/ChangeLog:

PR fortran/96024
* gfortran.dg/pr96024.f90: New test.

(cherry picked from commit 31303c9b5bab200754cdb7ef8cd91ae4918f3018)

2 years agoFortran: improve checking of character length specification [PR96025]
Harald Anlauf [Mon, 20 Feb 2023 20:28:09 +0000 (21:28 +0100)] 
Fortran: improve checking of character length specification [PR96025]

gcc/fortran/ChangeLog:

PR fortran/96025
* parse.c (check_function_result_typed): Improve type check of
specification expression for character length and return status.
(parse_spec): Use status from above.
* resolve.c (resolve_fntype): Prevent use of invalid specification
expression for character length.

gcc/testsuite/ChangeLog:

PR fortran/96025
* gfortran.dg/pr96025.f90: New test.

(cherry picked from commit 6c1b825b3d6499dfeacf7c79dcf4b56a393ac204)

2 years agoDaily bump.
GCC Administrator [Sun, 5 Mar 2023 00:18:31 +0000 (00:18 +0000)] 
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 4 Mar 2023 00:18:05 +0000 (00:18 +0000)] 
Daily bump.

2 years agos390: libatomic: Fix 16 byte atomic {cas,load,store}
Stefan Schulze Frielinghaus [Fri, 3 Mar 2023 16:14:13 +0000 (17:14 +0100)] 
s390: libatomic: Fix 16 byte atomic {cas,load,store}

This is a follow-up to commit a4c6bd0821099f6b8c0f64a96ffd9d01a025c413
introducing a runtime check for alignment for 16 byte atomic
compare-exchange, load, and store.

libatomic/ChangeLog:

* config/s390/cas_n.c: New file.
* config/s390/load_n.c: New file.
* config/s390/store_n.c: New file.

(cherry picked from commit 9056d0df830c5a295d7594d517d409d10476990d)

2 years agod: Fix ICE on explicit immutable struct import [PR108877]
Iain Buclaw [Mon, 27 Feb 2023 19:46:18 +0000 (20:46 +0100)] 
d: Fix ICE on explicit immutable struct import [PR108877]

Const and immutable types are built as variants of the type they are
derived from, and TYPE_STUB_DECL is not set for these variants.

PR d/108877

gcc/d/ChangeLog:

* imports.cc (ImportVisitor::visit (EnumDeclaration *)): Call
make_import on TYPE_MAIN_VARIANT.
(ImportVisitor::visit (AggregateDeclaration *)): Likewise.
(ImportVisitor::visit (ClassDeclaration *)): Likewise.

gcc/testsuite/ChangeLog:

* gdc.dg/imports/pr108877a.d: New test.
* gdc.dg/pr108877.d: New test.

(cherry picked from commit ce1cea3e22f58bbddde017f8a92e59bae8892339)

2 years agoDaily bump.
GCC Administrator [Fri, 3 Mar 2023 00:18:09 +0000 (00:18 +0000)] 
Daily bump.