* Makefile.am: Modify
* Makefile.in: Modify
* caf/libcaf.h (LIBCAF_H): Modify
(_gfortran_caf_failed_images): Modify
(_gfortran_caf_image_status): Modify
(_gfortran_caf_stopped_images): Modify
* caf/single.c (caf_internal_error): Modify
* caf/caf_error.c: New file. Modify
* caf/caf_error.h: New file. Modify
* caf/shmem.c: New file.
* caf/shmem/alloc.c: New file.
* caf/shmem/alloc.h: New file.
* caf/shmem/allocator.c: New file.
* caf/shmem/allocator.h: New file.
* caf/shmem/collective_subroutine.c: New file.
* caf/shmem/collective_subroutine.h: New file.
* caf/shmem/counter_barrier.c: New file.
* caf/shmem/counter_barrier.h: New file.
* caf/shmem/hashmap.c: New file.
* caf/shmem/hashmap.h: New file.
* caf/shmem/shared_memory.c: New file.
* caf/shmem/shared_memory.h: New file.
* caf/shmem/supervisor.c: New file.
* caf/shmem/supervisor.h: New file.
* caf/shmem/sync.c: New file.
* caf/shmem/sync.h: New file.
* caf/shmem/teams_mgmt.c: New file.
* caf/shmem/teams_mgmt.h: New file.
* caf/shmem/thread_support.c: New file.
* caf/shmem/thread_support.h: New file.
That revision delayed the evaluation of array bounds, with changes in
two places: in the scalarizer where we save expressions without
evaluating their values to variables, and in the reallocation code where
we evaluate to variables the expressions previously saved. The effect
should not have been visible in scalarized code, as the saving to a
variable was only delayed after reallocation.
Unfortunately, it's actually not the case, and there are cases where
expressions that were saved to variables before the change, are no
longer after it. The reason for that is differing conditions guarding
the omission of the evaluation to variables in the scalarizer on one
hand, and the emission of reallocation code with the saving to variables
on the other hand. There is an additional check that avoids the
emission of reallocation code if we can prove at compile time that both
sides of the assignment are conformable.
This change moves up the reallocation code condition definition, so that
it can be used as well to flag the left hand side array as
reallocatable, and omit the evaluation of expressions in the exact same
conditions where the reallocation code would catch those unevaluated
expressions.
An explicit call to gfc_fix_class_refs is added before the evaluation of
the reallocation code condition. It was implicit before, by the call to
gfc_walk_expr.
This is not a correctness issue, but PR #121185, that made the problem
apparent, exhibited wrong code examples where the lack of an
intermediary variable was making visible a class container at the
beginning of an array reference, causing the non-polymorphic array
reference to be evaluated in a polymorphic way.
The preceding commits have already fixed the PR #121185 test, so I
haven't found any addition to the testsuite that would reliably test
this change.
PR fortran/121185
gcc/fortran/ChangeLog:
* trans-expr.cc (gfc_trans_assignment_1): Use the same condition
to set the is_alloc_lhs flag and to decide to generate
reallocation code. Add explicit call to gfc_fix_class_refs
before evaluating the condition.
That revision introduced new variables to limit repeated subexpressions
in array descriptor references. The change added a walk along the
reference from child to parent, that selected subreferences worth
saving and applied the saving if the reference proved non-trivial
enough. Trivialness was defined in a comment as: only made of a DECL
and NOPs and COMPONENTs. But the case of a pointer derefence didn't
trigger the saving, so the code was also considering a dereference as if
it was trivial.
This change triggers the reference saving on pointer dereferences,
making the trivialness as defined by the code aligned with the comment.
This change is not strictly speaking a bug fix, but PR #121185 exhibited
wrong code examples where the lack of a variable hiding the polymorphic
leading part of a non-polymorphic array reference was causing the latter
to be evaluated in a polymorphic way.
PR fortran/121185
gcc/fortran/ChangeLog:
* trans-array.cc (set_factored_descriptor_value): Also trigger
the saving of the previously selected reference on encountering
an INDIRECT_REF. Extract the saving code...
(save_ref): ... here as a new function.
Mikael Morin [Sun, 27 Jul 2025 15:11:40 +0000 (17:11 +0200)]
fortran: Bound class container lookup after array descriptor [PR121185]
Don't look for a class container too far after an array descriptor.
This avoids generating a polymorphic array reference, using the virtual
table of a parent object, to access a non-polymorphic child having a
type unrelated to that of the parent.
PR fortran/121185
gcc/fortran/ChangeLog:
* trans-expr.cc (gfc_get_class_from_expr): Give up class
container lookup on the second COMPONENT_REF after an array
descriptor.
Pan Li [Fri, 25 Jul 2025 13:29:29 +0000 (21:29 +0800)]
RISC-V: Add test case for vaadd.vx combine polluting VXRM
Add asm check to make sure vx combine of vaadd.vx will not pollute
the vxrm.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/vx_vf/vx-fixed-vxrm-1-i16.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-fixed-vxrm-1-i32.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-fixed-vxrm-1-i64.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-fixed-vxrm-1-i8.c: New test.
Pan Li [Fri, 25 Jul 2025 13:22:47 +0000 (21:22 +0800)]
RISC-V: Combine vec_duplicate + vaadd.vv to vaadd.vx on GR2VR cost
This patch would like to combine the vec_duplicate + vaadd.vv to the
vaadd.vx. From example as below code. The related pattern will depend
on the cost of vec_duplicate from GR2VR. Then the late-combine will
take action if the cost of GR2VR is zero, and reject the combination
if the GR2VR cost is greater than zero.
Assume we have example code like below, GR2VR cost is 0.
* config/riscv/riscv-v.cc (expand_vx_binary_vxrm_vec_vec_dup):
Add new case UNSPEC_VAADD.
(expand_vx_binary_vxrm_vec_dup_vec): Ditto.
* config/riscv/riscv.cc (riscv_rtx_costs): Ditto.
* config/riscv/vector-iterators.md: Add new case UNSPEC_VAADD to
iterator.
Prevent mixups of IDENTIFIER_TRANSPARENT_ALIAS and IDENTIFIER_INTERNAL_P better [PR120855]
The assertion failure on ASM_OUTPUT_WEAKREF targets since my r16-1738
was caused because the 'TREE_CHAIN (id)' check in assemble_name_resolve
no longer implies that ID is a transparent alias, since internal
identifiers can have a TREE_CHAIN as well.
I still don't think it's possible for a transparent alias to be an
internal identifier in the sense added, so this patch simply constrains
the assertion better so that it doesn't fail spuriously. I also added a
couple of other assertions to help validate this assumption.
PR middle-end/120855
gcc/ChangeLog:
* cgraphunit.cc (symbol_table::compile): Assert a transparent
alias is not an internal identifier.
* symtab.cc (symbol_table::change_decl_assembler_name):
Likewise.
* varasm.cc (assemble_name_resolve): Check for
IDENTIFIER_TRANSPARENT_ALIAS instead of just TREE_CHAIN.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Jason Merrill <jason@redhat.com>
I noticed that trivial relocation didn't work in modules yet, and there
are a couple of other flags that seem potentially useful we weren't
streaming. This streams those flags and adds a comment to cp-tree.h in
the hope that people will remember about modules when adding more!
As a drive-by improvement, update gcc_assert with gcc_checking_assert in
lang_type_bools streaming.
gcc/cp/ChangeLog:
* cp-tree.h (struct lang_type): Add comment mentioning modules.
* module.cc (trees_out::lang_type_bools): Stream new flags, use
gcc_checking_assert.
(trees_in::lang_type_bools): Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/modules/class-11_a.H: New test.
* g++.dg/modules/class-11_b.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Patrick Palka <ppalka@redhat.com>
../../source-gcc/gcc/diagnostics/context.cc: In member function ‘bool diagnostics::context::diagnostic_impl(rich_location*, const diagnostics::metadata*, diagnostics::option_id, const char*, __va_list_tag (*)[1], diagnostics::kind)’:
../../source-gcc/gcc/diagnostics/context.cc:1514:15: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::permerror)
^
../../source-gcc/gcc/diagnostics/context.cc:1517:22: error: ‘kind’ is not a class, namespace, or enumeration
m_permissive ? kind::warning : kind::error);
^
../../source-gcc/gcc/diagnostics/context.cc:1517:38: error: ‘kind’ is not a class, namespace, or enumeration
m_permissive ? kind::warning : kind::error);
^
../../source-gcc/gcc/diagnostics/context.cc:1523:19: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::warning || kind == kind::pedwarn)
^
../../source-gcc/gcc/diagnostics/context.cc:1523:44: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::warning || kind == kind::pedwarn)
^
../../source-gcc/gcc/diagnostics/context.cc: In member function ‘bool diagnostics::context::diagnostic_n_impl(rich_location*, const diagnostics::metadata*, diagnostics::option_id, long unsigned int, const char*, const char*, __va_list_tag (*)[1], diagnostics::kind)’:
../../source-gcc/gcc/diagnostics/context.cc:1554:15: error: ‘kind’ is not a class, namespace, or enumeration
if (kind == kind::warning)
^
make[2]: *** [Makefile:1212: diagnostics/context.o] Error 1
gcc/
* diagnostics/context.cc (context::diagnostic_impl)
(context::diagnostic_n_impl): In presence of formal parameter
'kind', explicitly state 'diagnostics::' scope for 'kind' enum.
../../source-gcc/gcc/diagnostics/option-classifier.cc: In member function ‘diagnostics::kind diagnostics::option_classifier::update_effective_level_from_pragmas(diagnostics::diagnostic_info*) const’:
../../source-gcc/gcc/diagnostics/option-classifier.cc:212:20: error: ‘kind’ is not a class, namespace, or enumeration
if (kind != kind::unspecified)
^
make[2]: *** [Makefile:1212: diagnostics/option-classifier.o] Error 1
gcc/
* diagnostics/option-classifier.cc
(update_effective_level_from_pragmas): In presence of local
variable 'kind', explicitly state 'diagnostics::' scope for 'kind'
enum.
RISC-V: riscv-ext.def: Add allocated group IDs and group bit positions
The riscv-c-api-doc defines a group ID and and a bit position for some
extension. Most of them are set in riscv-ext.def, but some are missing
and one bit position (for Zilsd) is wrong.
This patch replaces the `BITMASK_NOT_YET_ALLOCATED` value for the actual
allocated value wherever possible and fixes the bit position for Zilsd.
Currently, we don't have any infrastructure to utilize the information
that is placed into riscv_ext_info_t::m_bitmask_group_id and
riscv_ext_info_t::m_bitmask_group_bit_pos. This also means we can't
test.
gcc/ChangeLog:
* config/riscv/riscv-ext.def: Add allocated group IDs and
group bit positions.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
David Malcolm [Fri, 25 Jul 2025 19:13:46 +0000 (15:13 -0400)]
Introduce lazily-created.h
No functional change intended.
gcc/ChangeLog:
* diagnostics/context.cc: Eliminate digraphs::lazy_digraph in
favor of lazily_created template.
* diagnostics/context.h: Likewise.
* diagnostics/digraphs.cc: Likewise, also digraphs::lazy_digraphs.
* diagnostics/digraphs.h: Likewise.
* diagnostics/html-sink.cc: Likewise.
* diagnostics/metadata.h: Likewise.
* diagnostics/sarif-sink.cc: Likewise.
* diagnostics/sink.h: Likewise.
* diagnostics/text-sink.h: Likewise.
* lazily-created.h: New file.
* libgdiagnostics.cc: Eliminate digraphs::lazy_digraph in
favor of lazily_created template.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_plugin_test_graphs.cc: Eliminate
digraphs::lazy_digraph and digraphs::lazy_digraphs in favor of
lazily_created template.
* gcc.dg/plugin/diagnostic_plugin_test_metadata.cc: Define
INCLUDE_VECTOR since diagnostics/metadata.h now requires it.
* gcc.dg/plugin/diagnostic_plugin_test_paths.cc: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:46 +0000 (15:13 -0400)]
diagnostics: avoid using "sink" for things that aren't a diagnostics::sink
No functional change intended.
gcc/ChangeLog:
* diagnostic.h: Use TextOrHtml rather than Sink for template
params.
* diagnostics/context.h: Likewise.
* diagnostics/selftest-context.cc: Use "html_or_text" rather than
"sink".
* diagnostics/source-printing.cc: Use TextOrHtml rather than Sink
for template params. Use "text_out" and "html_out" rather than
"sink".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/fortran/ChangeLog:
* cpp.cc: Update usage of "diagnostic_info" to explicitly refer to
"diagnostics::diagnostic_info".
* error.cc: Likewise.
gcc/jit/ChangeLog:
* dummy-frontend.cc: Update usage of "diagnostic_info" to
explicitly refer to "diagnostics::diagnostic_info".
gcc/m2/ChangeLog:
* gm2-gcc/m2linemap.cc: Update usage of "diagnostic_info" to
explicitly refer to "diagnostics::diagnostic_info".
* gm2-gcc/rtegraph.cc: Likewise.
gcc/rust/ChangeLog:
* resolve/rust-ice-finalizer.cc: Update usage of "diagnostic_info"
to explicitly refer to "diagnostics::diagnostic_info".
* resolve/rust-ice-finalizer.h: Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/plugin/show_template_tree_color_plugin.cc: Update usage
of "diagnostic_info" to explicitly refer to
"diagnostics::diagnostic_info".
* gcc.dg/plugin/diagnostic_group_plugin.cc: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Likewise.
* gcc.dg/plugin/location_overflow_plugin.cc: Likewise.
libcc1/ChangeLog:
* context.cc: Update usage of "diagnostic_info" to explicitly
refer to "diagnostics::diagnostic_info".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:44 +0000 (15:13 -0400)]
diagnostics: move file_cache from input.{cc,h} to diagnostics/file-cache.{cc,h}
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add diagnostics/file-cache.o.
* diagnostics/changes.cc: Update for file_cache and char_span
moving from input.h to diagnostics/file-cache.h and into the
"diagnostics::" namespace.
* diagnostics/context.cc: Likewise.
* diagnostics/diagnostics-selftests.cc: Likewise.
* diagnostics/diagnostics-selftests.h: Likewise.
* diagnostics/file-cache.cc: New file, based on the file_cache
and file_cache_slot material in input.cc.
* diagnostics/file-cache.h: Likewise for input.h.
* diagnostics/selftest-source-printing.h: Update for file_cache
and char_span moving from input.h to diagnostics/file-cache.h and
into the "diagnostics::" namespace.
* diagnostics/source-printing.cc: Likewise.
* final.cc: Likewise.
* gcc-rich-location.cc: Likewise.
* input.cc (default_charset_callback): Move to
diagnostics/file-cache.cc.
(file_cache::initialize_input_context): Likewise.
(class file_cache_slot): Likewise.
(file_cache::tune): Likewise.
(file_cache::lookup_file): Likewise.
(file_cache::forcibly_evict_file): Likewise.
(file_cache::missing_trailing_newline_p): Likewise.
(file_cache::add_buffered_content): Likewise.
(file_cache::evicted_cache_tab_entry): Likewise.
(file_cache::add_file): Likewise.
(file_cache::file_cache): Likewise.
(file_cache::dump): Likewise.
(file_cache::dump): Likewise.
(file_cache::lookup_or_add_file): Likewise.
(find_end_of_line): Likewise.
(file_cache::get_source_line): Likewise.
(check_line): Likewise.
(test_replacement): Likewise.
(test_reading_source_line): Likewise.
(test_reading_source_buffer): Likewise.
* input.h (class char_span): Move to diagnostics/file-cache.h and
into the "diagnostics::" namespace.
(class file_cache_slot): Likewise.
(class file_cache): Likewise.
* libgdiagnostics.cc: Update for file_cache and char_span moving
from input.h to diagnostics/file-cache.h and into the
"diagnostics::" namespace.
* selftest.cc: Likewise.
* selftest.h: Likewise.
* substring-locations.h: Likewise.
* toplev.cc: Likewise.
gcc/c-family/ChangeLog:
* c-format.cc: Update for file_cache and char_span moving from
input.h to diagnostics/file-cache.h and into the "diagnostics::"
namespace.
* c-indentation.cc: Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Update for
file_cache and char_span moving from input.h to
diagnostics/file-cache.h and into the "diagnostics::" namespace.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:44 +0000 (15:13 -0400)]
diagnostics: eliminate some redundant includes
No functional change intended.
gcc/ChangeLog:
* diagnostics/selftest-paths.cc: Don't include "demangle.h"
and "backtrace.h".
* diagnostics/source-printing.cc: Likewise.
* diagnostics/state-graphs.cc: Don't include "graphviz.h",
"xml.h", "xml-printer.h", or "intl.h".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:43 +0000 (15:13 -0400)]
diagnostics: move diagnostic.c to diagnostics/context.cc
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Replace diagnostic.o with
diagnostics/context.o.
gcc/c-family/ChangeLog:
* c-common.cc (c_family_tests): Add include of
"diagnostics/diagnostics-selftests.h". Replace
c_diagnostic_cc_tests with
diagnostics::selftest::context_cc_tests.
* c-common.h: Drop c_diagnostic_cc_tests decl.
gcc/ChangeLog:
* diagnostic.h (num_digits): Move to...
(diagnostics::num_digits): ...here.
(get_cwe_url): Move to...
(diagnostics::get_cwe_url): ...here.
(maybe_line_and_column): Move to...
(diagnostics::maybe_line_and_column): ...here.
* diagnostic.cc: Move to...
* diagnostics/context.cc: ...here.
* diagnostics/diagnostics-selftests.cc
(run_diagnostics_selftests): Add comment about context_cc_tests.
* diagnostics/diagnostics-selftests.h: Add context_cc_tests decl.
* diagnostics/sarif-sink.cc: Update for file rename.
* diagnostics/source-printing.cc: Update for num_digits moving to
diagnostics::num_digits.
* errors.cc: Update for file rename.
* input.cc: Update for num_digits moving to
diagnostics::num_digits.
libcpp/ChangeLog:
* charset.cc: Update comment for file rename.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:41 +0000 (15:13 -0400)]
Rename diagnostic-spec.{cc,h} to gcc-diagnostic-spec.{cc,h}
This has GCC-specific stuff in it (options and "GTY"), and so should
not be in the "diagnostics/" subdir, and should avoid a "diagnostics"
prefix in its name.
David Malcolm [Fri, 25 Jul 2025 19:13:41 +0000 (15:13 -0400)]
diagnostics: reorganize selftests
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS): Move diagnostics/lazy-paths.o to...
(OBJS-libcommon): ...here. Add
diagnostics/diagnostics-selftests.o.
* diagnostic.cc: Update for move of
selftest::test_diagnostic_context to
diagnostics::selftest::test_context.
* diagnostics/color.cc: Move selftests from selftest:: to
diagnostics::selftest::.
* diagnostics/diagnostics-selftests.cc: New file.
* diagnostics/diagnostics-selftests.h: New file.
* diagnostics/digraphs.cc: Move selftests from selftest:: to
diagnostics::selftest::.
* diagnostics/edit-context.cc: Likewise.
* diagnostics/html-sink.cc: Likewise.
* diagnostics/lazy-paths.cc: Likewise. Eliminate use of "tree"
by porting selftests from simple-diagnostic-path.h to
diagnostics/selftest-paths.h.
* diagnostics/output-spec.cc: Move selftests from selftest:: to
diagnostics::selftest::.
* diagnostics/paths-output.cc: Likewise.
* diagnostics/sarif-sink.cc: Likewise.
* diagnostics/selftest-context.cc: Move
selftest::test_diagnostic_context to
diagnostics::selftest::test_context.
* diagnostics/selftest-context.h: Likewise.
* diagnostics/selftest-logical-locations.cc: Move selftests from
selftest:: to diagnostics::logical_locations::selftest::.
* diagnostics/selftest-logical-locations.h: Move
selftest::logical_location_manager to
diagnostics::logical_locations::selftest::logical_location_manager.
* diagnostics/selftest-paths.cc: Move
selftest::test_diagnostic_path to
diagnostics::paths::selftest::test_path. Move
selftest::test_diagnostic_event to
diagnostics::paths::selftest::test_event.
* diagnostics/selftest-paths.h: Likewise, and move
selftest::test_diagnostic_thread to
diagnostics::paths::selftest::test_thread.
* diagnostics/selftest-source-printing.h: Move
selftest::diagnostic_show_locus_fixture to
diagnostics::selftest::source_printing_fixture.
* diagnostics/source-printing.cc: Move selftests from selftest::
to diagnostics::selftest:: and update for renames.
* diagnostics/state-graphs.cc: Likewise.
* selftest-run-tests.cc: Include
"diagnostics/diagnostics-selftests.h".
(selftest::run_tests): Replace invocation of the various diagnostics
selftests with a call to
diagnostics::selftest::run_diagnostics_selftests.
* selftest.h: Move decls of the various per-file diagnostics
invocation functions to diagnostics/diagnostics-selftests.h,
renaming due to diagostics prefix being implied by namespace.
gcc/c-family/ChangeLog:
* c-format.cc (test_type_mismatch_range_labels): Update for
move of selftest::test_diagnostic_context to
diagnostics::selftest::test_context.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/expensive_selftests_plugin.cc: Update for move of
selftest::test_diagnostic_context to
diagnostics::selftest::test_context.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:39 +0000 (15:13 -0400)]
diagnostics: move option_classifier to its own files
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Add
diagnostics/option-classifier.o.
* diagnostic.cc (diagnostics::option_classifier::init): Move to
diagnostics/option-classifier.cc.
(diagnostics::option_classifier::fini): Likewise.
(diagnostics::option_classifier::pch_save): Likewise.
(diagnostics::option_classifier::pch_restore): Likewise.
(diagnostics::option_classifier::push): Likewise.
(diagnostics::option_classifier::pop): Likewise.
(diagnostics::option_classifier::classify_diagnostic): Likewise.
(diagnostics::option_classifier::update_effective_level_from_pragmas):
Likewise.
* diagnostics/context.h: Include
"diagnostics/option-classifier.h".
(class option_classifier): Move to
diagnostics/option-classifier.h.
* diagnostics/option-classifier.cc: New file, based on material
from diagnostic.cc.
* diagnostics/option-classifier.h: New file, based on material
from diagnostics/context.h.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:39 +0000 (15:13 -0400)]
diagnostics: move diagnostic_context to diagnostics::context in its own header
No functional change intended.
gcc/ada/ChangeLog:
* gcc-interface/misc.cc: Update for diagnostic_context becoming
diagnostics::context.
gcc/analyzer/ChangeLog:
* program-point.cc: : Update for diagnostic_context becoming
diagnostics::context, and for diagnostic_source_print_policy
becoming diagnostics::source_print_policy.
David Malcolm [Fri, 25 Jul 2025 19:13:38 +0000 (15:13 -0400)]
diagnostics: move diagnostic_info to its own header
No functional change intended.
gcc/ChangeLog:
* diagnostic.h (struct diagnostic_info): Move to
diagnostics/diagnostic-info.h as diagnostics::diagnostic_info.
Add typedef bringing it back into root namespace, for now.
* diagnostics/diagnostic-info.h: New file, based on the above.
* langhooks-def.h: Update for diagnostic_info moving into
namespace diagnostics.
* langhooks.h: Likewise.
gcc/jit/ChangeLog:
* jit-playback.cc: Update for diagnostic_info moving into
namespace diagnostics.
* jit-playback.h: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:37 +0000 (15:13 -0400)]
diagnostics: move/rename output formats to diagnostics as "sinks"
Within gcc/
move diagnostic-buffer.h to diagnostics/buffering.h
move diagnostic-format-html.cc to diagnostics/html-sink.cc
move diagnostic-format-html.h to diagnostics/html-sink.h
move diagnostic-format-sarif.cc to diagnostics/sarif-sink.cc
move diagnostic-format-sarif.h to diagnostics/sarif-sink.h
move diagnostic-format.h to diagnostics/sink.h
move diagnostic-format-text.cc to diagnostics/text-sink.cc
move diagnostic-format-text.h to diagnostics/text-sink.h
renaming various types including:
Old name: New name:
diagnostic_output_format diagnostics::sink
diagnostic_buffer diagnostics::buffer
diagnostic_per_format_buffer diagnostics::per_sink_buffer
diagnostic_text_output_format diagnostics::text_sink
sarif_output_format diagnostics::sarif_sink
diagnostic_sarif_format_buffer diagnostics::sarif_sink_buffer
html_output_format diagnostics::html_sink
diagnostic_html_format_buffer diagnostics::html_sink_buffer
gcc/c-family/ChangeLog:
* c-opts.cc: Update for move of diagnostics output formats into
namespace "diagnostics" as "sinks".
gcc/cp/ChangeLog:
* cp-tree.h: Update for move of diagnostics output formats into
namespace "diagnostics" as "sinks".
* error.cc: Likewise.
gcc/fortran/ChangeLog:
* error.cc: Update for move of diagnostics output formats into
namespace "diagnostics" as "sinks".
* gfortran.h: Likewise.
gcc/jit/ChangeLog:
* dummy-frontend.cc: Update for move of diagnostics output formats
into namespace "diagnostics" as "sinks".
gcc/rust/ChangeLog:
* resolve/rust-ice-finalizer.cc: Update for move of diagnostics
output formats into namespace "diagnostics" as "sinks".
* resolve/rust-ice-finalizer.h: Likewise.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_group_plugin.cc: Update for move of
diagnostics output formats into namespace "diagnostics" as
"sinks".
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.cc: Likewise.
* gcc.dg/plugin/location_overflow_plugin.cc: Likewise.
libcc1/ChangeLog:
* context.cc: Update for move of diagnostics output formats into
namespace "diagnostics" as "sinks".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_gil_plugin.cc: Update #include for
"diagnostic-path.h" moving to "diagnostics/paths.h",
diagnostic_thread_id_t to diagnostics::paths::thread_id_t,
diagnostic_event_id_t to diagnostics::paths::event_id_t,
diagnostic_path to diagnostics::paths::path, and
diagnostic_thread to diagnostics::paths::thread, and
diagnostic_event to diagnostics::paths::event.
* gcc.dg/plugin/diagnostic_plugin_test_paths.cc: Likewise.
* lib/sarif.py (get_state_graph): Update property prefix for
threadFlowLocations from "gcc/diagnostic_event/" to
"gcc/diagnostics/paths/event/".
* gcc.dg/sarif-output/include-chain-2.h: Update comment.
libcpp/ChangeLog:
* include/rich-location.h: Replace diagnostic_path with
diagnostics::paths::path.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:35 +0000 (15:13 -0400)]
diagnostics: move edit_context to namespace/dir "diagnostics"
No functional change intended.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Replace edit-context.o with
diagnostics/edit-context.o.
* diagnostic-format-html.cc: Update #include for move
of edit-context.h to diagnostics subdir.
* diagnostic.cc: Likewise. Update for move of edit_context to
diagnostics::edit_context.
* diagnostic.h: Likewise.
* edit-context.cc: Move to...
* diagnostics/edit-context.cc: ...here. Update #include for move
of edit-context.h to diagnostics subdir. Move all code
within namespace diagnostics.
* edit-context.h: Move to...
* diagnostics/edit-context.h: ...here, updating header guard.
Move all code within namespace diagnostics.
* libgdiagnostics.cc: Update #include for move of edit-context.h
to diagnostics subdir. Update for move of edit_context
to diagnostics::edit_context.
* toplev.cc: Update #include for move of edit-context.h
to diagnostics subdir.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/expensive_selftests_plugin.cc: Update #include for
move of edit-context.h to diagnostics subdir. Update
for move of edit_context to diagnostics::edit_context.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:35 +0000 (15:13 -0400)]
diagnostics: move diagnostic_diagram to diagnostics::diagram
No functional change intended.
gcc/analyzer/ChangeLog:
* bounds-checking.cc: Update #include for move of
"diagnostic-diagram.h" to "diagnostics/diagram.h". Update for
move of diagnostic_diagram to diagnostics::diagram.
gcc/ChangeLog:
* diagnostic-format-html.cc: Update for move of diagnostic_diagram
to diagnostics::diagram.
* diagnostic-format-sarif.cc: Update #include for move of
"diagnostic-diagram.h" to "diagnostics/diagram.h". Update for move
of diagnostic_diagram to diagnostics::diagram.
* diagnostic-format-text.cc: Likewise.
* diagnostic-format-text.h: Update for move of diagnostic_diagram
to diagnostics::diagram.
* diagnostic-format.h: Likewise.
* diagnostic.cc: Update #include for move of
"diagnostic-diagram.h" to "diagnostics/diagram.h". Update for move
of diagnostic_diagram to diagnostics::diagram.
* diagnostic.h: Update for move of diagnostic_diagram to
diagnostics::diagram.
* diagnostic-diagram.h: Move to...
* diagnostics/diagram.h: ...here.
(class diagnostic_diagram): Convert to...
(class diagnostics::diagram): ...this.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_plugin_test_text_art.cc: Update
#include for move of "diagnostic-diagram.h" to
"diagnostics/diagram.h". Update for move of diagnostic_diagram to
diagnostics::diagram.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/analyzer/ChangeLog:
* diagnostic-manager.cc: Update for move of diagnostic_metadata to
diagnostics::metadata.
* kf.cc: Likewise.
* pending-diagnostic.h: Likewise; also, update #include for move
of "diagnostic-metadata.h" to "diagnostics/metadata.h".
gcc/ChangeLog:
* diagnostic-core.h: Update for move of diagnostic_metadata to
diagnostics::metadata.
* diagnostic-format-html.cc: Likewise; also, update #include for
move of "diagnostic-metadata.h" to "diagnostics/metadata.h".
* diagnostic-format-sarif.cc: Likewise.
* diagnostic-format-text.cc: Likewise.
* diagnostic-global-context.cc: Likewise.
* diagnostic.cc: Likewise.
* diagnostic.h: Likewise.
* diagnostic-metadata.h: Move to...
* diagnostics/metadata.h: ...here, updating header guard.
(class diagnostic_metadata): Move to...
(class diagnostics::metadata): ...here. Drop redundant
"diagnostics::" qualifiers.
* libgdiagnostics.cc: : Update #include for move of
"diagnostic-metadata.h" to "diagnostics/metadata.h", and update
for move of diagnostic_metadata to diagnostics::metadata.
* selftest-diagnostic.cc: Update for move of diagnostic_metadata
to diagnostics::metadata.
* selftest-diagnostic.h: Likewise.
gcc/rust/ChangeLog:
* rust-diagnostics.cc: Update #include for move of
"diagnostic-metadata.h" to "diagnostics/metadata.h", and update
for move of diagnostic_metadata to diagnostics::metadata.
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/analyzer_cpython_plugin.cc: : Update #include for
move of "diagnostic-metadata.h" to "diagnostics/metadata.h"
* gcc.dg/plugin/analyzer_kernel_plugin.cc: Likewise.
* gcc.dg/plugin/analyzer_known_fns_plugin.cc: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_graphs.cc: Likewise. Also
update for move of diagnostic_metadata to diagnostics::metadata.
* gcc.dg/plugin/diagnostic_plugin_test_metadata.cc: Likewise.
* gcc.dg/plugin/diagnostic_plugin_test_paths.cc: Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:34 +0000 (15:13 -0400)]
diagnostics: move logical locations into "diagnostics"
This patch moves gcc/logical-locations.h into gcc/diagnostics
and moves the classes into "namespace diagnostics", to better
indicate that this is part of the shared diagnostics code.
The type "logical_location" becomes diagnostics::logical_locations::key,
the class logical_location_manager becomes
class diagnostics::logical_locations::manager, and the enum
enum logical_location_kind becomes
enum diagnostics::logical_locations::kind.
Note that tree-logical-locations.{h,cc} are *not* part
of "namespace diagnostics", as they use tree.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Replace
selftest-logical-location.o with
diagnostics/selftest-logical-locations.o.
* diagnostic-client-data-hooks.h: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, and of logical_location
to diagnostics::logical_locations::key.
* diagnostic-format-html.cc: Add "using namespace diagnostics;",
and drop now-redundant "diagnostics::" prefixes.
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, of logical_location to
diagnostics::logical_locations::key, and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
* diagnostic-format-sarif.cc: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h". Add
"using namespace diagnostics;", and drop now-redundant
"diagnostics::" prefixes.
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, of logical_location to
diagnostics::logical_locations::key, and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
* diagnostic-format-sarif.h: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location to
diagnostics::logical_locations::key.
* diagnostic-path-output.cc: Add "using namespace diagnostics;".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, and
of logical_location to diagnostics::logical_locations::key,
* diagnostic-path.cc: Add "using namespace diagnostics;".
Update for conversion of logical_location to
diagnostics::logical_locations::key.
* diagnostic-path.h: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, and of logical_location
to diagnostics::logical_locations::key,
* diagnostic.cc: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
* diagnostic.h: Reorganize forward decls.
(class logical_location_manager): Replace this forward decl
with...
(class diagnostics::logical_locations::manager): ...this.
(diagnostic_context::get_logical_location_manager): Update
return type.
* diagnostics/digraphs.h: : Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location to
diagnostics::logical_locations::key.
* logical-location.h: Move to...
* diagnostics/logical-locations.h: ...here.
(enum class logical_location_kind): Convert to...
(enum class diagnostics::logical_locations::kind): ... this.
(class logical_location_manager::key): Convert to...
(class diagnostics::logical_locations::key): ... this.
(class logical_location_manager): Convert to...
(class diagnostics::logical_locations::manager): ... this.
(logical_location): Drop this typedef in favor of
diagnostics::logical_locations::key.
* selftest-logical-location.cc: Move to...
* diagnostics/selftest-logical-locations.cc: ...here.
Update #include for move of "selftest-logical-location.h" to
"diagnostics/selftest-logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, of logical_location to
diagnostics::logical_locations::key, and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
(selftest_logical_location_cc_tests): Rename to...
(diagnostics_selftest_logical_locations_cc_tests): ...this.
* selftest-logical-location.h: Move to...
* diagnostics/selftest-logical-locations.h: ...here, updating
include guard.
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, of logical_location to
diagnostics::logical_locations::key, and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
* diagnostics/state-graphs-to-dot.cc: Add
"using namespace diagnostics;" and drop now-redundant
"diagnostics::" prefixes.
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager.
* diagnostics/state-graphs.h: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager,
of logical_location to diagnostics::logical_locations::key.
* libgdiagnostics.cc: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, and of logical_location
to diagnostics::logical_locations::key.
* selftest-diagnostic-path.cc: Update for conversion of
logical_location to diagnostics::logical_locations::key.
* selftest-diagnostic-path.h: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location to
diagnostics::logical_locations::key.
* selftest-run-tests.cc (selftest::run_tests): Update for
renaming of selftest_logical_location_cc_tests to
diagnostics_selftest_logical_locations_cc_tests.
* selftest.h: Likewise.
* simple-diagnostic-path.h: Update for conversion of
logical_location to diagnostics::logical_locations::key.
* tree-diagnostic-client-data-hooks.cc: Update for conversion of
logical_location_manager to
diagnostics::logical_locations::manager, and of logical_location
to diagnostics::logical_locations::key.
* tree-logical-location.cc: Update for conversions.
Update for conversion of logical_location to
diagnostics::logical_locations::key, and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
* tree-logical-location.h: Update #include for move of
"logical-location.h" to "diagnostics/logical-locations.h".
Update for conversion of logical_location_manager to
diagnostics::logical_locations::manager, of logical_location
to diagnostics::logical_locations::key, and of
enum logical_location_kind to
enum diagnostics::logical_locations::kind.
gcc/analyzer/ChangeLog:
* checker-event.h (checker_event::get_logical_location): Update
for conversion of logical_location to
diagnostics::logical_locations::key.
(checker_event::m_logical_loc): Likewise.
* diagnostic-manager.cc
(diagnostic_manager::get_logical_location_manager): Likewise.
* diagnostic-manager.h
(diagnostic_manager::get_logical_location_manager): Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
David Malcolm [Fri, 25 Jul 2025 19:13:34 +0000 (15:13 -0400)]
diagnostics: introduce a "gcc/diagnostics" subdirectory
The "gcc" subdirectory of our source tree currently contains a total
of almost 1000 .cc and .h files, enough to hit rate-limiting in some
git web UIs, and obscuring the logical relationships between subsystems.
In r16-2211-ga5d9debedd2f46 I started introducing a
"namespace diagnostics" so it makes sense to move such code
into a new "gcc/diagnostics" subdirectory.
My intent is for the "diagnostics" namespace/directory to contain
shared parts of the diagnostics code that are in libcommon, in
particular which don't have knowledge of trees.
This patch begins moving of the existing code within
"namespace diagnostics" into a new "gcc/diagnostics" subdirectory.
gcc/ChangeLog:
* Makefile.in (OBJS-libcommon): Rename diagnostic-digraphs.o to
diagnostics/digraphs.o. Rename diagnostic-state-graphs.o to
diagnostics/state-graphs.o. Rename diagnostic-state-to-dot.o to
diagnostics/state-graphs-to-dot.o.
(PLUGIN_HEADERS): Add $(srcdir)/diagnostics/*.h.
(install-plugin:): Likewise.
* configure: Regenerate.
* configure.ac (gccdepdir): Add "diagnostics" to directories.
* diagnostic-format-html.cc: Update #includes for move of
"diagnostic-digraphs.h" to "diagnostics/digraphs.h" and of
move of "diagnostic-state-graphs.h" to
"diagnostics/state-graphs.h".
* diagnostic-format-sarif.cc: Likewise.
* diagnostic-path.cc: Likewise for state-graphs.h
* diagnostic-digraphs.cc: Move...
* diagnostics/digraphs.cc: ...to here. Update #include
for renaming of digraphs.h.
(selftest::diagnostic_digraphs_cc_tests): Rename to...
(selftest::diagnostics_digraphs_cc_tests): ...this.
* diagnostic-digraphs.h: Move...
* diagnostics/digraphs.h: ...to here, updating header guard.
* diagnostic-state-to-dot.cc: Move...
* diagnostics/state-graphs-to-dot.cc: ...to here. Update #include
of state-graphs.h.
* diagnostic-state-graphs.cc: Move...
* diagnostics/state-graphs.cc: ...to here. Update #include
of state-graphs.h.
(selftest::diagnostic_state_graphs_cc_tests): Rename...
(selftest::diagnostics_state_graphs_cc_tests): ...to this.
* diagnostic-state-graphs.h: Move...
* diagnostics/state-graphs.h: ...to here, updating header guard.
* libgdiagnostics.cc: Update #includes for move of
"diagnostic-digraphs.h" to "diagnostics/digraphs.h" and of
move of "diagnostic-state-graphs.h" to
"diagnostics/state-graphs.h".
* selftest-run-tests.cc (selftest::run_tests): Update for
function renamings that reflect file renamings.
* selftest.h (selftest::diagnostic_digraphs_cc_tests): Rename
to...
(selftest::diagnostics_digraphs_cc_tests): ...this.
(selftest::diagnostic_state_graphs_cc_tests): Rename...
(selftest::diagnostics_state_graphs_cc_tests): ...to this.
gcc/analyzer/ChangeLog:
* ana-state-to-diagnostic-state.cc: Update #include for move of
"diagnostic-state-graphs.h" to "diagnostics/state-graphs.h".
* ana-state-to-diagnostic-state.h: Likewise.
* checker-event.cc: Likewise.
* checker-event.h: Update #include for move of
"diagnostic-digraphs.h" to "diagnostics/digraphs.h".
* program-state.cc: : Update #include for move of
"diagnostic-state-graphs.h" to "diagnostics/state-graphs.h".
gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_plugin_test_graphs.cc: Update #include
for move of "diagnostic-digraphs.h" to "diagnostics/digraphs.h".
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Patrick Palka [Fri, 25 Jul 2025 14:55:35 +0000 (10:55 -0400)]
c++: more name lookup for non-dep rewritten cmp ops
As a follow-up to r16-2448-g7590c14b53a762, this patch attempts to teach
build_min_non_dep_op_overload how to rebuild all rewritten comparison
operators, not just != -> == ones, so that we don't incorrectly repeat
the unqualified name lookup at instantiation time.
Note that changes how we mangle such comparison ops, in a way that is
overall more consistent with how we've been mangling non-rewritten
operators, see PR c++/121239.
gcc/cp/ChangeLog:
* call.cc (build_new_op): If the selected candidate is
rewritten, communicate the LOOKUP_REWRITTEN/REVERSED flags to
the caller via the 'overload' out-parameter, and stop clearing
'*overload' in that case.
* tree.cc (build_min_non_dep_op_overload): Handle rebuilding all
C++20 rewritten comparison operator expressions.
gcc/testsuite/ChangeLog:
* g++.dg/lookup/operator-8.C: Remove XFAILs and properly
suppress all -Wunused-result warnings.
Richard Biener [Fri, 25 Jul 2025 13:03:36 +0000 (15:03 +0200)]
Remove now redundant vect_get_vec_defs overload
The following removes the vect_get_vec_defs overload receiving
a vector type to be used for the possibly constant/invariant
operand. This was used for non-SLP code generation as there
constants/invariants are generated on the fly. It also elides
the stmt_vec_info and ncopies argument which are not required
for SLP.
* tree-vectorizer.h (vect_get_vec_defs): Remove overload
with operand vector type. Remove stmt_vec_info and
ncopies argument.
* tree-vect-stmts.cc (vect_get_vec_defs): Likewise.
(vectorizable_conversion): Adjust by not passing in
vector types, stmt_vec_info and ncopies.
(vectorizable_bswap): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_scan_store): Likewise.
(vectorizable_store): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_comparison_1): Likewise.
* tree-vect-loop.cc (vect_transform_reduction): Likewise.
(vect_transform_lc_phi): Likewise.
Richard Biener [Fri, 25 Jul 2025 12:04:50 +0000 (14:04 +0200)]
Tidy vect_is_simple_use API for SLP only
The following removes one vect_is_simple_use overload that shouldn't
be used anymore after removing the single remaining use related
to gather handling in get_group_load_store_type. It also removes
the dual-purpose of the overload getting both SLP node and
stmt_vec_info and removes the latter argument.
That leaves us with a SLP overload handling vector code and the
stmt_info overload handling scalar code. In theory the former
is only convenience and it should never fail given SLP build
checks the constraint already, but there's the 'op' argument
we have to get rid of first.
* tree-vectorizer.h (vect_is_simple_use): Remove stmt-info
with vectype output overload and remove stmt-info argument
from SLP based API.
* tree-vect-loop.cc (vectorizable_lane_reducing): Remove
unused def_stmt_info output argument to vect_is_simple_use.
Adjust.
* tree-vect-stmts.cc (get_group_load_store_type): Get
the gather/scatter offset vector type from the SLP child.
(vect_check_scalar_mask): Remove stmt_info argument. Adjust.
(vect_check_store_rhs): Likewise.
(vectorizable_call): Likewise.
(vectorizable_simd_clone_call): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_load): Likewise.
(vect_is_simple_cond): Remove stmt_info argument. Adjust.
(vectorizable_condition): Likewise.
(vectorizable_comparison_1): Likewise.
(vectorizable_store): Likewise.
(vect_is_simple_use): Remove overload and non-SLP path.
Richard Biener [Fri, 25 Jul 2025 11:38:48 +0000 (13:38 +0200)]
Fix and simplify vect_model_simple_cost
There's no longer any call without SLP node so we don't need dts.
I also figured based on the callers that some expect to cost
more than one stmt but still N times so this changes what we cost.
* tree-vect-stmts.cc (vect_model_simple_cost): Removed code
when no SLP node is passed, remove then unused dt and ndts
parameters and fix the number of vector stmts calculation.
(vectorizable_call): Adjust.
(vectorizable_simd_clone_call): Likewise.
(vectorizable_conversion): Likewise.
(vectorizable_assignment): Likewise.
(vectorizable_shift): Likewise.
(vectorizable_operation): Likewise.
(vectorizable_condition): Likewise.
(vectorizable_comparison_1): Likewise.
Robin Dapp [Mon, 21 Jul 2025 14:00:51 +0000 (16:00 +0200)]
RISC-V: Prepare dynamic LMUL heuristic for SLP.
This patch prepares the dynamic LMUL vector costing to use the coming
SLP_TREE_TYPE instead of the (to-be-removed) STMT_VINFO_TYPE.
Even though the whole approach should be reviewed and adjusted at some
point, the patch chooses the path of least resistance and uses a hash
map for the stmt_info -> slp node relationship. A node is mapped to the
accompanying stmt_info during add_stmt_cost. In finish_cost we go
through all statements as before, and obtain the corresponding slp nodes
as well as their types.
This allows us to operate largely as before. We don't yet do the switch
over from STMT_VINFO_TYPE to SLP_TREE_TYPE, though but only take care
of the necessary refactoring upfront.
Regtested on rv64gcv_zvl512b with -mrvv-max-lmul=dynamic. There are a
few regressions but nothing worse than what we already have. I'd rather
accept these now and take it as an incentive to work on the heuristic
later than block the SLP work until it is fixed.
gcc/ChangeLog:
* config/riscv/riscv-vector-costs.cc (get_live_range):
Move compute_local_program_points to cost class.
(variable_vectorized_p): Add slp node parameter.
(need_additional_vector_vars_p): Move from here...
(costs::need_additional_vector_vars_p): ... to here and add slp
parameter.
(compute_estimated_lmul): Move update_local_live_ranges to cost
class.
(has_unexpected_spills_p): Move from here...
(costs::has_unexpected_spills_p): ... to here.
(costs::record_lmul_spills): New function.
(costs::add_stmt_cost): Add stmt_info, slp mapping.
(costs::finish_cost): Analyze loop.
* config/riscv/riscv-vector-costs.h: Move declarations to class.
libstdc++: doc: Rectify referencing of non-existent type
The unordered_map header incorrectly refers to a non-existent template parameter
_Value in default template argument descriptions. They should refer to _Key instead.
This patch fixes these descriptions to match the actual template parameters.
libstdc++-v3/ChangeLog:
* include/bits/unordered_map.h: Rectify referencing of
non-existent type.
Richard Biener [Fri, 25 Jul 2025 10:34:44 +0000 (12:34 +0200)]
Reduce the number of STMT_VINFO_VECTYPE uses
The following adjusts uses of STMT_VINFO_VECTYPE to look elsewhere
where obvious.
* tree-vect-loop.cc (vect_analyze_loop_2): Get vectype
from the SLP node.
(vectorize_fold_left_reduction): Likewise.
(vect_transform_reduction): Likewise.
(vect_transform_cycle_phi): Likewise.
(vect_transform_lc_phi): Likewise.
* tree-vect-slp.cc (vect_analyze_slp): Likewise.
* tree-vect-stmts.cc (vect_truncate_gather_scatter_offset):
Pass in vectype and use that.
(vect_use_strided_gather_scatters_p): Likewise.
(get_group_load_store_type): Adjust.
(vect_check_scalar_mask): We always have a SLP node.
Use vectype from the SLP node.
(vect_check_store_rhs): Likewise.
(vect_build_one_gather_load_call): Pass in the vector type
and use that.
(vect_get_strided_load_store_ops): Likewise.
(vectorizable_store): Adjust.
(vectorizable_load): Use the vector type from the SLP node
and adjust.
The current implementation was returning the result of the g_r_o_o_a_f
call independently of the return expressions for 'normal' cases.
This prevents the NVRO that we need to guarantee copy elision for the
ramp return values - when these are initialised from a temporary of the
same type.
The solution here reorders the code so that the regular return expression
appears before the allocation-failed case. Ensure that the g_r_o and
associated code appears in a distinct scope. These steps are to meet the
constaints of NRV.
PR c++/121219
gcc/cp/ChangeLog:
* coroutines.cc
(cp_coroutine_transform::build_ramp_function): Reorder the return
expressions for the 'normal' and 'allocation failed' cases so that
NRV constraints are met.
There was once a RISC-V extension draft ("N"), which introduced
user-level interrupts. However, it was never ratified and the
specification draft has been removed from the RISC-V ISA manual
in commit `b6cade07034` with the comment "it'll likely need to
be redesigned".
Support for a N extension never made it to GCC, but we support
fuction attributes for user-level interrupt handlers that use
the URET instruction.
The "user" interrupt attribute was documented in the RISC-V C API,
but has been removed in PR #106 in May 2025 (driven by LLVM devs/
maintainers and ack'ed by at least one GCC maintainer).
Richard Biener [Fri, 25 Jul 2025 07:50:18 +0000 (09:50 +0200)]
Remove STMT_VINFO_VEC_STMTS
The following removes the last uses of STMT_VINFO_VEC_STMTS and
the vector itself. Vector stmts are recorded in SLP nodes now.
The last use is a bit strange - it was introduced by
Richard S. in r8-6064-ga57776a1136962 and affects only
power7 and below (the re-align optimized load path). The
check should have never been true since vect_vfa_access_size
is only ever invoked before stmt transform. I have done
the "conservative" change of making it always true now
(so the code is now entered). I can as well remove it, but
I wonder if you remember anything about this ...
* tree-vectorizer.h (_stmt_vec_info::vec_stmts): Remove.
(STMT_VINFO_VEC_STMTS): Likewise.
* tree-vectorizer.cc (vec_info::new_stmt_vec_info): Do not
initialize it.
(vec_info::free_stmt_vec_info): Nor free it.
* tree-vect-data-refs.cc (vect_vfa_access_size): Remove
check on STMT_VINFO_VEC_STMTS.
Richard Biener [Fri, 25 Jul 2025 07:19:47 +0000 (09:19 +0200)]
Remove vect_get_vec_defs_for_operand
This removes vect_get_vec_defs_for_operand and its remaining uses.
It also removes some remaining non-SLP paths in preparation to
elide STMT_VINFO_VEC_STMTS.
* tree-vectorizer.h (vect_get_vec_defs_for_operand): Remove.
* tree-vect-stmts.cc (vect_get_vec_defs_for_operand): Likewise.
(vect_get_vec_defs): Remove non-SLP path.
(check_load_store_for_partial_vectors): We always have an
SLP node.
(vect_check_store_rhs): Likewise.
(vect_get_gather_scatter_ops): Likewise.
(vect_create_vectorized_demotion_stmts): Likewise.
(vectorizable_store): Adjust.
(vectorizable_load): Likewise.
Richard Biener [Fri, 25 Jul 2025 07:04:49 +0000 (09:04 +0200)]
Remove dead code from vectorizable_store
There's dead code in the else block of a if (!costing_p) block,
after trivial pruning only setting of 'op' remains but that has
no further uses downstream. I found this looking for remaining
(must-be-dead) uses of vect_get_vec_defs_for_operand.
* tree-vect-stmts.cc (vectorizable_store): Remove trivially
dead code.
MI300 requires some additional s_nop to be added between some instructions.
* As 'v_readlane' and 'v_writelane' have to be distinguished, the
'laneselect' attribute was changed from no/yes to no/read/write.
* Add some missing 'laneselect' attributes for v_(read,write)lane.
* Replace 'delayeduse' by 'flatmemaccess' which is more explicit,
especially as some uses have to destinguished more details.
(Alongside, one off-by-two delayeduse has been fixed.)
On the other hand, RDNA 2, 3, and 3.5 do not require any added s_nop;
thus, there is no need to walk the instructions for them to insert
pointless S_NOP. (RDNA4 (not yet in GCC) requires it in a few cases.)
gcc/ChangeLog:
* config/gcn/gcn-opts.h (TARGET_NO_MANUAL_NOPS,
TARGET_CDNA3_NOPS): Define.
* config/gcn/gcn.md (define_attr "laneselect): Change 'yes' to
'read' and 'write'.
(define_attr "flatmemaccess"): Add with values store, storex34,
load, atomic, atomicwait, cmpswapx2, and no. Replacing ...
(define_attr "delayeduse"): Remove.
(define_attr "transop"): Add with values yes and no.
(various insns): Update 'laneselect', add flatmemaccess and transop,
remove delayeduse; fixing an issue for s_load_dwordx4 vs.
flat_store_dwordx4 related to delayeduse (now: flatmemaccess).
* config/gcn/gcn-valu.md: Update laneselect attribute and add
flatmemaccess.
* config/gcn/gcn.cc (gcn_cmpx_insn_p): New.
(gcn_md_reorg): Update for MI300 to add additional s_nop.
Skip s_nop-insertion part for RDNA{2,3}; add "VALU writes EXEC
followed by VALU DPP" unconditionally for CDNA2/CDNA3/GCN5.
Tests gcc.dg/asm-hard-reg-error-{4,5}.c ICE on sparc*-sun-solaris2.11
since in tm-preds.h we end up with
#define CONSTRAINT_LEN(c_,s_) 1
and, therefore, do not parse hard register constraints correctly.
Hard register constraints are non-single character constraints and
require insn_constraint_len() in order to determine the length.
In write_tm_preds_h() from genpreds.cc, previously variable
constraint_max_namelen was used in order to decide whether we have
single or non-single character constraints. The distinction shouldn't
be done anymore and we always must call into insn_constraint_len().
While being on it, remove guard constraint_max_namelen>0 since we always
have some constraints coming from common.md. This leaves
constraint_max_namelen without users so remove it.
gcc/ChangeLog:
PR middle-end/121214
* genpreds.cc (constraint_max_namelen): Delete.
(write_tm_preds_h): Always write insn_constraint_len() and
define CONSTRAINT_LEN to it, i.e., remove guard
constraint_max_namelen>1. Remove outer guard
constraint_max_namelen>0 and re-indent.
(write_insn_preds_c): Remove guard
constraint_max_namelen>0 and re-indent.
ada: ppc-vx6: pthread clocks and headers for decls
VxWorks 6 lacks pthread_condattr_setclock, so define CLOCK_RT_Ada to
CLOCK_REALTIME to use the dummy definition of
__gnat_pthread_condattr_setup in libgnarl/thread.c.
socket.c and sysdep.c use FD_ZERO, that relies on bzero on VxWorks 6.
We need to include strings.h to get a declaration for bzero, but don't
require strings.h to exist, since it's nonstandard.
gcc/ada/ChangeLog:
* s-oscons-tmplt.c (CLOCK_RT_Ada) [__vxworks]: Define to
CLOCK_REALTIME on VxWorks6.
* gsocket.h [__vxworks]: Include strings.h if available.
* sysdep.c [__vxworks]: Likewise.
Steve Baird [Wed, 16 Jul 2025 20:37:44 +0000 (13:37 -0700)]
ada: Follow up fixes.
Two follow-up fixes for the previous change for this issue.
gcc/ada/ChangeLog:
* exp_ch6.adb (Apply_Access_Discrims_Accessibility_Check): Do
nothing and simply return if either Ada_Version <= Ada_95 or if
the function being returned from lacks the extra formal parameter
needed to perform the check (typically because the result is
tagged).
Bob Duff [Wed, 16 Jul 2025 14:29:01 +0000 (10:29 -0400)]
ada: Bug in Indefinite_Holders instance passed to formal package
Fix bug when an instance of Indefinite_Holders with a class-wide type is
passed as a generic formal package; Program_Error was raised when
dealing with the implicit "=" function.
The fix is to disable legality checks in formal packages when the
entity is an E_Subprogram_Body, because these are implicitly generated
for class-wide predefined functions when passed to generics.
gcc/ada/ChangeLog:
* sem_ch12.adb (Check_Formal_Package_Instance):
Do nothing in case of E_Subprogram_Body.
A previous patch changed the mechanism of early usage detection for
discriminants but failed to update a couple of surrounding comments
accordingly. This patch fixes this omission.
ada: Fix regression of finalization primitive selection
A recent patch introduced a new flag to mark the types for which looking
up finalization primitives needs special handling. But there was one
place in Build_Derived_Record_Type where the flag was not set when it
should, which introduced a regression in some cases.
This patch adds the missing setting of the flag.
gcc/ada/ChangeLog:
* sem_ch3.adb (Build_Derived_Record_Type): Set flag appropriately.
Eric Botcazou [Mon, 14 Jul 2025 22:37:19 +0000 (00:37 +0200)]
ada: Fix inconsistencies in conversion functions from Duration
The 3 units Ada.Calendar, GNAT.Calendar and GNAT.Sockets contain conversion
functions from the Duration fixed-point type that implement the same idiom
but with some inconsistencies:
* GNAT.Sockets only handles Timeval_Duration, i.e. positive Duration, and
is satisfactory, although a simpler implementation can be written,
* GNAT.Calendar mishandles negative Duration values, as well as integral
Duration values,
* Ada.Calendar mishandles negative Duration values, and rounds nanoseconds
instead of truncating them.
gcc/ada/ChangeLog:
* libgnat/a-calend.adb (To_Struct_Timespec_64): Deal with negative
Duration values and truncate the nanoseconds too.
* libgnat/g-calend.adb (timeval_to_duration): Unsuppress overflow
checks.
(duration_to_timeval): Likewise. Deal with negative Duration values
as well as integral Duration values.
* libgnat/g-socket.adb (To_Timeval): Simplify the implementation.
RISC-V: Add support for resumable non-maskable interrupt (RNMI) handlers
The Smrnmi extension introduces the nmret instruction to return from RNMI
handlers. We already have basic Smrnmi support. This patch introduces
support for the nmret instruction and the ability to set the function
attribute `__attribute__ ((interrupt ("rnmi")))` to let the compiler
generate RNMI handlers.
The attribute name is proposed in a PR for the RISC C API and approved
by LLVM maintainers:
https://github.com/riscv-non-isa/riscv-c-api-doc/pull/116
Nathaniel Shead [Thu, 29 May 2025 10:08:13 +0000 (20:08 +1000)]
c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]
Currently, concept failures of standard type traits just report
'expression X<T> evaluates to false'. However, many type traits are
actually defined in terms of compiler builtins; we can do better here.
For instance, 'is_constructible_v' could go on to explain why the type
is not constructible, or 'is_invocable_v' could list potential
candidates.
Apart from concept diagnostics, this is also useful when using such
traits in a 'static_assert' directly, so this patch also adjusts the
diagnostics in that context.
As a first step to supporting that we need to be able to map the
standard type traits to the builtins that they use. Rather than adding
another list that would need to be kept up-to-date whenever a builtin is
added, this patch instead tries to detect any variable template defined
directly in terms of a TRAIT_EXPR.
This patch also adjusts 'diagnose_trait_expr' to provide more helpful
diagnostics for these cases. Not all type traits have yet been updated,
this patch just updates those that seem particularly valuable or
straight-forward. The function also gets moved to cp/semantics.cc to be
closer to 'trait_expr_value'.
Various other parts of the compiler are also adjusted here to assist in
making clear diagnostics, such as making more use of 'is_stub_object' to
refer to a type directly rather than in terms of 'std::declval<T>()'.
Additionally, since there are now more cases of nesting within a
'static_assert'ion I felt it was helpful for the experimental-nesting
mode to nest here as well.
PR c++/117294
PR c++/113854
gcc/cp/ChangeLog:
* call.cc (implicit_conversion_error): Hide label when printing
a stub object.
(convert_like_internal): Likewise, and nest candidate
diagnostics.
* constexpr.cc (diagnose_failing_condition): Nest diagnostics,
attempt to provide more helpful diagnostics for traits.
* constraint.cc (satisfy_atom): Pass result before constant
evaluation to diagnose_atomic_constraint.
(diagnose_trait_expr): Adjust diagnostics for clarity and
detail.
(maybe_diagnose_standard_trait): New function.
(diagnose_atomic_constraint): Attempt to provide more helpful
diagnostics for more traits.
* cp-tree.h (explain_not_noexcept): Declare new function.
(is_trivially_xible): Add parameter.
(is_nothrow_xible): Likewise.
(is_xible): Likewise.
(is_convertible): Likewise.
(is_nothrow_convertible): Likewise.
(diagnose_trait_expr): Declare new function.
(maybe_diagnose_standard_trait): Declare new function.
* error.cc (dump_type) <case TREE_VEC>: Handle trait types.
* except.cc (explain_not_noexcept): New function.
* method.cc (build_trait_object): Add complain parameter.
(build_invoke): Propagate complain parameter.
(assignable_expr): Add explain parameter to show diagnostics.
(constructible_expr): Likewise.
(destructible_expr): Likewise.
(is_xible_helper): Replace trivial flag with explain flag,
add diagnostics.
(is_trivially_xible): New explain flag.
(is_nothrow_xible): Likewise.
(is_xible): Likewise.
(is_convertible_helper): Add complain flag.
(is_convertible): New explain flag.
(is_nothrow_convertible): Likewise.
* typeck.cc (cp_build_function_call_vec): Add handling for stub
objects.
(convert_arguments): Always return -1 on error.
* typeck2.cc (cxx_readonly_error): Add handling for stub
objects.
* g++.dg/cpp2a/concepts-traits3.C: Adjust diagnostics.
* g++.dg/cpp2a/concepts-traits4.C: New test.
* g++.dg/diagnostic/static_assert5.C: New test.
* g++.dg/ext/has_virtual_destructor2.C: New test.
* g++.dg/ext/is_assignable2.C: New test.
* g++.dg/ext/is_constructible9.C: New test.
* g++.dg/ext/is_convertible7.C: New test.
* g++.dg/ext/is_destructible3.C: New test.
* g++.dg/ext/is_invocable6.C: New test.
* g++.dg/ext/is_virtual_base_of_diagnostic2.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com> Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Jason Merrill [Thu, 24 Jul 2025 18:07:11 +0000 (14:07 -0400)]
c++: lambda convop in C++23 [PR114632]
The lambda conversion was ICEing for two C++23 features, static op() and
explicit object parameters. The issue with the former seems like a more
general issue: tsubst_function_decl recursing to substitute the parameters
was affected by cp_unevaluated_operand from the decltype that refers to the
declaration. Various places already make a point of clearing
cp_unevaluated_operand ahead of PARM_DECL tsubsting; doing it here makes the
PR101233 fix redundant.
For explicit object lambdas, we want to implement CWG2561 and
just not declare the conversion.
PR c++/114632
PR c++/101233
gcc/cp/ChangeLog:
* lambda.cc (maybe_add_lambda_conv_op): Not for xobj lambda.
* pt.cc (tsubst_function_decl): Add cp_evaluated.
(alias_ctad_tweaks): Revert PR101233 fix.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/explicit-obj-lambda18.C: New test.
* g++.dg/cpp23/static-operator-call7.C: New test.
Richard Biener [Thu, 24 Jul 2025 12:14:24 +0000 (14:14 +0200)]
Remove vec_stmt from vectorizable_* API
The following removes the non-SLP gimple **vec_stmt argument from
the vectorizable_* functions API. Checks on it can be replaced
by an inverted check on the passed cost_vec vector pointer.
Andrew Pinski [Thu, 24 Jul 2025 16:26:38 +0000 (09:26 -0700)]
Fix minor typo in #ifdef docuementation
As reported in https://gcc.gnu.org/pipermail/gcc/2025-July/246417.html,
This fixes the minor typo under the #ifdef documentation about adding
MACRO after the #endif and the MACRO matching of the #ifdef. It had `#ifndef`
in it, rather than `#ifdef`.
Pushed as obvious.
gcc/ChangeLog:
* doc/cpp.texi (#ifdef): Correct typo.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Tomasz Kamiński [Thu, 24 Jul 2025 07:14:38 +0000 (09:14 +0200)]
libstdc++: Cleaned up string_vector_iterators.cc test [PR104874]
Removed the wrong_stuff() function, which was effectively empty for
actual test runs. Replaced the manual failure counter with the VERIFY
macro to simplify identifying failures.
Robin Dapp [Wed, 2 Jul 2025 08:28:57 +0000 (10:28 +0200)]
riscv: testsuite: Fix misalignment check.
This fixes a thinko in the misalignment check. If we want to check for
vector misalignment support we need to load 16-byte elements, not
8-byte elements that will never be misaligned.
Robin Dapp [Thu, 3 Jul 2025 09:04:29 +0000 (11:04 +0200)]
vect: Misalign checks for gather/scatter.
This patch adds simple misalignment checks for gather/scatter
operations. Previously, we assumed that those perform element accesses
internally so alignment does not matter. The riscv vector spec however
explicitly states that vector operations are allowed to fault on
element-misaligned accesses. Reasonable uarchs won't, but...
For gather/scatter we have two paths in the vectorizer:
(1) Regular analysis based on datarefs. Here we can also create
strided loads.
(2) Non-affine access where each gather index is relative to the
initial address.
The assumption this patch works on is that once the alignment for the
first scalar is correct, all others will fall in line, as the index is
always a multiple of the first element's size.
For (1) we have a dataref and can check it for alignment as in other
cases. For (2) this patch checks the object alignment of BASE and
compares it against the natural alignment of the current vectype's unit.
The patch also adds a pointer argument to the gather/scatter IFNs that
contains the necessary alignment. Most of the patch is thus mechanical
in that it merely adjusts indices.
I tested the riscv version with a custom qemu version that faults on
element-misaligned vector accesses. With this patch applied, there is
just a single fault left, which is due to PR120782 and which will be
addressed separately.
Bootstrapped and regtested on x86 and aarch64. Regtested on
rv64gcv_zvl512b with and without unaligned vector support.
gcc/ChangeLog:
* internal-fn.cc (internal_fn_len_index): Adjust indices for new
alias_ptr param.
(internal_fn_else_index): Ditto.
(internal_fn_mask_index): Ditto.
(internal_fn_stored_value_index): Ditto.
(internal_fn_alias_ptr_index): Ditto.
(internal_fn_offset_index): Ditto.
(internal_fn_scale_index): Ditto.
(internal_gather_scatter_fn_supported_p): Ditto.
* internal-fn.h (internal_fn_alias_ptr_index): Ditto.
* optabs-query.cc (supports_vec_gather_load_p): Ditto.
* tree-vect-data-refs.cc (vect_check_gather_scatter): Add alias
pointer.
* tree-vect-patterns.cc (vect_recog_gather_scatter_pattern): Add
alias pointer.
* tree-vect-slp.cc (vect_get_operand_map): Adjust for alias
pointer.
* tree-vect-stmts.cc (vect_truncate_gather_scatter_offset): Add
alias pointer and misalignment handling.
(get_load_store_type): Move from here...
(get_group_load_store_type): ...To here.
(vectorizable_store): Add alias pointer.
(vectorizable_load): Ditto.
* tree-vectorizer.h (struct gather_scatter_info): Ditto.
Robin Dapp [Wed, 2 Jul 2025 08:02:16 +0000 (10:02 +0200)]
vect: Add is_gather_scatter argument to misalignment hook.
This patch adds an is_gather_scatter argument to the
support_vector_misalignment hook. All targets but riscv do not care
about alignment for gather/scatter so return true for is_gather_scatter.
Robin Dapp [Wed, 2 Jul 2025 08:04:58 +0000 (10:04 +0200)]
ifn: Add helper functions for gather/scatter.
This patch adds access helpers for the gather/scatter offset and scale
parameters.
gcc/ChangeLog:
* internal-fn.cc (expand_scatter_store_optab_fn): Use new
function.
(expand_gather_load_optab_fn): Ditto.
(internal_fn_offset_index): Ditto.
(internal_fn_scale_index): Ditto.
* internal-fn.h (internal_fn_offset_index): New function.
(internal_fn_scale_index): Ditto.
* tree-vect-data-refs.cc (vect_describe_gather_scatter_call):
Use new function.
Tomasz Kamiński [Wed, 23 Jul 2025 09:33:22 +0000 (11:33 +0200)]
libstdc++: Expand compile-time ranges tests for vector and basic_string.
This replaces most test_constexpr invocations with direct calls to
test_ranges(), which is also used for runtime tests.
SimpleAllocator was made constexpr to simplify this refactoring. Other
test allocators, like uneq_allocator (used in from_range constructor
tests), were not updated.
libstdc++-v3/ChangeLog:
* testsuite/21_strings/basic_string/cons/from_range.cc: Replace
test_constexpr with test_ranges inside static_assert.
* testsuite/21_strings/basic_string/modifiers/append/append_range.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/assign/assign_range.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/insert/insert_range.cc:
Likewise.
* testsuite/21_strings/basic_string/modifiers/replace/replace_with_range.cc:
Likewise.
* testsuite/23_containers/vector/bool/cons/from_range.cc: Likewise.
* testsuite/23_containers/vector/bool/modifiers/assign/assign_range.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/insert/insert_range.cc:
Likewise.
* testsuite/23_containers/vector/cons/from_range.cc: Likewise.
* testsuite/23_containers/vector/modifiers/assign/assign_range.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/insert/insert_range.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/insert/append_range.cc:
Run full test_ranges instead of span-only in test_constexpr.
* testsuite/23_containers/vector/modifiers/append_range.cc:
Replace test_constexpr with calls to test_ranges and test_overlapping.
* testsuite/util/testsuite_allocator.h (__gnu_test::SimpleAllocator):
Declared member functions as constexpr.