]> gcc.gnu.org Git - gcc.git/log
gcc.git
16 months agoRemove znver4 instruction reservations
Tejas Joshi [Fri, 21 Oct 2022 15:35:39 +0000 (21:05 +0530)]
Remove znver4 instruction reservations

This reverts the changes made to znver.md in:
commit bf3b532b524ecacb3202ab2c8af419ffaaab7cff

2022-10-21  Tejas Joshi <TejasSanjay.Joshi@amd.com>

gcc/ChangeLog:

* common/config/i386/i386-common.cc (processor_alias_table): Use
CPU_ZNVER3 for znver4.
* config/i386/znver.md: Remove znver4 reservations.

(cherry picked from commit d93171509aa7ca23148508b96f1c1f70b941d808)

16 months agoEnable AMD znver4 support and add instruction reservations
Tejas Joshi [Tue, 28 Jun 2022 11:03:53 +0000 (16:33 +0530)]
Enable AMD znver4 support and add instruction reservations

2022-09-28  Tejas Joshi <TejasSanjay.Joshi@amd.com>

gcc/ChangeLog:

* common/config/i386/cpuinfo.h (get_amd_cpu): Recognize znver4.
* common/config/i386/i386-common.cc (processor_names): Add znver4.
(processor_alias_table): Add znver4 and modularize old znvers.
* common/config/i386/i386-cpuinfo.h (processor_subtypes):
AMDFAM19H_ZNVER4.
* config.gcc (x86_64-*-* |...): Likewise.
* config/i386/driver-i386.cc (host_detect_local_cpu): Let
-march=native recognize znver4 cpus.
* config/i386/i386-c.cc (ix86_target_macros_internal): Add znver4.
* config/i386/i386-options.cc (m_ZNVER4): New definition.
(m_ZNVER): Include m_ZNVER4.
(processor_cost_table): Add znver4.
* config/i386/i386.cc (ix86_reassociation_width): Likewise.
* config/i386/i386.h (processor_type): Add PROCESSOR_ZNVER4.
(PTA_ZNVER1): New definition.
(PTA_ZNVER2): Likewise.
(PTA_ZNVER3): Likewise.
(PTA_ZNVER4): Likewise.
* config/i386/i386.md (define_attr "cpu"): Add znver4 and rename
md file.
* config/i386/x86-tune-costs.h (znver4_cost): New definition.
* config/i386/x86-tune-sched.cc (ix86_issue_rate): Add znver4.
(ix86_adjust_cost): Likewise.
* config/i386/znver1.md: Rename to znver.md.
* config/i386/znver.md: Add new reservations for znver4.
* doc/extend.texi: Add details about znver4.
* doc/invoke.texi: Likewise.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit bf3b532b524ecacb3202ab2c8af419ffaaab7cff)

16 months agoFortran: ICE in transformational_result [PR108529]
Harald Anlauf [Tue, 24 Jan 2023 20:39:43 +0000 (21:39 +0100)]
Fortran: ICE in transformational_result [PR108529]

gcc/fortran/ChangeLog:

PR fortran/108529
* simplify.cc (simplify_transformation): Do not try to simplify
transformational intrinsic when the ARRAY argument has a NULL shape.

gcc/testsuite/ChangeLog:

PR fortran/108529
* gfortran.dg/pr108529.f90: New test.

(cherry picked from commit 6c96382eed96a9285611f2e3e2e59557094172b8)

16 months agoFortran: error recovery for bad initializers of implied-shape arrays [PR106209]
Harald Anlauf [Thu, 14 Jul 2022 20:24:55 +0000 (22:24 +0200)]
Fortran: error recovery for bad initializers of implied-shape arrays [PR106209]

gcc/fortran/ChangeLog:

PR fortran/106209
* decl.cc (add_init_expr_to_sym): Handle bad initializers for
implied-shape arrays.

gcc/testsuite/ChangeLog:

PR fortran/106209
* gfortran.dg/pr106209.f90: New test.

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

16 months agoFortran: fix ICE in get_expr_storage_size [PR108421]
Harald Anlauf [Mon, 16 Jan 2023 20:30:56 +0000 (21:30 +0100)]
Fortran: fix ICE in get_expr_storage_size [PR108421]

gcc/fortran/ChangeLog:

PR fortran/108421
* interface.cc (get_expr_storage_size): Check that we actually have
an integer value before trying to extract it with mpz_get_si.

gcc/testsuite/ChangeLog:

PR fortran/108421
* gfortran.dg/pr108421.f90: New test.

(cherry picked from commit a75760374ee54768e5fd6a27080698bfbbd041ab)

16 months agoFortran: fix ICE in check_charlen_present [PR108420]
Harald Anlauf [Mon, 16 Jan 2023 20:41:09 +0000 (21:41 +0100)]
Fortran: fix ICE in check_charlen_present [PR108420]

gcc/fortran/ChangeLog:

PR fortran/108420
* iresolve.cc (check_charlen_present): Preserve character length if
there is no array constructor.

gcc/testsuite/ChangeLog:

PR fortran/108420
* gfortran.dg/pr108420.f90: New test.

(cherry picked from commit e6669c0a50ed8aee9e5997d61e6271668d149218)

16 months agoFortran: avoid ICE on invalid array subscript triplets [PR108501]
Harald Anlauf [Mon, 23 Jan 2023 20:19:03 +0000 (21:19 +0100)]
Fortran: avoid ICE on invalid array subscript triplets [PR108501]

gcc/fortran/ChangeLog:

PR fortran/108501
* interface.cc (get_expr_storage_size): Check array subscript triplets
that we actually have integer values before trying to extract with
mpz_get_si.

gcc/testsuite/ChangeLog:

PR fortran/108501
* gfortran.dg/pr108501.f90: New test.

(cherry picked from commit 771d793df1622a476e1cf8d05f0a6aee350fa56b)

16 months agoFortran: fix NULL pointer dereference in gfc_check_dependency [PR108502]
Harald Anlauf [Mon, 23 Jan 2023 21:13:44 +0000 (22:13 +0100)]
Fortran: fix NULL pointer dereference in gfc_check_dependency [PR108502]

gcc/fortran/ChangeLog:

PR fortran/108502
* dependency.cc (gfc_check_dependency): Prevent NULL pointer
dereference while recursively checking expressions.

gcc/testsuite/ChangeLog:

PR fortran/108502
* gfortran.dg/pr108502.f90: New test.

(cherry picked from commit 51767f31878a95161142254dca7119b409699670)

16 months agoDaily bump.
GCC Administrator [Sat, 28 Jan 2023 00:22:03 +0000 (00:22 +0000)]
Daily bump.

16 months agoarm: Fix MVE's vcmp vector-scalar patterns [PR107987]
Andre Vieira [Tue, 6 Dec 2022 12:06:33 +0000 (12:06 +0000)]
arm: Fix MVE's vcmp vector-scalar patterns [PR107987]

