test_jj.git
2 years agoDaily bump.
GCC Administrator [Tue, 17 May 2022 00:18:54 +0000 (00:18 +0000)]
Daily bump.

2 years ago[AArch64] add barriers to ool __sync builtins
Sebastian Pop [Mon, 18 Apr 2022 15:13:20 +0000 (15:13 +0000)]
[AArch64] add barriers to ool __sync builtins

2022-05-13  Sebastian Pop  <spop@amazon.com>

gcc/
PR target/105162
* config/aarch64/aarch64-protos.h (atomic_ool_names): Increase dimension
of str array.
* config/aarch64/aarch64.cc (aarch64_atomic_ool_func): Call
memmodel_from_int and handle MEMMODEL_SYNC_*.
(DEF0): Add __aarch64_*_sync functions.

gcc/testsuite/
PR target/105162
* gcc.target/aarch64/sync-comp-swap-ool.c: New.
* gcc.target/aarch64/sync-op-acquire-ool.c: New.
* gcc.target/aarch64/sync-op-full-ool.c: New.
* gcc.target/aarch64/target_attr_20.c: Update check.
* gcc.target/aarch64/target_attr_21.c: Same.

libgcc/
PR target/105162
* config/aarch64/lse.S: Define BARRIER and handle memory MODEL 5.
* config/aarch64/t-lse: Add a 5th memory model for _sync functions.

2 years agolibstdc++: Fix hyperlink in docs
Jonathan Wakely [Mon, 16 May 2022 13:54:07 +0000 (14:54 +0100)]
libstdc++: Fix hyperlink in docs

libstdc++-v3/ChangeLog:

* doc/xml/manual/prerequisites.xml: Fix attributes for external
hyperlink.
* doc/html/manual/setup.html: Regenerate.

(cherry picked from commit 682e587f1021241758f7dfe0b22651008622a312)

2 years agolibstdc++: Update C++23 status docs
Jonathan Wakely [Mon, 16 May 2022 13:44:41 +0000 (14:44 +0100)]
libstdc++: Update C++23 status docs

These are the C++23 proposals supported in the gcc-12 branch.

libstdc++-v3/ChangeLog:

* doc/xml/manual/status_cxx2023.xml: Update with gcc-12 support.
* doc/html/*: Regenerate.

(cherry picked from commit 8414dad54a8a5eed710f894bde5721631fd3f748)

2 years agolibstdc++: Add C++23 status docs
Jonathan Wakely [Mon, 16 May 2022 13:09:05 +0000 (14:09 +0100)]
libstdc++: Add C++23 status docs

These are the C++23 proposals already supported in the gcc-11 branch.

libstdc++-v3/ChangeLog:

* doc/xml/manual/intro.xml: Include new chapter.
* doc/xml/manual/status_cxx2020.xml: Tweak release numbers.
* doc/xml/manual/status_cxx2023.xml: New file.
* doc/html/*: Regenerate.

(cherry picked from commit 436186734481c38ccbd22becbd5aedb274bf5fa7)

2 years agolibstdc++: Fix status docs for <bit> support
Jonathan Wakely [Mon, 16 May 2022 12:57:08 +0000 (13:57 +0100)]
libstdc++: Fix status docs for <bit> support

libstdc++-v3/ChangeLog:

* doc/html/manual/status.html: Regenerate.
* doc/xml/manual/status_cxx2020.xml: Fix supported version for
C++20 bit operations.

(cherry picked from commit 64648821f151b0f86e16185bef7f0be5635fd737)

2 years agoipa/105598 - testcase for PR105598
Richard Biener [Mon, 16 May 2022 09:21:06 +0000 (11:21 +0200)]
ipa/105598 - testcase for PR105598

2022-05-16  Richard Biener  <rguenther@suse.de>

gcc/testsuite/
* gcc.dg/torture/pr105598.c: New testcase.

(cherry picked from commit 6230911cb91d428631e741d7d981fab578102084)

2 years agoDo not use DW_OP_not for TRUTH_NOT_EXPR in conditional expressions
Eric Botcazou [Mon, 16 May 2022 08:44:09 +0000 (10:44 +0200)]
Do not use DW_OP_not for TRUTH_NOT_EXPR in conditional expressions

DW_OP_not is a bitwise, not a logical NOT, so it computes the wrong result
in a DWARF conditional expression.

gcc/
* dwarf2out.cc (loc_list_from_tree_1) <TRUTH_NOT_EXPR>: Do a logical
instead of a bitwise negation.
<COND_EXPR>: Swap the operands if the condition is TRUTH_NOT_EXPR.

2 years agoDaily bump.
GCC Administrator [Mon, 16 May 2022 00:19:11 +0000 (00:19 +0000)]
Daily bump.

2 years agod: Merge upstream dmd a53934d18, phobos 604534d7c.
Iain Buclaw [Sun, 15 May 2022 22:56:06 +0000 (00:56 +0200)]
d: Merge upstream dmd a53934d18, phobos 604534d7c.

D front-end changes:

    - Import dmd v2.100.0.

Phobos changes:

    - Import phobos v2.100.0.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd a53934d18.
* dmd/VERSION: Update version to v2.100.0.
* d-codegen.cc (d_decl_context): Use resolvedLinkage to get
declaration linkage.
(build_struct_literal): Track offset in bits.
* d-gimplify.cc (d_gimplify_modify_expr): Check both operands for a
bit-field reference.
* d-lang.cc (d_post_options): Set flag_rtti and flag_exceptions if
-fno-druntime was seen on command-line.
(d_type_promotes_to): Use resolvedLinkage to get declaration linkage.
* decl.cc (make_thunk): Likewise.
* types.cc (layout_aggregate_members): Ignore anonymous fields in
total count.

libphobos/ChangeLog:

* src/MERGE: Merge upstream phobos 604534d7c.

2 years agoc++: array {}-init [PR105589]
Jason Merrill [Fri, 13 May 2022 20:07:10 +0000 (16:07 -0400)]
c++: array {}-init [PR105589]

My patch for 105191 made us use build_value_init more frequently from
build_vec_init_expr, but build_value_init doesn't like to be called to
initialize a class in a template.  That's caused trouble in the past, and
seems like a strange restriction, so let's fix it.

PR c++/105589
PR c++/105191
PR c++/92385

gcc/cp/ChangeLog:

* init.cc (build_value_init): Handle class in template.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist-array16.C: New test.

2 years agoc++: alias CTAD and member alias templates [PR104470]
Jason Merrill [Wed, 27 Apr 2022 15:13:24 +0000 (11:13 -0400)]
c++: alias CTAD and member alias templates [PR104470]

In this testcase, we were trying to substitute into
variant<Foo<T>>::__accepted_type, but failed to look it up because
variant<Foo<T>> doesn't exist.  In other cases we already rewrite such
things into a dependent reference; we need to do that for alias templates as
well.

This caused some testsuite regressions on alias uses outside of deduction
guides, so I've made all of this rewriting conditional on a new tf_dguide
tsubst flag.

PR c++/104470

gcc/cp/ChangeLog:

* cp-tree.h (enum tsubst_flags): Add tf_dguide.
* pt.cc (tsubst_aggr_type): Check it.
(tsubst_baselink, tsubst_copy): Check it.
(maybe_dependent_member_ref): Check it.
(instantiate_alias_template): Handle it.
(build_deduction_guide): Set it.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/explicit11.C: Second example also ill-formed.
* g++.dg/cpp2a/class-deduction-alias12.C: New test.

2 years agoc++: typeid and instantiation [PR102651]
Jason Merrill [Fri, 15 Apr 2022 04:11:00 +0000 (00:11 -0400)]
c++: typeid and instantiation [PR102651]

PR49387 was a problem with initially asking for a typeid for a class
template specialization before it was complete, and later actually filling
in the descriptor when the class was complete, and thus disagreeing on the
form of the descriptor.  I fixed that by forcing the class to be complete,
but this testcase shows why that approach is problematic.  So instead let's
adjust the type of the descriptor later if needed.

PR c++/102651
PR c++/49387

gcc/cp/ChangeLog:

* rtti.cc (get_tinfo_decl_direct): Don't complete_type.
(emit_tinfo_decl): Update tdesc type if needed.

gcc/testsuite/ChangeLog:

* g++.dg/rtti/typeid-complete1.C: New test.

2 years agoDaily bump.
GCC Administrator [Sun, 15 May 2022 00:18:55 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 14 May 2022 00:20:09 +0000 (00:20 +0000)]
Daily bump.

2 years agoFortran: fix error recovery on invalid array section
Harald Anlauf [Tue, 10 May 2022 21:41:57 +0000 (23:41 +0200)]
Fortran: fix error recovery on invalid array section

gcc/fortran/ChangeLog:

PR fortran/105230
* expr.cc (find_array_section): Correct logic to avoid NULL
pointer dereference on invalid array section.

gcc/testsuite/ChangeLog:

PR fortran/105230
* gfortran.dg/pr105230.f90: New test.

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

2 years agolibgcov: use proper type for n_functions
Martin Liska [Tue, 10 May 2022 08:52:19 +0000 (10:52 +0200)]
libgcov: use proper type for n_functions

gcov_info::n_functions type is initialized by generated
code in build_info_type:

/* n_functions */
field = build_decl (BUILTINS_LOCATION, FIELD_DECL, NULL_TREE,
    get_gcov_unsigned_t ());

