While looking at another issue I noticed that in a template we were failing
to find the INIT_EXPR we were looking for, and so ended up doing redundant
processing. No testcase, as the redundant processing ended up getting the
right result.
gcc/cp/ChangeLog:
* decl.c (check_initializer): Also look through STMT_EXPR
and BIND_EXPR.
For modules we need to compare structurally all the way down. This
means inhibiting typename_type resolution, independent of comparing
specializations.
gcc/cp/
* cp-tree.h (comparing_typenames): Declare.
* pt.c (comparing_typenames): Define.
(spec_hasher::equal): Increment it around comparisons.
* typeck.c (structural_comptypes): Adjust TYPENAME resolution
check.
I've been using
git send-email --annotate --suppress-from --to=gcc-patches@gcc.gnu.org \
${@:-HEAD^} ':!*/ChangeLog' ':!*configure'
for sending most patches, but it occurs to me that it would be useful to put
the To: address in the configury.
If someone were feeling ambitious, they could write a script to analyze a
patch and add the relevant maintainers to To: or CC:.
contrib/ChangeLog:
* gcc-git-customization.sh: Configure sendemail.to.
In this test, we have
static inline const int c = b;
in a class template, and we call store_init_value as usual. There, the
value is
IMPLICIT_CONV_EXPR<const float>(b)
which is is_nondependent_static_init_expression but isn't
is_nondependent_constant_expression (they only differ in STRICT).
We call fold_non_dependent_expr, but that just returns the expression
because it only instantiates is_nondependent_constant_expression
expressions. Since we're not checking the initializer of a constexpr
variable, we go on to call maybe_constant_init, whereupon we crash
because it tries to evaluate all is_nondependent_static_init_expression
expressions, which our value is, but it still contains a template code.
I think the fix is to call fold_non_dependent_init instead of
maybe_constant_init, and only call fold_non_dependent_expr on the
"this is a constexpr variable" path so as to avoid instantiating twice
in a row. Outside a template this should also avoid evaluating the
value twice.
gcc/cp/ChangeLog:
PR c++/97975
* constexpr.c (fold_non_dependent_init): Add a tree parameter.
Use it.
* cp-tree.h (fold_non_dependent_init): Add a tree parameter with
a default value.
* typeck2.c (store_init_value): Call fold_non_dependent_expr
only when checking the initializer for constexpr variables.
Call fold_non_dependent_init instead of maybe_constant_init.
gcc/testsuite/ChangeLog:
PR c++/97975
* g++.dg/cpp1z/inline-var8.C: New test.
I had a strong sense of deja vu when looking into this, and no wonder,
since this is almost identical to c++/95728.
Since r11-423 tsubst_copy_and_build/TREE_LIST uses tsubst_tree_list
instead of open coding it. While the latter could return an error
node wrapped in a TREE_LIST, the former can return a naked error node.
That broke in tsubst_copy_and_build/NEW_EXPR, because we were accessing
TREE_VALUE of an error node.
gcc/cp/ChangeLog:
PR c++/97187
PR c++/97993
* pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
if init is erroneous.
gcc/testsuite/ChangeLog:
PR c++/97187
PR c++/97993
* g++.dg/eh/crash2.C: New test.
* g++.dg/template/crash132.C: New test.
Currently GCC loads large immediates into GPRs from the literal pool,
which is not as efficient as loading two halves with llihf and oilf.
gcc/ChangeLog:
2020-11-30 Ilya Leoshkevich <iii@linux.ibm.com>
* config/s390/s390-protos.h (s390_const_int_pool_entry_p): New
function.
* config/s390/s390.c (s390_const_int_pool_entry_p): New
function.
* config/s390/s390.md: Add define_peephole2 that produces llihf
and oilf.
gcc/testsuite/ChangeLog:
2020-11-30 Ilya Leoshkevich <iii@linux.ibm.com>
* gcc.target/s390/load-imm64-1.c: New test.
* gcc.target/s390/load-imm64-2.c: New test.
In addition to the existing powerpc targets, powerpc64 needs libatomic
for 64-bit atomics when testing the 32-bit multilib with -m32. Adjust
the existing target checks to match all 32-bit powerpc targets, but not
64-bit ones.
libstdc++-v3/ChangeLog:
* testsuite/lib/dg-options.exp (add_options_for_libatomic):
Replace powerpc-ibm-aix* and powerpc*-*-darwin* with check for
powerpc && ilp32.
The module machinery needs to serialize tinfo types and vars by
meaning, not literally. This adds the necessary pieces to rtti.
gcc/cp/
* cp-tree.h (DECL_TINFO_P): Also for TYPE_DECLs.
(get_tinfo_decl_direct): Declare.
(get_pseudo_tinfo_index, get_pseudo_tinfo_type): Declare.
* rtti.c (get_tinfo_decl_direct): Externalize.
(get_tinfo_desc): Set DECL_TINFO_P on the typedef.
(get_pseudo_tinfo_index, get_pseudo_tinfo_type): New.
This is a gofrontend copy of https://golang.org/cl/203282.
From the CL 203282 description:
"declared and not used" is technically correct, but might confuse
the user. Switching "and" to "but" will hopefully create the
contrast for the users: they did one thing (declaration), but
not the other --- actually using the variable.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273629
We need to call the lang_decl and type_decl creators from the module
loading machinery. This makes them reachable.
gcc/cp/
* cp-tree.h (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
Declare.
* lex.c (maybe_add_lang_decl_raw, maybe_add_lang_type_raw):
Externalize, reformat.
The modules machinery needs to construct array types, and that wanted
to determine type dependency. That doesn't work during loading, but
the module loader can stream that fact too and tell the array builder.
Thus this extends the API to allow a caller to specify the dependency
explicitly. The call in cp_build_qualified_type_real is unreachable
during the loading, so that one's ok as is.
gcc/cp/
* cp-tree.h (build_cplus_array_type): Add defaulted DEP parm.
* tree.c (set_array_type_common): Add DEP parm.
(build_cplus_array_type): Add DEP parm, determine dependency if
needed.
(cp_build_qualified_type_real): Adjust array-building call.
(strip_typedefs): Likewise.
I made the prefix for dumping a binding-vector slightly too small.
Fixed thusly.
gcc/cp/
* ptree.c (cxx_print_xnode): Increase binding-vector prefix size.
This fixes SLP cycles leaking memory by maintaining a double-linked
list of allocatd SLP nodes we can zap when we free the alloc pool.
2020-12-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/97630
* tree-vectorizer.h (_slp_tree::next_node,
_slp_tree::prev_node): New.
(vect_slp_init): Declare.
(vect_slp_fini): Likewise.
* tree-vectorizer.c (vectorize_loops): Call vect_slp_init/fini.
(pass_slp_vectorize::execute): Likewise.
* tree-vect-slp.c (vect_slp_init): New.
(vect_slp_fini): Likewise.
(slp_first_node): New global.
(_slp_tree::_slp_tree): Link node into the SLP tree list.
(_slp_tree::~_slp_tree): Delink node from the SLP tree list.
Apparently vec.h doesn't build with -std=c++20/gnu++20, since the
DR2237 r11-532 change.
template <typename T>
class auto_delete_vec
{
private:
auto_vec_delete<T> (const auto_delete_vec<T> &) = delete;
};
which vec.h uses is invalid C++20, one needs to use
auto_vec_delete (const auto_delete_vec &) = delete;
instead which is valid all the way back to C++11 (and without = delete
to C++98).
2020-12-02 Scott Snyder <sss@li-snyder.org>
PR plugins/98059
* vec.h (auto_delete_vec): Use
DISABLE_COPY_AND_ASSIGN(auto_delete_vec) instead of
DISABLE_COPY_AND_ASSIGN(auto_delete_vec<T>) to make it valid C++20
after DR2237.
This adds the vector necessary to hold different module's namespace
bindings. We add a new tree-node 'tree_binding_vec', which contains a
sparse array, indexed by module number. To avoid space wasting, this
is allocated in clusters using 'unsigned short' as the index value (so
that's one of the upper bounds on module importing). If there are
only bindings from the current TU, there is no vector, so we have the
same representation as a non-module compilation.
To support lazy loading, a binding slot can contain either a tree (the
binding), or a cookie that the module machinery uses to load the
required binding on demand.
The first 2 or 3 slots end up being reserved for fixed meanings.
There are a couple of flags we have to record on a binding, to know
whether the same declaration could appear in two different slots.
gcc/cp/
* cp-tree.def (BINDING_VECTOR): New.
* name-lookup.h (struct binding_slot): New.
(BINDING_VECTOR_SLOTS_PER_CLUSTER): New.
(struct binding_index, struct binding_cluster): New.
(BINDING_VECTOR_ALLOC_CLUSTERS, BINDING_VECTOR_CLUSTER_BASE)
(BINDING_VECTOR_CLUSTER): New.
(struct tree_binding_vec): New.
(BINDING_VECTOR_NAME, BINDING_VECTOR_GLOBAL_DUPS_P)
(BINDING_VECTOR_PARTITION_DUPS_P): New.
(BINDING_BINDING_GLOBAL_P, BINDING_BINDING_PARTITION_P): New.
(BINDING_VECTOR_PENDING_SPECIALIZATIONS)
(BINDING_VECTOR_PENDING_IS_HEADER_P)
(BINDING_VECTOR_PENDING_IS_PARTITION_P): New.
* cp-tree.h (enum cp_tree_node_structure_enum): Add
TS_CP_BINDING_VECTOR.
(union lang_tree_node): Add binding_vec field.
(make_binding_vec): Declare.
(named_decl_hash::hash, named_decl_hash::equal): Check for binding
vector.
* decl.c (cp_tree_node_structure): Add BINDING_VECTOR case.
* ptree.c (cxx_print_xnode): Add BINDING_VECTOR case.
* tree.c (make_binding_vec): New.
This commit in GNU binutils 2.35:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=b7d072167715829eed0622616f6ae0182900de3e
added the section flag 'o' to .section directive:
.section __patchable_function_entries,"awo",@progbits,foo
which specifies the symbol name which the section references. Assembler
creates a unique __patchable_function_entries section with the section,
where foo is defined, as its linked-to section. Linker keeps a section
if its linked-to section is kept during garbage collection.
This patch checks assembler support for the section flag 'o' and uses
it to implement __patchable_function_entries section. Since Solaris may
use GNU assembler with Solairs ld. Even if GNU assembler supports the
section flag 'o', it doesn't mean that Solairs ld supports it. This
feature is disabled for Solairs targets.
gcc/
PR middle-end/93195
PR middle-end/93197
* configure.ac (HAVE_GAS_SECTION_LINK_ORDER): New. Define 1 if
the assembler supports the section flag 'o' for specifying
section with link-order.
* output.h (SECTION_LINK_ORDER): New. Defined to 0x8000000.
(SECTION_MACH_DEP): Changed from 0x8000000 to 0x10000000.
* targhooks.c (default_print_patchable_function_entry): Pass
SECTION_LINK_ORDER to switch_to_section if the section flag 'o'
works. Pass current_function_decl to switch_to_section.
* varasm.c (default_elf_asm_named_section): Use 'o' flag for
SECTION_LINK_ORDER if assembler supports it.
* config.in: Regenerated.
* configure: Likewise.
* doc/sourcebuild.texi: Document o_flag_in_section.
gcc/testsuite/
PR middle-end/93195
* g++.dg/pr93195a.C: New test.
* g++.dg/pr93195b.C: Likewise.
* lib/target-supports.exp
(check_effective_target_o_flag_in_section): New proc.
On targets with 32-bit poitners these tests do extra work, so give them
longer to run.
libstdc++-v3/ChangeLog:
* testsuite/27_io/basic_istream/ignore/char/94749.cc: Add
dg-timeout-factor for ilp32 targets.
* testsuite/27_io/basic_istream/ignore/wchar_t/94749.cc:
Likewise.
This fixes UBsan errors like:
/usr/include/c++/10/ext/ropeimpl.h:593:9: runtime error: member access within null pointer of type 'struct _RopeRep'
/usr/include/c++/10/ext/ropeimpl.h:593:9: runtime error: member call on null pointer of type 'struct _Rope_rep_base'
/usr/include/c++/10/ext/rope:556:17: runtime error: reference binding to null pointer of type 'struct allocator_type'
/usr/include/c++/10/ext/ropeimpl.h:593:9: runtime error: reference binding to null pointer of type 'struct allocator_type'
/usr/include/c++/10/ext/rope:1700:30: runtime error: member call on null pointer of type 'struct new_allocator'
/usr/include/c++/10/ext/new_allocator.h:105:29: runtime error: member call on null pointer of type 'struct new_allocator'
/usr/include/c++/10/ext/rope:1702:26: runtime error: reference binding to null pointer of type 'const struct allocator'
/usr/include/c++/10/bits/allocator.h:148:34: runtime error: reference binding to null pointer of type 'const struct new_allocator'
/usr/include/c++/10/ext/rope:1664:39: runtime error: reference binding to null pointer of type 'const struct allocator'
/usr/include/c++/10/ext/rope:1665:9: runtime error: reference binding to null pointer of type 'const struct allocator_type'
/usr/include/c++/10/ext/rope:725:36: runtime error: reference binding to null pointer of type 'const struct allocator_type'
/usr/include/c++/10/ext/rope:614:64: runtime error: reference binding to null pointer of type 'const struct allocator_type'
The problem is calling r->_M_get_allocator() when r is null.
libstdc++-v3/ChangeLog:
* include/ext/rope (rope::_S_concat_char_iter)
(rope::_S_destr_concat_char_iter): Add allocator parameter.
(rope::push_back, rope::append, rope::insert, operator+):
Pass allocator.
* include/ext/ropeimpl.h (rope::_S_concat_char_iter)
(rope::_S_destr_concat_char_iter): Add allocator parameter
and use it.
(_Rope_char_ref_proxy::operator=(_CharT)): Pass allocator.
This makes sure to not call maybe_set_vectorized_backedge_value when
we did not vectorize the latch def candidate.
2020-12-02 Richard Biener <rguenther@suse.de>
* tree-vect-loop.c (vect_transform_loop_stmt): Return whether
we vectorized a stmt.
(vect_transform_loop): Only call maybe_set_vectorized_backedge_value
when we vectorized the stmt.
Jeff has reported that my earlier patch broke rl78-elf, e.g. with
unsigned short foo (unsigned short x) { return x % 7; }
when compiled with -O2 -mg14. The problem is that rl78 is a BITS_PER_WORD
== 8 target which doesn't have 8-bit modulo or divmod optab, but has instead
16-bit divmod, so my patch attempted to optimize it, then called
expand_divmod to do 8-bit modulo and that in turn tried to do 16-bit modulo
again.
The following patch fixes it in two ways.
One is to not perform the optimization when we have {u,s}divmod_optab
handler for the double-word mode, in that case it is IMHO better to just
do whatever we used to do before. This alone should fix the infinite
recursion. But I'd be afraid some other target might have similar problem
and might not have a divmod pattern, but only say a library call.
So the patch also introduces a methods argument to expand_divmod such that
normally we allow everything that was allowed before (using libcalls and
widening), but when called from these expand_doubleword*mod routines we
restrict it to no widening and no libcalls.
2020-12-02 Jakub Jelinek <jakub@redhat.com>
* expmed.h (expand_divmod): Only declare if GCC_OPTABS_H is defined.
Add enum optabs_method argument defaulted to OPTAB_LIB_WIDEN.
* expmed.c: Include expmed.h after optabs.h.
(expand_divmod): Add methods argument, if it is not OPTAB_{,LIB_}WIDEN,
don't choose a wider mode, and pass it to other calls instead of
hardcoded OPTAB_LIB_WIDEN. Avoid emitting libcalls if not
OPTAB_LIB or OPTAB_LIB_WIDEN.
* optabs.c: Include expmed.h after optabs.h.
(expand_doubleword_mod, expand_doubleword_divmod): Pass OPTAB_DIRECT
as last argument to expand_divmod.
(expand_binop): Punt if {s,u}divmod_optab has handler for double-word
int_mode.
* expr.c: Include expmed.h after optabs.h.
* explow.c: Include expmed.h after optabs.h.
The following patch implements what Thomas wrote about, in particular
that we can handle also double-word divison by the constants for which
the earlier patch optimized modulo (if it would be otherwise a library
call) and that we can also easily handle such constants shifted to the left.
Unfortunately, seems CSE isn't able to optimize away the two almost
identical sequences (one to compute remainder, one to compute quotient),
probably because of the ADD_OVERFLOW introduced jumps, so the patch also
adjusts expand_DIVMOD.
2020-12-02 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/97459
* optabs.h (expand_doubleword_divmod): Declare.
* optabs.c (expand_doubleword_divmod): New function.
(expand_binop): Use it.
* internal-fn.c (expand_DIVMOD): Likewise.
* gcc.target/i386/pr97282.c (foo): Use 123456 divisor instead of
10.
* gcc.dg/pr97459-1.c (TESTS): Add tests for 10, 12 and
6144.
* gcc.dg/pr97459-2.c (TESTS): Likewise.
* gcc.dg/pr97459-3.c: New test.
* gcc.dg/pr97459-4.c: New test.
* gcc.dg/pr97459-5.c: New test.
* gcc.dg/pr97459-6.c: New test.
gcc/ChangeLog:
PR c/98087
* gimple-fold.c (clear_padding_type): Do not divide by zero.
gcc/testsuite/ChangeLog:
PR c/98087
* gcc.c-torture/compile/pr98087.c: New test.
Power ISA 3.1 has dropped transactional memory support, this patch
is to disable HTM feature for power10 and later by default.
Bootstrapped/regtested on powerpc64le-linux-gnu P8 and P10.
gcc/ChangeLog:
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Use OPTION_MASK_DIRECT_MOVE for Power8 target_enable instead
of OPTION_MASK_HTM.
* config/rs6000/rs6000-cpus.def (ISA_2_7_MASKS_SERVER):
Remove OPTION_MASK_HTM.
(RS6000_CPU): Add OPTION_MASK_HTM to power8, power9 and
powerpc64le entries.
Right now I see:
./xgcc -B. ~/Programming/testcases/json.i -c -O2 -fmax-errors=1
/home/marxin/Programming/testcases/json.i: In function ‘json_variant_type’:
/home/marxin/Programming/testcases/json.i:22:1: error: non-integral type switch statement
22 | }
| ^
int *
switch (v_2(D)) <default: <L16> [INV], case 0B: <L11> [INV], case 5B: <L12> [INV], case 6B: <L13> [INV], case 7B: <L14> [INV], case 8B: <L15> [INV]>
compilation terminated due to -fmax-errors=1.
with the patch I get:
./xgcc -B. ~/Programming/testcases/json.i -c -O2 -fmax-errors=1 -c
/home/marxin/Programming/testcases/json.i: In function ‘json_variant_type’:
/home/marxin/Programming/testcases/json.i:22:1: error: non-integral type switch statement
22 | }
| ^
int *
switch (v_2(D)) <default: <L16> [INV], case 0B: <L11> [INV], case 5B: <L12> [INV], case 6B: <L13> [INV], case 7B: <L14> [INV], case 8B: <L15> [INV]>
during GIMPLE pass: iftoswitch
/home/marxin/Programming/testcases/json.i:22:1: internal compiler error: verify_gimple failed
0xe4478c verify_gimple_in_cfg(function*, bool)
/home/marxin/Programming/gcc/gcc/tree-cfg.c:5467
0xd201cf execute_function_todo
/home/marxin/Programming/gcc/gcc/passes.c:2042
0xd2101c do_per_function
/home/marxin/Programming/gcc/gcc/passes.c:1687
0xd2101c execute_todo
/home/marxin/Programming/gcc/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
gcc/ChangeLog:
* diagnostic.c (diagnostic_report_diagnostic): ICE causes to
terminate compiler immediately, so I guess it should be printed
always.
As seen in the test-case, even 2 BBs can handle interesting
cases covered by a jump table or a bit-test.
gcc/ChangeLog:
PR tree-optimization/88702
* gimple-if-to-switch.cc (pass_if_to_switch::execute):
Require at least 2 BBs.
* gimple-if-to-switch.cc (find_conditions): Require
equal precision for low and high of a range.
gcc/testsuite/ChangeLog:
PR tree-optimization/88702
* gcc.dg/tree-ssa/if-to-switch-9.c: New test.
gcc/
* config/h8300/addsub.md (addqi3_clobber_flags): Rename to
addqi3_flags and annotate with a <cczn> for define_subst.
(addhi3_h8sx_clobber_flags): Likewise.
(subqi3_clobber_flags, sub<mode>3_clobber_flags): Likewise.
(neg<mode2>_clobber_flags): Similarly.
(addsi3_clobber_flags): Similarly. Update last argument to
output_plussi to distinguish when we need flags or do not need
flags.
(addhi3_clobber_flags): Similarly. Twiddle code for cases
+-1, +-2 and +-4.
* config/h8300/h8300.md: Define iterators, mode attributes and
substitutions for use in compare/test elimination.
* config/h8300/jumpcall.md (branch, branch_1): Use H8cc mode
iterator to cover the different modes for the CC register.
(branch_1_false): Likewise.
gcc/testsuite
* gcc.target/h8300/add.c: New test.
* gcc.target/h8300/add-2.c: New test.
* gcc.target/h8300/add-3.c: New test.
* gcc.target/h8300/sub.c: New test.
* gcc.target/h8300/sub-2.c: New test.
* gcc.target/h8300/sub-3.c: New test.
In assemly code, the section flag 'R' sets the SHF_GNU_RETAIN flag to
indicate that the section must be preserved by the linker.
Add SECTION_RETAIN to indicate a section should be retained by the linker
and set SECTION_RETAIN on section for the preserved symbol if assembler
supports SHF_GNU_RETAIN. All retained symbols are placed in separate
sections with
.section .data.rel.local.preserved_symbol,"awR"
preserved_symbol:
...
.section .data.rel.local,"aw"
not_preserved_symbol:
...
to avoid
.section .data.rel.local,"awR"
preserved_symbol:
...
not_preserved_symbol:
...
which places not_preserved_symbol definition in the SHF_GNU_RETAIN
section.
gcc/
2020-12-01 H.J. Lu <hjl.tools@gmail.com>
* configure.ac (HAVE_GAS_SHF_GNU_RETAIN): New. Define 1 if
the assembler supports marking sections with SHF_GNU_RETAIN flag.
* output.h (SECTION_RETAIN): New. Defined as 0x4000000.
(SECTION_MACH_DEP): Changed from 0x4000000 to 0x8000000.
(default_unique_section): Add a bool argument.
* varasm.c (get_section): Set SECTION_RETAIN for the preserved
symbol with HAVE_GAS_SHF_GNU_RETAIN.
(resolve_unique_section): Used named section for the preserved
symbol if assembler supports SHF_GNU_RETAIN.
(get_variable_section): Handle the preserved common symbol with
HAVE_GAS_SHF_GNU_RETAIN.
(default_elf_asm_named_section): Require the full declaration and
use the 'R' flag for SECTION_RETAIN.
* config.in: Regenerated.
* configure: Likewise.
* doc/sourcebuild.texi: Document R_flag_in_section.
gcc/testsuite/
2020-12-01 H.J. Lu <hjl.tools@gmail.com>
Jozef Lawrynowicz <jozef.l@mittosystems.com>
* c-c++-common/attr-used.c: Check the 'R' flag.
* c-c++-common/attr-used-2.c: Likewise.
* c-c++-common/attr-used-3.c: New test.
* c-c++-common/attr-used-4.c: Likewise.
* gcc.c-torture/compile/attr-used-retain-1.c: Likewise.
* gcc.c-torture/compile/attr-used-retain-2.c: Likewise.
* lib/target-supports.exp
(check_effective_target_R_flag_in_section): New proc.
This changes some #ifdef checks to use #if instead.
libstdc++-v3/ChangeLog:
* include/bits/atomic_timed_wait.h: Use #if instead of #ifdef.
* include/bits/semaphore_base.h: Likewise.
* include/std/version: Remove trailing whitespace.
On some systems libstdc++-prettyprinters/cxx17.cc FAILs with this error:
skipping: Python Exception <type 'exceptions.AttributeError'> 'gdb.Type' object has no attribute 'name': ^M
got: $27 = filesystem::path "/dir/."^M
FAIL: libstdc++-prettyprinters/cxx17.cc print path2
The gdb.Type.name attribute isn't present in GDB 7.6, so we get an
exception from StdPathPrinter._iterator.__next__ trying to use it.
The StdPathPrinter._iterator is already passed the type's name in its
constructor, so we can just store that and use it instead of
gdb.Type.name.
libstdc++-v3/ChangeLog:
* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Store the
name of the type and pass it to the iterator.
(StdPathPrinter): Likewise.
* testsuite/libstdc++-prettyprinters/filesystem-ts.cc: New test.
GCC 11 supports -march=x86-64-v[234] to enable x86 micro-architecture ISA
levels:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97250
Binutils has been updated to support GNU_PROPERTY_X86_ISA_1_V[234] marker:
https://gitlab.com/x86-psABIs/x86-64-ABI/-/merge_requests/13
with
commit b0ab06937385e0ae25cebf1991787d64f439bf12
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Oct 30 06:49:57 2020 -0700
x86: Support GNU_PROPERTY_X86_ISA_1_BASELINE marker
and
commit 32930e4edbc06bc6f10c435dbcc63131715df678
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Oct 9 05:05:57 2020 -0700
x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker
in x86 ELF binaries.
Add -mneeded to emit GNU_PROPERTY_X86_ISA_1_NEEDED property to indicate
the micro-architecture ISA level required to execute the binary.
gcc/
* config.gcc: Replace cet.o with gnu-property.o. Replace
i386/t-cet with i386/t-gnu-property.
* config/i386/cet.c: Renamed to ...
* config/i386/gnu-property.c: This.
(emit_gnu_property): New function.
(file_end_indicate_exec_stack_and_cet): Renamed to ...
(file_end_indicate_exec_stack_and_gnu_property): This. Call
emit_gnu_property to generate GNU_PROPERTY_X86_FEATURE_1_AND and
GNU_PROPERTY_X86_ISA_1_NEEDED properties.
* config/i386/i386.opt (mneeded): New.
* config/i386/linux-common.h (file_end_indicate_exec_stack_and_cet):
Renamed to ...
(file_end_indicate_exec_stack_and_gnu_property): This.
(TARGET_ASM_FILE_END): Updated.
* config/i386/t-cet: Renamed to ...
* config/i386/t-gnu-property: This.
(cet.o): Renamed to ...
(gnu-property.o): This.
* doc/invoke.texi: Document -mneeded.
gcc/testsuite/
* gcc.target/i386/x86-needed-1.c: New test.
* gcc.target/i386/x86-needed-2.c: Likewise.
* gcc.target/i386/x86-needed-3.c: Likewise.
Adds __cpp_lib_atomic_wait feature test macro which was overlooked in
the initial commit of this feature. Replaces uses of
_GLIBCXX_HAVE_ATOMIC_WAIT.
libstdc++-v3/ChangeLog:
* include/bits/atomic_base.h: Replace usage of
_GLIBCXX_HAVE_ATOMIC_WAIT with __cpp_lib_atomic_wait.
* include/bits/atomic_timed_wait.h: Likewise.
* include/bits/atomic_wait.h: Define __cpp_lib_atomic_wait
feature test macro.
* include/bits/semaphore_base.h: Replace usage of
_GLIBCXX_HAVE_ATOMIC_WAIT with __cpp_lib_atomic_wait.
* include/std/atomic: Likewise.
* include/std/latch: Likewise.
* include/std/semaphore: Likewise.
* include/std/version: Define __cpp_lib_atomic wait
feature test macro and replace usage of
_GLIBCXX_HAVE_ATOMIC_WAIT.
* testsuite/29_atomics/atomic/wait_notify/1.cc: New test.
* testsuite/29_atomics/atomic/wait_notify/2.cc: Likewise.