This patch surrounds the scalar operand of the MVE vcmp patterns with a
vec_duplicate to ensure both operands of the comparision operator have the same
(vector) mode.

gcc/ChangeLog:

PR target/107987
* config/arm/mve.md (mve_vcmp<mve_cmp_op>q_n_<mode>,
@mve_vcmp<mve_cmp_op>q_n_f<mode>): Apply vec_duplicate to scalar
operand.

gcc/testsuite/ChangeLog:

* gcc.target/arm/mve/pr107987.c: New test.

(cherry picked from commit ed34c3bc3428bce663d42e9eeda10bc0c5d56d5c)

16 months agoDaily bump.
GCC Administrator [Fri, 27 Jan 2023 00:22:41 +0000 (00:22 +0000)]
Daily bump.

16 months agoopts: SANITIZE_ADDRESS wrongly cleared [PR108543]
Marek Polacek [Wed, 25 Jan 2023 22:19:54 +0000 (17:19 -0500)]
opts: SANITIZE_ADDRESS wrongly cleared [PR108543]

Here we crash on a null fndecl ultimately because we haven't defined
the built-ins described in sanitizer.def.  So
builtin_decl_explicit (BUILT_IN_ASAN_POINTER_SUBTRACT);
returns NULL_TREE, causing an ICE later.

DEF_SANITIZER_BUILTIN only actually defines the built-ins when flag_sanitize
has SANITIZE_ADDRESS, or some of the other SANITIZE_*, but it doesn't check
SANITIZE_KERNEL_ADDRESS or SANITIZE_USER_ADDRESS.  Unfortunately, with
-fsanitize=address -fno-sanitize=kernel-address
or
-fsanitize=kernel-address -fno-sanitize=address
SANITIZE_ADDRESS ends up being unset from flag_sanitize even though
_USER/_KERNEL are set.  That's because -fsanitize=address means
SANITIZE_ADDRESS | SANITIZE_USER_ADDRESS and -fsanitize=kernel-address
is SANITIZE_ADDRESS | SANITIZE_KERNEL_ADDRESS but parse_sanitizer_options
does
  flags &= ~sanitizer_opts[i].flag;
so the subsequent -fno- unsets SANITIZE_ADDRESS.  Then no sanitizer
built-ins are actually defined.

I'm not sure why SANITIZE_ADDRESS isn't just SANITIZE_USER_ADDRESS |
SANITIZE_KERNEL_ADDRESS, I don't think we need 3 bits.

PR middle-end/108543

gcc/ChangeLog:

* opts.cc (parse_sanitizer_options): Don't always clear SANITIZE_ADDRESS
if it was previously set.

gcc/testsuite/ChangeLog:

* c-c++-common/asan/pointer-subtract-5.c: New test.
* c-c++-common/asan/pointer-subtract-6.c: New test.
* c-c++-common/asan/pointer-subtract-7.c: New test.
* c-c++-common/asan/pointer-subtract-8.c: New test.

(cherry picked from commit a82ce9c8d155ecda2d1c647d5c588f29e21ef4a3)

16 months agopru: Fix CLZ expansion for QI and HI modes
Dimitar Dimitrov [Sat, 21 Jan 2023 16:10:59 +0000 (18:10 +0200)]
pru: Fix CLZ expansion for QI and HI modes

The recent gcc.dg/tree-ssa/clz-char.c test case failed for PRU target,
exposing a wrong code generation bug in the PRU backend.  The "clz"
pattern did not produce correct output for QI and HI input operand
modes.  SI mode is ok.

The "clz" pattern is expanded to an LMBD instruction to get the
left-most bit position having value "1".  In turn, to get the correct
"clz" value, that bit position must be subtracted from the MSB bit
position of the input operand.  The old behaviour of hard-coding 31
for MSB bit position is wrong.

The LMBD instruction returns 32 if input operand is zero, irrespective
of its register mode.  This maps nicely for SI mode, where the "clz"
pattern outputs -1.  It also leads to peculiar (but valid!) output
values from the "clz" pattern for QI and HI zero-valued inputs.

The corresponding commit in trunk contains two new test cases, which
have been removed here because they depend on r13-5195-g4798080d4a3530.
Regtested for pru-unknown-elf.

gcc/ChangeLog:

* config/pru/pru.h (CLZ_DEFINED_VALUE_AT_ZERO): Fix value for QI
and HI input modes.
* config/pru/pru.md (clz): Fix generated code for QI and HI
input modes.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
(cherry picked from commit c517295940a23db8ca165dfd5d0edea4457eda49)

16 months agorestrict gcc.dg/pr107554.c to 64bit platforms
Richard Biener [Mon, 14 Nov 2022 07:08:26 +0000 (08:08 +0100)]
restrict gcc.dg/pr107554.c to 64bit platforms

The following avoids exceeding the maximum object size on 32bit
platforms.

* gcc.dg/pr107554.c: Restrict to lp64.

(cherry picked from commit e7ebdf51ea514ad0b2272ecfa97d6ec72a527e40)

16 months agoDaily bump.
GCC Administrator [Thu, 26 Jan 2023 00:21:48 +0000 (00:21 +0000)]
Daily bump.

16 months agoaarch64: fix warning emission for ABI break since GCC 9.1
Christophe Lyon [Tue, 14 Jun 2022 21:08:33 +0000 (21:08 +0000)]
aarch64: fix warning emission for ABI break since GCC 9.1

While looking at PR 105549, which is about fixing the ABI break
introduced in GCC 9.1 in parameter alignment with bit-fields, we
noticed that the GCC 9.1 warning is not emitted in all the cases where
it should be.  This patch fixes that and the next patch in the series
fixes the GCC 9.1 break.

We split this into two patches since patch #2 introduces a new ABI
break starting with GCC 13.1.  This way, patch #1 can be back-ported
to release branches if needed to fix the GCC 9.1 warning issue.

The main idea is to add a new global boolean that indicates whether
we're expanding the start of a function, so that aarch64_layout_arg
can emit warnings for callees as well as callers.  This removes the
need for aarch64_function_arg_boundary to warn (with its incomplete
information).  However, in the first patch there are still cases where
we emit warnings were we should not; this is fixed in patch #2 where
we can distinguish between GCC 9.1 and GCC.13.1 ABI breaks properly.

The fix in aarch64_function_arg_boundary (replacing & with &&) looks
like an oversight of a previous commit in this area which changed
'abi_break' from a boolean to an integer.

We also take the opportunity to fix the comment above
aarch64_function_arg_alignment since the value of the abi_break
parameter was changed in a previous commit, no longer matching the
description.