It uses gcov_unsigned_t, but the struct definition in libgcov.h uses
unsigned type. That brings troubled on 16-bit targets.

PR gcov-profile/105535

libgcc/ChangeLog:

* libgcov.h (struct gcov_info): Use gcov_unsigned_t for
n_functions.

Co-Authored-By: Hans-Peter Helfert <peter-helfert@t-online.de>
(cherry picked from commit eaf359ed04e7169f740dade548965c757f4c1e0a)

2 years agoFix wrong SRA with VIEW_CONVERT_EXPR and reverse SSO
Eric Botcazou [Fri, 13 May 2022 09:15:08 +0000 (11:15 +0200)]
Fix wrong SRA with VIEW_CONVERT_EXPR and reverse SSO

Most cases of VIEW_CONVERT_EXPRs involving reverse scalar storage order are
disqualified for SRA because they are storage_order_barrier_p, but you can
still have a VIEW_CONVERT_EXPR to a regular composite type being applied to
a component of a record type with reverse scalar storage order.

In this case the bypass for !useless_type_conversion_p in sra_modify_assign,
albeit already heavily guarded, triggers and may generate wrong code, so the
patch makes sure that it does only when the SSO is the same on both side.

gcc/
* tree-sra.cc (sra_modify_assign): Check that scalar storage order
is the same on the LHS and RHS before rewriting one with the model
of the other.
gcc/testsuite/
* gnat.dg/sso17.adb: New test.

2 years ago[PR105455] Set edge probabilities when hardening conditionals
Alexandre Oliva [Fri, 13 May 2022 06:05:46 +0000 (03:05 -0300)]
[PR105455] Set edge probabilities when hardening conditionals

When turning unconditional edges into conditional, as in
gimple-harden-conditionals.cc:insert_check_and_trap, the newly-created
edge's probability comes out uninitialized, while the previously
unconditional edge's probability is presumably
profile_probability::always.

Mixing initialized and uninitialized probabilities before expand
breaks predict.cc:force_edge_cold: the initialized probability may end
up copied to a REG_BR_PROB note in a conditional branch insn, but if
force_edge_cold is called on that edge, it will find another edge with
uninitialized probability and assume the note is absent.  Later on,
rtl_verify_edges complains that the note does not match the
probability modified by force_edge_cold in the edge.

This patch sets probabilities for edges affected by hardening of
conditionals, both the newly-created edges to trap blocks and the
previously-unconditional edges, so that the former are considered
never taken, while the latter are confirmed as always taken.

for  gcc/ChangeLog

PR rtl-optimization/105455
* gimple-harden-conditionals.cc (insert_check_and_trap): Set
probabilities for newly-conditional edges.

for  gcc/testsuite/ChangeLog

PR rtl-optimization/105455
* gcc.dg/pr105455.c: New.

(cherry picked from commit 90a8eab4a1292430467f68b65e5127f7760acc94)

2 years agolibstdc++: ppc: conditionalize vsx-only simd intrinsics
Alexandre Oliva [Fri, 13 May 2022 06:05:45 +0000 (03:05 -0300)]
libstdc++: ppc: conditionalize vsx-only simd intrinsics

libstdc++'s bits/simd.h section for PowerPC, guarded by __ALTIVEC__,
defines various intrinsic vector types that are only available with
__VSX__: 64-bit long double, double, (un)signed long long, and 64-bit
(un)signed long.

experimental/simd/standard_abi_usable{,_2}.cc tests error out
reporting the unmet requirements when the target cpu doesn't enable
VSX.  Make the reported instrinsic types conditional on __VSX__ so
that <experimental/simd> can be used on PowerPC variants that do not
support VSX.

for  libstdc++-v3/ChangeLog

* include/experimental/bits/simd.h [__ALTIVEC__]: Require VSX
for double, long long, and 64-bit long intrinsic types.
[__ALTIVEC__] (__intrinsic_type): Mention 128-bit in
preexisting long double diagnostic, adjust no-VSX double
diagnostic to cover 64-bit long double as well.

(cherry picked from commit 469c76f0d94d03e29467a9d1e77cd3613f46ac2f)

2 years agoDaily bump.
GCC Administrator [Fri, 13 May 2022 00:19:08 +0000 (00:19 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Thu, 12 May 2022 00:19:06 +0000 (00:19 +0000)]
Daily bump.

2 years agoipa: Release body of clone_of when removing its last clone (PR 100413)
Martin Jambor [Wed, 11 May 2022 21:25:40 +0000 (23:25 +0200)]
ipa: Release body of clone_of when removing its last clone (PR 100413)

In the PR, the verifier complains that we did not manage to remove the
body of a node and it is right.  The node is kept for materialization
of two clones but after one is materialized, the other one is removed
as unneeded (as a part of delete_unreachable_blocks_update_callgraph).
The problem is that the node removal does not check for this situation
and can leave the clone_of node there with a body attached to it even
though there is no use for it any more.  This patch does checks for it
and handles the situation in a simlar way that
cgraph_node::materialize_clone does it, except that it also has to be
careful that the removed node itself does not have any clones, which
would still need the clone_of's body.  Failing to do that results in a
bootstrap failure.

gcc/ChangeLog:

2022-04-27  Martin Jambor  <mjambor@suse.cz>

PR ipa/100413
* cgraph.cc (cgraph_node::remove): Release body of the node this
is clone_of if appropriate.

gcc/testsuite/ChangeLog:

2022-04-27  Martin Jambor  <mjambor@suse.cz>

PR ipa/100413
* g++.dg/ipa/pr100413.C: New test.

(cherry picked from commit 27ee75dbe81bb781214c66a9e6a759c08b7deb60)

2 years agoDaily bump.
GCC Administrator [Wed, 11 May 2022 00:20:00 +0000 (00:20 +0000)]
Daily bump.

2 years agoUpdate gcc hr.po
Joseph Myers [Tue, 10 May 2022 20:23:33 +0000 (20:23 +0000)]
Update gcc hr.po

* hr.po: Update.

2 years agolibstdc++: Add <spanstream> declarations to <iosfwd> [PR105284]
Jonathan Wakely [Tue, 10 May 2022 12:06:47 +0000 (13:06 +0100)]
libstdc++: Add <spanstream> declarations to <iosfwd> [PR105284]

libstdc++-v3/ChangeLog:

PR libstdc++/105284
* include/std/iosfwd: Add declarations for <spanstream> class
templates and typedefs.
* include/std/spanstream (basic_spanbuf, basic_ispanstream)
(basic_ospanstream, basic_spanstream): Remove default template
arguments.
* testsuite/27_io/headers/iosfwd/synopsis.cc: Add <spanstream>
declarations.
* testsuite/27_io/headers/iosfwd/types.cc: Check <spanstream>
default arguments.

(cherry picked from commit ca97c87758d450a946cac31b0db43da0039fabf1)

2 years agolibstdc++: Add <syncstream> declarations to <iosfwd> [PR105284]
Jonathan Wakely [Tue, 10 May 2022 12:03:14 +0000 (13:03 +0100)]
libstdc++: Add <syncstream> declarations to <iosfwd> [PR105284]

libstdc++-v3/ChangeLog:

PR libstdc++/105284
* include/std/iosfwd: Add declarations for <synstream> class
templates and typedefs.
* include/std/syncstream (basic_syncbuf, basic_osyncstream):
Remove default template arguments.
* testsuite/27_io/headers/iosfwd/synopsis.cc: New test.
* testsuite/27_io/headers/iosfwd/types.cc: New test.

(cherry picked from commit 1807e07825a86916bbfddca470708c5a8f613612)

2 years agox86: Add .note.GNU-stack section only for Linux
H.J. Lu [Fri, 6 May 2022 17:55:53 +0000 (10:55 -0700)]
x86: Add .note.GNU-stack section only for Linux

Add .note.GNU-stack section only for Linux since it may not be supported
on non-Linux OSes.  __ELF__ isn't checked since these tests can only run
on Linux/x86 ELF systems.

PR target/105472
* gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section
only for Linux.
* gcc.target/x86_64/abi/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S: Likewise.
* gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise.

(cherry picked from commit 71eae0fd3dd7a5f30067ea26a06a8774355fd5cc)

2 years agoisel: Fix up gimple_expand_vec_set_expr [PR105528]
Jakub Jelinek [Tue, 10 May 2022 16:34:08 +0000 (18:34 +0200)]
isel: Fix up gimple_expand_vec_set_expr [PR105528]

The following testcase ICEs (and only without -g), because we don't replace
one VEC_COND_EXPR with .VCOND* call.
We don't do that because gimple_expand_vec_set_expr adds some stmts before
*gsi and then uses gsi_remove to remove it.  gsi_remove moves the iterator
to the next stmt and in the caller we then do gsi_next before looking at
another stmt, which means we can skip processing of one stmt, which in this
case happened to be a VEC_COND_EXPR but with -g is some debug stmt in
between.  As we always emit some stmts before it, it is easy to update the
iterator to the last stmt emitted there, so that caller continues really
with the next stmt.

2022-05-10  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/105528
* gimple-isel.cc (gimple_expand_vec_set_expr): After gsi_remove
set *gsi to gsi_for_stmt (ass_stmt).  Fix up function comment.

* gcc.dg/pr105528.c: New test.

(cherry picked from commit ddd46293e2b508b260eefe1adbad6720df7a5dd2)

2 years agoFix internal error with vectorization on SPARC
Eric Botcazou [Tue, 10 May 2022 07:33:16 +0000 (09:33 +0200)]
Fix internal error with vectorization on SPARC

This is a regression present since the 10.x series, but the underlying issue
has been there since the TARGET_VEC_PERM_CONST hook was implemented, in the
form of an ICE when expanding a constant VEC_PERM_EXPR in V4QI, while the
back-end only supports V8QI constant VEC_PERM_EXPRs.

gcc/
PR target/105292
* config/sparc/sparc.cc (sparc_vectorize_vec_perm_const): Return
true only for 8-byte vector modes.

gcc/testsuite/
* gcc.target/sparc/20220510-1.c: New test.

2 years agoDaily bump.
GCC Administrator [Tue, 10 May 2022 00:19:32 +0000 (00:19 +0000)]
Daily bump.

2 years agoUpdate gcc .po files
Joseph Myers [Mon, 9 May 2022 21:11:02 +0000 (21:11 +0000)]
Update gcc .po files

* be.po, da.po, de.po, el.po, es.po, fi.po, fr.po, hr.po, id.po,
ja.po, nl.po, ru.po, sr.po, sv.po, tr.po, uk.po, vi.po, zh_CN.po,
zh_TW.po: Update.

2 years agolibstdc++: Fix test that fails on Solaris [PR104731]
Jonathan Wakely [Fri, 6 May 2022 13:31:06 +0000 (14:31 +0100)]
libstdc++: Fix test that fails on Solaris [PR104731]

On Solaris the dirent::d_name member is a single char, causing this test
to fail with warnings about buffer overflow. Change the test to use a
union with additional space for writing a string to the d_name member.

libstdc++-v3/ChangeLog:

PR libstdc++/104731
* testsuite/27_io/filesystem/iterators/error_reporting.cc:
Use a trailing char array as storage for dirent::d_name.

(cherry picked from commit aa8bdfee1db818b9a56908ab0197ff02c54bf281)

2 years agoDaily bump.
GCC Administrator [Mon, 9 May 2022 00:18:39 +0000 (00:18 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sun, 8 May 2022 00:19:11 +0000 (00:19 +0000)]
Daily bump.

2 years agoDaily bump.
GCC Administrator [Sat, 7 May 2022 00:18:53 +0000 (00:18 +0000)]
Daily bump.

2 years agolibstdc++: Fix deserialization for std::normal_distribution [PR105502]
Jonathan Wakely [Fri, 6 May 2022 20:19:17 +0000 (21:19 +0100)]
libstdc++: Fix deserialization for std::normal_distribution [PR105502]

This fixes a regression in std::normal_distribution deserialization that
caused the object to be left unchanged if the __state_avail value read
from the stream was false.

libstdc++-v3/ChangeLog:

PR libstdc++/105502
* include/bits/random.tcc
(operator>>(basic_istream<C,T>&, normal_distribution<R>&)):
Update state when __state_avail is false.
* testsuite/26_numerics/random/normal_distribution/operators/serialize.cc:
Check that deserialized object equals serialized one.

(cherry picked from commit 909ef4e2727ddc50a32d6ad379a1f1ccc1043c6a)

2 years agors6000: Ignore fusion option flags for inlining test [PR102059]
Michael Meissner [Fri, 6 May 2022 16:39:13 +0000 (11:39 -0500)]
rs6000: Ignore fusion option flags for inlining test [PR102059]

The -mpower8-fusion and -mpower10-fusion options do not modify which
instructions we can generate, so ignore them when deciding whether we
can inline callee into caller.

2022-05-06   Michael Meissner  <meissner@linux.ibm.com>

gcc/
PR target/102059
* config/rs6000/rs6000.cc (rs6000_can_inline_p): Ignore -mpower8-fusion
and -mpower10-fusion options for inlining purposes.

gcc/testsuite/
PR target/102059
* gcc.target/powerpc/pr102059-4.c: New test.

(cherry picked from commit 2fb654f77d5292864ef57040f7bc01d7a975f6d9)

2 years agox86: Add missing .note.GNU-stack to assembly source
H.J. Lu [Fri, 29 Apr 2022 17:26:24 +0000 (10:26 -0700)]
x86: Add missing .note.GNU-stack to assembly source

Add .note.GNU-stack assembly source to avoid linker warning:

ld: warning: /tmp/ccPZSZ7Z.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
FAIL: gcc.target/i386/iamcu/test_3_element_struct_and_unions.c compilation,  -O0

PR testsuite/105433
* gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack.
* gcc.target/x86_64/abi/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S: Likewise.
* gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise.

(cherry picked from commit 7e1f30d7edd433ca0fc28ae9ac1ce9b522790baf)

2 years agolibsanitizer: cherry-pick commit b226894d475b from upstream
H.J. Lu [Thu, 5 May 2022 20:59:16 +0000 (13:59 -0700)]
libsanitizer: cherry-pick commit b226894d475b from upstream

cherry-pick:

b226894d475b [sanitizer] [sanitizer] Correct GetTls for x32

(cherry picked from commit a48be2e513d9ddb2fa8800a158f18502a0923aec)

2 years agoc++: ICE during aggr CTAD for member tmpl [PR105476]
Patrick Palka [Wed, 4 May 2022 21:08:08 +0000 (17:08 -0400)]
c++: ICE during aggr CTAD for member tmpl [PR105476]

Here we're crashing from maybe_aggr_guide ultimately because
processing_template_decl isn't set when partially instantiating the
guide's parameter list; this causes us to force completion of the
dependent type Visitor_functior<Fn>, which of course fails and results
in an unexpected error_mark_node (the instantation should always succeed).

PR c++/105476

gcc/cp/ChangeLog:

* pt.cc (maybe_aggr_guide): Set processing_template_decl when
partially instantiating the guide's parameter list.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/class-deduction-aggr13.C: New test.
* g++.dg/cpp2a/class-deduction-aggr13a.C: New test.

(cherry picked from commit 8a98e3ff7e80bf2936f163d50309fd88d72564a0)

2 years agolibstdc++: Don't use std::tolower in <charconv> [PR103911]
Patrick Palka [Mon, 2 May 2022 11:01:33 +0000 (07:01 -0400)]
libstdc++: Don't use std::tolower in <charconv> [PR103911]

As with std::isdigit in r12-6281-gc83ecfbe74a5cf, we shouldn't be using
std::tolower in <charconv> either.

PR libstdc++/103911

libstdc++-v3/ChangeLog:

* src/c++17/floating_from_chars.cc (find_end_of_float): Accept
two delimeters for the exponent part in the form of a possibly
NULL string of length two.  Don't use std::tolower.
(pattern): Adjust calls to find_end_of_float accordingly.

(cherry picked from commit 86d821ddf5615e693ead667b2580898f46de8eb9)

2 years agomiddle-end/105376 - invalid REAL_CST for DFP constant
Richard Biener [Wed, 27 Apr 2022 06:28:31 +0000 (08:28 +0200)]
middle-end/105376 - invalid REAL_CST for DFP constant

We are eventually ICEing in decimal_to_decnumber on non-decimal
REAL_VALUE_TYPE that creep in from uses of build_real (..., dconst*)
for DFP types.  The following extends the decimal_to_decnumber
special-casing of dconst* to build_real, avoiding the bogus REAL_CSTs
from creeping into the IL and modified to ones not handled by
the decimal_to_decnumber special casing.  It also makes sure to
ICE for not handled dconst* values at the point we build the REAL_CST.

2022-04-27  Richard Biener  <rguenther@suse.de>

PR middle-end/105376
* tree.cc (build_real): Special case dconst* arguments
for decimal floating point types.

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

(cherry picked from commit e27eef7478f30ea79048dbde3317e89679d75a6e)

2 years ago[PR105324] libstdc++: testsuite: pr105324 requires FP from_char
Alexandre Oliva [Fri, 6 May 2022 10:26:04 +0000 (07:26 -0300)]
[PR105324] libstdc++: testsuite: pr105324 requires FP from_char

The floating-point overloads of from_char are only declared if
_GLIBCXX_HAVE_USELOCALE is #defined as nonzero.  That's exposed from
charconv as __cpp_lib_to_chars >= 201611L, so guard the test body with
that.

for  libstdc++-v3/ChangeLog

PR c++/105324
* testsuite/20_util/from_chars/pr105324.cc: Guard test body
with conditional for floating-point overloads of from_char.

(cherry picked from commit 25389f3de489c25a6983db96428a6bf06aedc829)

2 years agoc++: Don't emit deprecated warnings or unavailable errors on lambda declarations
Jakub Jelinek [Wed, 4 May 2022 08:07:36 +0000 (10:07 +0200)]
c++: Don't emit deprecated warnings or unavailable errors on lambda declarations

On the following testcase, we emit deprecated warnings or unavailable errors
even on merge declarations of those lambdas (the dg-bogus directives), while
IMHO we should emit them only when something actually calls those lambdas.

The following patch temporarily disables that diagnostics during
maybe_add_lambda_conv_op.

PR2173R1 also says that ambiguity between attribute-specifier-seq at the
end of requires-clause and attribute-specifier-seq from lambda-expression
should be resolved to attribute-specifier-seq for the latter.  Do we need
to do anything about that?  I mean, can a valid requires-clause end with
an attribute-specifier-seq?  Say operator int [[]] is valid primary
expression, but requires operator int [[]] isn't valid, nor is
requires operator int, no?

2022-05-04  Jakub Jelinek  <jakub@redhat.com>

* lambda.cc: Include decl.h.
(maybe_add_lambda_conv_op): Temporarily override deprecated_state to
UNAVAILABLE_DEPRECATED_SUPPRESS.

* g++.dg/cpp23/lambda-attr1.C: New test.
* g++.dg/cpp23/lambda-attr2.C: New test.

(cherry picked from commit 1c8e9bed9b9d46d479b83ae05b334543f66961fb)

2 years agotree-optimization/105484 - VEC_SET and EH
Richard Biener [Thu, 5 May 2022 07:34:59 +0000 (09:34 +0200)]
tree-optimization/105484 - VEC_SET and EH

When the IL representation of VEC_SET is marked as throwing
(unnecessarily), we need to clean that when replacing it with
the .VEC_SET internal function call which cannot throw.

2022-05-05  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105484
* gimple-isel.cc (gimple_expand_vec_set_expr): Clean EH, return
whether the CFG changed.
(gimple_expand_vec_exprs): When the CFG changed, clean it up.

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

(cherry picked from commit e1a41143a2e24c65d94364fd82b165ff71a759d8)

2 years agomiddle-end/105461 - opts processing of -fvar-tracking
Richard Biener [Tue, 3 May 2022 08:36:30 +0000 (10:36 +0200)]
middle-end/105461 - opts processing of -fvar-tracking

The flag_var_tracking reset in finish_options doesn't match the
condition in process_options, in particular we fail to reset it
when the option was specified on the command line.  The following
fixes this and also alters the debug info level guard to match
the one in process_options.

2022-05-03  Richard Biener  <rguenther@suse.de>

PR middle-end/105461
* opts.cc (finish_options): Match the condition to
disable flag_var_tracking to that of process_options.

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

(cherry picked from commit 6b4cc784806ac8676a08ecbbeadbd1bfa56073bb)

2 years agoFixup OPTION_SET_P usage in finish_options
Richard Biener [Tue, 3 May 2022 08:23:51 +0000 (10:23 +0200)]
Fixup OPTION_SET_P usage in finish_options

When some code was moved from process_options to finish_options,
uses of OPTION_SET_P were not replaced with references to the
opts_set option set.  The following fixes this.

2022-05-03  Richard Biener  <rguenther@suse.de>

* opts.cc: #undef OPTIONS_SET_P.
(finish_options): Use opts_set instead of OPTIONS_SET_P.

(cherry picked from commit 99f55024b0609e0d85f6c58828faad3c51a49749)

2 years agotree-optimization/105437 - BB vect with extern defs of throwing stmts
Richard Biener [Mon, 2 May 2022 07:30:27 +0000 (09:30 +0200)]
tree-optimization/105437 - BB vect with extern defs of throwing stmts

We have to watch out for vectorized stmt insert locations if the
def from the last stmt alters control flow.  We constrain region
building so we know the def is outside of the current region
and thus we can insert at the region start point.

2022-05-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105437
* tree-vect-slp.cc (vect_schedule_slp_node): Handle the
case where last_stmt alters control flow.

* g++.dg/vect/pr105437.cc: New testcase.

(cherry picked from commit 3a3eda000fdf4f8754c9a2535191091f1db0c2a2)

2 years agotree-optimization/105394 - vector lowering of compares
Richard Biener [Fri, 29 Apr 2022 09:54:45 +0000 (11:54 +0200)]
tree-optimization/105394 - vector lowering of compares

The following fixes missing handling of non-integer mode but
masked (SVE or MVE) compares in vector lowering by using the
appropriate mask element width to extract the components and
adjust the index.

2022-04-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105394
* tree-vect-generic.cc (expand_vector_condition): Adjust
comp_width for non-integer mode masks as well.

(cherry picked from commit dfae0c5a29f336cdab234b28999f9ba9dc20a4d0)

2 years agoBump BASE-VER
Jakub Jelinek [Fri, 6 May 2022 08:14:19 +0000 (10:14 +0200)]
Bump BASE-VER

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

* BASE-VER: Set to 12.1.1.

2 years agoUpdate ChangeLog and version files for release
Jakub Jelinek [Fri, 6 May 2022 07:07:53 +0000 (07:07 +0000)]
Update ChangeLog and version files for release

2 years agoUpdate gennews for GCC 12.
Jakub Jelinek [Fri, 6 May 2022 06:44:43 +0000 (08:44 +0200)]
Update gennews for GCC 12.

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

* gennews (files): Add files for GCC 12.

(cherry picked from commit 8025f29fbd8f87e27354b69d0bc9eb8d1aeae94c)

2 years agoDaily bump.
GCC Administrator [Fri, 6 May 2022 00:19:11 +0000 (00:19 +0000)]
Daily bump.

2 years agod: Merge upstream dmd 88de5e369.
Iain Buclaw [Thu, 5 May 2022 19:00:36 +0000 (21:00 +0200)]
d: Merge upstream dmd 88de5e369.

D front-end changes:

    - Merge regression fixes in v2.100.0 branch.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 88de5e369.

2 years agoRegenerate gcc.pot
Joseph Myers [Thu, 5 May 2022 17:03:54 +0000 (17:03 +0000)]
Regenerate gcc.pot

* gcc.pot: Regenerate.

2 years agoDaily bump.
GCC Administrator [Thu, 5 May 2022 00:18:48 +0000 (00:18 +0000)]
Daily bump.

2 years agoUpdate cpplib es.po
Joseph Myers [Wed, 4 May 2022 16:34:26 +0000 (16:34 +0000)]
Update cpplib es.po

* es.po: Update.

2 years agoDaily bump.
GCC Administrator [Wed, 4 May 2022 00:19:12 +0000 (00:19 +0000)]
Daily bump.

2 years agoUpdate gcc sv.po
Joseph Myers [Tue, 3 May 2022 22:17:18 +0000 (22:17 +0000)]
Update gcc sv.po

* sv.po: Update.

2 years agod: Merge upstream dmd 081d61e15, druntime 9c0d4f91, phobos dba1bbe27.
Iain Buclaw [Tue, 3 May 2022 15:53:08 +0000 (17:53 +0200)]
d: Merge upstream dmd 081d61e15, druntime 9c0d4f91, phobos dba1bbe27.

D front-end changes:

    - Import dmd v2.100.0-rc.1.

D runtime changes:

    - Import druntime v2.100.0-rc.1.

Phobos changes:

    - Import v2.100.0-rc.1.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 081d61e15.
* dmd/VERSION: Update version to v2.100.0-rc.1.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime 9c0d4f91.
* src/MERGE: Merge upstream phobos dba1bbe27.

2 years agotestsuite: vect: update unaligned message
Alexandre Oliva [Tue, 3 May 2022 07:23:54 +0000 (04:23 -0300)]
testsuite: vect: update unaligned message

gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c covers ppc variants
that accept and reject misaligned accesses.  The message that it
expects for rejection was removed in the gcc-11 development cycle by
commit r11-1969.  The patch adjusted multiple tests to use the message
introduced in r11-1945, but missed this one.

for  gcc/testsuite/ChangeLog

* gcc.dg/vect/costmodel/ppc/costmodel-vect-31a.c: Update
the expected message for the case in which unaligned accesses
are not allowed.

(cherry picked from commit 404edfce683cb1801b052ee7c8d45d603c392e08)

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

2 years agolibstdc++: case-sensitivity in hexfloat std::from_chars [PR105441]
Patrick Palka [Mon, 2 May 2022 11:00:48 +0000 (07:00 -0400)]
libstdc++: case-sensitivity in hexfloat std::from_chars [PR105441]

The hexfloat parser for binary32/64 added in r12-6645-gcc3bf3404e4b1c
overlooked that the exponent part can also begin with an uppercase 'P'.

PR libstdc++/105441

libstdc++-v3/ChangeLog:

* src/c++17/floating_from_chars.cc (__floating_from_chars_hex):
Also accept 'P' as the start of the exponent.
* testsuite/20_util/from_chars/7.cc: Add corresponding testcase.

(cherry picked from commit 576f975cabb0fd9843de152a2d247d486a967b08)

2 years agoFix exchanged period and letter in gfortan.texi.
Thomas Koenig [Fri, 29 Apr 2022 17:57:05 +0000 (19:57 +0200)]
Fix exchanged period and letter in gfortan.texi.

gcc/fortran/ChangeLog:

* gfortran.texi: Fix exchanged period and letter.

(cherry picked from commit 4a8b45e8bc8246bd141dad65f571a3e0cc499c6b)

2 years agosystem.h: Include <initializer_list> in system.h unconditionally
Jakub Jelinek [Mon, 2 May 2022 05:10:14 +0000 (07:10 +0200)]
system.h: Include <initializer_list> in system.h unconditionally

On Sun, May 01, 2022 at 07:06:53PM +0100, Jonathan Wakely wrote:
> > >> the reason is that "gcc/analyzer/region-model.cc” uses initializer_lists, and it seems that <initializer_list>
> > >> is not transitively included by any used headers for _LIBCPP_VERSION < 4000.  I fixed that locally by
> > >> adding initializer_list into system.h (and adding INCLUDE_INITIALIZER_LIST to the top of gcc/analyzer/region-model.cc)
> > >> - with that change those versions do bootstrap and test OK***
> > >
> > > From what I can see, with libstdc++ it works because <utility> which is
> > > included by system.h includes <initializer_list>.
> > > If I rename initializer_list in analyzer/region-model.ii to initializer_listx, I
> > > also get:
> > > ../../gcc/analyzer/region-model.cc: In function ‘void ana::selftest::test_binop_svalue_folding()’:
> > > ../../gcc/analyzer/region-model.cc:4966:48: error: deducing from brace-enclosed initializer list requires ‘#include <initializer_list>’
> > > 4508 |
> > >  +++ |+#include <initializer_list>
> > > 4509 | static void
> > > ......
> > > 4966 |     for (auto op : {BIT_IOR_EXPR, TRUTH_OR_EXPR})
> > >      |                                                ^
> > > ../../gcc/analyzer/region-model.cc:4978:49: error: deducing from brace-enclosed initializer list requires ‘#include <initializer_list>’
> > > 4978 |     for (auto op : {BIT_AND_EXPR, TRUTH_AND_EXPR})
> > >      |                                                 ^
> > >
> > > I think we have 2 options, one is do what you wrote above,
> > > INCLUDE_INITIALIZER_LIST defined before system.h to get #include <initializer_list>.
> > > The other option is just to include that unconditionally, it is a very small
> > > header.  For libstdc++ it will make no difference as it is included anyway
> > > and the header is really small there, libc++ includes <cstddef> which isn't
> > > normally included and system.h includes <stddef.h> instead.
> >
> > I’d say unconditionally would be OK. I suppose the chance that any host
> > C++ is good enough to build GCC as-is but fails to provide
> > <initializer_list> is zero?
> >
>
> Yes, definitely.
>
> > I’d be OK to do this change without a new RC even.

2022-05-02  Jakub Jelinek  <jakub@redhat.com>

* system.h: Include initializer_list.

(cherry picked from commit 4a0e89b10f6bdc1e285e0b9e6a435a0062f8936c)

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

2 years agoDaily bump.
GCC Administrator [Sun, 1 May 2022 00:18:44 +0000 (00:18 +0000)]
Daily bump.

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

2 years agolibstdc++: Add missing exports for ppc64le --with-long-double-format=ibm [PR105417]
Jonathan Wakely [Fri, 29 Apr 2022 11:17:13 +0000 (12:17 +0100)]
libstdc++: Add missing exports for ppc64le --with-long-double-format=ibm [PR105417]

The --with-long-double-abi=ibm build is missing some exports that are
present in the --with-long-double-abi=ieee build. Those symbols never
should have been exported at all, but now that they have been, they
should be exported consistently by both ibm and ieee.

This simply defines them as aliases for equivalent symbols that are
already present. The abi-tag on num_get::_M_extract_int isn't really
needed, because it only uses a std::string as a local variable, not in
the return type or function parameters, so it's safe to define the
_M_extract_int[abi:cxx11] symbols as aliases for the corresponding
function without the abi-tag.

This causes some new symbols to be added to the GLIBCXX_3.4.29 version
for the ibm long double build mode, but there is no advantage to adding
them to 3.4.30 for that build. That would just create more
inconsistencies.

libstdc++-v3/ChangeLog:

PR libstdc++/105417
* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt:
Regenerate.
* src/c++11/compatibility-ldbl-alt128.cc [_GLIBCXX_USE_DUAL_ABI]:
Define __gnu_ieee128::num_get<C>::_M_extract_int[abi:cxx11]<I>
symbols as aliases for corresponding symbols without abi-tag.

(cherry picked from commit bb7cf39b05a216431a431499d0c36a6034f6acc4)

2 years agolibstdc++: Update Solaris baselines for GCC 12.1
Rainer Orth [Fri, 29 Apr 2022 11:56:09 +0000 (13:56 +0200)]
libstdc++: Update Solaris baselines for GCC 12.1

The following patch updates the Solaris baselines for GCC 12.1.

Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (Solaris 11.3
and 11.4 in each case).

The only (expected) difference between the 11.3 and 11.4 versions is

--- baseline_symbols.txt.s113s 2022-04-28 10:37:11.464068450 +0000
+++ baseline_symbols.txt.s114s 2022-04-27 16:54:31.995636805 +0000
@@ -4070,3 +4070,3 @@
-FUNC:_ZSt10from_charsPKcS0_RdSt12chars_format@@GLIBCXX_3.4.30
-FUNC:_ZSt10from_charsPKcS0_ReSt12chars_format@@GLIBCXX_3.4.30
-FUNC:_ZSt10from_charsPKcS0_RfSt12chars_format@@GLIBCXX_3.4.30
+FUNC:_ZSt10from_charsPKcS0_RdSt12chars_format@@GLIBCXX_3.4.29
+FUNC:_ZSt10from_charsPKcS0_ReSt12chars_format@@GLIBCXX_3.4.29
+FUNC:_ZSt10from_charsPKcS0_RfSt12chars_format@@GLIBCXX_3.4.29

which is handled by the fix for PR libstdc++/103407.  I'm using the 11.4
version here.

2022-04-27  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libstdc++-v3:
* config/abi/post/i386-solaris/baseline_symbols.txt: Regenerate.
* config/abi/post/i386-solaris/amd64/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris/sparcv9/baseline_symbols.txt:
Likewise.

2 years agoc++, coroutines: Partial reversion of r12-8308-g15a176a833f23e [PR105426].
Iain Sandoe [Thu, 28 Apr 2022 19:06:29 +0000 (20:06 +0100)]
c++, coroutines: Partial reversion of r12-8308-g15a176a833f23e [PR105426].

The changes to fix PR 105287 included a tightening of the constraints on which
variables are promoted to frame copies.  This has exposed that we are failing
to name some variables that should be promoted.

We avoid the use of DECL_UID to build anonymous symbols since that might not
be stable for -fcompare-debug.

The long-term fix is to address the cases where the naming has been missed,
but for the short-term (and for the GCC-12 branch) backing out the additional
constraint is proposed.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/105426

gcc/cp/ChangeLog:

* coroutines.cc (register_local_var_uses): Allow promotion of unnamed
temporaries to coroutine frame copies.

(cherry picked from commit 3d8d093e820b10a4b4b2af8949a368377c0888cb)

2 years agoDaily bump.
GCC Administrator [Fri, 29 Apr 2022 00:19:02 +0000 (00:19 +0000)]
Daily bump.

2 years agoc++: partial ordering and dependent operator expr [PR105425]
Patrick Palka [Thu, 28 Apr 2022 17:10:56 +0000 (13:10 -0400)]
c++: partial ordering and dependent operator expr [PR105425]

Here ever since r12-6022-gbb2a7f80a98de3 we stopped deeming the partial
specialization #2 to be more specialized than #1 ultimately because
dependent operator expressions now have a DEPENDENT_OPERATOR_TYPE type
instead of an empty type, and this made unify stop deducing T(2) == 1
for K during partial ordering for #1 and #2.

This minimal patch fixes this by making the relevant logic in unify
treat DEPENDENT_OPERATOR_TYPE like an empty type.

PR c++/105425

gcc/cp/ChangeLog:

* pt.cc (unify) <case TEMPLATE_PARM_INDEX>: Treat
DEPENDENT_OPERATOR_TYPE like an empty type.

gcc/testsuite/ChangeLog:

* g++.dg/template/partial-specialization13.C: New test.

(cherry picked from commit 509fd16da8528444dccc98cef57a18a295c3f1b4)

2 years agolibstdc++: Update docs for release branch
Jonathan Wakely [Thu, 28 Apr 2022 17:24:10 +0000 (18:24 +0100)]
libstdc++: Update docs for release branch

libstdc++-v3/ChangeLog:

* doc/xml/manual/status_cxx1998.xml: Refer to GCC 12 not
mainline.
* doc/xml/manual/status_cxx2011.xml: Likewise.
* doc/xml/manual/status_cxx2014.xml: Likewise.
* doc/xml/manual/status_cxx2017.xml: Likewise.
* doc/xml/manual/status_cxx2020.xml: Likewise.
* doc/xml/manual/status_cxxtr1.xml: Likewise.
* doc/xml/manual/status_cxxtr24733.xml: Likewise.
* doc/html/manual/status.html: Regenerate.

2 years agoDocument changes to CONVERT for -mabi-ieeelongdouble for POWER.
Thomas Koenig [Thu, 28 Apr 2022 16:23:16 +0000 (18:23 +0200)]
Document changes to CONVERT for -mabi-ieeelongdouble for POWER.

gcc/fortran/ChangeLog:

* gfortran.texi: Mention r16_ieee and r16_ibm.
* invoke.texi: Likewise.

(cherry picked from commit 1a5ae012ff3303a8232a03ac9a0925c709775076)

2 years ago[committed] Fix more problems with new linker warnings
Jeff Law [Thu, 28 Apr 2022 16:03:52 +0000 (12:03 -0400)]
[committed] Fix more problems with new linker warnings

gcc/testsuite
* gcc.dg/lto/pr94157_0.c: Revert last change.
* lib/prune.exp (prune_gcc_output): Prune new linker warning.

2 years agoSet DEV-PHASE to prerelease.
Jakub Jelinek [Thu, 28 Apr 2022 13:59:21 +0000 (15:59 +0200)]
Set DEV-PHASE to prerelease.

2022-04-28  Jakub Jelinek  <jakub@redhat.com>

* DEV-PHASE: Set to prerelease.

2 years agocgraph: Don't verify semantic_interposition flag for aliases [PR105399]
Jakub Jelinek [Thu, 28 Apr 2022 13:45:33 +0000 (15:45 +0200)]
cgraph: Don't verify semantic_interposition flag for aliases [PR105399]

The following testcase ICEs, because the ctors during cc1plus all have
!opt_for_fn (decl, flag_semantic_interposition) - they have NULL
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) and optimization_default_node
is for -Ofast and so has flag_semantic_interposition cleared.
During free lang data, we set DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
for the ctor which has body (or for thunks), but don't touch it for
aliases.
During lto1 optimization_default_node reflects the lto1 flags which
are -O2 rather than -Ofast and so has flag_semantic_interposition
set, for the ctor which has body that makes no difference, but as the
alias doesn't still have DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) set,
we now trigger this verification check.

The following patch just doesn't verify it for aliases during lto1.
Another possibility would be to set DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl)
during free lang data even for aliases.