2022-11-28  Christophe Lyon  <christophe.lyon@arm.com>
    Richard Sandiford  <richard.sandiford@arm.com>

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_function_arg_alignment): Fix
comment.
(aarch64_layout_arg): Factorize warning conditions.
(aarch64_function_arg_boundary): Fix typo.
* function.cc (currently_expanding_function_start): New variable.
(expand_function_start): Handle
currently_expanding_function_start.
* function.h (currently_expanding_function_start): Declare.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/bitfield-abi-warning-align16-O2.c: New test.
* gcc.target/aarch64/bitfield-abi-warning-align16-O2-extra.c: New
test.
* gcc.target/aarch64/bitfield-abi-warning-align32-O2.c: New test.
* gcc.target/aarch64/bitfield-abi-warning-align32-O2-extra.c: New
test.
* gcc.target/aarch64/bitfield-abi-warning-align8-O2.c: New test.
* gcc.target/aarch64/bitfield-abi-warning.h: New test.
* g++.target/aarch64/bitfield-abi-warning-align16-O2.C: New test.
* g++.target/aarch64/bitfield-abi-warning-align16-O2-extra.C: New
test.
* g++.target/aarch64/bitfield-abi-warning-align32-O2.C: New test.
* g++.target/aarch64/bitfield-abi-warning-align32-O2-extra.C: New
test.
* g++.target/aarch64/bitfield-abi-warning-align8-O2.C: New test.
* g++.target/aarch64/bitfield-abi-warning.h: New test.

(cherry picked from commit 3df1a115be22caeab3ffe7afb12e71adb54ff132)

16 months agoDaily bump.
GCC Administrator [Wed, 25 Jan 2023 00:22:00 +0000 (00:22 +0000)]
Daily bump.

16 months agotree-optimization/108164 - undefined overflow with IV vectorization
Richard Biener [Mon, 19 Dec 2022 13:55:45 +0000 (14:55 +0100)]
tree-optimization/108164 - undefined overflow with IV vectorization

vect_update_ivs_after_vectorizer can end up emitting a signed
IV update when the loop body performed an unsigned computation.
The following makes sure to perform that update in the type
of the loop update type to avoid undefined behavior on overflow.

PR tree-optimization/108164
* tree-vect-loop-manip.cc (vect_update_ivs_after_vectorizer):
Perform vect_step_op_add update in the appropriate type.

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

(cherry picked from commit ec459469f8a75d96a9b26694554efcc900d411de)

16 months agotree-optimization/108076 - if-conversion and forced labels
Richard Biener [Mon, 12 Dec 2022 16:52:46 +0000 (17:52 +0100)]
tree-optimization/108076 - if-conversion and forced labels

When doing if-conversion we simply throw away labels without checking
whether they are possibly targets of non-local gotos or have their
address taken.  The following rectifies this and refuses to if-convert
such loops.

PR tree-optimization/108076
* tree-if-conv.cc (if_convertible_loop_p_1): Reject blocks
with non-local or forced labels that we later remove
labels from.

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

(cherry picked from commit b4fddbe9592e9feb37ce567d90af822b75995531)

16 months agomiddle-end/107994 - ICE after error with comparison gimplification
Richard Biener [Wed, 21 Dec 2022 11:27:58 +0000 (12:27 +0100)]
middle-end/107994 - ICE after error with comparison gimplification

The following avoids passing down error_mark_node to fold_convert.

PR middle-end/107994
* gimplify.cc (gimplify_expr): Catch errorneous comparison
operand.

(cherry picked from commit 845b514e8a150447ba041294586af76a6ac05158)

16 months agotree-optimization/107554 - fix ICE in stlen optimization
Richard Biener [Fri, 11 Nov 2022 13:28:52 +0000 (14:28 +0100)]
tree-optimization/107554 - fix ICE in stlen optimization

The following fixes a wrongly typed variable causing an ICE.

PR tree-optimization/107554
* tree-ssa-strlen.cc (strlen_pass::count_nonzero_bytes):
Use unsigned HOST_WIDE_INT type for the strlen.

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

Co-Authored-By: Nikita Voronov <nik_1357@mail.ru>
(cherry picked from commit 81de4037454275f8ed6d858fbc129e832c6147ef)

16 months agodriver: fix environ corruption after putenv() [PR106624]
Sergei Trofimovich [Tue, 16 Aug 2022 11:35:07 +0000 (12:35 +0100)]
driver: fix environ corruption after putenv() [PR106624]

The bug appeared afte r13-2010-g1270ccda70ca09 "Factor out
jobserver_active_p" slightly changed `putenv()` use from allocating
to non-allocating:

    -xputenv (concat ("MAKEFLAGS=", dup, NULL));
    +xputenv (jinfo.skipped_makeflags.c_str ());

`xputenv()` (and `putenv()`) don't copy strings and only store the
pointer in the `environ` global table. As a result `environ` got
corrupted as soon as `jinfo.skipped_makeflags` store got deallocated.

This started causing bootstrap crashes in `execv()` calls:

    xgcc: fatal error: cannot execute '/build/build/./prev-gcc/collect2': execv: Bad address

The change restores memory allocation for `xputenv()` argument.

gcc/

PR driver/106624
* gcc.cc (driver::detect_jobserver): Allocate storage xputenv()
argument using xstrdup().

(cherry picked from commit 2b403297b111c990c331b5bbb6165b061ad2259b)

16 months agoDaily bump.
GCC Administrator [Tue, 24 Jan 2023 00:21:31 +0000 (00:21 +0000)]
Daily bump.

16 months agoFortran: error recovery for invalid CLASS component [PR108434]
Harald Anlauf [Wed, 18 Jan 2023 21:13:29 +0000 (22:13 +0100)]
Fortran: error recovery for invalid CLASS component [PR108434]

gcc/fortran/ChangeLog:

PR fortran/108434
* expr.cc (class_allocatable): Prevent NULL pointer dereference
or invalid read.
(class_pointer): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/108434
* gfortran.dg/pr108434.f90: New test.

(cherry picked from commit 117848f425a3c0eda85517b4bdaf2ebe3bc705c2)

16 months agoPR 106101: IBM zSystems: Fix strict_low_part problem
Andreas Krebbel [Mon, 23 Jan 2023 07:56:05 +0000 (08:56 +0100)]
PR 106101: IBM zSystems: Fix strict_low_part problem

This avoids generating illegal (strict_low_part (reg ...)) RTXs. This
required two changes:

1. Do not use gen_lowpart to generate the inner expression of a
STRICT_LOW_PART.  gen_lowpart might fold the SUBREG either because
there is already a paradoxical subreg or because it can directly be
applied to the register. A new wrapper function makes sure that we
always end up having an actual SUBREG.

2. Change the movstrict patterns to enforce a SUBREG as inner operand
of the STRICT_LOW_PARTs.  The new predicate introduced for the
destination operand requires a SUBREG expression with a
register_operand as inner operand.  However, since reload strips away
the majority of the SUBREGs we have to accept single registers as well
once we reach reload.

Bootstrapped and regression tested on IBM zSystems 64 bit.

gcc/ChangeLog:

PR target/106101
* config/s390/predicates.md (subreg_register_operand): New
predicate.
* config/s390/s390-protos.h (s390_gen_lowpart_subreg): New
function prototype.
* config/s390/s390.cc (s390_gen_lowpart_subreg): New function.
(s390_expand_insv): Use s390_gen_lowpart_subreg instead of
gen_lowpart.
* config/s390/s390.md ("*get_tp_64", "*zero_extendhisi2_31")
("*zero_extendqisi2_31", "*zero_extendqihi2_31"): Likewise.
("movstrictqi", "movstricthi", "movstrictsi"): Use the
subreg_register_operand predicate instead of register_operand.

gcc/testsuite/ChangeLog:

PR target/106101
* gcc.c-torture/compile/pr106101.c: New test.

(cherry picked from commit 585a21bab3ec688c2039bff2922cc372d8558283)

16 months agoDaily bump.
GCC Administrator [Mon, 23 Jan 2023 00:21:32 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Sun, 22 Jan 2023 00:21:24 +0000 (00:21 +0000)]
Daily bump.

16 months agoBackported from master:
Jerry DeLisle [Sat, 21 Jan 2023 22:58:05 +0000 (14:58 -0800)]
Backported from master:

PR fortran/106731

gcc/fortran/ChangeLog:

* trans-array.cc (gfc_trans_auto_array_allocation): Remove gcc_assert (!TREE_STATIC()).

gcc/testsuite/ChangeLog:

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