2022-04-28  Jakub Jelinek  <jakub@redhat.com>

PR lto/105399
* cgraph.cc (cgraph_node::verify_node): Don't verify
semantic_interposition flag against
opt_for_fn (decl, flag_semantic_interposition) for aliases in lto1.

* g++.dg/lto/pr105399_0.C: New test.

2 years agoFix up 'libgomp.oacc-fortran/print-1.f90' GCN offloading compilation [PR104717]
Thomas Schwinge [Tue, 26 Apr 2022 16:41:23 +0000 (18:41 +0200)]
Fix up 'libgomp.oacc-fortran/print-1.f90' GCN offloading compilation [PR104717]

That got broken by recent commit b2202431910e30d8505c94d1cb9341cac7080d10
"fortran: Fix up gfc_trans_oacc_construct [PR104717]".

PR fortran/104717
libgomp/
* testsuite/libgomp.oacc-fortran/print-1.f90: Add OpenACC
privatization scanning.  For GCN offloading compilation, raise
'-mgang-private-size'.

2 years agoc++, coroutines: Improve check for throwing final await [PR104051].
Iain Sandoe [Mon, 18 Apr 2022 15:23:30 +0000 (16:23 +0100)]
c++, coroutines: Improve check for throwing final await [PR104051].

We check that the final_suspend () method returns a sane type (i.e. a class
or structure) but, unfortunately, that check has to be later than the one
for a throwing case.  If the use returns some nonsensical type from the
method, we need to handle that in the checking for noexcept.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/104051

gcc/cp/ChangeLog:

* coroutines.cc (coro_diagnose_throwing_final_aw_expr): Handle
non-target expression inputs.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr104051.C: New test.

2 years agoc++, coroutines: Account for overloaded promise return_value() [PR105301].
Iain Sandoe [Mon, 18 Apr 2022 08:21:52 +0000 (09:21 +0100)]
c++, coroutines: Account for overloaded promise return_value() [PR105301].

Whether it was intended or not, it is possible to define a coroutine promise
with multiple return_value() methods [which need not even have the same type].

We were not accounting for this possibility in the check to see whether both
return_value and return_void are specifier (which is prohibited by the
standard).  Fixed thus and provided an adjusted diagnostic for the case that
multiple return_value() methods are present.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/105301

gcc/cp/ChangeLog:

* coroutines.cc (coro_promise_type_found_p): Account for possible
mutliple overloads of the promise return_value() method.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr105301.C: New test.

2 years agoc++, coroutines: Make sure our temporaries are in a bind expr [PR105287]
Iain Sandoe [Sun, 17 Apr 2022 19:58:28 +0000 (20:58 +0100)]
c++, coroutines: Make sure our temporaries are in a bind expr [PR105287]

There are a few cases where we can generate a temporary that does not need
to be added to the coroutine frame (i.e. these are genuinely ephemeral).  The
intent was that unnamed temporaries should not be 'promoted' to coroutine
frame entries.  However there was a thinko and these were not actually ever
added to the bind expressions being generated for the expanded awaits.  This
meant that they were showing in the global namspace, leading to an empty
DECL_CONTEXT and the ICE reported.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
PR c++/105287