16 months agoDaily bump.
GCC Administrator [Sat, 21 Jan 2023 00:20:54 +0000 (00:20 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Fri, 20 Jan 2023 00:21:02 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Thu, 19 Jan 2023 00:21:17 +0000 (00:21 +0000)]
Daily bump.

16 months agolibstdc++: Avoid recursion in __nothrow_wait_cv::wait [PR105730]
Jonathan Wakely [Thu, 22 Dec 2022 09:56:47 +0000 (09:56 +0000)]
libstdc++: Avoid recursion in __nothrow_wait_cv::wait [PR105730]

The commit r12-5877-g9e18a25331fa25 removed the incorrect
noexcept-specifier from std::condition_variable::wait and gave the new
symbol version @@GLIBCXX_3.4.30. It also redefined the original symbol
std::condition_variable::wait(unique_lock<mutex>&)@GLIBCXX_3.4.11 as an
alias for a new symbol, __gnu_cxx::__nothrow_wait_cv::wait, which still
has the incorrect noexcept guarantee. That __nothrow_wait_cv::wait is
just a wrapper around the real condition_variable::wait which adds
noexcept and so terminates on a __forced_unwind exception.

This doesn't work on uclibc, possibly due to a dynamic linker bug. When
__nothrow_wait_cv::wait calls the condition_variable::wait function it
binds to the alias symbol, which means it just calls itself recursively
until the stack overflows.

This change avoids the possibility of a recursive call by changing the
__nothrow_wait_cv::wait function so that instead of calling
condition_variable::wait it re-implements it. This requires accessing
the private _M_cond member of condition_variable, so we need to use the
trick of instantiating a template with the member-pointer of the private
member.

libstdc++-v3/ChangeLog:

PR libstdc++/105730
* src/c++11/compatibility-condvar.cc (__nothrow_wait_cv::wait):
Access private data member of base class and call its wait
member.

(cherry picked from commit ee4af2ed0b7322884ec4ff537564683c3749b813)

16 months agoDaily bump.
GCC Administrator [Wed, 18 Jan 2023 00:21:32 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Tue, 17 Jan 2023 00:21:46 +0000 (00:21 +0000)]
Daily bump.

16 months agoAdd cpplib ka.po
Joseph Myers [Mon, 16 Jan 2023 22:44:28 +0000 (22:44 +0000)]
Add cpplib ka.po

* ka.po: New.

16 months agolibstdc++: Unblock atomic wait on non-futex platforms [PR106183]
Jonathan Wakely [Thu, 28 Jul 2022 15:15:58 +0000 (16:15 +0100)]
libstdc++: Unblock atomic wait on non-futex platforms [PR106183]

When using a mutex and condition variable, the notifying thread needs to
increment _M_ver while holding the mutex lock, and the waiting thread
needs to re-check after locking the mutex. This avoids a missed
notification as described in the PR.

By moving the increment of _M_ver to the base _M_notify we can make the
use of the mutex local to the use of the condition variable, and
simplify the code a little. We can use a relaxed store because the mutex
already provides sequential consistency. Also we don't need to check
whether __addr == &_M_ver because we know that's always true for
platforms that use a condition variable, and so we also know that we
always need to use notify_all() not notify_one().

Reviewed-by: Thomas Rodgers <trodgers@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/106183
* include/bits/atomic_wait.h (__waiter_pool_base::_M_notify):
Move increment of _M_ver here.
[!_GLIBCXX_HAVE_PLATFORM_WAIT]: Lock mutex around increment.
Use relaxed memory order and always notify all waiters.
(__waiter_base::_M_do_wait) [!_GLIBCXX_HAVE_PLATFORM_WAIT]:
Check value again after locking mutex.
(__waiter_base::_M_notify): Remove increment of _M_ver.

(cherry picked from commit af98cb88eb4be6a1668ddf966e975149bf8610b1)

16 months agoDaily bump.
GCC Administrator [Mon, 16 Jan 2023 00:21:08 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Sun, 15 Jan 2023 00:20:59 +0000 (00:20 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Sat, 14 Jan 2023 00:20:27 +0000 (00:20 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Fri, 13 Jan 2023 00:21:17 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Thu, 12 Jan 2023 00:24:45 +0000 (00:24 +0000)]
Daily bump.

16 months agoFix problematic interaction between bitfields, unions, SSO and SRA
Eric Botcazou [Wed, 11 Jan 2023 14:58:47 +0000 (15:58 +0100)]
Fix problematic interaction between bitfields, unions, SSO and SRA

The handling of bitfields by the SRA pass is peculiar and this must be taken
into account to support the scalar_storage_order attribute.

gcc/
PR tree-optimization/108199
* tree-sra.cc (sra_modify_expr): Deal with reverse storage order
for bit-field references.

gcc/testsuite/
* gcc.dg/sso-17.c: New test.

16 months agostrlen: do not use cond_expr for boundaries
Martin Liska [Fri, 23 Dec 2022 14:27:32 +0000 (15:27 +0100)]
strlen: do not use cond_expr for boundaries

PR tree-optimization/108137

gcc/ChangeLog:

* tree-ssa-strlen.cc (get_range_strlen_phi): Reject anything
different from INTEGER_CST.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/pr108137.c: New test.

(cherry picked from commit ee6f262b87fef590729e96e999f1c3b207c251c0)

16 months agoDaily bump.
GCC Administrator [Wed, 11 Jan 2023 00:22:09 +0000 (00:22 +0000)]
Daily bump.

16 months agoFix memory constraint on MVE v[ld/st][2/4] instructions [PR107714]
Stam Markianos-Wright [Fri, 30 Dec 2022 11:25:22 +0000 (11:25 +0000)]
Fix memory constraint on MVE v[ld/st][2/4] instructions [PR107714]

In the M-Class Arm-ARM:

https://developer.arm.com/documentation/ddi0553/bu/?lang=en

these MVE instructions only have '!' writeback variant and at:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107714

we found that the Um constraint would also allow through a
register offset writeback, resulting in an assembler error.

Here I have added a new constraint and predicate for these
instructions, which (uniquely, AFAICT), only support a `!` writeback
increment by the data size (inside the compiler this is a POST_INC).

No regressions in arm-none-eabi with MVE and MVE.FP.

gcc/ChangeLog:
PR target/107714
* config/arm/arm-protos.h (mve_struct_mem_operand): New protoype.
* config/arm/arm.cc (mve_struct_mem_operand): New function.
* config/arm/constraints.md (Ug): New constraint.
* config/arm/mve.md (mve_vst4q<mode>): Change constraint.
(mve_vst2q<mode>): Likewise.
(mve_vld4q<mode>): Likewise.
(mve_vld2q<mode>): Likewise.
* config/arm/predicates.md (mve_struct_operand): New predicate.

gcc/testsuite/ChangeLog:
PR target/107714
* gcc.target/arm/mve/intrinsics/vldst24q_reg_offset.c: New test.

(cherry picked from commit 4269a6567eb991e6838f40bda5be9e3a7972530c)

16 months agoaarch64: PR target/108140 Handle NULL target in data intrinsic expansion
Kyrylo Tkachov [Mon, 19 Dec 2022 11:16:47 +0000 (11:16 +0000)]
aarch64: PR target/108140 Handle NULL target in data intrinsic expansion

In this PR we ICE when expanding the __rbit builtin with a NULL target rtx.
I *think* that only happens when the result is unused and hence maybe we shouldn't be expanding
any RTL at all, but the ICE here is easily fixed by deriving the mode from the type of the expression
rather than the target.

This patch does that.
Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

PR target/108140
* config/aarch64/aarch64-builtins.cc
(aarch64_expand_builtin_data_intrinsic): Handle NULL target.

gcc/testsuite/ChangeLog:

PR target/108140
* gcc.target/aarch64/acle/pr108140.c: New test.

(cherry picked from commit 98756bcbe27647f263f2b312d1d933d70cf56ba9)

16 months agoDaily bump.
GCC Administrator [Tue, 10 Jan 2023 00:22:35 +0000 (00:22 +0000)]
Daily bump.

16 months agoUpdate cpplib eo.po
Joseph Myers [Mon, 9 Jan 2023 20:17:37 +0000 (20:17 +0000)]
Update cpplib eo.po

* eo.po: Update.

16 months agoDaily bump.
GCC Administrator [Mon, 9 Jan 2023 00:21:52 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Sun, 8 Jan 2023 00:21:14 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Sat, 7 Jan 2023 00:21:38 +0000 (00:21 +0000)]
Daily bump.

16 months agoDaily bump.
GCC Administrator [Fri, 6 Jan 2023 00:21:03 +0000 (00:21 +0000)]
Daily bump.

16 months agolibstdc++: Fix std::chrono::hh_mm_ss with unsigned rep [PR108265]
Jonathan Wakely [Wed, 4 Jan 2023 16:43:51 +0000 (16:43 +0000)]
libstdc++: Fix std::chrono::hh_mm_ss with unsigned rep [PR108265]

libstdc++-v3/ChangeLog:

PR libstdc++/108265
* include/std/chrono (hh_mm_ss): Do not use chrono::abs if
duration rep is unsigned. Remove incorrect noexcept-specifier.
* testsuite/std/time/hh_mm_ss/1.cc: Check unsigned rep. Check
floating-point representations. Check default construction.

(cherry picked from commit e36e57b032b2d70eaa1294d5921e4fd8ce12a74d)

16 months agors6000: Raise error for __vector_{quad,pair} uses without MMA enabled [PR106736]
Kewen Lin [Wed, 21 Dec 2022 03:02:08 +0000 (21:02 -0600)]
rs6000: Raise error for __vector_{quad,pair} uses without MMA enabled [PR106736]

As PR106736 shows, it's unexpected to use __vector_quad and
__vector_pair types without MMA support, it would cause ICE
when expanding the corresponding assignment.  We can't guard
these built-in types registering under MMA support as Peter
pointed out in that PR, because the registering is global,
it doesn't work for target pragma/attribute support with MMA
enabled.  The existing verify_type_context mentioned in [2]
can help to make the diagnostics invalid built-in type uses
better, but as Richard pointed out in [4], it can't deal with
all cases.  As the discussions in [1][3], this patch is to
check the invalid use of built-in types __vector_quad and
__vector_pair in mov pattern of OOmode and XOmode, on the
currently being expanded gimple assignment statement.  It
still puts an assertion in else arm rather than just makes
it go through, it's to ensure we can catch any other possible
unexpected cases in time if there are.

[1] https://gcc.gnu.org/pipermail/gcc/2022-December/240218.html
[2] https://gcc.gnu.org/pipermail/gcc/2022-December/240220.html
[3] https://gcc.gnu.org/pipermail/gcc/2022-December/240223.html
[4] https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608083.html

PR target/106736

gcc/ChangeLog:

* config/rs6000/mma.md (define_expand movoo): Call function
rs6000_opaque_type_invalid_use_p to check and emit error message for
the invalid use of opaque type.
(define_expand movxo): Likewise.
* config/rs6000/rs6000-protos.h
(rs6000_opaque_type_invalid_use_p): New function declaration.
(currently_expanding_gimple_stmt): New extern declaration.
* config/rs6000/rs6000.cc (rs6000_opaque_type_invalid_use_p): New
function.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr106736-1.c: New test.
* gcc.target/powerpc/pr106736-2.c: Likewise.
* gcc.target/powerpc/pr106736-3.c: Likewise.
* gcc.target/powerpc/pr106736-4.c: Likewise.
* gcc.target/powerpc/pr106736-5.c: Likewise.

16 months agoDaily bump.
GCC Administrator [Thu, 5 Jan 2023 00:20:48 +0000 (00:20 +0000)]
Daily bump.

16 months agoc++: mark_single_function and SFINAE [PR108282]
Patrick Palka [Wed, 4 Jan 2023 19:12:25 +0000 (14:12 -0500)]
c++: mark_single_function and SFINAE [PR108282]

We typically ignore mark_used failure when in a non-SFINAE context for
sake of better error recovery.  But in mark_single_function we're
instead ignoring mark_used failure in a SFINAE context, which ends up
causing the second static_assert here to incorrectly fail.

PR c++/108282

gcc/cp/ChangeLog:

* decl2.cc (mark_single_function): Ignore mark_used failure
only in a non-SFINAE context rather than in a SFINAE one.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-requires34.C: New test.

(cherry picked from commit 238e292cf5d822f3bd12d9b58eb04cf377758b2a)

16 months agolibiberty: Fix C89-isms in configure tests
Florian Weimer [Tue, 18 Oct 2022 14:58:48 +0000 (16:58 +0200)]
libiberty: Fix C89-isms in configure tests

libiberty/

* acinclude.m4 (ac_cv_func_strncmp_works): Add missing
int return type and parameter list to the definition of main.
Include <stdlib.h> and <string.h> for prototypes.
(ac_cv_c_stack_direction): Add missing
int return type and parameter list to the definitions of
main, find_stack_direction.  Include <stdlib.h> for exit
prototype.
* configure: Regenerate.

(cherry picked from commit 885b6660c17fb91980b5682514ef54668e544b02)

16 months agolibsanitizer: Avoid implicit function declaration in configure test
Florian Weimer [Wed, 4 Jan 2023 10:13:17 +0000 (11:13 +0100)]
libsanitizer: Avoid implicit function declaration in configure test

libsanitizer/

* configure.ac (sanitizer_supported): Include <unistd.h> for
syscall prototype.
* configure: Regenerate.

(cherry picked from commit 6be2672e4ee41c566a9e072088cccca263bab5f7)

16 months agoDaily bump.
GCC Administrator [Wed, 4 Jan 2023 00:20:17 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Tue, 3 Jan 2023 00:20:41 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Mon, 2 Jan 2023 00:20:14 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Sun, 1 Jan 2023 00:21:07 +0000 (00:21 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Sat, 31 Dec 2022 00:20:24 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Fri, 30 Dec 2022 00:20:15 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Thu, 29 Dec 2022 00:20:57 +0000 (00:20 +0000)]
Daily bump.

17 months agoFortran: incorrect array bounds when bound intrinsic used in decl [PR108131]
Harald Anlauf [Sat, 17 Dec 2022 21:04:32 +0000 (22:04 +0100)]
Fortran: incorrect array bounds when bound intrinsic used in decl [PR108131]

gcc/fortran/ChangeLog:

PR fortran/108131
* array.cc (match_array_element_spec): Avoid too early simplification
of matched array element specs that can lead to a misinterpretation
when used as array bounds in array declarations.

gcc/testsuite/ChangeLog:

PR fortran/108131
* gfortran.dg/pr103505.f90: Adjust expected patterns.
* gfortran.dg/pr108131.f90: New test.

(cherry picked from commit 6a95f0e0a06d78d94138d4c3dd64d41591197281)

17 months agoDaily bump.
GCC Administrator [Wed, 28 Dec 2022 00:20:23 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Tue, 27 Dec 2022 00:20:21 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Mon, 26 Dec 2022 00:20:39 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Sun, 25 Dec 2022 00:20:15 +0000 (00:20 +0000)]
Daily bump.

17 months agoSkip guality tests on hppa-hpux.
John David Anglin [Sun, 13 Nov 2022 17:04:44 +0000 (17:04 +0000)]
Skip guality tests on hppa-hpux.

The guality check command hangs. This causes TCL errors in
other tests and slows testsuite execution.

2022-11-13  John David Anglin  <danglin@gcc.gnu.org>

gcc/testsuite/ChangeLog:

* g++.dg/guality/guality.exp: Skip on hppa*-*-hpux*.
* gcc.dg/guality/guality.exp: Likewise.
* gfortran.dg/guality/guality.exp: Likewise.

17 months agoDaily bump.
GCC Administrator [Sat, 24 Dec 2022 00:20:55 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Fri, 23 Dec 2022 00:23:19 +0000 (00:23 +0000)]
Daily bump.

17 months agobootstrap/106482 - document minimal GCC version
Richard Biener [Thu, 22 Dec 2022 14:51:46 +0000 (15:51 +0100)]
bootstrap/106482 - document minimal GCC version

There's no explicit mention of what GCC compiler supports C++11
and the cross compiler build requirement mentions GCC 4.8 but not
GCC 4.8.3 which is the earliest known version to not run into
C++11 implementation bugs.  The following adds explicit wording.

PR bootstrap/106482
* doc/install.texi (ISO C++11 Compiler): Document GCC version
known to work.

(cherry picked from commit b97c33fbd28e74a206c81c96a9b0b9fa3c8545d6)

17 months agolto: support --jobserver-style=fifo for recent GNU make
Martin Liska [Tue, 9 Aug 2022 11:59:36 +0000 (13:59 +0200)]
lto: support --jobserver-style=fifo for recent GNU make

gcc/ChangeLog:

* opts-jobserver.h: Add one member.
* opts-common.cc (jobserver_info::jobserver_info): Parse FIFO
format of --jobserver-auth.

(cherry picked from commit 53e3b2bf16a486c15c20991c6095f7be09012b55)

17 months agoFactor out jobserver_active_p.
Martin Liska [Tue, 9 Aug 2022 11:59:32 +0000 (13:59 +0200)]
Factor out jobserver_active_p.

gcc/ChangeLog:

* gcc.cc (driver::detect_jobserver): Remove and move to
jobserver.h.
* lto-wrapper.cc (jobserver_active_p): Likewise.
(run_gcc): Likewise.
* opts-jobserver.h: New file.
* opts-common.cc (jobserver_info::jobserver_info): New function.

(cherry picked from commit 1270ccda70ca09f7d4fe76b5156dca8992bd77a6)

17 months agoDaily bump.
GCC Administrator [Thu, 22 Dec 2022 00:20:54 +0000 (00:20 +0000)]
Daily bump.

17 months 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)

17 months agolibstdc++: Fixes for std::expected
Jonathan Wakely [Fri, 16 Dec 2022 16:07:29 +0000 (16:07 +0000)]
libstdc++: Fixes for std::expected

This fixes some bugs in the swap functions for std::expected.

It also disables the noexcept-specifiers for equality operators, because
those are problematic when querying whether a std::expected is equality
comparable. The operator==(const expected<T,E>&, const U&) function is
not constrained, so is viable for comparing expected<T,E> with
expected<void,G>, but then we get an error from the noexcept-specifier.

libstdc++-v3/ChangeLog:

* include/std/expected (expected::_M_swap_val_unex): Guard the
correct object.
(expected::swap): Move is_swappable
requirement from static_assert to constraint.
(swap): Likewise.
(operator==): Remove noexcept-specifier.
* testsuite/20_util/expected/swap.cc: Check swapping of
types without non-throwing move constructor. Check constraints
on swap.
* testsuite/20_util/expected/unexpected.cc: Check constraints on
swap.
* testsuite/20_util/expected/equality.cc: New test.

(cherry picked from commit 59822c39207c9e8be576e9d6c3370bd85ddaf886)

17 months agolibgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056]
Tobias Burnus [Wed, 21 Dec 2022 06:55:22 +0000 (07:55 +0100)]
libgfortran's ISO_Fortran_binding.c: Use GCC11 version for backward-only code [PR108056]

Since GCC 12, the conversion between the array descriptors formats - the
internal (GFC) and the C binding one (CFI) - moved to the compiler itself
such that the cfi_desc_to_gfc_desc/gfc_desc_to_cfi_desc functions are only
used with older code (GCC 9 to 11).  The newly added checks caused asserts
as older code did not pass the proper values (e.g. real(4) as effective
argument arrived as BT_ASSUME type as the effective type got lost inbetween).

As proposed in the PR, revert to the GCC 11 version - known bugs is better
than some fixes and new issues. Still, GCC 12 is much better in terms of
TS29113 support and should really be used.

This patch uses the current libgomp version of the GCC 11 branch, except
it fixes the GFC version number (which is 0), uses calloc instead of malloc,
and sets the lower bound to 1 instead of keeping it as is for
CFI_attribute_other.

(cherry picked from commit e205ec03f0794aeac3e8a89e947c12624d5a274e)

(This cherry pick excludes an accidentally committed file, which was
removed in follow-up commit 18af26fc375398f0a7cd7bae5aabebd447f8c899.)

libgfortran/ChangeLog:

PR libfortran/108056
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc,
gfc_desc_to_cfi_desc): Mostly revert to GCC 11 version for
those backward-compatiblity-only functions.

17 months agoDaily bump.
GCC Administrator [Wed, 21 Dec 2022 00:20:23 +0000 (00:20 +0000)]
Daily bump.

17 months agod/104749 - document host GDC version requirement
Richard Biener [Tue, 20 Dec 2022 13:34:01 +0000 (14:34 +0100)]
d/104749 - document host GDC version requirement

This documents that GDC 9.4 or later is required to build the D
language rather than GDC 9.1 which suffers from PR94240.

PR d/104749
* doc/install.texi (GDC): Document GDC 9.4 or later is required
to build the D language frontend.

(cherry picked from commit 05b7cf52e1b640271900894a894da2d27ef90092)

17 months agoi386: Avoid fma_chain for -march=alderlake and sapphirerapids.
Hongyu Wang [Tue, 6 Dec 2022 01:53:35 +0000 (09:53 +0800)]
i386: Avoid fma_chain for -march=alderlake and sapphirerapids.

For Alderlake there is similar issue like PR81616, enable
avoid_fma256_chain will also benefit on Intel latest platforms
Alderlake and Sapphire Rapids.

gcc/ChangeLog:

* config/i386/x86-tune.def (X86_TUNE_AVOID_256FMA_CHAINS): Add
m_SAPPHIRERAPIDS, m_ALDERLAKE.

17 months agoDaily bump.
GCC Administrator [Tue, 20 Dec 2022 00:20:39 +0000 (00:20 +0000)]
Daily bump.

17 months agoc++: extract_local_specs and unevaluated contexts [PR100295]
Patrick Palka [Thu, 15 Dec 2022 21:02:05 +0000 (16:02 -0500)]
c++: extract_local_specs and unevaluated contexts [PR100295]

Here during partial instantiation of the constexpr if, extra_local_specs
walks the statement looking for local specializations within to capture.
However, we're thwarted by the fact that 'ts' first appears inside an
unevaluated context, and so the calls to process_outer_var_ref for its
local specializations are a no-op.  And since we walk each tree exactly
once, we end up not capturing the local specializations despite 'ts'
later occurring in an evaluated context.

This patch fixes this by making extract_local_specs walk evaluated
contexts first before walking unevaluated contexts.  We could probably
get away with not walking unevaluated contexts at all, but this approach
seems more clearly safe.

PR c++/100295
PR c++/107579

gcc/cp/ChangeLog:

* pt.cc (el_data::skip_unevaluated_operands): New data member.
(extract_locals_r): If skip_unevaluated_operands is true,
don't walk into unevaluated contexts.
(extract_local_specs): Walk the pattern twice, first with
skip_unevaluated_operands true followed by it set to false.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-if-lambda5.C: New test.

(cherry picked from commit 18499b9f848707aee42d810e99ac0a4c9788433c)

17 months agoc++: partial ordering with memfn ptr cst [PR108104]
Patrick Palka [Thu, 15 Dec 2022 20:38:47 +0000 (15:38 -0500)]
c++: partial ordering with memfn ptr cst [PR108104]

Here we're triggering an overzealous assert in unify during partial
ordering since the member function pointer constants are represented as
ordinary CONSTRUCTORs (with TYPE_PTRMEMFUNC_P TREE_TYPE) but the assert
expects COMPOUND_LITERAL_P constructors.

PR c++/108104

gcc/cp/ChangeLog:

* pt.cc (unify) <default>: Relax assert to accept any
CONSTRUCTOR parm, not just COMPOUND_LITERAL_P one.

gcc/testsuite/ChangeLog:

* g++.dg/template/ptrmem33.C: New test.

(cherry picked from commit 38304846d18d6bb14b0fd6c627c5c6d43a814d01)

17 months agoc++: pack in requires-expr parm list [PR107417]
Patrick Palka [Sun, 4 Dec 2022 15:47:24 +0000 (10:47 -0500)]
c++: pack in requires-expr parm list [PR107417]

Here find_parameter_packs_r isn't detecting the pack T inside the
requires-expr's parameter list ultimately because cp_walk_trees
deliberately avoids walking the list so as to avoid false positives in
the unexpanded pack checker.

But it should still be fine to walk the TREE_TYPE of each parameter,
which we already need to do from for_each_template_parm_r, and is
sufficient to fix the testcase.

PR c++/107417

gcc/cp/ChangeLog:

* pt.cc (for_each_template_parm_r) <case REQUIRES_EXPR>: Move
walking of the TREE_TYPE of each parameter to ...
* tree.cc (cp_walk_subtrees) <case REQUIRES_EXPR>: ... here.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-requires33.C: New test.

(cherry picked from commit 079add3ad39d6620d34665dd9c26c21951eb657c)

17 months agoc++: substituting CONST_DECL_USING_P enumerators [PR103081]
Patrick Palka [Sat, 3 Dec 2022 15:28:25 +0000 (10:28 -0500)]
c++: substituting CONST_DECL_USING_P enumerators [PR103081]

We implement class-scope using enum by injecting clones of the enum's
CONST_DECLs as fields of the class, for which CONST_DECL_USING_P is
true, so that qualified lookup naturally finds the enumerators.
Substitution into such a CONST_DECL currently ICEs however, because we
assume the DECL_CONTEXT is always the ENUMERAL_TYPE (which has
TYPE_VALUES) but in this case it's the RECORD_TYPE for the class scope
(which has TYPE_FIELDS).

Since these CONST_DECLs appear to always be non-dependent, this patch
fixes this by shortcutting substitution for CONST_DECLs that have
non-dependent DECL_CONTEXT.  This subsumes the existing (and seemingly
dead) DECL_NAMESPACE_SCOPE_P early exit test and also benefits
substitution into ordinary non-dependent CONST_DECLs.

PR c++/103081

gcc/cp/ChangeLog:

* pt.cc (tsubst_copy) <case CONST_DECL>: Generalize
early exit test for namespace-scope decls to check dependence of
the enclosing scope instead.  Remove dead early exit test.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/using-enum-10.C: New test.
* g++.dg/cpp2a/using-enum-10a.C: New test.

(cherry picked from commit b3912122c9dfaba6c8229e8f095885f69782ceda)

17 months agoc++: ICE with <=> of incompatible pointers [PR107542]
Patrick Palka [Wed, 30 Nov 2022 00:25:37 +0000 (19:25 -0500)]
c++: ICE with <=> of incompatible pointers [PR107542]

In a SFINAE context composite_pointer_type returns error_mark_node if
the given pointer types are incompatible.  But the SPACESHIP_EXPR case
of cp_build_binary_op wasn't prepared for this error_mark_node result,
which led to an ICE (from spaceship_comp_cat) for the below testcase.
(In a non-SFINAE context composite_pointer_type issues a permerror and
returns cv void* in this case, so this ICE seems specific to SFINAE.)

PR c++/107542

gcc/cp/ChangeLog:

* typeck.cc (cp_build_binary_op): In the SPACESHIP_EXPR case,
handle an error_mark_node result type.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/spaceship-sfinae2.C: New test.

(cherry picked from commit 000e9863120cbc75a0f8d497264519974c97669f)

17 months agoc-family: Fix ICE with -Wsuggest-attribute [PR98487]
Marek Polacek [Fri, 16 Dec 2022 17:28:43 +0000 (12:28 -0500)]
c-family: Fix ICE with -Wsuggest-attribute [PR98487]

Here we crash because check_function_format was using TREE_PURPOSE
directly rather than using get_attribute_name.

PR c/98487

gcc/c-family/ChangeLog:

* c-format.cc (check_function_format): Use get_attribute_name.

gcc/testsuite/ChangeLog:

* c-c++-common/Wsuggest-attribute-1.c: New test.

(cherry picked from commit 68e51bd0a85794cd437d3e740357dfef84dc560d)

17 months agoDaily bump.
GCC Administrator [Mon, 19 Dec 2022 00:21:58 +0000 (00:21 +0000)]
Daily bump.

17 months agoFortran: ICE on recursive derived types with allocatable components [PR107872]
Paul Thomas [Fri, 9 Dec 2022 21:13:45 +0000 (22:13 +0100)]
Fortran: ICE on recursive derived types with allocatable components [PR107872]

gcc/fortran/ChangeLog:

PR fortran/107872
* resolve.cc (derived_inaccessible): Skip over allocatable components
to prevent an infinite loop.

gcc/testsuite/ChangeLog:

PR fortran/107872
* gfortran.dg/pr107872.f90: New test.

(cherry picked from commit 01254aa2eb766c7584fd047568d7277d4d65d067)

17 months agoDaily bump.
GCC Administrator [Sun, 18 Dec 2022 00:20:41 +0000 (00:20 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Sat, 17 Dec 2022 00:21:28 +0000 (00:21 +0000)]
Daily bump.

17 months agoDaily bump.
GCC Administrator [Fri, 16 Dec 2022 00:21:18 +0000 (00:21 +0000)]
Daily bump.

17 months agoAArch64: Add UNSPECV_PATCHABLE_AREA [PR98776]
Sebastian Pop [Wed, 30 Nov 2022 19:45:24 +0000 (19:45 +0000)]
AArch64: Add UNSPECV_PATCHABLE_AREA [PR98776]

Currently patchable area is at the wrong place on AArch64.  It is placed
immediately after function label, before .cfi_startproc.  This patch
adds UNSPECV_PATCHABLE_AREA for pseudo patchable area instruction and
modifies aarch64_print_patchable_function_entry to avoid placing
patchable area before .cfi_startproc.

gcc/
PR target/98776
* config/aarch64/aarch64-protos.h (aarch64_output_patchable_area):
Declared.
* config/aarch64/aarch64.cc (aarch64_print_patchable_function_entry):
Emit an UNSPECV_PATCHABLE_AREA pseudo instruction.
(aarch64_output_patchable_area): New.
* config/aarch64/aarch64.md (UNSPECV_PATCHABLE_AREA): New.
(patchable_area): Define.

gcc/testsuite/
PR target/98776
* gcc.target/aarch64/pr98776.c: New.
* gcc.target/aarch64/pr92424-2.c: Adjust pattern.
* gcc.target/aarch64/pr92424-3.c: Adjust pattern.

17 months agoDaily bump.
GCC Administrator [Thu, 15 Dec 2022 00:20:50 +0000 (00:20 +0000)]
Daily bump.

17 months agolibstdc++: Fix size passed to operator delete [PR108097]
Jonathan Wakely [Wed, 14 Dec 2022 11:58:05 +0000 (11:58 +0000)]
libstdc++: Fix size passed to operator delete [PR108097]

The number of elements gets stored in _M_capacity so use a separate
variable for the number of bytes to allocate.

libstdc++-v3/ChangeLog:

PR libstdc++/108097
* include/std/stacktrace (basic_stracktrace::_Impl): Do not
multiply N by sizeof(value_type) when allocating.

(cherry picked from commit 881c6cabce5d0b27285ed41bd6dabdf48848cce7)

17 months agoDaily bump.
GCC Administrator [Wed, 14 Dec 2022 00:22:41 +0000 (00:22 +0000)]
Daily bump.

17 months agolibphobos: Backport library and bindings fixes from mainline
Iain Buclaw [Tue, 13 Dec 2022 21:34:57 +0000 (22:34 +0100)]
libphobos: Backport library and bindings fixes from mainline

D Runtime changes:

- Fix MIPS64 bindings for CRuntime_UClibc.

Phobos changes:

- Fix std.path.expandTilde erroneously raising onOutOfMemory
  after failed call to getpwnam_r().
- Fix std.random unittest failures on ILP32 targets.
- Use GENERIC_IO on CRuntime_UClibc port of std.stdio.

libphobos/ChangeLog:

* libdruntime/core/stdc/fenv.d: Compile in MIPS uClibc bindings on
MIPS_Any targets.
* libdruntime/core/stdc/math.d: Likewise.
* libdruntime/core/sys/posix/dlfcn.d: Likewise.
* libdruntime/core/sys/posix/setjmp.d: Add MIPS64 definitions for
CRuntime_UClibc.
* libdruntime/core/sys/posix/sys/types.d: Likewise.
* src/std/path.d (expandTilde): Handle more errno codes that could be
left set by getpwnam_r.
* src/std/random.d: Use D_LP64 in unittests.
* src/std/stdio.d: Set CRuntime_UClibc as GENERIC_IO target.

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