gcc/cp/ChangeLog:

* coroutines.cc (maybe_promote_temps): Ensure generated temporaries
are added to the bind expr.
(add_var_to_bind): Fix local var naming to use portable punctuation.
(register_local_var_uses): Do not add synthetic names to unnamed
temporaries.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr105287.C: New test.

2 years agoc++, coroutines: Avoid expanding within templates [PR103868]
Nathan Sidwell [Sun, 3 Apr 2022 10:35:03 +0000 (11:35 +0100)]
c++, coroutines: Avoid expanding within templates [PR103868]

This is a forward-port of a patch by Nathan (against 10.x) which fixes an open
PR.

We are ICEing because we ended up tsubst_copying something that had already
been tsubst, leading to an assert failure (mostly such repeated tsubsting is
harmless).

We had a non-dependent co_await in a non-dependent-type template fn, so we
processed it at definition time, and then reprocessed at instantiation time.
We fix this here by deferring substitution while processing templates.

Additional observations (for a better future fix, in the GCC13 timescale):

Exprs only have dependent type if at least one operand is dependent which was
what the current code was intending to do.  Coroutines have the additional
wrinkle, that the current fn's type is an implicit operand.

So, if the coroutine function's type is not dependent, and the operand is not
dependent, we should determine the type of the co_await expression using the
DEPENDENT_EXPR wrapper machinery.  That allows us to determine the
subexpression type, but leave its operand unchanged and then instantiate it
later.

PR c++/103868

gcc/cp/ChangeLog:

* coroutines.cc (finish_co_await_expr): Do not process non-dependent
coroutine expressions at template definition time.
(finish_co_yield_expr): Likewise.
(finish_co_return_stmt): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/coroutines/pr103868.C: New test.

Co-Authored-by: Iain Sandoe <iain@sandoe.co.uk>
2 years agotestsuite,X86: Fix missing USER_LABEL_PREFIX cases.
Iain Sandoe [Fri, 15 Apr 2022 14:51:22 +0000 (15:51 +0100)]
testsuite,X86: Fix missing USER_LABEL_PREFIX cases.

Yet another set of testcases that do not account for targets that
use __USER_LABEL_PREFIX__.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite/ChangeLog:

* gcc.target/i386/memcpy-strategy-10.c: Account for
__USER_LABEL_PREFIX__.
* gcc.target/i386/memcpy-strategy-5.c: Likewise.
* gcc.target/i386/memset-strategy-5.c: Likewise.
* gcc.target/i386/memset-strategy-7.c: Likewise.

2 years agotestsuite: Add target requires for ifuncs to mv31.C.
Iain Sandoe [Thu, 28 Apr 2022 07:51:48 +0000 (08:51 +0100)]
testsuite: Add target requires for ifuncs to mv31.C.

g++.target/i386/mv31.C fails on targets without ifuncs support so add
the necessary target supports guard.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite/ChangeLog:

* g++.target/i386/mv31.C: Add target supports guard for ifuncs.

2 years agoc++: global-namespace-qualified var after class def [PR90107]
Marek Polacek [Wed, 27 Apr 2022 22:17:54 +0000 (18:17 -0400)]
c++: global-namespace-qualified var after class def [PR90107]

Here we wrongly reject the definition of "::N::a"

  struct A;
  namespace N { extern A a; }
  struct A {} ::N::a;

because our code to diagnose a missing ; after a class definition doesn't
realize that :: can follow a class definition.

PR c++/90107

gcc/cp/ChangeLog:

* parser.cc (cp_parser_class_specifier_1): Accept :: after a class
definition.

gcc/testsuite/ChangeLog:

* g++.dg/parse/qualified6.C: New test.

2 years agolibstdc++: Fix error reporting in filesystem::copy [PR99290]
Jonathan Wakely [Thu, 28 Apr 2022 12:06:31 +0000 (13:06 +0100)]
libstdc++: Fix error reporting in filesystem::copy [PR99290]

The recursive calls to filesystem::copy should stop if any of them
reports an error.

libstdc++-v3/ChangeLog:

PR libstdc++/99290
* src/c++17/fs_ops.cc (fs::copy): Pass error_code to
directory_iterator constructor, and check on each iteration.
* src/filesystem/ops.cc (fs::copy): Likewise.
* testsuite/27_io/filesystem/operations/copy.cc: Check for
errors during recursion.
* testsuite/experimental/filesystem/operations/copy.cc:
Likewise.

2 years agod: Merge upstream dmd 313d28b3d, druntime e361d200.
Iain Buclaw [Thu, 28 Apr 2022 10:40:59 +0000 (12:40 +0200)]
d: Merge upstream dmd 313d28b3d, druntime e361d200.

D front-end changes:

    - Import latest bug fixes from the 2.100 release branch.
    - Fix signatures of extern C++ functions that have size_t
      parameters.

gcc/d/ChangeLog:

* dmd/MERGE: Merge upstream dmd 313d28b3d.
* d-port.cc (Port::memicmp): Use d_size_t instead of size_t.
(Port::valcpy): Likewise.

libphobos/ChangeLog:

* libdruntime/MERGE: Merge upstream druntime e361d200.

2 years agoi386: Fix up ix86_gimplify_va_arg [PR105331]
Jakub Jelinek [Thu, 28 Apr 2022 10:33:59 +0000 (12:33 +0200)]
i386: Fix up ix86_gimplify_va_arg [PR105331]

On the following testcase we emit a bogus
'va_arg_tmp.5' may be used uninitialized
warning.  The reason is that when gimplifying the addr = &temp;
statement, the va_arg_tmp temporary var for which we emit ADDR_EXPR
is not TREE_ADDRESSABLE, prepare_gimple_addressable emits some extra
code to initialize the newly addressable var from its previous value,
but it is a new variable which hasn't been initialized yet and will
be later, so we end up initializing it with uninitialized SSA_NAME:
  va_arg_tmp.6 = va_arg_tmp.5_14(D);
  addr.2_16 = &va_arg_tmp.6;
  _17 = MEM[(double *)sse_addr.4_13];
  MEM[(double * {ref-all})addr.2_16] = _17;
and with -O1 we actually don't DSE it before the warning is emitted.
If we make the temp TREE_ADDRESSABLE before the gimplification, then
this prepare_gimple_addressable path isn't taken and we effectively
omit the first statement above and so the bogus warning is gone.

I went through other backends and didn't find another instance of this
problem.

2022-04-28  Jakub Jelinek  <jakub@redhat.com>

PR target/105331
* config/i386/i386.cc (ix86_gimplify_va_arg): Mark va_arg_tmp
temporary TREE_ADDRESSABLE before trying to gimplify ADDR_EXPR
of it.

* gcc.dg/pr105331.c: New test.

2 years agodoc: Remove misleading text about multilibs for IEEE long double
Jonathan Wakely [Thu, 28 Apr 2022 09:30:58 +0000 (10:30 +0100)]
doc: Remove misleading text about multilibs for IEEE long double

The choice of ieee or ibm long double format is orthogonal to multilibs,
as the two sets of symbols co-exist and don't need a separate multilib.

gcc/ChangeLog:

* doc/install.texi (Configuration): Remove misleading text
around LE PowerPC Linux multilibs.

2 years agolibstdc++: Remove redundant line in versioned namespace linker script
François Dumont [Thu, 28 Apr 2022 09:01:14 +0000 (10:01 +0100)]
libstdc++: Remove redundant line in versioned namespace linker script

This doesn't match anything.

libstdc++-v3/ChangeLog:

* config/abi/pre/gnu-versioned-namespace.ver: Remove
std::random_device::* pattern.

2 years agodoc: Document Solaris D bootstrap requirements [PR 103528]
Rainer Orth [Thu, 28 Apr 2022 08:27:32 +0000 (10:27 +0200)]
doc: Document Solaris D bootstrap requirements [PR 103528]

This patch documents the Solaris-specific D bootstrap requirements.

Tested by building and inspecting gccinstall.{pdf,info}.

2022-03-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
PR d/103528
* doc/install.texi (Tools/packages necessary for building GCC)
(GDC): Document libphobos requirement.
(Host/target specific installation notes for GCC, *-*-solaris2*):
Document libphobos and GDC specifics.

2 years agotree-optimization/105219 - bogus max iters for vectorized epilogue
Richard Biener [Wed, 27 Apr 2022 12:06:12 +0000 (14:06 +0200)]
tree-optimization/105219 - bogus max iters for vectorized epilogue

The following makes sure to take into account prologue peeling
when trying to narrow down the maximum number of iterations
computed for the vectorized epilogue.  A similar issue exists when
peeling for gaps.

2022-04-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/105219
* tree-vect-loop.cc (vect_transform_loop): Disable
special code narrowing the vectorized epilogue max
iterations when peeling for alignment or gaps was in effect.

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

2 years agotestsuite: Add test case for pack/unpack bifs at soft-float [PR105334]
Kewen Lin [Thu, 28 Apr 2022 03:34:27 +0000 (22:34 -0500)]
testsuite: Add test case for pack/unpack bifs at soft-float [PR105334]

This patch is to add the test coverage for the two recent fixes
r12-8091 and r12-8226 from Segher, aix is skipped since it takes
soft-float and long-double-128 incompatible.

PR target/105334

gcc/testsuite/ChangeLog:

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

2 years agotestsuite: Skip target not support -pthread [PR104676].
Jia-Wei Chen [Tue, 19 Apr 2022 03:11:24 +0000 (11:11 +0800)]
testsuite: Skip target not support -pthread [PR104676].

The "ftree-parallelize-loops=" imply -pthread option in gcc/gcc.cc,
some target are not support pthread like elf target use newlib,
and will get an error:

"*-*-elf-gcc: error: unrecognized command-line option '-pthread'"

so we add an additional condition "{target pthread}" to make sure the
dg-additional-options runs on support targets.

gcc/testsuite/ChangeLog

PR target/104676
* gcc.dg/torture/pr104676.c: Add "{target pthread}" check.

2 years agoloongarch: ignore zero-size fields in calling convention
Xi Ruoyao [Wed, 27 Apr 2022 11:45:59 +0000 (19:45 +0800)]
loongarch: ignore zero-size fields in calling convention

gcc/

* config/loongarch/loongarch.cc
(loongarch_flatten_aggregate_field): Ignore empty fields for
RECORD_TYPE.

gcc/testsuite/

* gcc.target/loongarch/zero-size-field-pass.c: New test.
* gcc.target/loongarch/zero-size-field-ret.c: New test.

2 years agoDaily bump.
GCC Administrator [Thu, 28 Apr 2022 00:16:52 +0000 (00:16 +0000)]
Daily bump.

2 years agoc++: add comments
Jason Merrill [Wed, 27 Apr 2022 20:09:35 +0000 (16:09 -0400)]
c++: add comments

gcc/cp/ChangeLog:

* tree.cc (strip_typedefs): Add default argument comments.

2 years agoFix oversight from previous commit to pr70673.
Thomas Koenig [Wed, 27 Apr 2022 20:40:49 +0000 (22:40 +0200)]
Fix oversight from previous commit to pr70673.

gcc/testsuite/ChangeLog:

* gfortran.dg/pr70673.f90: Removed second invalid
line.