]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
3 days agoFix libgomp.fortran/dep-uses-allocators.f90
Tobias Burnus [Fri, 12 Dec 2025 21:50:39 +0000 (22:50 +0100)] 
Fix libgomp.fortran/dep-uses-allocators.f90

libgomp/ChangeLog:

* testsuite/libgomp.fortran/dep-uses-allocators.f90: Properly
escape '(..)' in dg-warning.

3 days agoOpenMP/Fortran: uses_allocators - suggest 5.2 format in the warning
Tobias Burnus [Fri, 12 Dec 2025 21:44:15 +0000 (22:44 +0100)] 
OpenMP/Fortran: uses_allocators - suggest 5.2 format in the warning

Actually mention how the new 5.2+ syntax looks like when outputting
the deprecation warning for 'uses_allocators'.

gcc/fortran/ChangeLog:

* openmp.cc (gfc_match_omp_clause_uses_allocators): Mention
new syntax in deprecation warning.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/dep-uses-allocators.f90: Update
dg-warning.

3 days agoOpenMP: Small fortran/intrinsic.texi + libgomp.texi update
Tobias Burnus [Fri, 12 Dec 2025 21:06:42 +0000 (22:06 +0100)] 
OpenMP: Small fortran/intrinsic.texi + libgomp.texi update

Some followup to the OpenMP 5.2 version bump - and marking some features
as partially implemented: uses_allocators (only predefined allocators),
'declare mapper' (only C/C++, some but few loose ends), map iterator
(C/C++ only - and several loose ends, most fixed by approved patches
that still have to land after minor modifications).

gcc/fortran/ChangeLog:

* intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Link
also to OpenMP 6.0, move 'partially supported' to the end of the
list of OpenMP versions. Mark 'omp_lock_hint_...' and
'omp_atv_sequential' constants as deprecated.

libgomp/ChangeLog:

* libgomp.texi (OpenMP Implementation Status): Add missing '@tab';
claim initial partial support for 'declare mapper',
'uses_allocators', and map iterators.

3 days agoOpenMP: Add uses_allocators parser support to C/C++
Chung-Lin Tang [Fri, 12 Dec 2025 20:20:33 +0000 (21:20 +0100)] 
OpenMP: Add uses_allocators parser support to C/C++

This is the parser part for C/C++, including early middle end bits,
but then stops with a 'sorry, unimplemented'. It also adds support
for omp_null_alloctor (6.0 clarificiation, is to be ignored). As
predefined allocators do not require any special handling in GCC,
those are ignored. Therefore, this patch fully supports
uses_allocators that only use predefined allocators - only printing
a sorry for those that use the (implicit) traits/memspace modifer.

(The parsing support for Fortran was added before; this patch just
adds omp_null_allocator support to Fortran. The sorry message for
Fortran is also still in the FE and not in gimplify.cc, but that
only make a difference for the original dump.)

Except for some minor fixes, this is the same patch as
https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700345.html
with the middle-end + libgomp handling excluded. That patch in turn
is based on previous patches, the latest previous one was
https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637415.html
and, in particular, the C/C++ parser style was updated following the
review comments. Also, more C++ template-handling fixes have been
applied.

gcc/c-family/ChangeLog:

* c-omp.cc (c_omp_split_clauses): Hande uses_allocators.
* c-pragma.h (enum pragma_omp_clause): Add
PRAGMA_OMP_CLAUSE_USES_ALLOCATORS.

gcc/c/ChangeLog:

* c-parser.cc (c_parser_omp_clause_uses_allocators): New function.
(c_parser_omp_clause_name, c_parser_omp_all_clauses,
OMP_TARGET_CLAUSE_MASK): Handle uses_allocators.
* c-typeck.cc (c_finish_omp_clauses): Likewise.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_omp_clause_uses_allocators): New function.
(cp_parser_omp_clause_name, cp_parser_omp_all_clauses,
OMP_TARGET_CLAUSE_MASK): Handle uses_allocators.
* semantics.cc (finish_omp_clauses): Likewise.
* pt.cc (tsubst_omp_clauses): Likewise.

gcc/fortran/ChangeLog:

* openmp.cc (resolve_omp_clauses): Handle omp_null_allocator.
* trans-openmp.cc (gfc_trans_omp_clauses): Mention it in a comment.

gcc/ChangeLog:

* gimplify.cc (gimplify_scan_omp_clauses): Handle uses_allocators
by printing a 'sorry, unimplemented' and removing it.
* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE_USES_ALLOCATORS.
* tree.cc (omp_clause_num_ops, omp_clause_code_name): Likewise.
* tree-pretty-print.cc (dump_omp_clause): Handle it.
* tree.h (OMP_CLAUSE_USES_ALLOCATORS_ALLOCATOR,
OMP_CLAUSE_USES_ALLOCATORS_MEMSPACE,
OMP_CLAUSE_USES_ALLOCATORS_TRAITS): New.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/uses_allocators_1.f90: Add check for
omp_null_allocator.
* testsuite/libgomp.fortran/uses_allocators-7.f90: New test.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/uses_allocators-1.c: New test.
* c-c++-common/gomp/uses_allocators-2.c: New test.
* c-c++-common/gomp/uses_allocators-4.c: New test.
* c-c++-common/gomp/uses_allocators-7.c: New test.
* g++.dg/gomp/deprecate-2.C: New test.
* g++.dg/gomp/uses_allocators-1.C: New test.
* gcc.dg/gomp/deprecate-2.c: New test.

Co-authored-by: Tobias Burnus <tburnus@baylibre.com>
Co-authored-by: Andrew Stubbs <ams@baylibre.com>
3 days agoldist: Fix probability on loop exit
Andrew Pinski [Tue, 9 Dec 2025 09:09:53 +0000 (01:09 -0800)] 
ldist: Fix probability on loop exit

While moving the phi part of removal of forwarder blocks,
I noticed that I was getting some failures due to "mismatch counts".
I worked around the issue by disabling the case where the forwarder
block would just get merged. I have now gone back and found
the problem is in ldist where it is removing the loop
by changing the exit to always exit but forgot to update
the edge to always probability. This fixes that and
also removes a few of the "mismatch counts".

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

PR tree-optimization/103680
* tree-loop-distribution.cc (destroy_loop): Set probability
of the exit edge to be always.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
3 days agocfg: Fix count when creating new forwarder block
Andrew Pinski [Tue, 9 Dec 2025 06:53:06 +0000 (22:53 -0800)] 
cfg: Fix count when creating new forwarder block

This was a bug previously but maybe did't matter as most of
the time the block was going to be removed after cddce.
Anyways the problem here is the count of the new bb was missing
of the first edge that was moved to it. So the fix is reuse the count
after the splitting of the edge as the initial value instead of 0.

This does not fix gcc.target/i386/pr90178.c with -m32, but at least
we don't get any more warning saying the incorrect count happening.

Bootstrapped and tested on x86_64-linux-gnu.

gcc/ChangeLog:

PR tree-optimization/103680
* tree-cfg.cc (make_forwarders_with_degenerate_phis): Fix
initial value of the count to new bb.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
3 days agos390: Warn about non-overloaded deprecated builtins
Stefan Schulze Frielinghaus [Fri, 12 Dec 2025 19:44:45 +0000 (20:44 +0100)] 
s390: Warn about non-overloaded deprecated builtins

Previously a warning for a deprecated builtin was only emitted for
overloaded builtins.  Warn about non-overloaded deprecated builtins,
too.

gcc/ChangeLog:

* config/s390/s390.cc (s390_expand_builtin): Warn about
non-overloaded deprecated builtins.

3 days agos390: Fix builtin s390_vec_load_bndry for C++
Stefan Schulze Frielinghaus [Fri, 12 Dec 2025 19:44:45 +0000 (20:44 +0100)] 
s390: Fix builtin s390_vec_load_bndry for C++

The second argument for builtin s390_vec_load_bndry must be an integer
constant.  The C++ front end wraps a constant inside a NON_LVALUE_EXPR
which we need to unpack first.  Otherwise we bail out in
s390_adjust_builtin_arglist():

t.C: In function ‘__vector(4) unsigned int test(const unsigned int*)’:
t.C:7:42: error: constant value required for builtin ‘__vector(16) signed char __builtin_s390_vlbb(const void*, int)’ argument 2
    7 |     return __builtin_s390_vec_load_bndry (x, 4096);
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

gcc/ChangeLog:

* config/s390/s390-c.cc (s390_adjust_builtin_arglist): Fix
builtin s390_vec_load_bndry for C++.

3 days agos390: Accept array arguments for builtins
Stefan Schulze Frielinghaus [Fri, 12 Dec 2025 19:44:45 +0000 (20:44 +0100)] 
s390: Accept array arguments for builtins

A difference in front ends is that in contrast to C the C++ FE does no
array-to-pointer conversion prior calling resolve_overloaded_builtin().
However, we depend on this for finding the proper overloaded builtin or
in case of direct expansion.  Therefore, do the conversion manually.

gcc/ChangeLog:

* config/s390/s390-c.cc (s390_resolve_overloaded_builtin):
Perform array-to-pointer conversion for C++.

gcc/testsuite/ChangeLog:

* g++.target/s390/builtin-array-arg-1.C: New test.
* gcc.target/s390/builtin-array-arg-1.c: New test.

3 days agolibstdc++: Make <mdspan> compatible with clang.
Luc Grosheintz [Fri, 12 Dec 2025 11:28:01 +0000 (12:28 +0100)] 
libstdc++: Make <mdspan> compatible with clang.

The submdspan feature broke compatibility with clang, due to a missing
'::template type'.

libstdc++-v3/ChangeLog:

* include/std/mdspan (submdspan): Fix missing '::template'.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
3 days agoRegenerate analyzer.opt.urls
David Malcolm [Fri, 12 Dec 2025 18:04:41 +0000 (13:04 -0500)] 
Regenerate analyzer.opt.urls

gcc/analyzer/ChangeLog:
* analyzer.opt.urls: Regenerate.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
3 days agoanalyzer: reimplement supergraph to eliminate function_point and stmt_finder
David Malcolm [Fri, 12 Dec 2025 17:23:34 +0000 (12:23 -0500)] 
analyzer: reimplement supergraph to eliminate function_point and stmt_finder

GCC's static analyzer code has become hard to debug and extend.

I've realized that the core data structures within it for tracking
positions in the user's code are clunky and make things more difficult
than they need to be.

The analyzer has a data structure called the "supergraph" which unifies
all CFGs and the callgraph into a single directed graph expressing
control flow and function calls in the user's code.  The core job of the
analyzer is to walk paths in the supergraph to build a directed graph
called the exploded graph, which combines control flow and data flow,
and uncovers problems as it does so (e.g. double-free bugs).

Previously, the nodes in the supergraph closely matched basic blocks in
the gimple CFG representation in the hope that this would help the
analyzer scale better, using a class function_point to refer to places
in the code, such as *within* a basic block/supernode.  This approach
needed lots of awkward special cases and workarounds to deal with state
changes that happen mid-node, which complicated the implementation and
make debugging it hard.

This patch reimplements the analyzer's supergraph:

* eliminate class function_point in favor of a very fine-grained
supergraph, where each node in the graph represents a location in the
user's program, and each edge in the graph represents an operation (with
no-op edges for showing changing locations).  The debug option
"-fanalyzer-fine-grained" becomes redundant.

* eliminate the class hierarchy inheriting from class superedge in
favor of having each superedge optionally own an "operation", to better
express the state transitions along edges (composition rather than
inheritance), and splitting up the more complicated cases into
multiple operations/edges (making debugging easier and reasoning about
state transitions clearer).

* perform various post-processing "passes" to the supergraph after it's
initially constructed but before performing the analysis, such as
simplifying the graph, improving source location information, etc

* eliminate class stmt_finder (which was always something of a hack) in
favor of improving user source locations in the supergraph, using
class event_loc_info more consistently, and a new class
pending_location::fixup_for_epath for the most awkward cases (leaks)

* precompute and cache various properties in operations, such as for
switch edges and for phi edges, rather than performing work each time we
visit an edge.

Advantages:

* The implementation is much simpler, easier to understand and debug,
and has much clearer separation of responsibilities.

* Locations for diagnostics are somewhat improved (due to being more
consistent about using the goto_locus field of CFG edges when
constructing the supergraph, and fixing up missing location data from
gimple stmts).

* The analyzer now detects a missing "return" from a non-void-returning
function (albeit as a read of uninitialized "<return-value>"), which
found many lurking true +ves in the test suite.  I can fix the wording
of this case as a follow-up.

Disadvantages:

* The supergraph is much larger than before (one node per gimple stmt,
rather than per basic block) - but the optimizer that runs after the
supergraph is built simplifies it somewhat (and I have various ideas for
future simplifications which I hope will help the analyzer scale).

* all edges in the supergraph are intraprocedural, making "supergraph"
a misnomer.

Other notes:

* I tried to maintain the behavior of -fanalyzer as closely as possible,
but there are changes to the testsuite output.  These mostly are places
where the exploration of the exploded graph leads to nodes not being
merged as well as the previous implementation on a particular test case,
leading to the analysis hitting a termination limit and bailing out.
So I expect the analyzer's behavior to change somewhat.  I had to add
xfails in various places - but was able to remove xfails in others.

* the testsuite was running with -fanalyzer-call-summaries enabled,
which is not the default for users.  The new implementation uncovered
numerous pre-existing bugs in -fanalyzer-call-summaries, so the patch
disables this within the testsuite, matching the default for users.
Fixing those bugs can be done separately from the patch.

* the only performance data I have so far is with a debug rather than
release build.  "wall" time spent in the analyzer shows a slight
improvement overall, but with one new outlier in the integration
testsuite that now takes over an hour (specifically,
qemu-7.2.0/build/target_hexagon_decode.c) but I'd like to go ahead with
pushing this, and treat that specific slowdown as a bug.

I posted an incomplete version of this before the close of stage 1 here:
  https://gcc.gnu.org/pipermail/gcc-patches/2025-November/700883.html

Although the patch is a very large change to -fanalyzer, the changes are
confined to that component (apart from a trivial addition of
INCLUDE_DEQUE/#include <deque> to system.h), so I want to apply this
patch now in stage 3: it's a big quality-of-life improvement when
debugging -fanalyzer.

gcc/ChangeLog:
PR analyzer/122003
* Makefile.in (ANALYZER_OBJS): Add analyzer/ops.o,
analyzer/supergraph-fixup-locations.o,
analyzer/supergraph-simplify.o, and analyzer/supergraph-sorting.o.
* digraph.h (dnode::add_in_edge): New.
(dnode::remove_in_edge): New.
(dnode::add_out_edge): New.
(dnode::remove_out_edge): New.
(dnode::m_preds): Make public.
(dnode::m_succs): Likewise.
(dnode::find_edge_idx): New.
(dedge::edge_t): New typedef.
(dedge::m_src): Make non-const.
(dedge::m_dest): Likewise.
(dedge::set_dest): New.
(digraph::add_any_extra_stmts): New.
(digraph<GraphTraits>::dump_dot_to_pp): Call it.
* doc/analyzer.texi: Update for rewrite of supergraph.
* doc/invoke.texi (fanalyzer-fine-grained): Make this as a no-op
preserved for backwards compatibility.
(fanalyzer-simplify-supergraph): Document new option.
(fdump-analyzer-supergraph): Update for changes to output.
* gdbhooks.py (AnaSupernodePrinter.to_string): Update for renaming
of supernode::m_index to supernode::m_id.
* system.h: Include <deque> if INCLUDE_DEQUE was defined.

gcc/analyzer/ChangeLog:
PR analyzer/122003
* analyzer-logging.h (class log_nesting_level): New.
(log_nesting_level::log_nesting_level): New.
(log_nesting_level::~log_nesting_level): New.
* analyzer.cc (is_cxa_end_catch_p): New.
* analyzer.opt (fdump-analyzer-callgraph): Make this as a no-op
preserved for backwards compatibility.
(fanalyzer-fine-grained): Likewise.
(fanalyzer-simplify-supergraph): New.
* bounds-checking.cc (strip_types): Update for changes to
widening_svalue.
* call-details.h: Include "pending-diagnostic.h".
* call-info.cc (custom_edge_info::get_dot_attrs): New.
(call_info::add_events_to_path): Add pending_diagnostic & param.
Fix indentation.
* call-info.h (call_info::add_events_to_path): Add
pending_diagnostic & param.
* call-string.cc (call_string::element_t::operator==): Reimplement.
(call_string::element_t::cmp): New.
(call_string::element_t::get_caller_function): Likewise.
(call_string::element_t::get_callee_function): Likewise.
(call_string::element_t::get_call_snode_in_caller): New.
(call_string::element_t::get_return_snode_in_caller): New.
(call_string::element_t::get_call_stmt): New.
(call_string::print): Update for new implementation.
(call_string::to_json): Likewise.
(call_string::push_call): Likewise.
(call_string::count_occurrences_of_function): Likewise.
(call_string::cmp): Likewise.
(call_string::get_callee_node): Delete.
(call_string::get_caller_node): Convert into...
(call_string::get_return_node_in_caller): ...this new function.
(call_string::validate): Update for new implementation.
(call_string::recursive_log): Likewise.
* call-string.h (class call_superedge): Delete forward decl.
(class return_superedge): Likewise.
(class call_and_return_op): New forward decl.
(struct call_string::element_t): Reimplement using
call_and_return_op, rather than relying on interprocedural edges
in the supergraph.
(class call_string): Likewise.
* call-summary.cc (call_summary::get_fndecl): Reimplement.
(call_summary_replay::convert_svalue_from_summary_1): Update for
changes to widening_svalue.
* checker-event.cc (event_kind_to_string): Update for renamings
of event_kind::{call_edge -> call_} and
event_kind::{return_edge -> return_}.
(region_creation_event_debug::print_desc): Update for change to
event_loc_info.
(state_change_event::state_change_event): Pass in event_loc_info
rather than stack_depth, and pass it to checker_event ctor.
(superedge_event::get_callgraph_superedge): Delete.
(superedge_event::should_filter_p): Reimplement in terms of
get_any_cfg_edge.
(superedge_event::get_call_and_return_op): New.
(superedge_event::superedge_event): Drop m_eedge and
m_critical_state.  Add assertion that the superedge is non-null.
(cfg_edge_event::get_cfg_superedge): Delete.
(cfg_edge_event::cfg_edge_event): Add "op" param, and remove
assertion refering to kinds of superedge.
(cfg_edge_event::get_meaning): Reimplement without
cfg_superedge.
(cfg_edge_event::get_cfg_edge): New.
(start_cfg_edge_event::print_desc): Use m_op.  Update for renaming
of superedge::m_index to superedge::m_id.
(start_cfg_edge_event::maybe_describe_condition): Reimplement in
ops.cc as gcond_edge_op::maybe_describe_condition.
(start_cfg_edge_event::should_print_expr_p): Reimplement in ops.cc
as gcond_edge_op::should_print_expr_p.
(call_event::call_event): Update for renaming of event_kind.  Drop
assertion about superedge kind.
(call_event::print_desc): Update for consolidation of m_var and
m_critical_state into a struct.
(return_event::return_event): Inherit directly from checker_event.
Drop assertion referring to kinds of superedge.  Initialize m_edge
and m_call_and_return_op.
(return_event::print_desc): Update for change to m_critical_state.
* checker-event.h (enum class event_kind): Rename call_edge to
call_, and return_edge to return_.
(state_change_event::state_change_event): Update for changes to
location-handling in base class ctor.
(state_change_event::record_critical_state): Drop this, moving
it to special-cases in the subclasses that need it.
(state_change_event::get_callgraph_superedge): Delete.
(superedge_event::get_call_and_return_op): New vfunc decl.
(superedge_event::m_var, superedge_event::m_critical_state): Drop
these fields from this class, combining them into a new struct
and moving the fields to the interprocedural event subclasses
where they make sense.
(cfg_edge_event::get_cfg_superedge): Delete.
(cfg_edge_event::get_cfg_edge): Add.
(cfg_edge_event::cfg_edge_event): Update for changes to location
handling in base class ctor.  Add "op".
(cfg_edge_event::m_op): New field.
(start_cfg_edge_event::start_cfg_edge_event): Update for changes
to base class ctor.
(start_cfg_edge_event::maybe_describe_condition): Drop.
(end_cfg_edge_event::end_cfg_edge_event): Update for changes to
base class ctor.
(catch_cfg_edge_event::catch_cfg_edge_event): Likewise.
(struct critical_state): New struct.
(call_event::record_critical_state): New decl.
(call_event::m_critical_state): New field.
(class return_event): Inherit from checker_event, rather than
superedge_event.
(return_event::get_call_and_return_op): New.
(return_event::record_critical_state): New.
(return_event::m_call_and_return_op): New field.
(return_event::m_critical_state): New field.
* common.h: Define INCLUDE_SET.
(class cfg_superedge): Drop forward decl.
(class switch_cfg_superedge): Likewise.
(class eh_dispatch_cfg_superedge): Likewise.
(class eh_dispatch_try_cfg_superedge): Likewise.
(class eh_dispatch_allowed_cfg_superedge): Likewise.
(class callgraph_superedge): Likewise.
(class call_superedge): Likewise.
(class return_superedge): Likewise.
(class stmt_finder): Likewise.
(class function_point): Likewise.
(class feasibility_state): New forward decl.
(class uncertainty_t): Likewise.
(useful_location_p): New.
(known_function::check_any_preconditions): New.
(custom_edge_info::get_dot_attrs): New decl.
(custom_edge_info::add_events_to_path): Add param
"pending_diagnostic &pd".
(is_cxa_end_catch_p): New decl.
* constraint-manager.cc
(bounded_ranges_manager::get_or_create_ranges_for_switch): Delete.
(bounded_ranges_manager::create_ranges_for_switch): Delete.
* constraint-manager.h
(bounded_ranges_manager::get_or_create_ranges_for_switch): Delete
decl.
(bounded_ranges_manager::create_ranges_for_switch): Likewise.
(bounded_ranges_manager::make_case_label_ranges): Make public for
use by ops code.
(bounded_ranges_manager::edge_cache_t): Delete.
(bounded_ranges_manager::m_edge_cache): Delete.
* diagnostic-manager.cc (pending_location::pending_location): New
ctor implementations.
(pending_location::to_json): New.
(epath_finder::get_best_epath): Rename param to "target_enode".
Drop param "target_stmt".  Update for renaming of
supernode::m_index to m_id.
(epath_finder::explore_feasible_paths): Drop param "target_stmt".
(process_worklist_item): Likewise.
(saved_diagnostic::saved_diagnostic): Pass in param "ploc" by
rvalue reference and store it in m_ploc.  Drop m_stmt_finder and
other fields made redundant by m_ploc.
(saved_diagnostic::get_supernode): New.
(saved_diagnostic::operator==): Update for changes to
location-tracking.
(saved_diagnostic::to_json): Update.
(saved_diagnostic::dump_as_dot_node): Drop m_stmt.
(saved_diagnostic::calc_best_epath): Update for change to
location-tracking.
(saved_diagnostic::supercedes_p): Likewise.
(saved_diagnostic::maybe_add_sarif_properties): Likewise.
(get_emission_location): Delete.
(diagnostic_manager::add_diagnostic): Pass "ploc" by rvalue
reference, moving it to the saved_diagnostic.  Update early
rejection check, and call fixup_location before-hand.
(class dedupe_key): Drop m_stmt field, and update for changes
to saved_diagnostic.
(dedupe_winners::add): Call get_best_epath here, and call
fixer_for_epath on it.
(diagnostic_manager::emit_saved_diagnostics): Update for
changes to saved_diagnostic and supernode.
(diagnostic_manager::emit_saved_diagnostic): Likewise.
Use the pending_location from the saved_diagnostic for the
location of the final event, and for the primary location of the
diagnostic itself.
(diagnostic_manager::build_emission_path): Use useful_location_p.
(state_change_event_creator::on_global_state_change): Update for
changes to location-tracking.
(state_change_event_creator::on_state_change): Likewise.
(struct null_assignment_sm_context): Reimplement within ops.cc.
(diagnostic_manager::add_events_for_eedge): Reimplement.
(diagnostic_manager::add_events_for_superedge): Delete in favor of
control_flow_op::add_any_events_for_eedge.
(diagnostic_manager::prune_for_sm_diagnostic): Update call/return
for event_kind renamings, and to use call_and_return_op rathern
than callgraph_superedge.
(diagnostic_manager::consolidate_conditions): Port from
cfg_superedge to get_cfg_edge.
* diagnostic-manager.h: Include "analyzer/supergraph.h" and
"analyzer/event-loc-info.h".
(struct pending_location): Move decl earlier in file.  Replace
the existing specified ctors with 3 new ones.  Add comments.
(class pending_location::fixer_for_epath): New.
(pending_location::get_location): New.
(pending_location::to_json): New decl.
(pending_location::m_snode): Drop redundant field.
(pending_location::m_event_loc_info): New field, replacing m_stmt
and m_loc.
(pending_location::m_finder): Replace with...
(pending_location::m_fixer_for_epath): ...this new field.
(make_ploc_fixer_for_epath_for_leak_diagnostic): New decl.
(saved_diagnostic::saved_diagnostic): Pass in param "ploc" by
rvalue reference and store it in m_ploc.
(saved_diagnostic::get_supernode): New.
(saved_diagnostic::m_ploc): New field, replacing m_enode,
m_snode, m_stmt, m_stmt_finder, and m_loc.
(diagnostic_manager::add_diagnostic): Pass ploc as rvalue
reference.
(diagnostic_manager::add_events_for_superedge): Delete decl.
* engine.cc: Include "gimple-predict.h" and
"analyzer/impl-sm-context.h".
(impl_region_model_context::impl_region_model_context): Drop
stmt_finder.
(impl_region_model_context::warn): Convert to...
(impl_region_model_context::warn_at): ...this.
(class impl_sm_context): Move to impl-sm-context.h.
(impl_region_model_context::get_state_map_by_name): Drop
m_stmt_finder.
(class leak_stmt_finder): Reimplement as...
(class leak_ploc_fixer_for_epath): ...this.
(make_ploc_fixer_for_epath_for_leak_diagnostic): New.
(returning_from_function_p): Update for supergraph changes.
(impl_region_model_context::on_state_leak): Port from
leak_stmt_finder to leak_ploc_fixer_for_epath.
(impl_region_model_context::on_condition): Update for
location-handling changes.
(impl_region_model_context::on_bounded_ranges): Likewise.
(impl_region_model_context::on_phi): Likewise.
(impl_region_model_context::get_pending_location_for_diag): New.
(exploded_node::status_to_str): Add status::special.
(exploded_node::get_processed_stmt): Delete.
(exploded_node::dump_dot): Elide state if we have a single
predecessor  and the state hasn't changed.
(exploded_node::dump_processed_stmts): Delete.
(exploded_node::on_stmt): Delete, reimplementing in ops.cc as
gimple_stmt_op::execute_on_state, call_and_return_op::execute, and
operation::handle_on_stmt_for_state_machines.
(exploded_node::on_stmt_pre): Delete, reimplementing in ops.cc as
call_and_return_op::make.
(exploded_node::on_stmt_post): Delete.
(class call_summary_edge_info): Move to ops.cc.
(exploded_node::replay_call_summaries): Delete.
(exploded_node::replay_call_summary): Delete.
(exploded_node::on_edge): Delete.
(exploded_node::on_longjmp): Eliminate ambiguous "setjmp_point"
and "next_point" in favor of "point_before_setjmp" and
"point_after_setjmp".
(exploded_graph::unwind_from_exception): Update for changes to
program_point.
(exploded_node::on_throw): Convert "after_throw_point" to a param.
(exploded_node::on_resx): Delete.
(exploded_node::detect_leaks): Update for renaming of
supernode::return_p to supernode::exit_p, and drop stmt param of
impl_region_model_context ctor.
(dynamic_call_info_t::update_model): Delete.
(dynamic_call_info_t::add_events_to_path): Delete.
(interprocedural_call::print): New.
(interprocedural_call::get_dot_attrs): New.
(interprocedural_call::update_state): New.
(interprocedural_call::update_model): New.
(interprocedural_call::add_events_to_path): New.
(interprocedural_return::print): New.
(interprocedural_return::get_dot_attrs): New.
(interprocedural_return::update_state): New.
(interprocedural_return::update_model): New.
(interprocedural_return::add_events_to_path): New.
(rewind_info_t::add_events_to_path): Add pending_diagnostic &
param.
(exploded_edge::dump_dot_label): Drop superedge kinds.  Show
op vs no-op.  Flush before printing any superedge label, and
escape that label.
(exploded_edge::maybe_get_stmt): New.
(exploded_edge::maybe_get_op): New.
(stats::stats): Update for change to m_num_nodes;
(stats::log): Likewise.
(stats::dump): Likewise.
(stats::get_total_enodes): Likewise.
(strongly_connected_components::strongly_connected_components):
Update for changes to supergraph.
(strongly_connected_components::dump): Show the stack.  Update for
changes to supernode.
(strongly_connected_components::to_json): Update for changes to
supergraph.
(strongly_connected_components::strong_connect): Rename "index" to
"id".  Drop superedge kinds.
(worklist::key_t::cmp): Compare BB indexes before snode ids.
Drop function_point.
(exploded_graph::exploded_graph): Update stats initialization.
(tainted_args_function_info::update_model): Reimplement.
(tainted_args_function_info::add_events_to_path): Add param.
(exploded_graph::get_or_create_node): Check for recursion limit
here, rather than in program_point::on_edge and
exploded_graph::maybe_create_dynamic_call.  Only merge state
for points with state_merge_at_p.  Update stats tracking for
changes to supergraph.  Fix wording of log of state.
(exploded_graph::get_or_create_per_call_string_data): Update for
supergraph changes.
(tainted_args_call_info::update_model): Reimplement.
(tainted_args_call_info::add_events_to_path): Add param.
(exploded_graph::process_worklist): Drop assertions that nodes
have no successors, due to some cases during unwinding exceptions.
Update call to maybe_process_run_of_before_supernode_enodes to
call to maybe_process_run_of_enodes, and only at points for
which state_merge_at_p.  Reimplement "too complex" check.
(exploded_graph::maybe_process_run_of_before_supernode_enodes):
Convert to...
(exploded_graph::maybe_process_run_of_enodes): ...this.  Only
consider nodes with a single successor in the supergraph and for
which that superedge supports_bulk_merge_p.  Port state updates to
using operation::update_state_for_bulk_merger.
(stmt_requires_new_enode_p): Delete.
(state_change_requires_new_enode_p): Delete.
(exploded_graph::maybe_create_dynamic_call): Delete.
(class impl_path_context): Reimplement in ops.cc.
(class jump_through_null): Move to region-model.cc.
(exploded_graph::process_node): Use location_t from supernode,
rather than trying to have a stmt associated with a supernode.
Drop switch on program_point kind, instead using the operation, if any,
from the superedge.
(exploded_graph::get_or_create_function_stats): Update computation
of num_supernodes for the function.
(exploded_graph::print_bar_charts): Update for supergraph changes.
(exploded_graph::dump_stats): Likewise.
(exploded_graph::dump_states_for_supernode): Delete.
(exploded_graph::to_json): Update comment.
(exploded_path::find_stmt_backwards): Update for supergraph
reimplementation.
(exploded_path::feasible_p): Drop "last_stmt".
(feasibility_state::maybe_update_for_edge): Move most of
implementation to ops and custom_edge_infos.
(feasibility_state::update_for_stmt): Delete.
(supernode_cluster::dump_dot): Update for supernode changes.
(supernode_cluster::cmp_ptr_ptr): Likewise.
(exploded_graph::dump_exploded_nodes): Update for
location-handling changes, and for changes to supergraph
representation.
(class viz_callgraph_node): Delete
(class viz_callgraph_edge): Delete.
(class viz_callgraph): Delete.
(class viz_callgraph_cluster): Delete.
(struct viz_callgraph_traits): Delete.
(dump_callgraph): Delete.
(exploded_graph_annotator::exploded_graph_annotator): Update for
supernode::m_index becoming supernode:m_id.
(exploded_graph_annotator::add_node_annotations): Reimplement to
show enodes within the node for the supernode.
(exploded_graph_annotator::print_enode_port): New.
(exploded_graph_annotator::print_enode): Add port.
(exploded_graph_annotator::print_saved_diagnostic): Drop stmt.
(exploded_graph_annotator::m_enodes_per_snodes): Convert to...
(exploded_graph_annotator::m_enodes_per_snode_id): ...this, using
std::vector.
(maybe_dump_supergraph): New.
(impl_run_checkers): Create region_model_manager before supergraph
and pass it to supergraph ctor.  Dump the original form of the
supergraph, then call fixup_locations, simplify, and sort_nodes on
the supergraph, dumping it at each stage.  Drop dump_callgraph.
Replace dump to "NAME.supergraph-eg.dot" with dump to
"NAME.supergraph.N.eg.dot".
* event-loc-info.h (event_loc_info::event_loc_info): Add ctors taking
const exploded_node * and const program_point &.
* exploded-graph.h: Add include of "analyzer/region-model.h".
(impl_region_model_context::impl_region_model_context): Add default
for "stmt" param. Drop "stmt_finder" param.
(impl_region_model_context::warn): Convert to...
(impl_region_model_context::warn_at): ...this.
(impl_region_model_context::get_pending_location_for_diag): New.
(impl_region_model_context::m_stmt_finder): Drop.
(struct exploded_node::on_stmt_flags): Drop.
(exploded_node::on_stmt): Drop.
(exploded_node::on_stmt_pre): Drop.
(exploded_node::on_stmt_post): Drop.
(exploded_node::replay_call_summaries): Drop.
(exploded_node::replay_call_summary): Drop.
(exploded_node::on_edge): Drop.
(exploded_node::on_throw): Add "after_throw_point" param.
(exploded_node::on_resx): Drop.
(exploded_node::get_location): New.
(exploded_node::get_stmt): Drop.
(exploded_node::get_processed_stmt): Drop.
(exploded_node::maybe_get_stmt): New decl.
(exploded_node::maybe_get_op): New decl.
(class dynamic_call_info_t): Delete.
(class interprocedural_call): New.
(class interprocedural_return): New.
(rewind_info_t::add_events_to_path): Add pending_diagnostic &
param.
(rewind_info_t::get_setjmp_point): Replace with...
(rewind_info_t::get_point_before_setjmp): ...this...
(rewind_info_t::get_point_after_setjmp): ...and this.
(stats::m_num_nodes): Convert from an array to a plain int.
(class strongly_connected_components): Convert from index to id
throughout.
(exploded_graph::maybe_process_run_of_before_supernode_enodes):
Replace with...
(exploded_graph::maybe_process_run_of_enodes): ...this.
(exploded_graph::maybe_create_dynamic_call): Delete.
(exploded_graph::save_diagnostic): Drop stmt_finder param.
(exploded_graph::dump_states_for_supernode): Drop.
(exploded_graph::m_PK_AFTER_SUPERNODE_per_snode): Drop.
(class feasibility_problem): Drop "m_last_stmt".
(feasibility_state::update_for_stmt): Drop.
(feasibility_state::get_model): Add non-const accessor.
(feasibility_state::get_snodes_visited): New accessor.
(class stmt_finder): Drop.
* feasible-graph.cc (feasible_node::dump_dot): Drop call to
dump_processed_stmts.
(feasible_node::get_state_at_stmt): Drop.
* impl-sm-context.h: New file, adapted from material in engine.cc.
* infinite-loop.cc
(perpetual_start_cfg_edge_event::perpetual_start_cfg_edge_event):
Add "op" param.
(perpetual_start_cfg_edge_event::print_desc): Use m_op to describe
condition.
(looping_back_event::looping_back_event): Add "op" param.
(infinite_loop_diagnostic::maybe_add_custom_events_for_superedge):
Convert to...
(infinite_loop_diagnostic::maybe_add_custom_events_for_eedge):
...this.
(infinite_loop_diagnostic::add_final_event): Port from
cfg_superedge to get_any_cfg_edge and operations.  Update for
location-handling changes.
(get_in_edge_back_edge): Port from cfg_superedge to
get_any_cfg_edge.
(starts_infinite_loop_p): Update for location-handling changes.
(exploded_graph::detect_infinite_loops): Remove redundant params.
* infinite-recursion.cc
(infinite_recursion_diagnostic::add_final_event): Update for
location-handling changes.
(infinite_recursion_diagnostic::check_valid_fpath_p): Drop gimple
param.
(infinite_recursion_diagnostic::fedge_uses_conjured_svalue_p):
Port from cfg_superedge to operations.
(is_entrypoint_p): Update for supergraph changes.
(exploded_graph::detect_infinite_recursion): Update for
location-handling changes.
* kf-lang-cp.cc (kf_operator_new::impl_call_pre): Split out
code to handle placement-new into...
(kf_operator_new::check_any_preconditions): ...this...
(kf_operator_new::get_sized_region_for_placement_new): ...and
this.
* ops.cc: New file, albeit with material adatpted from old
implementation.
* ops.h: Likewise.
* pending-diagnostic.cc (pending_diagnostic::add_call_event): Add
gcall param.  Update for changes to location-handling.
* pending-diagnostic.h
(pending_diagnostic::maybe_add_custom_events_for_superedge):
Convert to...
(pending_diagnostic::maybe_add_custom_events_for_eedge): ...this.
(pending_diagnostic::add_call_event): Add "call_stmt" param.
(pending_diagnostic::check_valid_fpath_p): Drop stmt param.
* program-point.cc (point_kind_to_string): Delete.
(function_point::function_point): Delete.
(function_point::print): Delete.
(function_point::hash): Delete.
(function_point::get_function): Delete.
(function_point::get_stmt): Delete.
(function_point::get_location): Delete.
(function_point::final_stmt_p): Delete.
(function_point::from_function_entry): Delete.
(function_point::before_supernode): Delete.
(function_point::print_source_line): Convert to...
(program_point::print_source_line): ...this.
(program_point::print): Reimplement.
(program_point::to_json): Likewise.
(program_point::push_to_call_stack): Delete.
(program_point::hash): Reimplement.
(program_point::get_function_at_depth): Likewise.
(program_point::on_edge): Delete.
(function_point::cmp_within_supernode_1): Delete.
(function_point::cmp_within_supernode): Delete.
(function_point::cmp): Delete.
(function_point::cmp_ptr): Delete.
(function_point::next_stmt): Delete.
(function_point::get_next): Delete.
(program_point::origin): Update.
(program_point::from_function_entry): Update.
(program_point::get_next): Delete.
(selftest::test_function_point_equality): Delete.
(selftest::test_function_point_ordering): Delete.
(selftest::test_program_point_equality): Update for changes to
program_point.
(selftest::analyzer_program_point_cc_tests): Don't call deleted
function_point tests.
* program-point.h: Include "analyzer/supergraph.h".
(class exploded_graph): Drop forward decl.
(enum point_kind): Drop.
(point_kind_to_string): Drop decl.
(class function_point): Delete.
(program_point::program_point): Take a const supernode *
rather than a const function_point &.
(program_point::print_source_line): New decl.
(program_point::operator==): Update.
(program_point::get_function_point): Drop.
(program_point::get_supernode): Reimplement.
(program_point::get_function): Reimplement.
(program_point::get_fndecl): Reimplement.
(program_point::get_stmt): Drop.
(program_point::get_location): Reimplement.
(program_point::get_kind): Drop.
(program_point::get_from_edge): Drop.
(program_point::get_stmt_idx): Drop.
(program_point::get_stack_depth): Update.
(program_point::state_merge_at_p): New.
(program_point::before_supernode): Drop.
(program_point::before_stmt): Drop.
(program_point::after_supernode): Drop.
(program_point::empty): Drop.
(program_point::deleted): Drop.
(program_point::on_edge): Drop.
(program_point::push_to_call_stack): Drop.
(program_point::next_stmt): Drop.
(program_point::get_next): Drop.
(program_point::m_function_point): Replace with...
(program_point::m_snode): ...this.
* program-state.cc (program_state::on_edge): Delete.
(program_state::push_call): Delete.
(program_state::returning_call): Delete.
(program_state::prune_for_point): Port from function_point to
supernode.  Drop stmt param to impl_region_model_context ctor.
(selftest::test_sm_state_map): Update for engine borrowing rather
owning the region_model_manager.
(selftest::test_program_state_1): Likewise.
(selftest::test_program_state_2): Likewise.
(selftest::test_program_state_merging): Likewise.
(selftest::test_program_state_merging_2): Likewise.
* program-state.h (program_state::push_call): Delete decl.
(program_state::returning_call): Delete decl.
(program_state::on_edge): Delete decl.
* region-model-manager.cc (region_model_manager::maybe_fold_unaryop):
Only fold constants if we have a type.
(region_model_manager::get_or_create_widening_svalue): Port from
function_point to supernode.
* region-model-manager.h
(region_model_manager::get_or_create_widening_svalue): Likewise.
* region-model.cc
(poisoned_value_diagnostic::check_valid_fpath_p): Drop code for
handling function_points within an snode.
(exception_thrown_from_unrecognized_call::add_events_to_path): Add
pending_diagnostic param.
(class jump_through_null): Move here from engine.cc.
(region_model::on_call_pre): Check for jump through null here,
rather than in exploded_graph::process_node.
(region_model::on_setjmp): Add superedge param and pass it to
setjmp_record ctor.
(region_model::handle_phi): Delete, in favor of
phis_for_edge_op::update_state in ops.cc.
(region_model::update_for_phis): Likewise.
(region_model::maybe_update_for_edge): Delete.
(region_model::update_for_call_superedge): Delete.
(region_model::update_for_return_superedge): Delete.
(region_model::apply_constraints_for_gcond): Reimplement in ops.cc as
gcond_edge_op::apply_constraints.
(has_nondefault_case_for_value_p): Move to ops.cc.
(has_nondefault_cases_for_all_enum_values_p): Move to ops.cc
(region_model::apply_constraints_for_gswitch): Reimplement in
ops.cc as switch_case_op::apply_constraints.
(class rejected_eh_dispatch): Move to ops.cc.
(exception_matches_type_p): Move to ops.cc.
(matches_any_exception_type_p): Move to ops.cc.
(region_model::apply_constraints_for_eh_dispatch): Reimplement in
ops.cc as eh_dispatch_edge_op::apply_constraints.
(region_model::apply_constraints_for_eh_dispatch_try): Reimplement
in ops.cc as eh_dispatch_try_edge_op::apply_eh_constraints.
(region_model::apply_constraints_for_eh_dispatch_allowed):
Reimplement in ops.cc as
eh_dispatch_allowed_edge_op::apply_eh_constraints.
(region_model::apply_constraints_for_ggoto): Reimplement in ops.cc
as ggoto_edge_op::apply_constraints.
(caller_context::warn): Replace with...
(caller_context::get_pending_location_for_diag): ...this.
(region_model::get_or_create_region_for_heap_alloc): Fix
indentation.
(region_model_context::warn): New, replacing vfunc with
shared code that calls get_pending_location_for_diag and warn_at
vfuncs.
(engine::engine): Borrow m_mgr rather than own it.
(seldtest::test_state_merging): Update test for ptrs to different
base regions becoming unmergeable.
(selftest::test_widening_constraints): Port from function_point to
supernode.
* region-model.h: Include "analyzer/diagnostic-manager.h".
(region_model::on_setjmp): Add superedge param.
(region_model::void update_for_phis): Drop decl.
(region_model::handle_phi): Drop decl.
(region_model::maybe_update_for_edge): Drop decl.
(region_model::apply_constraints_for_eh_dispatch_try): Drop decl.
(region_model::apply_constraints_for_eh_dispatch_allowed): Drop
decl.
(region_model::update_for_call_superedge): Drop decl.
(region_model::update_for_return_superedge): Drop decl.
(region_model::apply_constraints_for_gcond): Drop decl.
(region_model::apply_constraints_for_gswitch): Drop decl.
(region_model::apply_constraints_for_ggoto): Drop decl.
(region_model::apply_constraints_for_eh_dispatch): Drop decl.
(region_model_context::warn): Convert from vfunc to func.
(region_model_context::get_pending_location_for_diag): New vfunc.
(region_model_context::warn_at): New vfunc.
(class noop_region_model_context): Update for changes to
region_model_context.
(class region_model_context_decorator): Likewise.
(class annotating_context): Likewise.
(struct model_merger): Port from function_point to supernode.
(class engine): Borrow m_mgr rather than own it.
(class test_region_model_context): Update for changes to
region_model_context.
* region.cc (frame_region::get_region_for_local): Update for
change to supergraph.
* sm-fd.cc: Drop redundant params throughout.  Pass stmt
rather than node to the various on_ calls.
* sm-file.cc: Drop redundant params throughout.
(register_known_file_functions): Register "*_unlocked" versions of
functions that I'd missed.
* sm-malloc.cc: Drop redundant params throughout.
(deref_before_check::loop_header_p): Reimplement cfg_superedge
check.
(malloc_state_machine::on_stmt): Move attribute-handling to...
(malloc_state_machine::check_call_preconditions): ...this new
function.
(maybe_complain_about_deref_before_check): Use
sm_ctxt.get_emission_location when checking for inlining.
* sm-pattern-test.cc: Drop redundant params throughout.
* sm-sensitive.cc: Likewise.
* sm-signal.cc: Likewise.
* sm-taint.cc: Likewise.
* sm.cc: Fix unused param warnings.
* sm.h: Include "analyzer/analyzer-logging.h".  Drop redundant
params throughout.
(state_machine::check_call_preconditions): New vfunc.
(sm_context::get_state): Drop "stmt" args.
(sm_context::set_next_state): Likewise.
(sm_context::on_transition): Drop "stmt" and "node" args.
(sm_context::warn): Likewise.
(sm_context::get_emission_location): New vfunc.
* state-purge.cc: Define INCLUDE_SET.
(class gimple_op_visitor): Replace function_point and function
with superedge.
(state_purge_map::state_purge_map): Iterate through ops on edges,
rather than on stmts in supernodes.
(state_purge_map::on_duplicated_node): New.
(state_purge_map::get_or_create_data_for_decl): Use supernode
rather than function_point.
(state_purge_per_ssa_name::state_purge_per_ssa_name): Likewise.
(state_purge_per_ssa_name::needed_at_point_p): Replace with...
(state_purge_per_ssa_name::needed_at_supernode_p): ...this.
(state_purge_per_ssa_name::before_use_stmt): Delete.
(state_purge_per_ssa_name::add_to_worklist): Use supernode rather
than function_point.
(name_used_by_phis_p): Delete.
(state_purge_per_ssa_name::process_point): Replace with...
(state_purge_per_ssa_name::process_supernode): ...this.
(state_purge_per_ssa_name::on_duplicated_node): New.
(state_purge_per_decl::state_purge_per_decl): Use supernode rather
than function_point.
(state_purge_per_decl::add_needed_at): Likewise.
(state_purge_per_decl::add_pointed_to_at): Likewise.
(state_purge_per_decl::process_worklists): Likewise.
(state_purge_per_decl::add_to_worklist): Likewise.
(state_purge_per_decl::process_point_backwards): Replace with...
(state_purge_per_decl::process_supernode_backwards): ...this.
(state_purge_per_decl::process_point_forwards): Replace with...
(state_purge_per_decl::process_supernode_forwards): ...this.
(state_purge_per_decl::needed_at_point_p): Replace with...
(state_purge_per_decl::needed_at_supernode_p): ...this.
(state_purge_per_decl::on_duplicated_node): New.
(print_vec_of_names): Drop "within_table" param.
(state_purge_annotator::add_stmt_annotations): Drop.
(state_purge_annotator::add_node_annotations): Reimplement.
* state-purge.h: Convert throughout from function_point to
supernode.
(state_purge_map::on_duplicated_node): New decl.
(state_purge_per_ssa_name::on_duplicated_node): Likewise.
(state_purge_per_decl::on_duplicated_node): Likewise.
* store.cc (needs_loop_replay_fixup_p): New.
(store::loop_replay_fixup): Use it rather than checking for
SK_WIDENING.
* supergraph-fixup-locations.cc: New file.
* supergraph-manipulation.h: New file.
* supergraph-simplify.cc: New file.
* supergraph-sorting.cc: New file.
* supergraph.cc: Define INCLUDE_DEQUE.  Drop include of
"tree-dfa.h".  Include "diagnostics/file-cache.h"
and "analyzer/exploded-graph.h".
(supergraph_call_edge): Delete.
(control_flow_stmt_p): New.
(supergraph::supergraph): Add "mgr" param.  Initialize
m_next_snode_id.  Reimplement.
(supergraph::populate_for_basic_block): New.
(supergraph::dump_dot_to_pp): Add auto_cfun sentinel.
Split up nodes using loop information from the original CFG,
then by basic block.  Call the node_annotator's
add_extra_objects vfunc.
(supergraph::dump_dot_to_gv_for_loop): New.
(supergraph::dump_dot_to_gv_for_bb): New, based on code in
dump_dot_to_pp.
(supergraph::add_node): Drop "returning_call" and "phi_nodes"
params. Add logger param and logging.  Use m_next_snode_id to
allow for node deletion.
(supergraph::add_cfg_edge): Delete.
(supergraph::add_call_superedge): Delete.
(supergraph::add_return_superedge): Delete.
(supergraph::delete_nodes): New.
(supergraph::add_sedges_for_cfg_edge): New.
(supernode::dump_dot): Drop output cluster, moving
add_node_annotations to within the dot node.  Show any SCC id.
Show m_preserve_p and m_state_merger_node.  Update for renaming of
supernode::return_p to supernode::exit_p.  Highlight nodes without
source location information.  Show m_loc and m_stmt_loc.  Show
source lines, with color for highlight.
(supernode::dump_dot_id): Update.
(supernode::to_json): Update.
(supernode::get_start_location): Delete.
(supernode::get_end_location): Delete.
(supernode::get_stmt_index): Delete.
(supernode::get_label): Delete.
(edge_kind_to_string): Delete.
(superedge::dump): Update for supernode::m_index becoming m_id.
(superedge::dump_dot): Drop ltail/lhead attrs.  Flush after
dumping the label.
(superedge::to_json): Reimplement.
(superedge::get_any_cfg_edge): Delete.
(superedge::get_any_callgraph_edge): Delete.
(superedge::preserve_p): New.
(superedge::supports_bulk_merge_p): New.
(cfg_superedge::dump_label_to_pp): Delete.
(superedge::dump_label_to_pp): New.
(cfg_superedge::get_phi_arg_idx): Delete.
(cfg_superedge::get_phi_arg): Delete.
(switch_cfg_superedge::switch_cfg_superedge): Delete.
(switch_cfg_superedge::dump_label_to_pp): Delete.
(switch_cfg_superedge::implicitly_created_default_p): Delete.
(get_catch): Move to ops.cc.
(eh_dispatch_cfg_superedge::make): Delete in favor of
eh_dispatch_edge_op::make.
(eh_dispatch_cfg_superedge::eh_dispatch_cfg_superedge): Delete.
(eh_dispatch_cfg_superedge::get_eh_status): Delete.
(eh_dispatch_try_cfg_superedge::dump_label_to_pp): Delete.
(eh_dispatch_try_cfg_superedge::apply_constraints): Delete.
(eh_dispatch_allowed_cfg_superedge::eh_dispatch_allowed_cfg_superedge):
Delete.
(eh_dispatch_allowed_cfg_superedge::dump_label_to_pp): Delete.
(eh_dispatch_allowed_cfg_superedge::apply_constraints): Delete.
(callgraph_superedge::dump_label_to_pp): Delete.
(callgraph_superedge::get_callee_function): Delete.
(callgraph_superedge::get_caller_function): Delete
(callgraph_superedge::get_callee_decl): Delete
(callgraph_superedge::get_call_stmt): Delete
(callgraph_superedge::get_caller_decl): Delete
(callgraph_superedge::get_arg_for_parm): Delete in favor of
call_and_return_op::get_arg_for_parm in ops.cc.
(callgraph_superedge::get_parm_for_arg): Delete in favor of
call_and_return_op::get_parm_for_arg in ops.cc.
(callgraph_superedge::map_expr_from_caller_to_callee): Delete in
favor of call_and_return_op::map_expr_from_caller_to_callee in
ops.cc.
(callgraph_superedge::map_expr_from_callee_to_caller): Delete in
favor of call_and_return_op::map_expr_from_callee_to_caller in
ops.cc.
* supergraph.h: Include "cfgloop.h" and "analyzer/ops.h".
(enum edge_kind): Delete.
(struct supergraph_traits::dump_args_t): Add m_eg.
(class supergraph): Rewrite leading comment.
(supergraph::supergraph): Add "mgr" param.
(supergraph::get_node_for_function_entry): Reimplement.
(supergraph::get_node_for_function_exit): Reimplement.
(supergraph::get_node_for_block): Convert to...
(supergraph::get_initial_node_for_block): ...this.
(supergraph::get_caller_next_node): Delete.
(supergraph::get_edge_for_call): Delete.
(supergraph::get_edge_for_return): Delete.
(supergraph::get_intraprocedural_edge_for_call): Delete.
(supergraph::get_edge_for_cfg_edge): Delete.
(supergraph::get_supernode_for_stmt): Delete.
(supergraph::get_final_node_for_block): New.
(supergraph::get_supernode_for_stmt): New.
(supergraph::get_superedge_for_phis): New.
(supergraph::get_node_by_index): Delete.
(supergraph::add_node): Drop "returning_call" and "phi_nodes"
params.  Add logger param.
(supergraph::add_cfg_edge): Delete.
(supergraph::add_call_superedge): Delete.
(supergraph::add_return_superedge): Delete.
(supergraph::log_stats): New decl.
(supergraph::delete_nodes): New decl.
(supergraph::fixup_locations): New decl.
(supergraph::simplify): New decl.
(supergraph::sort_nodes): New decl.
(supergraph::populate_for_basic_block): New decl.
(supergraph::add_sedges_for_cfg_edge): New decl.
(supergraph::dump_dot_to_gv_for_loop): New decl.
(supergraph::dump_dot_to_gv_for_bb): New decl.
(supergraph::reorder_nodes_and_ids): New decl.
(supergraph::bb_to_node_t): Make private.
(supergraph::m_bb_to_initial_node): Make private.
(supergraph::m_bb_to_final_node): Make private.
(supergraph::cgraph_edge_to_node_t): Delete typedef.
(supergraph::m_cgraph_edge_to_caller_prev_node): Delete.
(supergraph::m_cgraph_edge_to_caller_next_node): Delete.
(supergraph::cfg_edge_to_cfg_superedge_t): Delete typedef.
(supergraph::m_cfg_edge_to_cfg_superedge): Delete.
(supergraph::cgraph_edge_to_call_superedge_t): Delete typedef.
(supergraph::m_cgraph_edge_to_call_superedge): Delete
(supergraph::cgraph_edge_to_return_superedge_t): Delete typedef.
(supergraph::m_cgraph_edge_to_return_superedge): Delete.
(supergraph::cgraph_edge_to_intraproc_superedge_t): Delete
typedef.
(supergraph::m_cgraph_edge_to_intraproc_superedge): Delete.
(supergraph::stmt_to_node_t): Delete typedef.
(supergraph::m_stmt_to_node_t): Replace with...
(supergraph::m_node_for_stmt): ...this.
(supergraph::m_edges_for_phis): New field.
(supergraph::m_next_snode_id): New field.
(supergraph::m_snode_by_id): New field.
(supernode::supernode): Drop "returning_call" and "phi_nodes"
params.  Convert "index" to "id".  Update for changes to fields.
(supernode::return_p): Rename for clarity to...
(supernode::exit_p): ...this.
(supernode::get_start_location): Delete.
(supernode::get_end_location): Delete.
(supernode::start_phis): Delete.
(supernode::get_returning_call): Delete.
(supernode::print): New.
(supernode::get_last_stmt): Delete.
(supernode::get_final_call): Delete.
(supernode::get_stmt_index): Delete.
(supernode::get_location): New.
(supernode::get_label): Convert to trivial accessor.
(supernode::preserve_p): New.
(supernode::m_returning_call): Drop field.
(supernode::m_phi_nodes): Drop field.
(supernode::m_stmts): Drop field.
(supernode::m_index): Replace with...
(supernode::m_id): ...this.
(supernode::m_loc): New field.
(supernode::m_stmt_loc): New field.
(supernode::m_original_id): New field.
(supernode::m_label): New field.
(supernode::m_preserve_p): New field.
(supernode::m_state_merger_node): New field.
(class superedge): Update leading comment.
(superedge::superedge): Make public rather than protected.  Drop
"kind" param.  Add "op" and "cfg_edge" params.  Assert that edge
is intraprocedural.
(superedge::m_kind): Drop field.
(superedge::m_op): New field.
(superedge::m_cfg_edge): New field.
(superedge::dump_label_to_pp): Make non-virtual.
(superedge::get_op): New.
(superedge::set_op): New.
(superedge::get_kind): Drop.
(superedge::get_dest_snode): New accessor.
(superedge::dyn_cast_cfg_superedge): Delete.
(superedge::dyn_cast_switch_cfg_superedge): Delete
(superedge::dyn_cast_eh_dispatch_cfg_superedge): Delete
(superedge::dyn_cast_eh_dispatch_try_cfg_superedge): Delete
(superedge::dyn_cast_eh_dispatch_allowed_cfg_superedge): Delete
(superedge::dyn_cast_callgraph_superedge): Delete
(superedge::dyn_cast_callgraph_superedge): Delete
(superedge::dyn_cast_call_superedge): Delete
(superedge::dyn_cast_call_superedge): Delete
(superedge::dyn_cast_return_superedge): Delete
(superedge::dyn_cast_return_superedge): Delete
(superedge::get_any_cfg_edge): Convert to trivial accessor.
(superedge::get_any_callgraph_edge): Drop.
(superedge::preserve_p): New.
(superedge::supports_bulk_merge_p): New.
(class callgraph_superedge): Drop.
(is_a_helper <const callgraph_superedge *>::test): Drop.
(class call_superedge): Drop.
(is_a_helper <const call_superedge *>::test): Drop.
(class return_superedge): Drop.
(is_a_helper <const return_superedge *>::test): Drop.
(class cfg_superedge): Drop.
(class switch_cfg_superedge): Drop.
(is_a_helper <const switch_cfg_superedge *>::test): Drop.
(class eh_dispatch_cfg_superedge): Drop.
(is_a_helper <const eh_dispatch_cfg_superedge *>::test): Drop.
(class eh_dispatch_try_cfg_superedge): Drop.
(is_a_helper <const eh_dispatch_try_cfg_superedge *>::test): Drop.
(class eh_dispatch_allowed_cfg_superedge): Drop.
(is_a_helper <const eh_dispatch_allowed_cfg_superedge *>::test):
Drop.
(dot_annotator::~dot_annotator): Use "= default;".
(dot_annotator::add_node_annotations): Drop return value and
"within_table" param.
(dot_annotator::add_stmt_annotations): Drop.
(dot_annotator::add_after_node_annotations): Drop.
(dot_annotator::add_extra_objects): New.
(supergraph_call_edge): Delete decl.
(get_ultimate_function_for_cgraph_edge): Delete decl.
* svalue.cc (svalue::can_merge_p): Reject attempts to merge
pointers that point to different base regions, except for the case
where both are string literals.  Update for point change in
widening_svalue.
(svalue::cmp_ptr): Update for point change to widening_svalue.
(widening_svalue::dump_to_pp): Likewise.
(widening_svalue::print_dump_widget_label): Likewise.
* svalue.h (struct setjmp_record): Add m_sedge.
(class widening_svalue): Replace function_point m_point with
const supernode *m_snode throughout.
* varargs.cc (va_list_state_machine::on_stmt): Drop redundant
param.
(va_list_state_machine::on_va_start): Likewise.  Update for change
to get_state.
(va_list_state_machine::check_for_ended_va_list): Likewise.
(va_list_state_machine::on_va_copy): Likewise.
(va_list_state_machine::on_va_arg): Likewise.
(va_list_state_machine::on_va_end): Likewise.
(va_arg_diagnostic::add_call_event): Update for changes to
location-tracking.

gcc/testsuite/ChangeLog:
PR analyzer/122003
* c-c++-common/analyzer/allocation-size-multiline-1.c: Update for split
of region creation events.
* c-c++-common/analyzer/bzip2-arg-parse-1.c: Drop test for enode
merging.  Add -Wno-analyzer-too-complex.
* c-c++-common/analyzer/coreutils-cksum-pr108664.c: Add
-Wno-analyzer-symbol-too-complex.  Add dg-bogus for false +ve seen
during patch development.
* c-c++-common/analyzer/coreutils-group_number.c: New test.
* c-c++-common/analyzer/data-model-20.c: Mark warnings as xfail.
* c-c++-common/analyzer/deref-before-check-qemu-qtest_rsp_args.c:
Add xfails.
* c-c++-common/analyzer/dot-output.c: Update for changes to dumps.
* c-c++-common/analyzer/fd-symbolic-socket.c: Update for
improvements to locations of leaks.
* c-c++-common/analyzer/fibonacci.c: Update regex.
* c-c++-common/analyzer/flex-with-call-summaries.c: Add xfail.
* c-c++-common/analyzer/flex-without-call-summaries.c: Add
-Wno-analyzer-symbol-too-complex.  Add xfail.
* c-c++-common/analyzer/infinite-recursion-5.c: Disable cases that
now explode the analysis.
* c-c++-common/analyzer/infinite-recursion-pr108524-2.c: Remove
xfail.
* c-c++-common/analyzer/invalid-shift-1.c: Remove xfails with c++26.
* c-c++-common/analyzer/ipa-callbacks-1.c: New test.
* c-c++-common/analyzer/loop-4.c: Expect incorrect UNKNOWN within
loop.  Update expected number of enodes.
* c-c++-common/analyzer/loop-n-down-to-1-by-1.c: Expect incorrect
UNKNOWN within loop.
* c-c++-common/analyzer/loop.c: Drop xfail.
* c-c++-common/analyzer/out-of-bounds-coreutils.c: Expect infinite
loop warning.
* c-c++-common/analyzer/paths-4.c: Update expected number of
enodes.
* c-c++-common/analyzer/pr94362-1.c: Drop -Wno-analyzer-too-complex.
* c-c++-common/analyzer/pr94851-2.c: Add xfail.
* c-c++-common/analyzer/pr96650-1-notrans.c: Add
-Wno-analyzer-too-complex.
* c-c++-common/analyzer/pr98628.c: Likewise.
* c-c++-common/analyzer/pr99774-1.c: Likewise.
* c-c++-common/analyzer/pragma-2.c: Expect double-free warning.
* c-c++-common/analyzer/realloc-1.c: Move expected location of
leak from trailing "}" to realloc call.
* c-c++-common/analyzer/sock-1.c: Add -fno-exceptions.
* c-c++-common/analyzer/sprintf-2.c: Add __attribute__ nonnull to
decl.
* c-c++-common/analyzer/sprintf-concat.c: Move expected location
of leak of p from sprintf to trailing "}".
* c-c++-common/analyzer/stdarg-sentinel-1.c: Drop
-Wno-analyzer-too-complex.
* c-c++-common/analyzer/strncpy-1.c: Add __attribute__ nonnull to
decl.
* c-c++-common/analyzer/strstr-1.c: Likewise.
* g++.dg/analyzer/analyzer.exp: Drop -fanalyzer-call-summaries.
* g++.dg/analyzer/fanalyzer-show-events-in-system-headers-default.C:
Update expected messages.
* g++.dg/analyzer/fanalyzer-show-events-in-system-headers-no.C:
Likewise.
* g++.dg/analyzer/fanalyzer-show-events-in-system-headers.C: Likewise.
* g++.dg/analyzer/pr94028.C: Move expected location of leak
warning to where return value of f is discarded within m.
* g++.dg/analyzer/pr96641.C: Expect infinite recursion warning.
* gcc.dg/analyzer/CWE-131-examples.c: Add
-Wno-analyzer-too-complex.
* gcc.dg/analyzer/abs-1.c (test_2): Fix return type.
* gcc.dg/analyzer/analyzer-decls.h: Reformat.  Add
__attribute__ ((nothrow)) to all functions.
* gcc.dg/analyzer/analyzer.exp: Drop -fanalyzer-call-summaries.
* gcc.dg/analyzer/boxed-malloc-1.c: Fix return types.
* gcc.dg/analyzer/call-summaries-2.c: Likewise.
* gcc.dg/analyzer/combined-conditionals-1.c: Likewise.
* gcc.dg/analyzer/compound-assignment-2.c: Expect warning about
missing return.
* gcc.dg/analyzer/compound-assignment-3.c: Likewise.
* gcc.dg/analyzer/conditionals-3.c: Fix return type.
* gcc.dg/analyzer/data-model-1.c: Likewise.
* gcc.dg/analyzer/data-model-15.c: Likewise.
* gcc.dg/analyzer/data-model-17.c: Likewise.
* gcc.dg/analyzer/data-model-20a.c: Remove xfail from bogus leak.
* gcc.dg/analyzer/data-model-7.c: Fix return type.
* gcc.dg/analyzer/doom-d_main-IdentifyVersion.c: Add xfail to some
of the leak msgs.
* gcc.dg/analyzer/doom-s_sound-pr108867.c: Add xfail.
* gcc.dg/analyzer/edges-1.c: Update for improvements to location
of leak.
* gcc.dg/analyzer/error-1.c: Fix return type.
* gcc.dg/analyzer/explode-1.c: Drop xfail.  Expect uninit and
double-free warnings.
* gcc.dg/analyzer/explode-2.c: Add xfail.
* gcc.dg/analyzer/explode-3.c: Drop xfail.  Expect uninit and
double-free warnings.
* gcc.dg/analyzer/fd-datagram-socket.c: Move expected location of
leaks to closing "}"s.
* gcc.dg/analyzer/fd-glibc-byte-stream-connection-server.c: Add
false +ve leak message, due to not considering that program is
about to exit.
* gcc.dg/analyzer/fd-stream-socket.c: Move expected location of
leaks to closing "}"s.
* gcc.dg/analyzer/malloc-1.c: Fix return types.
* gcc.dg/analyzer/malloc-many-paths-2.c: Likewise.
* gcc.dg/analyzer/malloc-paths-10.c: Likewise.
* gcc.dg/analyzer/malloc-vs-local-4.c: Likewise.
* gcc.dg/analyzer/memset-CVE-2017-18549-1.c: Likewise.
* gcc.dg/analyzer/null-deref-pr102671-1.c: Enable
-fanalyzer-call-summaries.
* gcc.dg/analyzer/null-deref-pr102671-2.c: Remove xfail.
* gcc.dg/analyzer/pr101143.c: Fix return type.
* gcc.dg/analyzer/pr101837.c: Fix return type.  Add warning about
missing return.
* gcc.dg/analyzer/pr101983-not-main.c: Fix return type.
* gcc.dg/analyzer/pr103892.c: Enable -fanalyzer-call-summaries.
* gcc.dg/analyzer/pr104224.c: Add xfails.
* gcc.dg/analyzer/pr104434-nonconst.c: Likewise.
* gcc.dg/analyzer/pr93032-mztools-signed-char.c: Increase
exploration limits by a factor of 5.
* gcc.dg/analyzer/pr93032-mztools-unsigned-char.c: Likewise.
* gcc.dg/analyzer/pr93355-localealias-feasibility-2.c: Fix return type.
* gcc.dg/analyzer/pr93355-localealias.c: Add xfail.  Add expected
leak true +ve and uninit false +ve.
* gcc.dg/analyzer/pr94579.c: Add warning about missing return.
* gcc.dg/analyzer/pr98599-a.c: Add missing return stmts.
* gcc.dg/analyzer/pr99771-1.c: Fix expected locations of leaks.
* gcc.dg/analyzer/pr99774-2.c: Likewise.
* gcc.dg/analyzer/sensitive-1.c: Fix return types.
* gcc.dg/analyzer/state-diagram-1-sarif.py: Update.
* gcc.dg/analyzer/stdarg-1.c
(__analyzer_test_not_enough_args_2_middle): Add test coverage for
wording of call event with variadic args.
* gcc.dg/analyzer/strcmp-1.c: Fix return types.
* gcc.dg/analyzer/strcpy-1.c: Likewise.
* gcc.dg/analyzer/switch-enum-taint-1.c: Add warning about missing
return.
* gcc.dg/analyzer/switch.c: Fix return types.
* gcc.dg/analyzer/taint-assert.c: Likewise.
* gcc.dg/analyzer/taint-write-offset-1.c: Likewise.
* gcc.dg/analyzer/torture/analyzer-torture.exp: Drop
-fanalyzer-call-summaries.
* gcc.dg/analyzer/torture/boxed-ptr-1.c: Fix return type.
* gcc.dg/analyzer/torture/fold-ptr-arith-pr105784.c: Add
-Wno-analyzer-too-complex.
* gcc.dg/analyzer/torture/loop-inc-ptr-1.c: Skip at -O3 to avoid
changes to enode count.
* gcc.dg/analyzer/torture/pr102225.c: Consolidate on one line to
avoid caring about precise location of leak warning.
* gcc.dg/analyzer/torture/pr93379.c: Skip on -fno-fat-lto-objects.
Add warning about uninit.
* gcc.dg/analyzer/torture/stdarg-4.c: Replace UNKNOWN with
symbolic sum of params.
* gcc.dg/analyzer/untracked-1.c: Fix return type.
* gcc.dg/analyzer/use-after-free.c: Likewise.
* gcc.dg/analyzer/zlib-3.c: Add xfails.
* gcc.dg/plugin/analyzer_cpython_plugin.cc
(class refcnt_stmt_finder): Eliminate.
(check_refcnt): ...in favor of a call to
make_ploc_fixer_for_epath_for_leak_diagnostic.
* gcc.dg/plugin/analyzer_gil_plugin.cc: Update for
location-handling changes.
* gcc.dg/plugin/infoleak-CVE-2011-1078-1.c: Add missing
"return 0;".
* gcc.dg/plugin/infoleak-CVE-2011-1078-2.c: Fix return types.
* gcc.dg/plugin/infoleak-CVE-2017-18549-1.c: Likewise.
* gdc.dg/analyzer/analyzer.exp: Drop -fanalyzer-call-summaries.
* gfortran.dg/analyzer/analyzer.exp: Likewise.
* gfortran.dg/analyzer/uninit-pr63311.f90: Add
-Wno-analyzer-too-complex.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
4 days agortlanal: Use REG_UNUSED notes in single_set only in passes where df_analyze has compu...
Jakub Jelinek [Fri, 12 Dec 2025 14:18:08 +0000 (15:18 +0100)] 
rtlanal: Use REG_UNUSED notes in single_set only in passes where df_analyze has computed them [PR121852]

REG_UNUSED and REG_DEAD notes are only valid when computed by df
with df_note_add_problem () before df_analyze ().
Generally, especially CSE/GCSE optimizations can invalidate those
notes by reusing the REG_UNUSED results later on, unfortunately dropping
REG_UNUSED notes in such cases is not very easy.
See e.g. PR113059 and PR40209 for additional details.

Most users of REG_UNUSED/REG_DEAD notes add the note problems, but
single_set function is called from many of the passes and requiring
that df_note_add_problem () is done in each such a case would be very
slow and would need some checking.

The following patch instead limits the use of REG_UNUSED notes to
passes which have the note problem computed (i.e. df && df_note), and
for pseudos as a fallback uses DF_REG_USE_COUNT == 0 check if at least
df is computed.

2025-12-12  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/121852
* rtlanal.cc (single_set_2): Only look for REG_UNUSED notes if
df && df_note, otherwise if df and SET_DEST is a pseudo with
DF_REG_USE_COUNT 0, assume it is unused as well.  Otherwise
assume it may be used.

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

4 days agoAArch64: Flip svbool_t equal conditionals in ternary operators.
Tejas Belagod [Tue, 11 Nov 2025 16:35:23 +0000 (16:35 +0000)] 
AArch64: Flip svbool_t equal conditionals in ternary operators.

This patch flips == conditions:

  p == q ? s1 : s2;

to

  p != q ? s2 : s1;

where p and q are svbool_t expression types. This is an optimization
to avoid generating an extra bit inverse to check for equality.

gcc/

* config/aarch64/aarch64.cc (aarch64_instruction_selection): Flip
svbool_t == to != to avoid extra bit-inverse.

gcc/testsuite/

* g++.target/aarch64/sve/acle/general-c++/svbool_ternary.C: New test.

Co-authored-by: Tamar Christina <tamar.christina@arm.com>
4 days agoopenmp: 2 further testsuite tweaks for -Wdeprecated-openmp [PR123098]
Jakub Jelinek [Fri, 12 Dec 2025 08:43:45 +0000 (09:43 +0100)] 
openmp: 2 further testsuite tweaks for -Wdeprecated-openmp [PR123098]

2025-12-12  Jakub Jelinek  <jakub@redhat.com>

PR testsuite/123098
* gcc.dg/debug/dwarf2/omp-fesdr.c: Use #pragma omp masked
instead of #pragma omp master.
* g++.dg/debug/dwarf2/omp-fesdr.C: Likewise.

4 days agoLoongArch: Add deleted testcases
mengqinggang [Thu, 11 Dec 2025 06:38:52 +0000 (14:38 +0800)] 
LoongArch: Add deleted testcases

Add gcc.target/loongarch/la64 path for LA64 testcases.
Move vector testcases in gcc.target/loongarch to
gcc.target/loongarch/vector/lsx or gcc.target/loongarch/vector/lasx.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/la64/add-const.c: New test.
* gcc.target/loongarch/la64/alsl-cost.c: New test.
* gcc.target/loongarch/la64/alsl_wu.c: New test.
* gcc.target/loongarch/la64/and-large-immediate-opt.c: New test.
* gcc.target/loongarch/la64/arch-func-attr-1.c: New test.
* gcc.target/loongarch/la64/arch-pragma-attr-1.c: New test.
* gcc.target/loongarch/la64/attr-model-1.c: New test.
* gcc.target/loongarch/la64/attr-model-2.c: New test.
* gcc.target/loongarch/la64/attr-model-3.c: New test.
* gcc.target/loongarch/la64/attr-model-4.c: New test.
* gcc.target/loongarch/la64/attr-model-5.c: New test.
* gcc.target/loongarch/la64/attr-model-diag.c: New test.
* gcc.target/loongarch/la64/attr-model-test.c: New test.
* gcc.target/loongarch/la64/bitint-alignments.c: New test.
* gcc.target/loongarch/la64/bitint-args.c: New test.
* gcc.target/loongarch/la64/bitint-sizes.c: New test.
* gcc.target/loongarch/la64/bitwise-shift-reassoc.c: New test.
* gcc.target/loongarch/la64/bitwise_extend.c: New test.
* gcc.target/loongarch/la64/bstrins-1.c: New test.
* gcc.target/loongarch/la64/bstrins-2.c: New test.
* gcc.target/loongarch/la64/bstrins-3.c: New test.
* gcc.target/loongarch/la64/bstrins-4.c: New test.
* gcc.target/loongarch/la64/bstrpick_alsl_paired.c: New test.
* gcc.target/loongarch/la64/bytepick_combine.c: New test.
* gcc.target/loongarch/la64/bytepick_shift_128.c: New test.
* gcc.target/loongarch/la64/can_inline_1.c: New test.
* gcc.target/loongarch/la64/can_inline_2.c: New test.
* gcc.target/loongarch/la64/can_inline_3.c: New test.
* gcc.target/loongarch/la64/can_inline_4.c: New test.
* gcc.target/loongarch/la64/can_inline_5.c: New test.
* gcc.target/loongarch/la64/can_inline_6.c: New test.
* gcc.target/loongarch/la64/cmodel-extreme-1.c: New test.
* gcc.target/loongarch/la64/cmodel-extreme-2.c: New test.
* gcc.target/loongarch/la64/cmodel-func-attr-1.c: New test.
* gcc.target/loongarch/la64/cmodel-pragma-attr-1.c: New test.
* gcc.target/loongarch/la64/cmov_ii.c: New test.
* gcc.target/loongarch/la64/compare-both-non-zero.c: New test.
* gcc.target/loongarch/la64/conditional-move-opt-1.c: New test.
* gcc.target/loongarch/la64/conditional-move-opt-2.c: New test.
* gcc.target/loongarch/la64/conditional-move-opt-3.c: New test.
* gcc.target/loongarch/la64/const-double-zero-stx.c: New test.
* gcc.target/loongarch/la64/crc-sext.c: New test.
* gcc.target/loongarch/la64/direct-extern-1.c: New test.
* gcc.target/loongarch/la64/div-div32.c: New test.
* gcc.target/loongarch/la64/div-no-div32.c: New test.
* gcc.target/loongarch/la64/divf.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-extreme-tls-desc.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-lto.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-single-load-store-2.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-single-load-store-3.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-single-load-store-no-anchor.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-single-load-store.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-tls-desc.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-tls-ld-gd.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-auto-tls-le-ie.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-extreme-auto-tls-ld-gd.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-extreme-tls-desc.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-medium-auto-tls-ld-gd.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-medium-call36-auto-tls-ld-gd.c: New test.
* gcc.target/loongarch/la64/explicit-relocs-tls-desc.c: New test.
* gcc.target/loongarch/la64/extendsidi2-combine.c: New test.
* gcc.target/loongarch/la64/fclass-compile.c: New test.
* gcc.target/loongarch/la64/fclass-run.c: New test.
* gcc.target/loongarch/la64/flogb.c: New test.
* gcc.target/loongarch/la64/flt-abi-isa-1.c: New test.
* gcc.target/loongarch/la64/flt-abi-isa-2.c: New test.
* gcc.target/loongarch/la64/flt-abi-isa-3.c: New test.
* gcc.target/loongarch/la64/flt-abi-isa-4.c: New test.
* gcc.target/loongarch/la64/frint.c: New test.
* gcc.target/loongarch/la64/fscaleb.c: New test.
* gcc.target/loongarch/la64/ftint-no-inexact.c: New test.
* gcc.target/loongarch/la64/ftint.c: New test.
* gcc.target/loongarch/la64/func-call-1.c: New test.
* gcc.target/loongarch/la64/func-call-2.c: New test.
* gcc.target/loongarch/la64/func-call-3.c: New test.
* gcc.target/loongarch/la64/func-call-4.c: New test.
* gcc.target/loongarch/la64/func-call-5.c: New test.
* gcc.target/loongarch/la64/func-call-6.c: New test.
* gcc.target/loongarch/la64/func-call-7.c: New test.
* gcc.target/loongarch/la64/func-call-8.c: New test.
* gcc.target/loongarch/la64/func-call-extreme-1.c: New test.
* gcc.target/loongarch/la64/func-call-extreme-2.c: New test.
* gcc.target/loongarch/la64/func-call-extreme-3.c: New test.
* gcc.target/loongarch/la64/func-call-extreme-4.c: New test.
* gcc.target/loongarch/la64/func-call-extreme-5.c: New test.
* gcc.target/loongarch/la64/func-call-extreme-6.c: New test.
* gcc.target/loongarch/la64/func-call-medium-1.c: New test.
* gcc.target/loongarch/la64/func-call-medium-2.c: New test.
* gcc.target/loongarch/la64/func-call-medium-3.c: New test.
* gcc.target/loongarch/la64/func-call-medium-5.c: New test.
* gcc.target/loongarch/la64/func-call-medium-6.c: New test.
* gcc.target/loongarch/la64/func-call-medium-7.c: New test.
* gcc.target/loongarch/la64/func-call-medium-8.c: New test.
* gcc.target/loongarch/la64/func-call-medium-call36-1.c: New test.
* gcc.target/loongarch/la64/func-call-medium-call36.c: New test.
* gcc.target/loongarch/la64/imm-load.c: New test.
* gcc.target/loongarch/la64/imm-load1.c: New test.
* gcc.target/loongarch/la64/invariant-recip.c: New test.
* gcc.target/loongarch/la64/la64.exp: New test.
* gcc.target/loongarch/la64/larch-frecipe-builtin.c: New test.
* gcc.target/loongarch/la64/larch-frecipe-intrinsic.c: New test.
* gcc.target/loongarch/la64/lasx-func-attr-1.c: New test.
* gcc.target/loongarch/la64/lasx-pragma-attr-1.c: New test.
* gcc.target/loongarch/la64/lsx-func-attr-1.c: New test.
* gcc.target/loongarch/la64/lsx-pragma-attr-1.c: New test.
* gcc.target/loongarch/la64/math-float-128.c: New test.
* gcc.target/loongarch/la64/mem-and-mask-opt.c: New test.
* gcc.target/loongarch/la64/memcpy-vec-1.c: New test.
* gcc.target/loongarch/la64/memcpy-vec-2.c: New test.
* gcc.target/loongarch/la64/memcpy-vec-3.c: New test.
* gcc.target/loongarch/la64/mode-tieable-opt.c: New test.
* gcc.target/loongarch/la64/mov-zero-2.c: New test.
* gcc.target/loongarch/la64/movcf2gr-via-fr.c: New test.
* gcc.target/loongarch/la64/movcf2gr.c: New test.
* gcc.target/loongarch/la64/mul-const-reduction.c: New test.
* gcc.target/loongarch/la64/mulh_wu.c: New test.
* gcc.target/loongarch/la64/mulw_d_w.c: New test.
* gcc.target/loongarch/la64/mulw_d_wu.c: New test.
* gcc.target/loongarch/la64/pr109465-1.c: New test.
* gcc.target/loongarch/la64/pr109465-2.c: New test.
* gcc.target/loongarch/la64/pr109465-3.c: New test.
* gcc.target/loongarch/la64/pr113148.c: New test.
* gcc.target/loongarch/la64/pr114861.c: New test.
* gcc.target/loongarch/la64/pr118561.c: New test.
* gcc.target/loongarch/la64/pr118828-2.c: New test.
* gcc.target/loongarch/la64/pr118828-3.c: New test.
* gcc.target/loongarch/la64/pr118828-4.c: New test.
* gcc.target/loongarch/la64/pr118828.c: New test.
* gcc.target/loongarch/la64/pr118843.c: New test.
* gcc.target/loongarch/la64/pr119127.c: New test.
* gcc.target/loongarch/la64/pr121542.c: New test.
* gcc.target/loongarch/la64/pr121634.c: New test.
* gcc.target/loongarch/la64/pr121875.c: New test.
* gcc.target/loongarch/la64/prolog-opt.c: New test.
* gcc.target/loongarch/la64/recip-divf.c: New test.
* gcc.target/loongarch/la64/recip-sqrtf.c: New test.
* gcc.target/loongarch/la64/relocs-symbol-noaddend.c: New test.
* gcc.target/loongarch/la64/revb.c: New test.
* gcc.target/loongarch/la64/rotl-with-rotr.c: New test.
* gcc.target/loongarch/la64/rotrw.c: New test.
* gcc.target/loongarch/la64/sign-extend-1.c: New test.
* gcc.target/loongarch/la64/sign-extend-2.c: New test.
* gcc.target/loongarch/la64/sign-extend-3.c: New test.
* gcc.target/loongarch/la64/sign-extend-4.c: New test.
* gcc.target/loongarch/la64/sign-extend-5.c: New test.
* gcc.target/loongarch/la64/sign-extend-6.c: New test.
* gcc.target/loongarch/la64/sign-extend-bitwise.c: New test.
* gcc.target/loongarch/la64/sign_extend_ashift.c: New test.
* gcc.target/loongarch/la64/slt-sign-extend.c: New test.
* gcc.target/loongarch/la64/smuldi3_highpart.c: New test.
* gcc.target/loongarch/la64/spill-less.c: New test.
* gcc.target/loongarch/la64/sqrtf.c: New test.
* gcc.target/loongarch/la64/switch-qi.c: New test.
* gcc.target/loongarch/la64/tls-extreme-macro.c: New test.
* gcc.target/loongarch/la64/tls-gd-noplt.c: New test.
* gcc.target/loongarch/la64/tls-ie-extreme.c: New test.
* gcc.target/loongarch/la64/tls-ie-norelax.c: New test.
* gcc.target/loongarch/la64/tls-ie-relax.c: New test.
* gcc.target/loongarch/la64/tls-le-relax.c: New test.
* gcc.target/loongarch/la64/widen-mul-rtx-cost-signed.c: New test.
* gcc.target/loongarch/la64/widen-mul-rtx-cost-unsigned.c: New test.
* gcc.target/loongarch/la64/zero-size-field-pass.c: New test.
* gcc.target/loongarch/la64/zero-size-field-ret.c: New test.
* gcc.target/loongarch/vector/lasx/abd-lasx.c: New test.
* gcc.target/loongarch/vector/lasx/avg-ceil-lasx.c: New test.
* gcc.target/loongarch/vector/lasx/avg-floor-lasx.c: New test.
* gcc.target/loongarch/vector/lasx/fnmam4-vec.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-andn-iorn.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-extract-even_odd-opt.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-func-attr-2.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-pragma-attr-2.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-reduc-1.c: New test.
* gcc.target/loongarch/vector/lasx/lasx-xvpermi_q-opt.c: New test.
* gcc.target/loongarch/vector/lasx/pr112476-2.c: New test.
* gcc.target/loongarch/vector/lasx/pr112476-4.c: New test.
* gcc.target/loongarch/vector/lasx/pr113033.c: New test.
* gcc.target/loongarch/vector/lasx/pragma-push-pop.c: New test.
* gcc.target/loongarch/vector/lasx/rotl-with-xvrotr-b.c: New test.
* gcc.target/loongarch/vector/lasx/rotl-with-xvrotr-d.c: New test.
* gcc.target/loongarch/vector/lasx/rotl-with-xvrotr-h.c: New test.
* gcc.target/loongarch/vector/lasx/rotl-with-xvrotr-w.c: New test.
* gcc.target/loongarch/vector/lasx/sad-lasx.c: New test.
* gcc.target/loongarch/vector/lasx/strict-align.c: New test.
* gcc.target/loongarch/vector/lasx/vec_pack_unpack_256.c: New test.
* gcc.target/loongarch/vector/lasx/vec_reduc_half.c: New test.
* gcc.target/loongarch/vector/lasx/vect-extract.c: New test.
* gcc.target/loongarch/vector/lasx/vect-frint-no-inexact.c: New test.
* gcc.target/loongarch/vector/lasx/vect-frint.c: New test.
* gcc.target/loongarch/vector/lasx/vect-ftint-no-inexact.c: New test.
* gcc.target/loongarch/vector/lasx/vect-ftint.c: New test.
* gcc.target/loongarch/vector/lasx/vect-ld-st-imm12.c: New test.
* gcc.target/loongarch/vector/lasx/vect-muh.c: New test.
* gcc.target/loongarch/vector/lasx/vect-rotr.c: New test.
* gcc.target/loongarch/vector/lasx/vect-shuf-fp.c: New test.
* gcc.target/loongarch/vector/lasx/vect-slp-two-operator.c: New test.
* gcc.target/loongarch/vector/lasx/vect-widen-add.c: New test.
* gcc.target/loongarch/vector/lasx/vect-widen-mul.c: New test.
* gcc.target/loongarch/vector/lasx/vect-widen-sub.c: New test.
* gcc.target/loongarch/vector/lasx/vfmax-vfmin.c: New test.
* gcc.target/loongarch/vector/lasx/vrepli.c: New test.
* gcc.target/loongarch/vector/lasx/wide-mul-reduc-1.c: New test.
* gcc.target/loongarch/vector/lasx/wide-mul-reduc-2.c: New test.
* gcc.target/loongarch/vector/lasx/xvfcmp-d.c: New test.
* gcc.target/loongarch/vector/lasx/xvfcmp-f.c: New test.
* gcc.target/loongarch/vector/lsx/abd-lsx.c: New test.
* gcc.target/loongarch/vector/lsx/avg-ceil-lsx.c: New test.
* gcc.target/loongarch/vector/lsx/avg-floor-lsx.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-andn-iorn.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-func-attr-2.c: New test.
* gcc.target/loongarch/vector/lsx/lsx-pragma-attr-2.c: New test.
* gcc.target/loongarch/vector/lsx/mov-zero-1.c: New test.
* gcc.target/loongarch/vector/lsx/popcnt.c: New test.
* gcc.target/loongarch/vector/lsx/popcount.c: New test.
* gcc.target/loongarch/vector/lsx/pr112476-1.c: New test.
* gcc.target/loongarch/vector/lsx/pr112476-3.c: New test.
* gcc.target/loongarch/vector/lsx/pr119084.c: New test.
* gcc.target/loongarch/vector/lsx/pr121064.c: New test.
* gcc.target/loongarch/vector/lsx/pr122097.c: New test.
* gcc.target/loongarch/vector/lsx/rotl-with-vrotr-b.c: New test.
* gcc.target/loongarch/vector/lsx/rotl-with-vrotr-d.c: New test.
* gcc.target/loongarch/vector/lsx/rotl-with-vrotr-h.c: New test.
* gcc.target/loongarch/vector/lsx/rotl-with-vrotr-w.c: New test.
* gcc.target/loongarch/vector/lsx/sad-lsx.c: New test.
* gcc.target/loongarch/vector/lsx/vec_pack_unpack_128.c: New test.
* gcc.target/loongarch/vector/lsx/vect-frint-scalar-no-inexact.c: New test.
* gcc.target/loongarch/vector/lsx/vect-frint-scalar.c: New test.
* gcc.target/loongarch/vector/lsx/vect-shift-imm-round.c: New test.
* gcc.target/loongarch/vector/lsx/vector-func-attr-1.c: New test.
* gcc.target/loongarch/vector/lsx/vector-pragma-attr-1.c: New test.
* gcc.target/loongarch/vector/lsx/vfcmp-d.c: New test.
* gcc.target/loongarch/vector/lsx/vfcmp-f.c: New test.
* gcc.target/loongarch/vector/lsx/xorsign-run.c: New test.
* gcc.target/loongarch/vector/lsx/xorsign.c: New test.

4 days agoLoongArch: Testcases for LA32
mengqinggang [Thu, 11 Dec 2025 06:37:39 +0000 (14:37 +0800)] 
LoongArch: Testcases for LA32

Delete LA64 testcases in gcc.target/loongarch.
Add a new path gcc.target/loongarch/la64 for LA64 testcases in next patch.

Delete vector testcases in gcc.target/loongarch.
Move these vector testcases to gcc.target/loongarch/vector/lsx
or gcc.target/loongarch/vector/lasx in next patch.

gcc/testsuite/ChangeLog:

* g++.target/loongarch/bytepick.C: Skip on LA32.
* g++.target/loongarch/got-load.C: Likewise.
* g++.target/loongarch/pr106828.C: Likewise.
* g++.target/loongarch/vect-ashr-lshr.C: Add loongarch_asx check.
* gcc.dg/ifcvt-4.c: Skip on LA32.
* gcc.dg/stack-usage-1.c: Change __loongarch_lp64 to __loongarch__.
* gcc.dg/tree-ssa/gen-vect-2.c: Skip on LoongArch.
* gcc.dg/tree-ssa/gen-vect-25.c: Likewise.
* gcc.dg/tree-ssa/pr83403-1.c: Add dg-additional-options.
* gcc.dg/tree-ssa/pr83403-2.c: Likewise.
* gcc.target/loongarch/float-load.c: Add hard_float check.
* gcc.target/loongarch/larch-builtin.c: Skip some check on LA32.
* gcc.target/loongarch/pr115752.c: Add hard_float check.
* gcc.target/loongarch/vector/loongarch-vector.exp: Add
check_effective_target_loongarch_sx.
* lib/target-supports.exp: Add hard float condition to
check_effective_target_scalar_all_fma.
Disable loongarch for check_effective_target_vect_cmdline_needed.
Add check_effective_target_loongarch_sx condition to
check_vect_support_and_set_flags.
* gcc.target/loongarch/abd-lasx.c: Removed.
* gcc.target/loongarch/abd-lsx.c: Removed.
* gcc.target/loongarch/add-const.c: Removed.
* gcc.target/loongarch/alsl-cost.c: Removed.
* gcc.target/loongarch/alsl_wu.c: Removed.
* gcc.target/loongarch/and-large-immediate-opt.c: Removed.
* gcc.target/loongarch/arch-func-attr-1.c: Removed.
* gcc.target/loongarch/arch-pragma-attr-1.c: Removed.
* gcc.target/loongarch/attr-model-1.c: Removed.
* gcc.target/loongarch/attr-model-2.c: Removed.
* gcc.target/loongarch/attr-model-3.c: Removed.
* gcc.target/loongarch/attr-model-4.c: Removed.
* gcc.target/loongarch/attr-model-5.c: Removed.
* gcc.target/loongarch/attr-model-diag.c: Removed.
* gcc.target/loongarch/attr-model-test.c: Removed.
* gcc.target/loongarch/avg-ceil-lasx.c: Removed.
* gcc.target/loongarch/avg-ceil-lsx.c: Removed.
* gcc.target/loongarch/avg-floor-lasx.c: Removed.
* gcc.target/loongarch/avg-floor-lsx.c: Removed.
* gcc.target/loongarch/bitint-alignments.c: Removed.
* gcc.target/loongarch/bitint-args.c: Removed.
* gcc.target/loongarch/bitint-sizes.c: Removed.
* gcc.target/loongarch/bitwise-shift-reassoc.c: Removed.
* gcc.target/loongarch/bitwise_extend.c: Removed.
* gcc.target/loongarch/bstrins-1.c: Removed.
* gcc.target/loongarch/bstrins-2.c: Removed.
* gcc.target/loongarch/bstrins-3.c: Removed.
* gcc.target/loongarch/bstrins-4.c: Removed.
* gcc.target/loongarch/bstrpick_alsl_paired.c: Removed.
* gcc.target/loongarch/bytepick_combine.c: Removed.
* gcc.target/loongarch/bytepick_shift_128.c: Removed.
* gcc.target/loongarch/can_inline_1.c: Removed.
* gcc.target/loongarch/can_inline_2.c: Removed.
* gcc.target/loongarch/can_inline_3.c: Removed.
* gcc.target/loongarch/can_inline_4.c: Removed.
* gcc.target/loongarch/can_inline_5.c: Removed.
* gcc.target/loongarch/can_inline_6.c: Removed.
* gcc.target/loongarch/cmodel-extreme-1.c: Removed.
* gcc.target/loongarch/cmodel-extreme-2.c: Removed.
* gcc.target/loongarch/cmodel-func-attr-1.c: Removed.
* gcc.target/loongarch/cmodel-pragma-attr-1.c: Removed.
* gcc.target/loongarch/cmov_ii.c: Removed.
* gcc.target/loongarch/compare-both-non-zero.c: Removed.
* gcc.target/loongarch/conditional-move-opt-1.c: Removed.
* gcc.target/loongarch/conditional-move-opt-2.c: Removed.
* gcc.target/loongarch/conditional-move-opt-3.c: Removed.
* gcc.target/loongarch/const-double-zero-stx.c: Removed.
* gcc.target/loongarch/crc-sext.c: Removed.
* gcc.target/loongarch/direct-extern-1.c: Removed.
* gcc.target/loongarch/div-div32.c: Removed.
* gcc.target/loongarch/div-no-div32.c: Removed.
* gcc.target/loongarch/divf.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-extreme-tls-desc.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-lto.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-single-load-store-2.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-single-load-store-3.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-single-load-store-no-anchor.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-single-load-store.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-tls-desc.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-tls-ld-gd.c: Removed.
* gcc.target/loongarch/explicit-relocs-auto-tls-le-ie.c: Removed.
* gcc.target/loongarch/explicit-relocs-extreme-auto-tls-ld-gd.c: Removed.
* gcc.target/loongarch/explicit-relocs-extreme-tls-desc.c: Removed.
* gcc.target/loongarch/explicit-relocs-medium-auto-tls-ld-gd.c: Removed.
* gcc.target/loongarch/explicit-relocs-medium-call36-auto-tls-ld-gd.c: Removed.
* gcc.target/loongarch/explicit-relocs-tls-desc.c: Removed.
* gcc.target/loongarch/extendsidi2-combine.c: Removed.
* gcc.target/loongarch/fclass-compile.c: Removed.
* gcc.target/loongarch/fclass-run.c: Removed.
* gcc.target/loongarch/flogb.c: Removed.
* gcc.target/loongarch/flt-abi-isa-1.c: Removed.
* gcc.target/loongarch/flt-abi-isa-2.c: Removed.
* gcc.target/loongarch/flt-abi-isa-3.c: Removed.
* gcc.target/loongarch/flt-abi-isa-4.c: Removed.
* gcc.target/loongarch/fnmam4-vec.c: Removed.
* gcc.target/loongarch/frint.c: Removed.
* gcc.target/loongarch/fscaleb.c: Removed.
* gcc.target/loongarch/ftint-no-inexact.c: Removed.
* gcc.target/loongarch/ftint.c: Removed.
* gcc.target/loongarch/func-call-1.c: Removed.
* gcc.target/loongarch/func-call-2.c: Removed.
* gcc.target/loongarch/func-call-3.c: Removed.
* gcc.target/loongarch/func-call-4.c: Removed.
* gcc.target/loongarch/func-call-5.c: Removed.
* gcc.target/loongarch/func-call-6.c: Removed.
* gcc.target/loongarch/func-call-7.c: Removed.
* gcc.target/loongarch/func-call-8.c: Removed.
* gcc.target/loongarch/func-call-extreme-1.c: Removed.
* gcc.target/loongarch/func-call-extreme-2.c: Removed.
* gcc.target/loongarch/func-call-extreme-3.c: Removed.
* gcc.target/loongarch/func-call-extreme-4.c: Removed.
* gcc.target/loongarch/func-call-extreme-5.c: Removed.
* gcc.target/loongarch/func-call-extreme-6.c: Removed.
* gcc.target/loongarch/func-call-medium-1.c: Removed.
* gcc.target/loongarch/func-call-medium-2.c: Removed.
* gcc.target/loongarch/func-call-medium-3.c: Removed.
* gcc.target/loongarch/func-call-medium-5.c: Removed.
* gcc.target/loongarch/func-call-medium-6.c: Removed.
* gcc.target/loongarch/func-call-medium-7.c: Removed.
* gcc.target/loongarch/func-call-medium-8.c: Removed.
* gcc.target/loongarch/func-call-medium-call36-1.c: Removed.
* gcc.target/loongarch/func-call-medium-call36.c: Removed.
* gcc.target/loongarch/imm-load.c: Removed.
* gcc.target/loongarch/imm-load1.c: Removed.
* gcc.target/loongarch/invariant-recip.c: Removed.
* gcc.target/loongarch/larch-frecipe-builtin.c: Removed.
* gcc.target/loongarch/larch-frecipe-intrinsic.c: Removed.
* gcc.target/loongarch/lasx-andn-iorn.c: Removed.
* gcc.target/loongarch/lasx-extract-even_odd-opt.c: Removed.
* gcc.target/loongarch/lasx-func-attr-1.c: Removed.
* gcc.target/loongarch/lasx-func-attr-2.c: Removed.
* gcc.target/loongarch/lasx-pragma-attr-1.c: Removed.
* gcc.target/loongarch/lasx-pragma-attr-2.c: Removed.
* gcc.target/loongarch/lasx-reduc-1.c: Removed.
* gcc.target/loongarch/lasx-xvpermi_q-opt.c: Removed.
* gcc.target/loongarch/lsx-andn-iorn.c: Removed.
* gcc.target/loongarch/lsx-func-attr-1.c: Removed.
* gcc.target/loongarch/lsx-func-attr-2.c: Removed.
* gcc.target/loongarch/lsx-pragma-attr-1.c: Removed.
* gcc.target/loongarch/lsx-pragma-attr-2.c: Removed.
* gcc.target/loongarch/math-float-128.c: Removed.
* gcc.target/loongarch/mem-and-mask-opt.c: Removed.
* gcc.target/loongarch/memcpy-vec-1.c: Removed.
* gcc.target/loongarch/memcpy-vec-2.c: Removed.
* gcc.target/loongarch/memcpy-vec-3.c: Removed.
* gcc.target/loongarch/mode-tieable-opt.c: Removed.
* gcc.target/loongarch/mov-zero-1.c: Removed.
* gcc.target/loongarch/mov-zero-2.c: Removed.
* gcc.target/loongarch/movcf2gr-via-fr.c: Removed.
* gcc.target/loongarch/movcf2gr.c: Removed.
* gcc.target/loongarch/mul-const-reduction.c: Removed.
* gcc.target/loongarch/mulh_wu.c: Removed.
* gcc.target/loongarch/mulw_d_w.c: Removed.
* gcc.target/loongarch/mulw_d_wu.c: Removed.
* gcc.target/loongarch/popcnt.c: Removed.
* gcc.target/loongarch/popcount.c: Removed.
* gcc.target/loongarch/pr109465-1.c: Removed.
* gcc.target/loongarch/pr109465-2.c: Removed.
* gcc.target/loongarch/pr109465-3.c: Removed.
* gcc.target/loongarch/pr112476-1.c: Removed.
* gcc.target/loongarch/pr112476-2.c: Removed.
* gcc.target/loongarch/pr112476-3.c: Removed.
* gcc.target/loongarch/pr112476-4.c: Removed.
* gcc.target/loongarch/pr113033.c: Removed.
* gcc.target/loongarch/pr113148.c: Removed.
* gcc.target/loongarch/pr114861.c: Removed.
* gcc.target/loongarch/pr118561.c: Removed.
* gcc.target/loongarch/pr118828-2.c: Removed.
* gcc.target/loongarch/pr118828-3.c: Removed.
* gcc.target/loongarch/pr118828-4.c: Removed.
* gcc.target/loongarch/pr118828.c: Removed.
* gcc.target/loongarch/pr118843.c: Removed.
* gcc.target/loongarch/pr119084.c: Removed.
* gcc.target/loongarch/pr119127.c: Removed.
* gcc.target/loongarch/pr121064.c: Removed.
* gcc.target/loongarch/pr121542.c: Removed.
* gcc.target/loongarch/pr121634.c: Removed.
* gcc.target/loongarch/pr121875.c: Removed.
* gcc.target/loongarch/pr122097.c: Removed.
* gcc.target/loongarch/pragma-push-pop.c: Removed.
* gcc.target/loongarch/prolog-opt.c: Removed.
* gcc.target/loongarch/recip-divf.c: Removed.
* gcc.target/loongarch/recip-sqrtf.c: Removed.
* gcc.target/loongarch/relocs-symbol-noaddend.c: Removed.
* gcc.target/loongarch/revb.c: Removed.
* gcc.target/loongarch/rotl-with-rotr.c: Removed.
* gcc.target/loongarch/rotl-with-vrotr-b.c: Removed.
* gcc.target/loongarch/rotl-with-vrotr-d.c: Removed.
* gcc.target/loongarch/rotl-with-vrotr-h.c: Removed.
* gcc.target/loongarch/rotl-with-vrotr-w.c: Removed.
* gcc.target/loongarch/rotl-with-xvrotr-b.c: Removed.
* gcc.target/loongarch/rotl-with-xvrotr-d.c: Removed.
* gcc.target/loongarch/rotl-with-xvrotr-h.c: Removed.
* gcc.target/loongarch/rotl-with-xvrotr-w.c: Removed.
* gcc.target/loongarch/rotrw.c: Removed.
* gcc.target/loongarch/sad-lasx.c: Removed.
* gcc.target/loongarch/sad-lsx.c: Removed.
* gcc.target/loongarch/sign-extend-1.c: Removed.
* gcc.target/loongarch/sign-extend-2.c: Removed.
* gcc.target/loongarch/sign-extend-3.c: Removed.
* gcc.target/loongarch/sign-extend-4.c: Removed.
* gcc.target/loongarch/sign-extend-5.c: Removed.
* gcc.target/loongarch/sign-extend-6.c: Removed.
* gcc.target/loongarch/sign-extend-bitwise.c: Removed.
* gcc.target/loongarch/sign_extend_ashift.c: Removed.
* gcc.target/loongarch/slt-sign-extend.c: Removed.
* gcc.target/loongarch/smuldi3_highpart.c: Removed.
* gcc.target/loongarch/spill-less.c: Removed.
* gcc.target/loongarch/sqrtf.c: Removed.
* gcc.target/loongarch/strict-align.c: Removed.
* gcc.target/loongarch/switch-qi.c: Removed.
* gcc.target/loongarch/tls-extreme-macro.c: Removed.
* gcc.target/loongarch/tls-gd-noplt.c: Removed.
* gcc.target/loongarch/tls-ie-extreme.c: Removed.
* gcc.target/loongarch/tls-ie-norelax.c: Removed.
* gcc.target/loongarch/tls-ie-relax.c: Removed.
* gcc.target/loongarch/tls-le-relax.c: Removed.
* gcc.target/loongarch/vec_pack_unpack_128.c: Removed.
* gcc.target/loongarch/vec_pack_unpack_256.c: Removed.
* gcc.target/loongarch/vec_reduc_half.c: Removed.
* gcc.target/loongarch/vect-extract.c: Removed.
* gcc.target/loongarch/vect-frint-no-inexact.c: Removed.
* gcc.target/loongarch/vect-frint-scalar-no-inexact.c: Removed.
* gcc.target/loongarch/vect-frint-scalar.c: Removed.
* gcc.target/loongarch/vect-frint.c: Removed.
* gcc.target/loongarch/vect-ftint-no-inexact.c: Removed.
* gcc.target/loongarch/vect-ftint.c: Removed.
* gcc.target/loongarch/vect-ld-st-imm12.c: Removed.
* gcc.target/loongarch/vect-muh.c: Removed.
* gcc.target/loongarch/vect-rotr.c: Removed.
* gcc.target/loongarch/vect-shift-imm-round.c: Removed.
* gcc.target/loongarch/vect-shuf-fp.c: Removed.
* gcc.target/loongarch/vect-slp-two-operator.c: Removed.
* gcc.target/loongarch/vect-widen-add.c: Removed.
* gcc.target/loongarch/vect-widen-mul.c: Removed.
* gcc.target/loongarch/vect-widen-sub.c: Removed.
* gcc.target/loongarch/vector-func-attr-1.c: Removed.
* gcc.target/loongarch/vector-pragma-attr-1.c: Removed.
* gcc.target/loongarch/vfcmp-d.c: Removed.
* gcc.target/loongarch/vfcmp-f.c: Removed.
* gcc.target/loongarch/vfmax-vfmin.c: Removed.
* gcc.target/loongarch/vrepli.c: Removed.
* gcc.target/loongarch/wide-mul-reduc-1.c: Removed.
* gcc.target/loongarch/wide-mul-reduc-2.c: Removed.
* gcc.target/loongarch/widen-mul-rtx-cost-signed.c: Removed.
* gcc.target/loongarch/widen-mul-rtx-cost-unsigned.c: Removed.
* gcc.target/loongarch/xorsign-run.c: Removed.
* gcc.target/loongarch/xorsign.c: Removed.
* gcc.target/loongarch/xvfcmp-d.c: Removed.
* gcc.target/loongarch/xvfcmp-f.c: Removed.
* gcc.target/loongarch/zero-size-field-pass.c: Removed.
* gcc.target/loongarch/zero-size-field-ret.c: Removed.

4 days agoLoongArch: XALLOCAVEC allocate too large space on stack
mengqinggang [Thu, 11 Dec 2025 06:23:57 +0000 (14:23 +0800)] 
LoongArch: XALLOCAVEC allocate too large space on stack

Compare (length > la_max_inline_memcpy_size) and
(length <= align * LARCH_MAX_MOVE_OPS_STRAIGHT) is signed.

But loongarch_block_move_straight() -> XALLOCAVEC() -> alloca() allocate
space as unsigned value. It may result in segment fault if length > 0x7fffffff.

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_block_move_loop): Change
length, align to unsigned.
(loongarch_expand_block_move): Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/la32/memcpy.c: New test.

Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: Fix signed 32-bit overflow for loongarch32 target
Jiajie Chen [Sun, 6 Aug 2023 08:36:14 +0000 (16:36 +0800)] 
LoongArch: Fix signed 32-bit overflow for loongarch32 target

When rhs equals to 0x7fffffff, adding 1 to rhs overflows SI, generating
invalid const_int.

gcc/ChangeLog:

* config/loongarch/loongarch.cc (loongarch_emit_int_compare):
Call trunc_int_mode to ensure valid rhs.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/la32/trunc_int_for_mode.c: New test.

Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: Fix uint64_t a & 0xfffffffffff on LA32
mengqinggang [Wed, 19 Nov 2025 06:19:39 +0000 (14:19 +0800)] 
LoongArch: Fix uint64_t a & 0xfffffffffff on LA32

"uint64_t a & 0xfffffffffff" expands to two and:SI on LA32 with -O0:

(insn 8 7 9 (set (subreg:SI (reg:DI 82 [ a_2 ]) 0)
         (and:SI (reg:SI 83)
             (const_int -1 [0xffffffffffffffff]))) "t.c":3:5 -1
      (nil))
(insn 10 9 11 (set (subreg:SI (reg:DI 82 [ a_2 ]) 4)
        (and:SI (reg:SI 84)
            (const_int 4095 [0xfff]))) "t.c":3:5 -1
     (nil))

"insn 8" -1 operand can't match Yx constraint low_bitmask_len condition.

low_bitmask_len can selects a field of low-order bits within an item but not
the entire word. Add (match_test "INTVAL (op) == -1") to low_bitmask_operand
predicate.

Note: "uint64_t a & 0xffffffffffffffff" and "uint32_t a & 0xffffffff" are
optimized away before expand with -O0, can't cause this error.

gcc/ChangeLog:

* config/loongarch/predicates.md: Add CONSTM1_RTX for low_bitmask_operand.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/la32/and.c: New test.
* gcc.target/loongarch/la32/la32.exp: New test.

Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: Add support for libgcc on LA32
mengqinggang [Thu, 11 Dec 2025 06:13:55 +0000 (14:13 +0800)] 
LoongArch: Add support for libgcc on LA32

LA32 does not support extreme code mode, change to medium code model on LA32.

libgcc/ChangeLog:

* configure: Regenerate.
* configure.ac:
* config/loongarch/t-crtstuff-la32: New file.
* config/loongarch/t-crtstuff: Rename to t-crtstuff-la64.

Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: Add support for intrinsics on LA32
mengqinggang [Tue, 9 Dec 2025 11:11:30 +0000 (19:11 +0800)] 
LoongArch: Add support for intrinsics on LA32

gcc/ChangeLog:

* config/loongarch/larchintrin.h (__movgr2fcsr): Disable on soft float.
(__cacop_w): New.
(__lddir_d): Delete #error.
(__ldpte_d): Likewise.
(__crc_w_w_w): Disable on LA32
(__crc_w_d_w): Likewise.
(__crcc_w_w_w): Likewise.
* config/loongarch/loongarch-builtins.cc : Disable some builtin on LA32.

Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: C and .h files for LA32
mengqinggang [Tue, 25 Nov 2025 11:07:42 +0000 (19:07 +0800)] 
LoongArch: C and .h files for LA32

gcc/ChangeLog:

* config/loongarch/loongarch-opts.cc (loongarch_target_option_override):
Delete opts->x_flag_pcc_struct_return and enable mstrict-align by
default on LA32.
* config/loongarch/loongarch.cc (loongarch_for_each_saved_reg): Save reg
depend on float abi.
(loongarch_explicit_relocs_p): Disable explicit relocs on LA32.
(loongarch_valid_offset_p): Disable const_imm16_operand with 4 byte aligned.
(loongarch_valid_lo_sum_p): Allow lo_sum to be used with DF in ilp32d.
(loongarch_valid_index_p): Disable ADDRESS_REG_REG on LA32.
(loongarch_legitimize_address): Disable mem_shadd_or_shadd_rtx_p on LA32.
(loongarch_output_move_index):  Assert TARGET_64BIT for ldx/stx.
(loongarch_output_move): Disable ldptr/stptr if offset is 0.
(loongarch_output_equal_conditional_branch): Disable beqz/bnez on LA32R.
(loongarch_trampoline_init): Change pcaddi to pcaddu12i.
(loongarch_get_separate_components): Disable ldptr/stptr on LA32.
(loongarch_c_mode_for_floating_type): Use TFmode for long double
regardless of target bitness.
(loongarch_bitint_type_info): Disable BitInt on LA32.
(loongarch_call_tls_get_addr): Use call30 on LA32.
(loongarch_split_move): Add split for DI, DF, TF.
* config/loongarch/loongarch.h (LA_LONG_DOUBLE_TYPE_SIZE): Set
LONG_DOUBLE_TYPE_SIZE to 128 regardless of target bitness.
(MAX_FIXED_MODE_SIZE): Set to 64 on LA32.
(DEFAULT_PCC_STRUCT_RETURN): New.
(STACK_BOUNDARY): Set to 128 on LA64 and LA32.
(LARCH_STACK_ALIGN): Set to 16 on LA64 and LA32.
(TRAMPOLINE_SIZE): Set to same value on LA64 and LA32.

include/ChangeLog:

* longlong.h (count_leading_zeros): Delete because LA32R no clz.
(count_trailing_zeros): Delete because LA32R no ctz.
(COUNT_LEADING_ZEROS_0): Delete.

Co-authored-by: Jiajie Chen <c@jia.je>
Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: Machine description files for LA32
mengqinggang [Tue, 25 Nov 2025 12:09:52 +0000 (20:09 +0800)] 
LoongArch: Machine description files for LA32

gcc/ChangeLog:

* config/loongarch/constraints.md: Disable k on LA32.
* config/loongarch/loongarch.md (*and<mode>3): Delete.
(*and<mode>3_extend): New.
(zero_extend<SHORT:mode><GPR:mode>2_la32r): New.
(extend<SHORT:mode><GPR:mode>2_la32r): New.
(extendqihi2_la32r): New.
(*movdi_32bit): Remove not working split, use existing
loongarch_split_move instead.
(move_doubleword_2_<mode>): New.
(load_low<mode>): New.
(load_high<mode>): New.
(store_word<mode>): New.
(movgr2frh<mode>): New.
(movfrh2gr<mode>): New.
* config/loongarch/predicates.md: Disable low_bitmask_operand and
ins_zero_bitmask_operand on LA32. Enable const_call_insn_operand on LA32.
* config/loongarch/sync.md (atomic_<amop><mode>): Change to define_expand.
(la64_atomic_<amop><mode>): New.
(la32_atomic_<amop>si): New.
(atomic_fetch_<amop><mode>): Change to define_expand.
(la64_atomic_fetch_<amop><mode>): New.
(la32_atomic_fetch_<amop>si): New.
(atomic_exchange<mode>): Change to define_expand.
(la64_atomic_exchange<mode>): New.
(la32_atomic_exchangesi): New.

Co-authored-by: Jiajie Chen <c@jia.je>
Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoLoongArch: Introduce LoongArch32 target
mengqinggang [Wed, 5 Nov 2025 02:55:13 +0000 (10:55 +0800)] 
LoongArch: Introduce LoongArch32 target

Introduce LoongArch32 (LA32) ilp32d abi and LoongArch32 Reduced (LA32R) ilp32s abi.
Add march la32v1.0 and la32rv1.0.
Add mtune loongarch32 as a general tune.
Add la32 march and mtune to gcc/doc/invoke.texi.

contrib/ChangeLog:

* config-list.mk: Add loongarch32-linux-gnu*.

gcc/ChangeLog:

* config.gcc: Add target triple loongarch32-*-*-* and
corresponding abi ilp32f, ilp32d and ilp32s.
* config/loongarch/genopts/loongarch-strings: Add strings for
loongarch32 and ilp32 abi variants.
* config/loongarch/genopts/loongarch.opt.in: Add
-march=la32v1.0/la32rv1.0 and -mabi=ilp32d/ilp32f/ilp32s.
* config/loongarch/gnu-user.h: Add ilp32 abi variants to spec.
* config/loongarch/linux.h: Add ABI_LIBDIR for ilp32 abi
variants.
* config/loongarch/loongarch-c.cc (loongarch_define_unconditional_macros):
Add builtin definitions for loongarch32 target.
* config/loongarch/loongarch-def.cc: Add loongarch32 and ilp32
definitions.
* config/loongarch/loongarch-def.h: Add loongarch32 and ilp32
definitions.
* config/loongarch/loongarch-driver.h: Add ilp32 abi variants to
spec.
* config/loongarch/loongarch-opts.cc: Handle ilp32 abi variants.
* config/loongarch/loongarch-opts.h: Add loongarch32 case to
macros.
* config/loongarch/loongarch-str.h: Add loongarch32 and ilp32
strings.
* config/loongarch/loongarch.opt: Add -march=la32v1.0/la32rv1.0
and -mabi=ilp32d/ilp32f/ilp32s.
* config/loongarch/t-linux: Add ilp32 abi variants to multilib.
* doc/invoke.texi: Add LA32 arch and tune.

libitm/ChangeLog:

* config/loongarch/asm.h: Fix ilp32 detection.

Co-authored-by: Jiajie Chen <c@jia.je>
Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Lulu Cheng <chenglulu@loongson.cn>
4 days agoa68: emit proper error for empty source file
Jose E. Marchesi [Fri, 12 Dec 2025 02:43:38 +0000 (03:43 +0100)] 
a68: emit proper error for empty source file

Ok this is an embarrassing one.  A source file that is either empty or
that contains just blanks, characters and/or pragmats, is not a proper
particular program nor a prelude packet.  This patch makes ga68 to
emit an error mesage rather than ICEing.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-parser-scanner.cc (a68_lexical_analyser): New argument
empty_program.
* a68.h: Update prototype of a68_lexical_analyser.
* a68-parser.cc (a68_parser): Emit error for empty input files.

4 days agoa68: new test algol68/execute/manorboy.a68
Jose E. Marchesi [Fri, 12 Dec 2025 01:55:48 +0000 (02:55 +0100)] 
a68: new test algol68/execute/manorboy.a68

This commit adds Knuth's famous man-or-boy test to the Algol 68
testsuite.

gcc/testsuite/ChangeLog

* algol68/execute/manorboy.a68: New file.

4 days agoalgol68: Document -L option
Pietro Monteiro [Fri, 12 Dec 2025 00:27:41 +0000 (19:27 -0500)] 
algol68: Document -L option

Add a simple explanation for the -L option.  Expand the -I option
documentation to note it is also used for module interface-definitions.

gcc/algol68/ChangeLog:

* ga68.texi (@opindex I): Expand.
(@oindex L): New.
* lang.opt.urls: Regenerate.

gcc/ChangeLog:

* common.opt.urls: Regenerate.

gcc/go/ChangeLog:

* lang.opt.urls: Regenerate.

gcc/m2/ChangeLog:

* lang.opt.urls: Regenerate.

gcc/rust/ChangeLog:

* lang.opt.urls: Regenerate.

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
4 days agoMAINTAINERS: add myself to write after approval
Pietro Monteiro [Fri, 12 Dec 2025 00:20:30 +0000 (19:20 -0500)] 
MAINTAINERS: add myself to write after approval

ChangeLog:

* MAINTAINERS: add myself to write after approval

Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
4 days agoDaily bump.
GCC Administrator [Fri, 12 Dec 2025 00:16:34 +0000 (00:16 +0000)] 
Daily bump.

4 days agocontrib: Use config.sub in test_installed
Joseph Myers [Thu, 11 Dec 2025 23:20:54 +0000 (23:20 +0000)] 
contrib: Use config.sub in test_installed

Correctly running GCC testsuites with an installed compiler requires
both the canonical and noncanonical versions of the target triplet:
the canonical one for where the testsuite matches on target triplets,
and the noncanonical one for various "transform" calls used to find
binutils programs.  Make test_installed use config.sub to determine
the canonical target from any value passed with --target= (and thus
make logic to locate the toplevel source directory from its own
location unconditional, as it's now used to locate config.sub).

* test_installed: Use config.sub to determine canonical target.

4 days agoFortran: Fix wrongly rejected allocatable LOCK_TYPE [PR107406]
Jerry DeLisle [Wed, 10 Dec 2025 18:38:29 +0000 (10:38 -0800)] 
Fortran: Fix wrongly rejected allocatable LOCK_TYPE [PR107406]

PR fortran/107406

gcc/fortran/ChangeLog:

* parse.cc (check_component): Adjust the error check to
require a codimension if the allocatable type has
a non-coarray LOCK_TYPE component.

gcc/testsuite/ChangeLog:

* gfortran.dg/coarray_lock_3.f90: Remove dg-error on
valid code.
* gfortran.dg/coarray_lock_4.f90: Likewise.
* gfortran.dg/coarray_lock_5.f90: Likwise

Co-Authored by: Andre Vehreschild <vehre@gcc.gnu.org>

4 days agoMAINTAINERS file updates
Jeff Law [Thu, 11 Dec 2025 20:57:25 +0000 (13:57 -0700)] 
MAINTAINERS file updates

So with the acquisition of Ventana Microsystems by Qualcomm, Daniel, Robin,
Shreya, Raphael and I all work for Qualcomm now and ongoing contributions will
be under that umbrella.

I also realized that Raphael has write-after-approval access, but didn't have a
suitable entry in the MAINTAINERS file.  So I updated that as well.

/

* MAINTAINERS: Update entries for contributors formerly at
Ventana Microsystems to refer to Qualcomm instead.

4 days agoopenmp: Limit - reduction -Wdeprecated-openmp diagnostics to OpenMP, testsuite fixes...
Jakub Jelinek [Thu, 11 Dec 2025 20:29:32 +0000 (21:29 +0100)] 
openmp: Limit - reduction -Wdeprecated-openmp diagnostics to OpenMP, testsuite fixes [PR123098]

The recent -Wdeprecated-openmp changes broke various tests.

This patch limits the - reduction diagnostics to OpenMP, as the code is used
by OpenACC and even if OpenACC deprecates it, it should be changed independently
and not mention OpenMP versions in that case.

The rest are just testsuite tweaks to make stuff pass, sometimes adding
-Wno-deprecated-openmp, in other cases using newer syntax.

2025-12-11  Jakub Jelinek  <jakub@redhat.com>

PR testsuite/123098
gcc/c/
* c-parser.cc (c_parser_omp_clause_reduction): Only emit
-Wdeprecated-openmp warning for CPP_MINUS if is_omp.
gcc/cp/
* parser.cc (cp_parser_omp_clause_reduction): Only emit
-Wdeprecated-openmp warning for CPP_MINUS if is_omp.
gcc/fortran/
* openmp.cc (gfc_match_omp_clause_reduction): Only emit
-Wdeprecated-openmp warning for '-' if !openacc.
gcc/testsuite/
* gcc.dg/vect/vect-simd-clone-15.c (foo): Use OpenMP 5.2
syntax for linear clause.
* g++.dg/vect/simd-clone-6.cc (foo): Likewise.
* c-c++-common/goacc-gomp/pr93465-1.c: Use
#pragma omp begin declare target instead of
#pragma omp declare target.
* c-c++-common/goacc-gomp/nesting-fail-1.c: Use #pragma omp masked
instead of #pragma omp master.
* gfortran.dg/goacc-gomp/pr102330-1.f90 (r1): Use
!$omp masked taskloop simd instead of !$omp master taskloop simd.
* gfortran.dg/vect/pr86421.f90 (foo): Use OpenMP 5.2 syntax for
linear clause.
* gfortran.dg/gomp/allocate-16.f90: Use \\\$ instead of $ in dg-error
and use relative line numbers instead of absolute.
* gfortran.dg/gomp/groupprivate-2.f90: Add -Wno-deprecated-openmp
to dg-additional-options.
* gfortran.dg/gomp/groupprivate-5.f90: Likewise.
* gfortran.dg/goacc/pr93329.f90: Likewise.

4 days agoFormatting fixes for -Wdeprecated-openmp diagnostic calls
Jakub Jelinek [Thu, 11 Dec 2025 19:47:33 +0000 (20:47 +0100)] 
Formatting fixes for -Wdeprecated-openmp diagnostic calls

All the -Wdeprecated-openmp diagnostic calls use indentation
style not used anywhere else in the compiler, this fixes it up.

2025-12-11  Jakub Jelinek  <jakub@redhat.com>

gcc/c/
* c-parser.cc (c_parser_omp_clause_reduction,
c_parser_omp_clause_linear, c_parser_omp_clause_depend,
c_parser_omp_clause_map, c_parser_omp_clause_proc_bind,
c_parser_omp_master, c_parser_omp_declare_target,
c_parser_omp_metadirective): Formatting fixes.
gcc/cp/
* parser.cc (cp_parser_omp_clause_reduction,
cp_parser_omp_clause_linear, cp_parser_omp_clause_depend,
cp_parser_omp_clause_map, cp_parser_omp_clause_proc_bind,
cp_parser_omp_master, cp_parser_omp_declare_target,
cp_parser_omp_metadirective): Formatting fixes.
gcc/fortran/
* openmp.cc (gfc_match_omp_clause_reduction,
gfc_match_omp_clause_uses_allocators, gfc_match_omp_clauses,
match_omp_metadirective, gfc_match_omp_parallel_master,
gfc_match_omp_parallel_master_taskloop,
gfc_match_omp_parallel_master_taskloop_simd,
gfc_match_omp_master, gfc_match_omp_master_taskloop,
gfc_match_omp_master_taskloop_simd, resolve_omp_clauses): Formatting
fixes.

4 days agoAda: Fix internal error on incomplete private tagged type
Eric Botcazou [Thu, 11 Dec 2025 19:08:54 +0000 (20:08 +0100)] 
Ada: Fix internal error on incomplete private tagged type

The code expects the partial view but gets the incomplete view instead.

gcc/ada/
PR ada/123096
* exp_put_image.adb (Build_Record_Put_Image_Procedure): Call
Incomplete_Or_Partial_View with Partial_Only set to True.

gcc/testsuite/
* gnat.dg/specs/put_image2.ads: New test.

4 days agolibstdc++: Implement C++26 P3378R2 - constexpr exception types
Jakub Jelinek [Thu, 11 Dec 2025 18:37:22 +0000 (19:37 +0100)] 
libstdc++: Implement C++26 P3378R2 - constexpr exception types

The following patch attempts to implement the C++26 P3378R2 - constexpr
exception types paper.

This is quite complicated, because most of these classes which should
be constexpr-ized use solely or mostly out of line definitions in
libstdc++, both for historical, code size and dual ABI reasons, so that
one can throw these as exceptions between TUs with old vs. new (or vice
versa) ABIs.
For this reason, logic_error/runtime_error and classes derived from it
have the old ABI std::string object inside of them and the exported
APIs from libstdc++.so.6 ensure the right thing.

Now, because new invoked during constant evaluation needs to be deleted
during the same constant evaluation and can't leak into the constant
expressions, I think we don't have to use COW strings under the hood
(which aren't constexpr I guess because of reference counting/COW) and
we can use something else, the patch uses heap allocated std::string
object (where __cow_constexpr_string class has just a pointer to that).
As I think we still want to hide the ugly details if !consteval in the
library, the patch exports 8 __cow_string class symbols (6 existing which
were previously just not exported and 2 new ones) and if !consteval
calls those through extern "C" _Zmangled_name symbols.  The functions
are always_inline.

And then logic_error etc. have for C++26 (precisely for
__cpp_lib_constexpr_exceptions >= 202502L) constexpr definitions of
cdtors/methods.  This results in slightly larger code (a few insns at most)
at runtime for C++26, e.g. instead of calling say some logic error
cdtor/method with 2 arguments it calls some __cow_string one with 2
arguments but + 8 bytes pointer additions on both.

The patch also removes the __throw_format_error forward declaration
which apparently wasn't needed for anything as all __throw_format_error
users were either in <format> or included <format> before the uses,
reverts the
https://gcc.gnu.org/pipermail/libstdc++/2025-July/062598.html
patch and makes sure __throw_* functions (only those for exception types
which the P3378R2 or P3068R5 papers made constexpr usable and there are
actually constexpr/consteval uses of those) are constexpr for C++26
constexpr exceptions.

The patch does that by splitting the bits/functexcept.h header:
1) bits/functexcept.h stays for the __throw_* functions which are (at
least for now) never constexpr (the <ios>, <system_error>, <future>
and <functional> std::exception derived classes) or are never used
or never used in constexpr/consteval contexts (<exception>, <typeinfo>
std::exception derived classes and std::range_error).
2) bits/new_{throw,except}.h for __throw_bad_alloc/__throw_bad_array_new_length
and std::bad_alloc/std::bad_array_new_length (where <new> includes
<bits/new_except.h> and <bits/new_throw.h> as well for the C++26 constexpr
exceptions case)
3) for the most complicated <stdexcept> stuff, one header
addition to bits/stdexcept.h one header for the __throw_logic_error etc.
forward declarations, one header for the __throw_logic_error etc.
definitions and one header without header guards which will
depending on __glibcxx_exc_in_string include one or the other because
<string> vs. <string_view> vs. <stdexcept> have heavy interdependencies

2025-12-11  Jakub Jelinek  <jakub@redhat.com>

PR libstdc++/121114
libstdc++-v3/
* include/bits/version.def: Implement C++26 P3378R2 - constexpr
exception types.
(constexpr_exceptions): Change value from 1 to 202502, remove
no_stdname and TODO comments.
* include/bits/version.h: Regenerate.
* src/c++11/cow-stdexcept.cc (__cow_string(const char*)): New
ctor.
(__cow_string::c_str()): New method.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.35): Export 8 __cow_string
symbols.
* include/bits/new_except.h: New file.
* include/bits/new_throw.h: New file.
* include/bits/stdexcept_throw.h: New file.
* include/bits/stdexcept_throwdef.h: New file.
* include/bits/stdexcept_throwfwd.h: New file.
* include/std/stdexcept: Include bits/stdexcept_except.h and move
everything after <string> include except for std::range_error into
include/bits/stdexcept_except.h.
(std::range_error): If __cpp_lib_constexpr_exceptions >= 202502L
make all cdtors and methods constexpr.
* include/bits/stdexcept_except.h: New file.
* include/std/optional (__glibcxx_want_constexpr_exceptions): Define
before including bits/version.h.
(bad_optional_access::what): Make constexpr for
__cpp_lib_constexpr_exceptions >= 202502L.
(__throw_bad_optional_access): Likewise.
* include/std/expected (__glibcxx_want_constexpr_exceptions): Define
before including bits/version.h.
(bad_expected_access): Make cdtors and all methods constexpr for
__cpp_lib_constexpr_exceptions >= 202502L.
* include/std/format (__glibcxx_want_constexpr_exceptions): Define
before including bits/version.h.
(_GLIBCXX_CONSTEXPR_FORMAT_ERROR): Define and undef later.
(format_error): Use _GLIBCXX_CONSTEXPR_FORMAT_ERROR on ctors.
* include/std/variant (__glibcxx_want_constexpr_exceptions): Define
before including bits/version.h.
(_GLIBCXX_CONSTEXPR_BAD_VARIANT_ACCESS): Define and undef later.
(bad_variant_access): Use it on ctors and what() method.
(__throw_bad_variant_access): Use it here too.
* testsuite/18_support/exception/version.cc: Adjust expected
__cpp_lib_constexpr_exceptions value.
* testsuite/19_diagnostics/runtime_error/constexpr.cc: New test.
* testsuite/19_diagnostics/headers/stdexcept/version.cc: New test.
* testsuite/19_diagnostics/logic_error/constexpr.cc: New test.
* testsuite/20_util/expected/observers.cc (test_value_throw): Change
return type to bool from void, return true at the end, add test
to dereference what() first character.  Make it constexpr for
__cpp_lib_constexpr_exceptions >= 202502L and add static_assert.
* testsuite/20_util/expected/version.cc: Add tests for
__cpp_lib_constexpr_exceptions value.
* testsuite/20_util/variant/constexpr.cc: For
__cpp_lib_constexpr_exceptions >= 202502L include <string>.
(test_get): New function if __cpp_lib_constexpr_exceptions >= 202502L,
assert calling it is true.
* testsuite/20_util/variant/version.cc: Add tests for
__cpp_lib_constexpr_exceptions value.
* testsuite/20_util/optional/constexpr/observers/3.cc: Include
testsuite_hooks.h.
(eat, test01): New functions.  Assert test01() is true.
* testsuite/20_util/optional/version.cc: Add tests for
__cpp_lib_constexpr_exceptions value.
* include/std/future: Add #include <bits/functexcept.h>.
* include/std/shared_mutex: Include <bits/new_throw.h>.
* include/std/flat_map: Include <bits/stdexcept_throw.h> instead of
<bits/functexcept.h>.
* include/std/syncstream: Remove <bits/functexcept.h> include.
* include/std/flat_set: Likewise.
* include/std/bitset: Include <bits/stdexcept_throw.h> instead of
<bits/functexcept.h>.
* include/std/string_view: Don't include <bits/functexcept.h>, include
<bits/stdexcept_throw.h> early if __glibcxx_exc_in_string is not
defined and include <bits/stdexcept_throw.h> at the end of
the header again if __glibcxx_exc_in_string is 2 and C++26 constexpr
exceptions are enabled.
(__glibcxx_exc_in_string): Define if __glibcxx_exc_in_string wasn't
defined before including <bits/stdexcept_throw.h>.
* include/std/array: Include <bits/stdexcept_throw.h> instead of
<bits/functexcept.h>.
* include/std/inplace_vector: Likewise.
* include/std/string: Include <bits/stdexcept_except.h> and
<bits/stdexcept_throw.h> after bits/basic_string.tcc include if
C++26 constexpr exceptions are enabled and include
<bits/stdexcept_throw.h> instead of <bits/functexcept.h> early.
(__glibcxx_exc_in_string): Define early to 1, undefine at the end.
* include/std/deque: Include <bits/stdexcept_throw.h>.
* include/bits/new_allocator.h: Include <bits/new_throw.h> instead
of <bits/functexcept.h>.
* include/bits/stl_algobase.h: Remove <bits/functexcept.h> include.
* include/bits/stl_vector.h: Include <bits/stdexcept_throw.h> instead
of <bits/functexcept.h>.
* include/bits/memory_resource.h: Include <bits/new_throw.h> instead
of <bits/functexcept.h>.
* include/bits/functexcept.h: Guard everything after includes with
#if _GLIBCXX_HOSTED.
(__throw_bad_alloc, __throw_bad_array_new_length,  __throw_logic_error,
__throw_domain_error, __throw_invalid_argument, __throw_length_error,
__throw_out_of_range, __throw_out_of_range_fmt, __throw_runtime_error,
__throw_overflow_error, __throw_underflow_error): Move declarations to
other headers - <bits/new_throw.h> and <bits/stdexcept_throwfwd.h>.
* include/bits/stl_map.h: Include <bits/stdexcept_throw.h> instead
of <bits/functexcept.h>.
* include/bits/hashtable_policy.h: Include <bits/stdexcept_throw.h>
instead of <bits/functexcept.h>.
* include/bits/formatfwd.h (std::__throw_format_error): Remove
declaration.
* include/bits/specfun.h: Include <bits/stdexcept_throw.h> instead of
<bits/functexcept.h>.
* include/bits/basic_ios.h: Include <bits/functexcept.h>.
* include/bits/locale_classes.h: Likewise.
* include/tr1/cmath: Include <bits/stdexcept_throw.h> instead of
<bits/functexcept.h>.
* include/tr1/memory: Remove <bits/functexcept.h> include.
* include/tr1/array: Include <bits/stdexcept_throw.h>.
* include/ext/vstring_util.h: Include <bits/stdexcept_throw.h> instead
of <bits/functexcept.h>.
* include/ext/bitmap_allocator.h: Include <bits/new_throw.h> instead
of <bits/functexcept.h>.
* include/ext/mt_allocator.h: Likewise.
* include/ext/malloc_allocator.h: Likewise.
* include/ext/debug_allocator.h: Include <bits/stdexcept_throw.h>
instead of <bits/functexcept.h>.
* include/ext/concurrence.h: Include <bits/exception_defines.h>
instead of <bits/functexcept.h>.
* include/ext/throw_allocator.h: Include <bits/new_throw.h> and
<bits/stdexcept_throw.h> instead of <bits/functexcept.h>.
* include/ext/string_conversions.h: Include <bits/stdexcept_throw.h>
instead of <bits/functexcept.h>.
* include/ext/pool_allocator.h: Include <bits/new_throw.h> instead
of <bits/functexcept.h>.
* include/ext/ropeimpl.h: Include <bits/stdexcept_throw.h> instead of
<bits/functexcept.h>.
* include/tr2/dynamic_bitset: Likewise.
* include/experimental/optional: Include <bits/exception_defines.h>
instead of <bits/functexcept.h>.
* include/Makefile.am (bits_freestanding): Add
${bits_srcdir}/{new,stdexcept}_{except,throw}.h
and ${bits_srcdir}/stdexcept_throw{fwd,def}.h.
* include/Makefile.in: Regenerate.
* src/c++17/floating_from_chars.cc: Remove <bits/functexcept.h>
include.
* src/c++11/regex.cc: Likewise.
* src/c++11/functexcept.cc: Likewise.
* src/c++11/snprintf_lite.cc: Include <bits/stdexcept_throw.h> instead
of <bits/functexcept.h>.
* src/c++11/thread.cc: Include <bits/functexcept.h>.
* testsuite/util/testsuite_hooks.h: Include <bits/stdexcept_throw.h>
instead of <bits/functexcept.h>.
* testsuite/util/io/verified_cmd_line_input.cc: Include
<bits/exception_defines.h> instead of <bits/functexcept.h>.
* testsuite/20_util/allocator/105975.cc: Expect different diagnostics
for C++26.
* testsuite/23_containers/inplace_vector/access/capacity.cc: Remove
#error, guard if consteval { return; } with
#ifndef __cpp_lib_constexpr_exceptions.
* testsuite/23_containers/inplace_vector/access/elem.cc: Likewise.
* testsuite/23_containers/inplace_vector/cons/1.cc: Likewise.
* testsuite/23_containers/inplace_vector/cons/from_range.cc: Likewise.
* testsuite/23_containers/inplace_vector/modifiers/single_insert.cc:
Likewise.
* testsuite/23_containers/inplace_vector/modifiers/assign.cc:
Likewise.
* testsuite/23_containers/inplace_vector/modifiers/multi_insert.cc:
Likewise.
* libsupc++/new: Include <bits/new_except.h>.
(std::bad_alloc, std::bad_array_new_length): Move defintion to
<bits/new_except.h>.
libgomp/
* omp.h.in: Include <bits/new_throw.h> instead of
<bits/functexcept.h>.
gcc/testsuite/
* g++.dg/tree-ssa/pr110819.C: Guard scan-tree-dump-not delete on
c++23_down and add comment explaining why C++26 fails that.
* g++.dg/tree-ssa/pr96945.C: Likewise.
* g++.dg/tree-ssa/pr109442.C: Likewise.
* g++.dg/tree-ssa/pr116868.C: Likewise.
* g++.dg/tree-ssa/pr58483.C: Likewise.

4 days agoSome typo fixes (mostly comment but some messages too)
Jakub Jelinek [Thu, 11 Dec 2025 18:34:20 +0000 (19:34 +0100)] 
Some typo fixes (mostly comment but some messages too)

There is one issue I haven't touched in auto-profile.cc,
                fprintf (dump_file,
                         "  Annotating edge %i->%i with count 0;"
                         " static profile aggress",
                         e->src->index, e->dest->index);
Not sure if the last word should be agrees or something completely
different.

2025-12-11  Jakub Jelinek  <jakub@redhat.com>

gcc/
* config/arc/arc.cc (hwloop_optimize): Fix comment typo,
begining -> beginning.
* config/nds32/nds32-utils.cc (nds32::extract_pattern_from_insn):
Fix comment typo, funciton -> function.
* ipa-inline.cc (speculation_useful_p): Fix comment typo,
calll -> call.
* auto-profile.cc: Fix comment typos, implements -> implement,
inlning -> inlining, passe -> passes, form -> from, ambigous
-> ambiguous.
(afdo_hot_bb_threshod): Rename to ...
(afdo_hot_bb_threshold): ... this.
(maybe_hot_afdo_count_p): Adjust for the above change.
(function_instance::merge): Fix comment typo, hasnt -> hasn't.
(function_instance::offline_if_not_realized): Fix comment typo,
instancs -> instances.
(afdo_count_scale): Fix comment typo, reudce -> reduce.
(get_original_name): Fix comment typos, generetad -> generated,
sufix -> suffix.
(function_instance::get_function_instance): Fix dump message
typo, insteed -> instead.
(function_instance::merge): Fix comment typos, hasnt -> hasn't,
acounting -> accounting, calll -> call, begining -> beginning.
(function_instance::offline_if_in_set): Fix comment typo,
begining -> beginning.
(match_with_target): Fix comment typo, correspons -> corresponds.
(function_instance::match): Fix diagnostic typo, discrimnator
-> discriminator.
(autofdo_source_profile::offline_external_functions): Fix comment
typos, Doint -> Doing, distingush -> distinguish, shold -> should,
Poppulate -> Populate.  Fix dump message typo, suffxes -> suffixes.
(autofdo_source_profile::offline_unrealized_inlines): Fix comment
typo, Poppulate -> Populate.
(autofdo_source_profile::update_inlined_ind_target): Fix dump message
typo, funciton -> function.
(autofdo_source_profile::read): Fix comment typos, function_instace
-> function_instance, exixts -> exits.  Use afdo_hot_bb_threshold
instead of afdo_hot_bb_threshod.
(autofdo_source_profile::get_function_instance_by_inline_stack):
Fix dump message typo, locaction -> location.
(afdo_propagate_edge): Fix dump message typo, succesors -> successors.
(afdo_propagate): Fix comment typo, stablize -> stabilize.
(struct scale): Fix comment typo, descired -> desired.
(afdo_adjust_guessed_profile): Fix dump message typos, predecesor
-> predecessor, sucessor -> successor.  Fix comment typo, inprecise
-> imprecise.
(auto_profile): Fix comment typo, annoate -> annotate.
* tree-vect-slp.cc (vectorizable_slp_permutation_1): Fix comment typo,
cylical -> cyclical.
* except.cc (maybe_add_nop_after_section_switch): Fix comment typo,
begining -> beginning.
* tree-ssa-loop-ivcanon.cc (tree_unroll_loops_completely): Fix comment
typo, begining -> beginning.
* gcc.cc (insert_comments): Likewise.
gcc/cobol/
* util.cc (class temp_loc_t): Fix comment typo, paramters
-> parameters.
* lexio.cc (valid_sequence_area): Fix comment typo, begining
-> beginning.
gcc/m2/
* gm2-compiler/M2Check.mod (buildError4): Fix comment typo,
paramters -> parameters.
gcc/fortran/
* trans-expr.cc (gfc_conv_procedure_call): Fix comment typo, passe
-> pass.
gcc/jit/
* docs/_build/texinfo/libgccjit.texi: Fix comment typo, shold -> should.
* docs/internals/index.rst: Likewise.
gcc/rust/
* backend/rust-tree.cc (fold_builtin_source_location): Fix string literal
typo, funciton -> function.
* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Fix comment typo,
begining -> beginning.
gcc/testsuite/
* gfortran.dg/interface_16.f90: Fix comment typo,calll -> call.

4 days agoFortran: Fix ICE arising from PDT class components [PR107142]
Paul Thomas [Thu, 11 Dec 2025 17:24:07 +0000 (17:24 +0000)] 
Fortran: Fix ICE arising from PDT class components [PR107142]

2025-12-11  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/107142
* match.cc (gfc_match_type_spec): Change original declaration
to static match_type_spec and call from gfc_match_type_spec,
where the gfc_current_ns is stashed and restored after call.
(gfc_match_type_is): Before emitting the syntax error message
check if there are any pending error messages and use them
instead.

gcc/testsuite
PR fortran/107142
* gfortran.dg/pdt_78.f03: New test.

4 days agoFortran: Fix ICE arising from PDT class components [PR110012]
Paul Thomas [Thu, 11 Dec 2025 16:51:53 +0000 (16:51 +0000)] 
Fortran: Fix ICE arising from PDT class components [PR110012]

2025-12-11  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/110012
* decl.cc (gfc_get_pdt_instance): Continue to loop through the
type parameters components if param_list is null and the
parameter is not KIND with a default initializer.
* resolve.cc (resolve_fl_derived): If the data component is a
PDT template, find the instance and build the class.

gcc/testsuite
PR fortran/110012
* gfortran.dg/pdt_77.f03: New test.

4 days agoc++, libstdc++: add "modules" std to testsuite
Jason Merrill [Thu, 11 Dec 2025 16:31:18 +0000 (23:31 +0700)] 
c++, libstdc++: add "modules" std to testsuite

Since modules aren't enabled by default at any -std= yet, let's add a
pseudo-std for them, like we already have for -fimplicit-constexpr.  And
also add to target-supports so dg lines can check { target modules }.

To run library tests with modules we need to compile them; this patch makes
us build a header unit for bits/stdc++.h and module interface units for std
and std.compat, if v3_std_list includes "modules".  So this doesn't happen
by default without a further change.

libstdc++-v3/ChangeLog:

* testsuite/Makefile.am (CLEANFILES): Add gcm.cache.
* testsuite/Makefile.in: Regenerate.
* testsuite/lib/dg-options.exp (add_options_for_no_pch): Also add
-fno-modules.
* testsuite/lib/libstdc++.exp (v3_std_list): Handle "modules" std.
(v3_modules_std): New global.
(v3-build_support): Build gcms for bits/stdc++.h, std, and
std.compat.

gcc/testsuite/ChangeLog:

* lib/g++-dg.exp: Handle "modules" std.
* lib/target-supports.exp (check_effective_target_modules): New.

4 days agoopenmp: Bump Version from 4.5 to 5.2 (4/4)
supers1ngular [Thu, 11 Dec 2025 16:25:28 +0000 (08:25 -0800)] 
openmp: Bump Version from 4.5 to 5.2 (4/4)

Updates the documentation to reflect the version bump.
Additionally updates implementation status and notes
deprecations where relevant.

gcc/ChangeLog:

* doc/extend.texi: Bump version and clarify implementation
status.

gcc/fortran/ChangeLog:

* gfortran.texi: Bump version and clarify implementation status.
* intrinsic.texi: Bump version and note deprecation of
'omp_proc_bind_master'.

libgomp/ChangeLog:

* libgomp.texi: Bump version. Update implementation status.
Note deprecation of 'MASTER' affinity policy.

4 days agoopenmp: Bump Version from 4.5 to 5.2 (3/4)
supers1ngular [Thu, 11 Dec 2025 16:12:50 +0000 (08:12 -0800)] 
openmp: Bump Version from 4.5 to 5.2 (3/4)

Implements the OpenMP 5.2 Fortran deprecations. Uses the warning
established in patch 1/4, -Wdeprecated-openmp, for said deprecations.
Similarly, we do not implement the relaxing of constraints for the
interop construct since it is not a deprecation. However, the
deprecation for 'uses_allocators' is implemented, since support
exists in Fortran mainline. Additionally implements the
Fortran-specific deprecation for executable allocate directives,
and adds new tests.

gcc/fortran/ChangeLog:

* openmp.cc (gfc_match_omp_clause_reduction): Deprecate '-'
operator for reductions.
(gfc_match_omp_clause_uses_allocators): Deprecate
allocator(traits) pattern for 'uses_allocators'.
(gfc_match_omp_clauses): Deprecate 'sink' and 'source' for
'depend' clause. Deprecate list items as arguments with 'linear'
clause. Deprecate non-comma-separated modifiers for the map
clause. Deprecate 'to' clause with declare target.
(gfc_match_omp_declare_target): Whitespace.
(match_omp_metadirective): Deprecate 'default' clause on
metadirectives.
(resolve_omp_clauses): Deprecate executable allocate directives.

libgomp/ChangeLog:

* testsuite/libgomp.fortran/allocate-8a.f90: Suppress warnings.
* testsuite/libgomp.fortran/allocators-1.f90: Ditto.
* testsuite/libgomp.fortran/allocators-2.f90: Ditto.
* testsuite/libgomp.fortran/allocators-4.f90: Ditto.
* testsuite/libgomp.fortran/declare-target-1.f90: Ditto.
* testsuite/libgomp.fortran/declare-target-2.f90: Ditto.
* testsuite/libgomp.fortran/declare-target-indirect-1.f90: Ditto.
* testsuite/libgomp.fortran/declare-target-indirect-2.f90: Ditto.
* testsuite/libgomp.fortran/doacross1.f90: Ditto.
* testsuite/libgomp.fortran/doacross2.f90: Ditto.
* testsuite/libgomp.fortran/doacross3.f90: Ditto.
* testsuite/libgomp.fortran/map-alloc-ptr-2.f90: Ditto.
* testsuite/libgomp.fortran/pr84418-1.f90: Ditto.
* testsuite/libgomp.fortran/pr84418-2.f90: Ditto.
* testsuite/libgomp.fortran/reduction1.f90: Ditto.
* testsuite/libgomp.fortran/udr11.f90: Ditto.
* testsuite/libgomp.fortran/uses_allocators_1.f90: Ditto.
* testsuite/libgomp.fortran/uses_allocators_2.f90: Ditto.
* testsuite/libgomp.fortran/dep-uses-allocators.f90: New test.

gcc/testsuite/ChangeLog:

* gfortran.dg/gomp/allocate-14.f90: Suppress warnings.
* gfortran.dg/gomp/allocate-16.f90: Ditto.
* gfortran.dg/gomp/allocate-5.f90: Ditto.
* gfortran.dg/gomp/allocate-6.f90: Ditto.
* gfortran.dg/gomp/allocate-7.f90: Ditto.
* gfortran.dg/gomp/allocators-3.f90: Ditto.
* gfortran.dg/gomp/declare-simd-2.f90: Ditto.
* gfortran.dg/gomp/declare-simd-6.f90: Ditto.
* gfortran.dg/gomp/declare-target-1.f90: Ditto.
* gfortran.dg/gomp/declare-target-2.f90: Ditto.
* gfortran.dg/gomp/declare-target-4.f90: Ditto.
* gfortran.dg/gomp/declare-target-5.f90: Ditto.
* gfortran.dg/gomp/declare-target-indirect-1.f90: Ditto.
* gfortran.dg/gomp/declare-target-indirect-2.f90: Ditto.
* gfortran.dg/gomp/declare-variant-10.f90: Ditto.
* gfortran.dg/gomp/declare-variant-8.f90: Ditto.
* gfortran.dg/gomp/implicit-save.f90: Ditto.
* gfortran.dg/gomp/linear-1.f90: Ditto.
* gfortran.dg/gomp/linear-2.f90: Ditto.
* gfortran.dg/gomp/linear-3.f90: Ditto.
* gfortran.dg/gomp/linear-4.f90: Ditto.
* gfortran.dg/gomp/linear-6.f90: Ditto.
* gfortran.dg/gomp/map-12.f90: Ditto.
* gfortran.dg/gomp/map-6.f90: Ditto.
* gfortran.dg/gomp/map-7.f90: Ditto.
* gfortran.dg/gomp/map-8.f90: Ditto.
* gfortran.dg/gomp/order-8.f90: Ditto.
* gfortran.dg/gomp/pr83977.f90: Ditto.
* gfortran.dg/gomp/reduction1.f90: Ditto.
* gfortran.dg/gomp/schedule-modifiers-2.f90: Ditto.
* gfortran.dg/gomp/workshare-reduction-55.f90: Ditto.
* gfortran.dg/gomp/workshare-reduction-56.f90: Ditto.
* gfortran.dg/gomp/workshare-reduction-57.f90: Ditto.
* gfortran.dg/gomp/workshare-reduction-58.f90: Ditto.
* gfortran.dg/gomp/52-deps.f90: New test.

4 days agovect: only move update_e if edge is split [PR123014]
Tamar Christina [Thu, 11 Dec 2025 15:51:23 +0000 (15:51 +0000)] 
vect: only move update_e if edge is split [PR123014]

This is an alternative fix for PR122959 where the issue is that in order to
maintain LOOPS_HAVE_PREHEADERS slpeel_add_loop_guard may add an empty block that
becomes the pre-header edge of the epilog loop.

If the epilog loop already had a pre-header we insert nothing and update_e  is
already pointing to the right thing.  However if we do insert the intermediate
block we have this situation

      guard block
          |
      pre-header
          |
        epilog

vect_update_ivs_after_vectorizer now needs to use the guard block to identify
the PHI nodes, but use the edge from pre-header -> epilog as the update_e.

The first fix moved update_e detection and we picked the guard pre-header ->
epilog edge and would use the pre-header block to fill in any new adjustments
needed.

This doesn't work because due to skip_epilog we have to put all adjustments in
the guard block, since the skip_epilog edge also skips the pre-header.

This patch instead addresses this in vect_update_ivs_after_vectorizer by if
you have an empty pre-header, it moves the edge down through the fall-through
edge, but keeps exit_bb as guard block.

gcc/ChangeLog:

PR tree-optimization/123014
* tree-vect-loop-manip.cc (vect_update_ivs_after_vectorizer): Detect
empty pre-header block.
(vect_do_peeling): Undo changes from PR122959.

4 days agoopenmp: Bump Version from 4.5 to 5.2 (2/4)
supers1ngular [Thu, 11 Dec 2025 15:45:04 +0000 (07:45 -0800)] 
openmp: Bump Version from 4.5 to 5.2 (2/4)

Implements the OpenMP 5.2 C and C++ deprecations. Uses the warning
established in patch 1/4, -Wdeprecated-openmp, for said deprecations.
Not implemented is 'uses_allocators', since the base is not yet in
mainline, along with the relaxing of constraints for the interop
construct, since this is not a deprecation. Additionally does not
deprecate 'destroy' with no arguments on depobj construct, since
this was undeprecated in OpenMP 6.0. Adds new tests.

gcc/c/ChangeLog:

* c-parser.cc (c_parser_omp_clause_reduction): Deprecate '-'
operator for reductions.
(c_parser_omp_clause_linear): Deprecate modifiers with parens.
(c_parser_omp_clause_depend): Deprecate 'sink' and 'source'
modifiers for 'depend' clause.
(c_parser_omp_clause_map): Map clause modifiers comma-separated.
(c_parser_omp_declare_target): Deprecate synonymous omp declare
target for omp begin declare target. Deprecate 'to' clause.
(c_parser_omp_metadirective): Deprecate default clause on
metadirectives.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_omp_clause_reduction): Deprecate '-'
operator.
(cp_parser_omp_clause_linear): Deprecate modifiers with parens.
(cp_parser_omp_clause_depend): Deprecate sink and source.
(cp_parser_omp_clause_map): Map clause modifiers
comma-separated.
(cp_parser_omp_declare_target): Deprecate synonymous omp declare
target for omp begin declare target. Deprecate to clause.
(cp_parser_omp_metadirective): Deprecate default clause on
metadirectives.

libgomp/ChangeLog:

* testsuite/libgomp.c++/declare_target-1.C: Suppress warnings.
* testsuite/libgomp.c++/depobj-1.C: Ditto.
* testsuite/libgomp.c++/doacross-1.C: Ditto.
* testsuite/libgomp.c++/for-15.C: Ditto.
* testsuite/libgomp.c++/for-24.C: Ditto.
* testsuite/libgomp.c++/pr101544-1-O0.C: Ditto.
* testsuite/libgomp.c++/pr101544-1.C: Ditto.
* testsuite/libgomp.c++/pr96835-1-O0.C: Ditto.
* testsuite/libgomp.c++/pr96835-1.C: Ditto.
* testsuite/libgomp.c++/static-aggr-constructor-destructor-1.C: Ditto.
* testsuite/libgomp.c++/static-aggr-constructor-destructor-2.C: Ditto.
* testsuite/libgomp.c++/static-aggr-constructor-destructor-3.C: Ditto.
* testsuite/libgomp.c++/target-13.C: Ditto.
* testsuite/libgomp.c++/target-cdtor-1.C: Ditto.
* testsuite/libgomp.c++/target-cdtor-2.C: Ditto.
* testsuite/libgomp.c++/target-std__array-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__array-concurrent.C: Ditto.
* testsuite/libgomp.c++/target-std__cmath.C: Ditto.
* testsuite/libgomp.c++/target-std__complex.C: Ditto.
* testsuite/libgomp.c++/target-std__deque-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__deque-concurrent.C: Ditto.
* testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__forward_list-concurrent.C: Ditto.
* testsuite/libgomp.c++/target-std__list-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__list-concurrent.C: Ditto.
* testsuite/libgomp.c++/target-std__numbers.C: Ditto.
* testsuite/libgomp.c++/target-std__span-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__span-concurrent.C: Ditto.
* testsuite/libgomp.c++/target-std__valarray-1.C: Ditto.
* testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__valarray-concurrent.C: Ditto.
* testsuite/libgomp.c++/target-std__vector-concurrent-usm.C: Ditto.
* testsuite/libgomp.c++/target-std__vector-concurrent.C: Ditto.
* testsuite/libgomp.c-c++-common/declare_target-1.c: Ditto.
* testsuite/libgomp.c-c++-common/depend-2.c: Ditto.
* testsuite/libgomp.c-c++-common/depobj-1.c: Ditto.
* testsuite/libgomp.c-c++-common/for-11.c: Ditto.
* testsuite/libgomp.c-c++-common/for-12.c: Ditto.
* testsuite/libgomp.c-c++-common/for-16.c: Ditto.
* testsuite/libgomp.c-c++-common/for-3.c: Ditto.
* testsuite/libgomp.c-c++-common/for-5.c: Ditto.
* testsuite/libgomp.c-c++-common/for-6.c: Ditto.
* testsuite/libgomp.c-c++-common/for-9.c: Ditto.
* testsuite/libgomp.c-c++-common/function-not-offloaded.c: Ditto.
* testsuite/libgomp.c-c++-common/metadirective-1.c: Ditto.
* testsuite/libgomp.c-c++-common/metadirective-2.c: Ditto.
* testsuite/libgomp.c-c++-common/metadirective-3.c: Ditto.
* testsuite/libgomp.c-c++-common/metadirective-5.c: Ditto.
* testsuite/libgomp.c-c++-common/monotonic-1.c: Ditto.
* testsuite/libgomp.c-c++-common/monotonic-2.c: Ditto.
* testsuite/libgomp.c-c++-common/pr100059-1.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-2.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-4.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-5.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-6.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-7.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-8.c: Ditto.
* testsuite/libgomp.c-c++-common/pr66199-9.c: Ditto.
* testsuite/libgomp.c-c++-common/ptr-attach-1.c: Ditto.
* testsuite/libgomp.c-c++-common/reverse-offload-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-10.c: Ditto.
* testsuite/libgomp.c-c++-common/target-40.c: Ditto.
* testsuite/libgomp.c-c++-common/target-abi-struct-1-O0.c: Ditto.
* testsuite/libgomp.c-c++-common/target-abi-struct-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-cdtor-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-same-name-1.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-14.c: Ditto.
* testsuite/libgomp.c-c++-common/variable-not-offloaded.c: Ditto.
* testsuite/libgomp.c/declare-variant-3.c: Ditto.
* testsuite/libgomp.c/declare-variant-4.c: Ditto.
* testsuite/libgomp.c/doacross-1.c: Ditto.
* testsuite/libgomp.c/doacross-2.c: Ditto.
* testsuite/libgomp.c/doacross-3.c: Ditto.
* testsuite/libgomp.c/examples-4/async_target-1.c: Ditto.
* testsuite/libgomp.c/examples-4/declare_target-1.c: Ditto.
* testsuite/libgomp.c/examples-4/declare_target-3.c: Ditto.
* testsuite/libgomp.c/examples-4/declare_target-4.c: Ditto.
* testsuite/libgomp.c/examples-4/declare_target-5.c: Ditto.
* testsuite/libgomp.c/max_vf-1.c: Ditto.
* testsuite/libgomp.c/pr81778.c: Ditto.
* testsuite/libgomp.c/pr86660.c: Ditto.
* testsuite/libgomp.c/reduction-4.c: Ditto.
* testsuite/libgomp.c/switch-conversion.c: Ditto.
* testsuite/libgomp.c/target-26.c: Ditto.
* testsuite/libgomp.c/target-28.c: Ditto.
* testsuite/libgomp.c/target-30.c: Ditto.
* testsuite/libgomp.c/target-32.c: Ditto.
* testsuite/libgomp.c/target-35.c: Ditto.
* testsuite/libgomp.c/target-38.c: Ditto.
* testsuite/libgomp.c/target-39.c: Ditto.
* testsuite/libgomp.c/target-9.c: Ditto.
* testsuite/libgomp.c/target-link-1.c: Ditto.
* testsuite/libgomp.c/target-teams-1.c: Ditto.
* testsuite/libgomp.c/thread-limit-2.c: Ditto.
* testsuite/libgomp.oacc-c-c++-common/vred2d-128.c: Ditto.

gcc/testsuite/ChangeLog:

* c-c++-common/gomp/Wparentheses-2.c: Suppress warnings.
* c-c++-common/gomp/attrs-metadirective-1.c: Ditto.
* c-c++-common/gomp/attrs-metadirective-2.c: Ditto.
* c-c++-common/gomp/attrs-metadirective-3.c: Ditto.
* c-c++-common/gomp/attrs-metadirective-4.c: Ditto.
* c-c++-common/gomp/attrs-metadirective-5.c: Ditto.
* c-c++-common/gomp/attrs-metadirective-8.c: Ditto.
* c-c++-common/gomp/begin-declare-target-1.c: Ditto.
* c-c++-common/gomp/begin-declare-target-2.c: Ditto.
* c-c++-common/gomp/clauses-3.c: Ditto.
* c-c++-common/gomp/declare-target-1.c: Ditto.
* c-c++-common/gomp/declare-target-2.c: Ditto.
* c-c++-common/gomp/declare-target-3.c: Ditto.
* c-c++-common/gomp/declare-target-4.c: Ditto.
* c-c++-common/gomp/declare-target-5.c: Ditto.
* c-c++-common/gomp/declare-target-7.c: Ditto.
* c-c++-common/gomp/declare-target-indirect-1.c: Ditto.
* c-c++-common/gomp/declare-target-indirect-2.c: Ditto.
* c-c++-common/gomp/declare-variant-10.c: Ditto.
* c-c++-common/gomp/declare-variant-8.c: Ditto.
* c-c++-common/gomp/defaultmap-2.c: Ditto.
* c-c++-common/gomp/defaultmap-3.c: Ditto.
* c-c++-common/gomp/depend-iterator-2.c: Ditto.
* c-c++-common/gomp/depobj-1.c: Ditto.
* c-c++-common/gomp/directive-1.c: Ditto.
* c-c++-common/gomp/distribute-1.c: Ditto.
* c-c++-common/gomp/doacross-1.c: Ditto.
* c-c++-common/gomp/doacross-2.c: Ditto.
* c-c++-common/gomp/doacross-3.c: Ditto.
* c-c++-common/gomp/doacross-4.c: Ditto.
* c-c++-common/gomp/doacross-8.c: Ditto.
* c-c++-common/gomp/linear-1.c: Ditto.
* c-c++-common/gomp/linear-2.c: Ditto.
* c-c++-common/gomp/linear-3.c: Ditto.
* c-c++-common/gomp/loop-6.c: Ditto.
* c-c++-common/gomp/map-1.c: Ditto.
* c-c++-common/gomp/map-3.c: Ditto.
* c-c++-common/gomp/map-6.c: Ditto.
* c-c++-common/gomp/metadirective-1.c: Ditto.
* c-c++-common/gomp/metadirective-2.c: Ditto.
* c-c++-common/gomp/metadirective-3.c: Ditto.
* c-c++-common/gomp/metadirective-4.c: Ditto.
* c-c++-common/gomp/metadirective-5.c: Ditto.
* c-c++-common/gomp/metadirective-8.c: Ditto.
* c-c++-common/gomp/metadirective-construct.c: Ditto.
* c-c++-common/gomp/metadirective-device.c: Ditto.
* c-c++-common/gomp/metadirective-target-device-1.c: Ditto.
* c-c++-common/gomp/metadirective-target-device-2.c: Ditto.
* c-c++-common/gomp/order-2.c: Ditto.
* c-c++-common/gomp/ordered-3.c: Ditto.
* c-c++-common/gomp/ordered-5.c: Ditto.
* c-c++-common/gomp/pr102640.c: Ditto.
* c-c++-common/gomp/pr106836.c: Ditto.
* c-c++-common/gomp/pr120180-1.c: Ditto.
* c-c++-common/gomp/pr88203-1.c: Ditto.
* c-c++-common/gomp/pr88203-2.c: Ditto.
* c-c++-common/gomp/pr88203-3.c: Ditto.
* c-c++-common/gomp/pr91401-2.c: Ditto.
* c-c++-common/gomp/pr91987.c: Ditto.
* c-c++-common/gomp/reverse-offload-1.c: Ditto.
* c-c++-common/gomp/schedule-modifiers-1.c: Ditto.
* c-c++-common/gomp/sink-1.c: Ditto.
* c-c++-common/gomp/sink-2.c: Ditto.
* c-c++-common/gomp/sink-3.c: Ditto.
* c-c++-common/gomp/sink-4.c: Ditto.
* c-c++-common/gomp/sink-5.c: Ditto.
* c-c++-common/gomp/target-teams-1.c: Ditto.
* g++.dg/gomp/attrs-12.C: Ditto.
* g++.dg/gomp/attrs-5.C: Ditto.
* g++.dg/gomp/attrs-9.C: Ditto.
* g++.dg/gomp/clause-3.C: Ditto.
* g++.dg/gomp/declare-simd-3.C: Ditto.
* g++.dg/gomp/declare-simd-4.C: Ditto.
* g++.dg/gomp/declare-simd-6.C: Ditto.
* g++.dg/gomp/declare-simd-7.C: Ditto.
* g++.dg/gomp/declare-simd-8.C: Ditto.
* g++.dg/gomp/declare-target-1.C: Ditto.
* g++.dg/gomp/declare-target-2.C: Ditto.
* g++.dg/gomp/declare-target-3.C: Ditto.
* g++.dg/gomp/declare-target-indirect-1.C: Ditto.
* g++.dg/gomp/depend-iterator-2.C: Ditto.
* g++.dg/gomp/depobj-1.C: Ditto.
* g++.dg/gomp/doacross-2.C: Ditto.
* g++.dg/gomp/linear-1.C: Ditto.
* g++.dg/gomp/linear-2.C: Ditto.
* g++.dg/gomp/linear-3.C: Ditto.
* g++.dg/gomp/linear-5.C: Ditto.
* g++.dg/gomp/map-1.C: Ditto.
* g++.dg/gomp/pr118876.C: Ditto.
* g++.dg/gomp/pr119370.C: Ditto.
* g++.dg/gomp/sink-1.C: Ditto.
* g++.dg/gomp/sink-2.C: Ditto.
* g++.dg/gomp/sink-3.C: Ditto.
* g++.dg/gomp/target-simd-clone-1.C: Ditto.
* g++.dg/gomp/target-simd-clone-2.C: Ditto.
* g++.dg/gomp/target-teams-1.C: Ditto.
* g++.dg/gomp/udr-5.C: Ditto.
* gcc.dg/gomp/attrs-12.c: Ditto.
* gcc.dg/gomp/attrs-5.c: Ditto.
* gcc.dg/gomp/attrs-9.c: Ditto.
* gcc.dg/gomp/clause-1.c: Ditto.
* gcc.dg/gomp/declare-simd-3.c: Ditto.
* gcc.dg/gomp/linear-1.c: Ditto.
* gcc.dg/gomp/metadirective-1.c: Ditto.
* gcc.dg/gomp/pr104757.c: Ditto.
* gcc.dg/gomp/sink-fold-1.c: Ditto.
* gcc.dg/gomp/sink-fold-2.c: Ditto.
* gcc.dg/gomp/sink-fold-3.c: Ditto.
* gcc.dg/gomp/target-simd-clone-1.c: Ditto.
* gcc.dg/gomp/target-simd-clone-2.c: Ditto.
* gcc.dg/gomp/target-simd-clone-3.c: Ditto.
* gcc.dg/gomp/target-simd-clone-4.c: Ditto.
* gcc.dg/gomp/target-simd-clone-5.c: Ditto.
* gcc.dg/gomp/target-simd-clone-6.c: Ditto.
* gcc.dg/gomp/target-simd-clone-7.c: Ditto.
* gcc.dg/gomp/target-simd-clone-8.c: Ditto.
* gcc.dg/gomp/workshare-reduction-55.c: Ditto.
* gcc.dg/gomp/workshare-reduction-56.c: Ditto.
* gcc.dg/gomp/workshare-reduction-57.c: Ditto.
* gcc.dg/gomp/workshare-reduction-58.c: Ditto.
* c-c++-common/gomp/52-deps.c: New test.
* g++.dg/gomp/map-csm-dep.C: New test.
* gcc.dg/gomp/map-csm-dep.c: New test.

5 days agoAda: Fix ICE when building spawn-25.0.0 with GTK support
Eric Botcazou [Thu, 11 Dec 2025 14:58:37 +0000 (15:58 +0100)] 
Ada: Fix ICE when building spawn-25.0.0 with GTK support

This is a regression introduced on the mainline by the freezing change for
the designated type of anonymous access-to-subprogram types, which has
uncovered a small oversight in Analyze_Subprogram_Instantiation, whereby
we propagate the Convention of the generic subprogram onto the named actual
only, and not onto the anonymous actual built alongside the named one.

gcc/ada/
PR ada/123062
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Also propagate
the Convention and Is_Exported flag onto the anonymous actual.

5 days agoaarch64: Cache the PCS value for a function
Alfie Richards [Tue, 18 Nov 2025 10:50:04 +0000 (10:50 +0000)] 
aarch64: Cache the PCS value for a function

As aarch64_function_arg_regno_p is a very hot function called many times for a
function it should not call fndecl_abi every time as it is expensive and
unecessasary.

This caches the result and in doing so fixes a regression in compile time
introduced by r16-5076-g7197d8062fddc2.

gcc/ChangeLog:

* config/aarch64/aarch64.cc (aarch64_fndecl_abi): New function.
(aarch64_function_abi): New function.
(aarch64_function_arg_regno_p): Update to use aarch64_fndecl_abi.
(aarch64_output_mi_thunk): Likewise.
(aarch64_is_variant_pcs): Likewise.
(aarch64_set_current_function): Update to initialize pcs value.
* config/aarch64/aarch64.h (enum arm_pcs): Move location earlier in
file.
(machine_function) Add pcs value.

5 days ago[PATCH v2 1/4] openmp: Bump Version from 4.5 to 5.2 (1/4)
supers1ngular [Thu, 11 Dec 2025 14:27:09 +0000 (06:27 -0800)] 
[PATCH v2 1/4] openmp: Bump Version from 4.5 to 5.2 (1/4)

Bumps OpenMP from 4.5 (201511) to 5.2 (202111), with deprecation and
test support to 5.1 (202011). Adds new tests and a new warning.
Suppresses deprecation warnings in all relevant tests and removes
suppression pragmas visible outside of the testsuite. Additionally
implements new warning in the relevant frontends. Otherwise, cleans
up some whitespace and fixed a misspelled pragma in a testcase. Also
fixes an indentation error.

gcc/c-family/ChangeLog:

* c-cppbuiltin.cc (c_cpp_builtins): Bump _OPENMP version.
* c.opt (Wdeprecated-openmp): Add warning.
* c.opt.urls: Regenerated.

gcc/c/ChangeLog:

* c-parser.cc (c_parser_omp_clause_proc_bind): Deprecate master
affinity.
(c_parser_omp_master): Deprecate master construct.
(c_parser_transaction): Whitespace.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_postfix_expression): Whitespace.
(cp_parser_builtin_c23_va_start): Ditto.
(cp_parser_omp_clause_proc_bind): Deprecate master affinity.
(cp_parser_omp_master): Deprecate master construct.

gcc/ChangeLog:

* doc/invoke.texi: Update docs for '-Wdeprecated-openmp'.

gcc/fortran/ChangeLog:

* cpp.cc (cpp_define_builtins): Bump _OPENMP version.
* invoke.texi: Update docs for '-Wdeprecated-openmp'.
* lang.opt (Wdeprecated-openmp): Add warning.
* lang.opt.urls: Regenerated.
* openmp.cc (gfc_match_omp_clauses): Deprecate master affinity
policy.
(gfc_match_omp_parallel_master): Deprecate master construct.
(gfc_match_omp_parallel_master_taskloop): Ditto.
(gfc_match_omp_parallel_master_taskloop_simd): Ditto.
(gfc_match_omp_master): Ditto.
(gfc_match_omp_master_taskloop): Ditto.
(gfc_match_omp_master_taskloop_simd): Ditto.
(resolve_omp_clauses): Warn for deprecated use of
{use,is}_device_ptr.

libgomp/ChangeLog:

* env.c (omp_display_env): Bump _OPENMP version.
* fortran.c (ialias_redirect): Remove suppression pragmas.
(omp_set_dynamic_8_): Ditto.
(omp_set_nested_8_): Ditto.
(omp_get_nested_): Ditto.
* icv.c (omp_get_dynamic): Ditto.
(omp_get_nested): Ditto.
(ialias): Ditto.
* omp_lib.f90.in: Bump openmp_version.
* omp_lib.h.in: Ditto.
* testsuite/libgomp.c++/affinity-1.C: Suppress deprecation
warnings.
* testsuite/libgomp.c++/ctor-1.C: Ditto.
* testsuite/libgomp.c++/ctor-11.C: Ditto.
* testsuite/libgomp.c++/ctor-13.C: Ditto.
* testsuite/libgomp.c++/ctor-2.C: Ditto.
* testsuite/libgomp.c++/ctor-5.C: Ditto.
* testsuite/libgomp.c++/ctor-7.C: Ditto.
* testsuite/libgomp.c++/depend-iterator-1.C: Ditto.
* testsuite/libgomp.c++/loop-13.C: Ditto.
* testsuite/libgomp.c++/master-1.C: Ditto.
* testsuite/libgomp.c++/pr26943.C: Ditto.
* testsuite/libgomp.c++/pr81130.C: Ditto.
* testsuite/libgomp.c++/pr81314.C: Ditto.
* testsuite/libgomp.c++/target-in-reduction-1.C: Ditto.
* testsuite/libgomp.c++/target-in-reduction-2.C: Ditto.
* testsuite/libgomp.c++/task-1.C: Ditto.
* testsuite/libgomp.c++/task-2.C: Ditto.
* testsuite/libgomp.c++/task-6.C: Ditto.
* testsuite/libgomp.c++/task-reduction-7.C: Ditto.
* testsuite/libgomp.c++/task-reduction-9.C: Ditto.
* testsuite/libgomp.c++/taskloop-reduction-1.C: Ditto.
* testsuite/libgomp.c-c++-common/cancel-taskgroup-4.c: Ditto.
* testsuite/libgomp.c-c++-common/depend-inoutset-1.c: Ditto.
* testsuite/libgomp.c-c++-common/depend-iterator-1.c: Ditto.
* testsuite/libgomp.c-c++-common/master-combined-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-in-reduction-1.c: Ditto.
* testsuite/libgomp.c-c++-common/target-in-reduction-2.c: Ditto.
* testsuite/libgomp.c-c++-common/task-detach-12.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-15.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-5.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-6.c: Ditto.
* testsuite/libgomp.c-c++-common/task-reduction-8.c: Ditto.
* testsuite/libgomp.c-c++-common/taskloop-reduction-1.c: Ditto.
* testsuite/libgomp.c-c++-common/taskloop-reduction-3.c: Ditto.
* testsuite/libgomp.c-c++-common/taskloop-reduction-4.c: Ditto.
* testsuite/libgomp.c/affinity-1.c: Remove extraneous dg
instruction and add suppression.
* testsuite/libgomp.c/critical-2.c: Suppress deprecation
warnings.
* testsuite/libgomp.c/debug-1.c: Ditto.
* testsuite/libgomp.c/lib-1.c: Ditto.
* testsuite/libgomp.c/loop-24.c: Ditto.
* testsuite/libgomp.c/nestedfn-2.c: Ditto.
* testsuite/libgomp.c/nestedfn-3.c: Ditto.
* testsuite/libgomp.c/pr104385.c: Ditto.
* testsuite/libgomp.c/target-31.c: Ditto.
* testsuite/libgomp.c/target-34.c: Ditto.
* testsuite/libgomp.c/target-critical-1.c: Ditto.
* testsuite/libgomp.c/task-1.c: Ditto.
* testsuite/libgomp.c/task-3.c: Ditto.
* testsuite/libgomp.c/task-6.c: Ditto.
* testsuite/libgomp.c/task-reduction-1.c: Ditto.
* testsuite/libgomp.c/task-reduction-2.c: Ditto.
* testsuite/libgomp.c/teams-1.c: Ditto.
* testsuite/libgomp.c/vla-1.c: Ditto.
* testsuite/libgomp.fortran/crayptr1.f90: Ditto.
* testsuite/libgomp.fortran/depend-inoutset-1.f90: Ditto.
* testsuite/libgomp.fortran/is_device_ptr-1.f90: Ditto.
* testsuite/libgomp.fortran/is_device_ptr-2.f90: Ditto.
* testsuite/libgomp.fortran/lib1.f90: Ditto.
* testsuite/libgomp.fortran/lib2.f: Ditto.
* testsuite/libgomp.fortran/lib3.f: Ditto.
* testsuite/libgomp.fortran/omp_parse2.f90: Ditto.
* testsuite/libgomp.fortran/openmp_version-1.f: Bump OMP version.
* testsuite/libgomp.fortran/openmp_version-2.f90: Ditto.
* testsuite/libgomp.fortran/parallel-master.f90: Suppress
warnings.
* testsuite/libgomp.fortran/pointer2.f90: Ditto.
* testsuite/libgomp.fortran/reduction6.f90: Ditto.
* testsuite/libgomp.fortran/target-firstprivate-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-2.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-3.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-4.f90: Ditto.
* testsuite/libgomp.fortran/use_device_addr-5.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-3.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-4.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-optional-2.f90: Ditto.
* testsuite/libgomp.fortran/use_device_ptr-optional-3.f90: Ditto.
* testsuite/libgomp.c-c++-common/omp-atv-seq-dep.c: New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-contended-dep.c:
New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-none-dep.c: New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-speculative-dep.c:
New test.
* testsuite/libgomp.c-c++-common/omp-lock-hint-uncontended-dep.c:
New test.
* testsuite/libgomp.c/omp-proc-bind-master-dep.c: New test.
* testsuite/libgomp.fortran/omp-atv-seq-dep.f90: New test.
* testsuite/libgomp.fortran/omp-lock-hint-contended-dep.f90: New
test.
* testsuite/libgomp.fortran/omp-lock-hint-none-dep.f90: New test.
* testsuite/libgomp.fortran/omp-lock-hint-speculative-dep.f90: New
test.
* testsuite/libgomp.fortran/omp-lock-hint-uncontended-dep.f90: New
test.

gcc/testsuite/ChangeLog:

* c-c++-common/cpp/openmp-define-3.c: Bump OMP version.
* c-c++-common/gomp/Wparentheses-1.c: Suppress deprecation
warnings.
* c-c++-common/gomp/Wparentheses-3.c: Ditto.
* c-c++-common/gomp/affinity-3.c: Ditto.
* c-c++-common/gomp/allocate-18.c: Ditto.
* c-c++-common/gomp/cancel-1.c: Ditto.
* c-c++-common/gomp/clause-dups-1.c: Ditto.
* c-c++-common/gomp/clauses-1.c: Suppress deprecation
warnings and fix misspelled directive. Add
'-Wunknown-pragmas'.
* c-c++-common/gomp/clauses-6.c: Suppress deprecation warnings.
* c-c++-common/gomp/declare-variant-1.c: Ditto.
* c-c++-common/gomp/declare-variant-2.c: Ditto.
* c-c++-common/gomp/depend-iterator-1.c: Ditto.
* c-c++-common/gomp/lastprivate-conditional-1.c: Ditto.
* c-c++-common/gomp/loop-1.c: Ditto.
* c-c++-common/gomp/loop-2.c: Ditto.
* c-c++-common/gomp/loop-3.c: Ditto.
* c-c++-common/gomp/loop-4.c: Ditto.
* c-c++-common/gomp/master-combined-1.c: Ditto.
* c-c++-common/gomp/master-combined-2.c: Ditto.
* c-c++-common/gomp/nesting-2.c: Ditto.
* c-c++-common/gomp/pr100902-1.c: Ditto.
* c-c++-common/gomp/pr61486-2.c: Ditto.
* c-c++-common/gomp/pr85696.c: Ditto.
* c-c++-common/gomp/pr85956.c: Ditto.
* c-c++-common/gomp/pr98187.c: Ditto.
* c-c++-common/gomp/pr99928-1.c: Ditto.
* c-c++-common/gomp/pr99928-10.c: Ditto.
* c-c++-common/gomp/pr99928-11.c: Ditto.
* c-c++-common/gomp/pr99928-12.c: Ditto.
* c-c++-common/gomp/pr99928-13.c: Ditto.
* c-c++-common/gomp/pr99928-14.c: Ditto.
* c-c++-common/gomp/pr99928-2.c: Ditto.
* c-c++-common/gomp/pr99928-3.c: Ditto.
* c-c++-common/gomp/pr99928-4.c: Ditto.
* c-c++-common/gomp/pr99928-5.c: Ditto.
* c-c++-common/gomp/pr99928-6.c: Ditto.
* c-c++-common/gomp/pr99928-7.c: Ditto.
* c-c++-common/gomp/pr99928-8.c: Ditto.
* c-c++-common/gomp/pr99928-9.c: Ditto.
* c-c++-common/gomp/task-detach-1.c: Ditto.
* c-c++-common/gomp/teams-2.c: Ditto.
* g++.dg/gomp/attrs-1.C: Ditto.
* g++.dg/gomp/attrs-2.C: Ditto.
* g++.dg/gomp/attrs-4.C: Ditto.
* g++.dg/gomp/block-0.C: Ditto.
* g++.dg/gomp/block-10.C: Ditto.
* g++.dg/gomp/block-5.C: Ditto.
* g++.dg/gomp/block-9.C: Ditto.
* g++.dg/gomp/depend-iterator-1.C: Ditto.
* g++.dg/gomp/master-1.C: Ditto.
* g++.dg/gomp/master-2.C: Ditto.
* g++.dg/gomp/master-3.C: Ditto.
* g++.dg/gomp/method-1.C: Ditto.
* g++.dg/gomp/pr29965-3.C: Ditto.
* g++.dg/gomp/pr29965-9.C: Ditto.
* g++.dg/gomp/pr78363-4.C: Ditto.
* g++.dg/gomp/pr78363-6.C: Ditto.
* g++.dg/gomp/pr79664.C: Ditto.
* g++.dg/gomp/pr94477.C: Ditto.
* g++.dg/gomp/pr94512.C: Ditto.
* g++.dg/gomp/tpl-master-1.C: Ditto.
* gcc.dg/gomp/appendix-a/a.12.1.c: Ditto.
* gcc.dg/gomp/appendix-a/a.33.2.c: Ditto.
* gcc.dg/gomp/attrs-1.c: Ditto.
* gcc.dg/gomp/attrs-2.c: Ditto.
* gcc.dg/gomp/attrs-4.c: Ditto.
* gcc.dg/gomp/block-10.c: Ditto.
* gcc.dg/gomp/block-5.c: Ditto.
* gcc.dg/gomp/block-9.c: Ditto.
* gcc.dg/gomp/master-1.c: Ditto.
* gcc.dg/gomp/master-2.c: Ditto.
* gcc.dg/gomp/master-3.c: Ditto.
* gcc.dg/gomp/nesting-1.c: Ditto.
* gcc.dg/gomp/pr104517.c: Ditto.
* gcc.dg/gomp/pr29965-3.c: Ditto.
* gcc.dg/gomp/pr35818.c: Ditto.
* gcc.dg/gomp/pr91216.c: Ditto.
* gcc.dg/gomp/sharing-2.c: Ditto.
* gfortran.dg/gomp/adjust-args-10.f90: Ditto.
* gfortran.dg/gomp/affinity-1.f90: Ditto.
* gfortran.dg/gomp/allocate-clause.f90: Ditto.
* gfortran.dg/gomp/appendix-a/a.12.1.f90: Ditto.
* gfortran.dg/gomp/appendix-a/a.33.2.f90: Ditto.
* gfortran.dg/gomp/c_ptr_tests_20.f90: Ditto.
* gfortran.dg/gomp/c_ptr_tests_21.f90: Ditto.
* gfortran.dg/gomp/cancel-1.f90: Ditto.
* gfortran.dg/gomp/clauses-1.f90: Ditto.
* gfortran.dg/gomp/declare-variant-1.f90: Ditto.
* gfortran.dg/gomp/depend-iterator-1.f90: Ditto.
* gfortran.dg/gomp/depend-iterator-2.f90: Ditto.
* gfortran.dg/gomp/is_device_ptr-1.f90: Ditto.
* gfortran.dg/gomp/is_device_ptr-2.f90: Ditto.
* gfortran.dg/gomp/is_device_ptr-3.f90: Ditto.
* gfortran.dg/gomp/lastprivate-conditional-1.f90: Ditto.
* gfortran.dg/gomp/loop-4.f90: Ditto.
* gfortran.dg/gomp/loop-exit.f90: Ditto.
* gfortran.dg/gomp/map-3.f90: Ditto.
* gfortran.dg/gomp/nesting-2.f90: Ditto.
* gfortran.dg/gomp/nesting-3.f90: Ditto.
* gfortran.dg/gomp/nowait-2.f90: Ditto.
* gfortran.dg/gomp/nowait-4.f90: Ditto.
* gfortran.dg/gomp/nowait-5.f90: Ditto.
* gfortran.dg/gomp/openmp-simd-2.f90: Ditto.
* gfortran.dg/gomp/openmp-simd-3.f90: Ditto.
* gfortran.dg/gomp/parallel-master-1.f90: Ditto.
* gfortran.dg/gomp/parallel-master-2.f90: Ditto.
* gfortran.dg/gomp/pr107214-8.f90: Ditto.
* gfortran.dg/gomp/pr48117.f90: Ditto.
* gfortran.dg/gomp/pr94672.f90: Ditto.
* gfortran.dg/gomp/pr99928-1.f90: Suppression + fix whitespace.
* gfortran.dg/gomp/pr99928-11.f90: Suppression.
* gfortran.dg/gomp/pr99928-2.f90: Suppression + fix whitespace.
* gfortran.dg/gomp/pr99928-3.f90: Ditto.
* gfortran.dg/gomp/pr99928-4.f90: Ditto.
* gfortran.dg/gomp/pr99928-5.f90: Ditto.
* gfortran.dg/gomp/pr99928-6.f90: Ditto.
* gfortran.dg/gomp/pr99928-8.f90: Ditto.
* gfortran.dg/gomp/sharing-3.f90: Suppress deprecation warnings.
* gfortran.dg/gomp/strictly-structured-block-1.f90: Ditto.
* gfortran.dg/gomp/strictly-structured-block-2.f90: Ditto.
* gfortran.dg/gomp/target1.f90: Ditto.
* gfortran.dg/gomp/taskloop-1.f90: Ditto.
* gfortran.dg/gomp/taskloop-2.f90: Ditto.
* gfortran.dg/openmp-define-3.f90: Bump expected version.
* c-c++-common/gomp/master-construct-dep.c: New test.
* gfortran.dg/gomp/master-construct-dep.f90: New test.

5 days agolibstdc++: constexpr flat_set and flat_multiset
Yuao Ma [Thu, 11 Dec 2025 14:24:42 +0000 (22:24 +0800)] 
libstdc++: constexpr flat_set and flat_multiset

This patch makes flat_set and flat_multiset constexpr as part of P3372R3.

libstdc++-v3/ChangeLog:

* include/bits/version.def: Add FTM.
* include/bits/version.h: Regenerate.
* include/std/flat_set: Add constexpr.
* testsuite/23_containers/flat_multiset/1.cc: Add constexpr test.
* testsuite/23_containers/flat_set/1.cc: Add constexpr test.

5 days ago[PATCH] MAINTAINERS: add myself to write after approval
supers1ngular [Thu, 11 Dec 2025 12:22:23 +0000 (04:22 -0800)] 
[PATCH] MAINTAINERS: add myself to write after approval

ChangeLog:

* MAINTAINERS: add myself to write after approval

5 days agoAda: Fix internal error on illegal aggregate for private type
Eric Botcazou [Thu, 11 Dec 2025 09:07:15 +0000 (10:07 +0100)] 
Ada: Fix internal error on illegal aggregate for private type

This just adds a guard for illegal cases to Resolve_Record_Aggregate.

gcc/ada/
PR ada/123088
* sem_aggr.adb (Resolve_Record_Aggregate): Add missing guard.

gcc/testsuite/
* gnat.dg/aggr33.adb: New test.

5 days agoi386: Fix and rework Windows TLS support
Eric Botcazou [Thu, 11 Dec 2025 09:02:35 +0000 (10:02 +0100)] 
i386: Fix and rework Windows TLS support

The compiler can emit invalid movabs instructions at -O0 for TLS accesses in
64-bit mode on Windows, for example with the attached testcase:

eric@fomalhaut:~/build/gcc/x86_64-w64-mingw32> gcc/xgcc -Bgcc -c struct-2.c
/tmp/ccOM8wdd.s: Assembler messages:
/tmp/ccOM8wdd.s:34: Error: operand type mismatch for `movabs'

This fixes the issue by leveraging the existing pic_32bit_operand predicate,
and fixing an oversight present in it for a couple of decades.  The patch
also reworks the support to make use of the get_thread_pointer machinery as
for other platforms, of more comments and of shorter lines.

gcc/
PR target/80881
* config/i386/i386.h (DEFAULT_TLS_SEG_OFFSET): New define.
* config/mingw/mingw32.h (DEFAULT_TLS_SEG_OFFSET): Likewise.
* config/i386/i386.cc (ix86_tls_index): Fix long line.
(legitimize_tls_address): Use get_thread_pointer, add comments and
fix long lines.
* config/i386/i386.md (*load_tp_<mode>): Use DEFAULT_TLS_SEG_OFFSET
(*load_tp_x32_zext): Likewise.
(*add_tp_<mode>): Likewise.
(*add_tp_x32_zext): Likewise.
* config/i386/predicates.md (pic_32bit_operand): Fix oversight.
(symbolic_operand): Accept UNSPEC_SECREL32 with or without offset.

gcc/testsuite/
* gcc.dg/tls/struct-2.c: New test.

5 days agolibatomic: Regenerate Makefile.in
Mark Wielaard [Thu, 11 Dec 2025 10:15:46 +0000 (11:15 +0100)] 
libatomic: Regenerate Makefile.in

After regeneration in commit e5d853bbe9b0 ("Factor out thread model
detection with new `GCC_AC_THREAD_MODEL` macro") some whitespace was
removed from the Makefile.in files under libatomic. Fix this by
regenerating them again.

libatomic/ChangeLog:

* Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

5 days agoUpdate my maintainer entry email
Pengxuan Zheng [Thu, 11 Dec 2025 02:58:37 +0000 (18:58 -0800)] 
Update my maintainer entry email

Just updating with my new email address.

ChangeLog:

* MAINTAINERS (Pengxuan Zheng): Update email address.

Signed-off-by: Pengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>
5 days agoDaily bump.
GCC Administrator [Thu, 11 Dec 2025 00:16:27 +0000 (00:16 +0000)] 
Daily bump.

5 days agox86: improve lea peepholes
Alexandre Oliva [Wed, 10 Dec 2025 23:56:17 +0000 (20:56 -0300)] 
x86: improve lea peepholes

gcc.target/i386/lea-3.c fails on ia32 with PIE enabled by default.
There are two reasons for that:

- setting up the PIC register requires one addl instruction, and the
  testcase wants none

- the expected lea-combining peephole doesn't get applied for two
  reasons:

-- the second insn of the pair that could be turned into a single lea
   doesn't clobber CC, but the existing peephole2 requires an add with
   such a clobber

-- the first and second insns set different regs, and the existing
   peephole2 requires them to be the same

Add extra peephole2s for when the second insn doesn't clobber CC, and
for when the first set reg is different, but it dies at the second
insn.

Adjust lea-3.c to run with -fno-PIE, and add lea-4.c with -fPIE.

The last of the newly-added peephole2s, that enables lea-4.c to pass,
also hits during an i686-linux-gnu bootstrap (without PIE enabled),
while building shared libraries for the target.  I haven't been able
to exercise the other 2, but I haven't tried very hard, and I see no
why they couldn't possibly hit, so I left them in.

for  gcc/ChangeLog

* config/i386/i386.md (lea peephole2): Add 3 new variants.

for  gcc/testsuite/ChangeLog

* gcc.target/i386/lea-3.c: Add -fno-PIE.
* gcc.target/i386/lea-4.c: New, with -fPIE.

5 days ago[testsuite] [ia32] adjust testcases to cope with default-to-PIE
Alexandre Oliva [Wed, 10 Dec 2025 23:56:15 +0000 (20:56 -0300)] 
[testsuite] [ia32] adjust testcases to cope with default-to-PIE

A few testcases new in gcc-15 fail on i686-linux-gnu with PIE enabled
by default.  Add -fno-PIE so that they find the code they test for.

for  gcc/testsuite/ChangeLog

* gcc.dg/sibcall-12.c: Add -fno-PIE on ia32.
* gcc.target/i386/pr106060-2.c: Likewise.
* gcc.target/i386/pr106060-3.c: Likewise.
* gcc.target/i386/vect-shiftv4qi.c: Likewise.

5 days agovect-generic: Fix expand_vector_mult [PR123069]
Jakub Jelinek [Wed, 10 Dec 2025 17:07:02 +0000 (18:07 +0100)] 
vect-generic: Fix expand_vector_mult [PR123069]

The r16-5095 PR122065 change added build_int_cst call on vector types.
That is never correct, it ICEs already on the TYPE_PRECISION used at the
start of wide_int_to_tree_1.

Fixed by using build_zero_cst instead.

2025-12-10  Jakub Jelinek  <jakub@redhat.com>
    Andrew Pinski  <andrew.pinski@oss.qualcomm.com>

PR middle-end/123069
* tree-vect-generic.cc (expand_vector_mult): Use
build_zero_cst (vectype) instead of build_int_cst (vectype, 0).

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

5 days agoa68: add entry for OPT_L in algol68/lang.opt
Jose E. Marchesi [Wed, 10 Dec 2025 03:30:54 +0000 (04:30 +0100)] 
a68: add entry for OPT_L in algol68/lang.opt

We need to handle OPT_L in ga68 in order to add the specified
directories to the modules search path.  This patch adds the necessary
entry in algol68/lang.opt.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* lang.opt: Add entry for OPT_L.

5 days agoa68: do not try extensionless packet files in a68_get_packet_exports
Jose E. Marchesi [Wed, 10 Dec 2025 03:30:37 +0000 (04:30 +0100)] 
a68: do not try extensionless packet files in a68_get_packet_exports

This commit makes ga68 to not look to exports data in files without
extensions, i.e. to not look in a file `foo' for packet Foo. The files
to try are: first foo.m68, then libfoo.so, then libfoo.a, finally
foo.o.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-imports.cc (a68_try_packet_in_directory): do not try
extensionless packet files.

5 days agoa68: fix a68_int_sign and a68_real_sign
Jose E. Marchesi [Tue, 9 Dec 2025 23:10:05 +0000 (00:10 +0100)] 
a68: fix a68_int_sign and a68_real_sign

This commit fixes the lowerer for `sign' operator for ints and reals
to not gimplify its operand twice.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-low-ints.cc (a68_int_sign): Avoid gimplifying val twice.
* a68-low-reals.cc (a68_real_sign): Likewise.

gcc/testsuite/ChangeLog

* algol68/execute/sign-int-2.a68: New test.
* algol68/execute/sign-real-2.a68: Likewise.

5 days agoa68: fix `int * char' lowerer
Jose E. Marchesi [Tue, 9 Dec 2025 22:53:24 +0000 (23:53 +0100)] 
a68: fix `int * char' lowerer

This commit fixes the asserts in a68_loer_char_mult3 so it expects
either int*char or char*int.  It also expands the mult-char-1.a68
testcase to cover this case.

Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
gcc/algol68/ChangeLog

* a68-low-prelude.cc (a68_lower_char_mult3): Fix asserts.

gcc/testsuite/ChangeLog

* algol68/execute/mult-char-1.a68: Cover int*char cases.

6 days agoc++/modules: #include <vector> -> import <bits/stdc++.h>
Jason Merrill [Wed, 10 Dec 2025 15:11:26 +0000 (23:11 +0800)] 
c++/modules: #include <vector> -> import <bits/stdc++.h>

Since the standard library doesn't preclude an #include of a standard
library header from bringing in declarations from other headers, we can
translate an #include of any of the importable headers as an import of
<bits/stdc++.h>.

To reduce the amount of C++ standard knowledge encoded in libcpp, I extend
the translate_include callback to allow it to suggest an alternate header to
try translating.  It's a bit awkward to bounce back and forth, but this
seems like the right division of responsibilities.

libcpp/ChangeLog:

* include/cpplib.h (struct cpp_callbacks): Replace 'path' parameter
with file, angle_brackets, and alternate name.
(cpp_get_name): Declare.
* files.cc (cpp_get_name): New.
(_cpp_stack_include, _cpp_post_stack_file, _cpp_stack_file)
(_cpp_stack_translated_file): Refactor, try alternate file.

gcc/cp/ChangeLog:

* module.cc (maybe_translate_include): Suggest <bits/stdc++.h>
as an alternate for importable standard library headers.
(importable_headers, is_importable_header): New.

gcc/ChangeLog:

* doc/invoke.texi (C++ Modules): Remove standard library header
units from missing pieces, mention importable header redirection.

gcc/testsuite/ChangeLog:

* g++.dg/modules/compile-std1.C: Test <vector> translation.

6 days agoc++: clean up gcms from compile-std1.C
Jason Merrill [Wed, 10 Dec 2025 09:32:59 +0000 (17:32 +0800)] 
c++: clean up gcms from compile-std1.C

I noticed that the .gcms from compile-std1.C were sticking around and
confusing other tests; this patch enhances dg-module-cmi to understand
<header> and adds the appropriate directives to the test.

gcc/testsuite/ChangeLog:

* g++.dg/modules/compile-std1.C: Add dg-module-cmi lines.
* g++.dg/modules/modules.exp (host_header_path): New.
(munge_cmi): Factor out...
(dg-module-cmi): ...from here.

6 days agoRISC-V: Move pr123074.C to g++.target.
Robin Dapp [Wed, 10 Dec 2025 08:19:39 +0000 (09:19 +0100)] 
RISC-V: Move pr123074.C to g++.target.

Andrew noticed that I added a c++ file to the wrong dir.  This patch
corrects it.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr123074.C: Move to...
* g++.target/riscv/rvv/autovec/pr123074.C: ...here.
* gcc.target/riscv/rvv/rvv.exp: Remove 'C'.

6 days agolibsanitizer: Update LOCAL_PATCHES
Rainer Orth [Wed, 10 Dec 2025 08:33:36 +0000 (09:33 +0100)] 
libsanitizer: Update LOCAL_PATCHES

This patch updates LOCAL_PATCHES for

commit 203d4dd09ba83121e447ce93ba98175b68d955f6
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Wed Dec 10 09:24:53 2025 +0100

    libsanitizer: Restore local sanitizer_redefine_builtins.h patch

2025-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libsanitizer:
* LOCAL_PATCHES: Update.

6 days agolibsanitizer: Restore local sanitizer_redefine_builtins.h patch
Rainer Orth [Wed, 10 Dec 2025 08:24:53 +0000 (09:24 +0100)] 
libsanitizer: Restore local sanitizer_redefine_builtins.h patch

The recent libsanitizer update broke the Solaris/SPARC build with the
native assembler: many files don't compile any longer like

/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 5: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 6: error: statement syntax
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: unknown opcode ".set"
/usr/bin/as: "/var/tmp//ccYsT60a.s", line 7: error: statement syntax

This happens because sanitizer_common/sanitizer_redefine_builtins.h lost
a local patch that guards use of .set in asm by HAVE_AS_SYM_ASSIGN.
This patch restores that patch.

Although the Darwin assembler accepts .set (thus HAVE_AS_SYM_ASSIGN is
defined), the __APPLE__ guard is kept to guard against the link failures
that prompted its upstreadm addition in LLVM commit

commit cfdbbb8fcc62f75dcf0b251dfab63353f3921227
Author: Dan Blackwell <dan_blackwell@apple.com>
Date:   Fri Aug 15 09:13:26 2025 +0100

    [sanitizer_common] Disable sanitizer_redefine_builtins on Apple platforms (#153381)

even though they didn't happen in the GCC build.

It also keeps the _AIX guard due to LLVM commit

commit d7c6cad744bc7ed28535dc6f75629902eda559ea
Author: Jake Egan <Jake.egan@ibm.com>
Date:   Wed Jun 11 20:22:15 2025 -0400

    [sanitizer_common] Implement interception on AIX (#138606)

Bootstrapped without regressions on sparc-sun-solaris2.11 with gas and
as, i386-pc-solaris2.11, x86_64-pc-linux-gnu, and
x86_64-apple-darwin25.1.0.

6 days agoFix PID_TYPE on 32-bit Solaris
Rainer Orth [Wed, 10 Dec 2025 08:05:55 +0000 (09:05 +0100)] 
Fix PID_TYPE on 32-bit Solaris

The pid_t type on 32-bit Solaris differs from gcc's builtin.

<sys/types.h> has

typedef int pid_t; /* process id type */
typedef long pid_t; /* (historical version) */

while gcc/defaults.h uses

on all targets.

This patch fixes this by providing a Solaris definition.
g++.dg/lookup/extern-c-redecl3.C had to be adjusted accordingly.

Bootstrapped without regressions on i386-pc-solaris2.11,
sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.

2025-11-17  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc:
* config/sol2.h (PID_TYPE): Define.
* doc/tm.texi.in (Type Layout): Document PID_TYPE.
* doc/tm.texi: Regenerate.

gcc/testsuite:
* g++.dg/lookup/extern-c-redecl3.C (pid_t): Define.
Use it for fork return type.
terms of __builtin_fork.
* g++.dg/pid_t-1.C: New test.
* gcc.dg/pid_t-1.c: Likewise.

6 days agoDaily bump.
GCC Administrator [Wed, 10 Dec 2025 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

6 days agolibgcc: Dont use TARGET_SYSTEM_ROOT from gcc
John Ericson [Tue, 9 Dec 2025 22:06:52 +0000 (22:06 +0000)] 
libgcc: Dont use TARGET_SYSTEM_ROOT from gcc

Following Andrew Pinski's suggestions in
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, just
use the output of:

   $(CC) -print-sysroot

It is just used in one spot, in an AIX code-path. I just made (within
make) a shell variable to use instead.

I don't have AIX on-hand to test this, however.

gcc/ChangeLog:

* Makefile.in: No longer include TARGET_SYSTEM_ROOT in
libgcc.mvars.

libgcc/ChangeLog:

* config/rs6000/t-slibgcc-aix: Instead of using a
TARGET_SYSTEM_ROOT make variable, just define a shell variable
as part of the rule and use that.

Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: John Ericson <git@JohnEricson.me>
6 days agoMove NO_PIE_CFLAGS logic from gcc to libgcc
John Ericson [Tue, 9 Dec 2025 22:06:51 +0000 (22:06 +0000)] 
Move NO_PIE_CFLAGS logic from gcc to libgcc

My goal is to be able to build libgcc cleanly in isolation --- today one
needs to figure `make ...` misc things in the gcc subdir.

Following Andrew Pinski's suggestions in
https://gcc.gnu.org/pipermail/gcc-patches/2025-July/689683.html, this
commit moves the NO_PIE_CFLAGS logic.

gcc/ChangeLog:

* Makefile.in:: Remove NO_PIE_CFLAGS logic, since it is now in
libgcc.
* configure: Regenerate.
* configure.ac: Remove the enable_default_pie substitution, since
libgcc now has its own logic.

libgcc/ChangeLog:

* Makefile.in: Define NO_PIE_CFLAGS make variable via autoconf
substitution.
* configure: Regenerate.
* configure.ac: New configure check to define NO_PIE_CFLAGS
using the algorithm Andrew asked for in the linked mail.

Suggested-by: Andrew Pinski <quic_apinski@quicinc.com>
Signed-off-by: John Ericson <git@JohnEricson.me>
6 days agoFactor out thread model detection with new `GCC_AC_THREAD_MODEL` macro
John Ericson [Tue, 9 Dec 2025 22:06:48 +0000 (22:06 +0000)] 
Factor out thread model detection with new `GCC_AC_THREAD_MODEL` macro

This macro deduplicates the

    $CC -v 2>&1 | sed -n 's/^Thread model: //p'

check that was occurring in various runtime libs.

Additionally, as a bit of an Easter egg, this also allows overriding
what the compiler would return by setting the
`gcc_cv_target_thread_file` cache variable first. I admit that it is in
fact this Easter egg that led me to write the patch. The use-case for it
is for making multilib builds where the library sets do not all share
the same thread model easier. See also `THREAD_MODEL_SPEC` for more
about the varying thread models use-case.

Arguably one could could try to define on `THREAD_MODEL_SPEC` on more
platforms (besides e.g. AIX) but the ramifications of this are a bit
unclear. Setting `gcc_cv_target_thread_file` directly is a "low tech"
solution that will work for now for sure. Of course, since setting a
cache variable like this a hacky trick, I will not expect this to be at
all stable/guaranteed to work, going forward.

Thanks to Arsen who on IRC discussed these things with me, including in
particular making it a cache var not `--with-model` flag, to not
prematurely foster expectations that this is stable.

Suggested-by: Arsen Arsenović <arsen@aarsen.me>
config/ChangeLog:

* gthr.m4: Create new GCC_AC_THREAD_MODEL macro

libatomic/ChangeLog:

* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* configure.ac: Use GCC_AC_THREAD_MODEL instead of hand-rolled
* testsuite/Makefile.in: Regenerate.

libgcc/ChangeLog:

* configure: Regenerate.
* configure.ac: Use GCC_AC_THREAD_MODEL instead of hand-rolled

libphobos/ChangeLog:

* configure: Regenerate.
* m4/druntime/os.m4: Use AC_MSG_ERROR, not private as_fn_error

libstdc++-v3/ChangeLog:

* acinclude.m4: Use GCC_AC_THREAD_MODEL instead, via AC_REQUIRE
* configure: Regenerate.

6 days agolibstdc++: Regenerate <bits/version.h>
Jonathan Wakely [Tue, 9 Dec 2025 21:05:02 +0000 (21:05 +0000)] 
libstdc++: Regenerate <bits/version.h>

Some pre-r16-4328-g71e95e871d62e4 comments sneaked back in with some
recent commits.

libstdc++-v3/ChangeLog:

* include/bits/version.h: Regenerate.

6 days agolibstdc++: Set __cpp_lib_submdspan to 202411.
Luc Grosheintz [Mon, 8 Dec 2025 20:23:46 +0000 (21:23 +0100)] 
libstdc++: Set __cpp_lib_submdspan to 202411.

The submdspan feature is complete and this commit sets the feature
testing macros accordingly. Also makes the feature testing macro
submdspan depend on constant_wrapper.

Also changes the value of the internal feature testing macro for padded
layouts to 202403.

libstdc++-v3/ChangeLog:

* include/bits/version.def (padded_layouts): Set to 202403.
(submdspan): Set to 202411 add dependency.
* include/bits/version.h: Regenerate.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
6 days agovect: Reset using_select_vl_p before starting over [PR123074].
Robin Dapp [Tue, 9 Dec 2025 12:07:36 +0000 (13:07 +0100)] 
vect: Reset using_select_vl_p before starting over [PR123074].

In the PR we ICE accessing the loop lens in
vect_get_loop_variant_data_ptr_increment when building 510.parest.
This function only gets called when we use SELECT_VL for the loop
control, however during initialization of the loop lens partial
vectors, a prerequisite for SELECT_VL, was false while using_select_vl
was true.  We reset using_partial_vectors when restarting the analysis
after forcing single-lane SLP but don't reset using_select_vl.

This patch resets it as well.

PR tree-optimization/123074

gcc/ChangeLog:

* tree-vect-loop.cc: Reset LOOP_VINFO_USING_SELECT_VL_P.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/rvv.exp: Include *.C.
* gcc.target/riscv/rvv/autovec/pr123074.C: New test.

6 days agoc: ICE in gimplify_expr when counted_by for pointer is added [PR122982]
Qing Zhao [Tue, 9 Dec 2025 14:21:55 +0000 (14:21 +0000)] 
c: ICE in gimplify_expr when counted_by for pointer is added [PR122982]

The first argument of the call to .ACCESS_WITH_SIZE includes
"c_maybe_const_expr" which should not be passed to gimplifier.

Before passing the expression as the first argument to the call to
.ACCESS_WITH_SIZE, c_fully_fold should be called on this expression.

PR c/122982

gcc/c/ChangeLog:

* c-typeck.cc (build_access_with_size_for_counted_by): Call
c_fully_fold on the first parameter.

gcc/testsuite/ChangeLog:

* gcc.dg/pointer-counted-by-pr122982.c: New test.

6 days agolibstdc++: Implement submdspan_mapping for layout_right_padded. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:45 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_right_padded. [PR110352]

Implements submdspan for layout_right_padded as described in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan
(__mdspan::_SubMdspanMapping<_LayoutSide::__right, true>): Define.
(layout_right_padded::submdspan_mapping): New friend function.
* testsuite/23_containers/mdspan/submdspan/selections/right_padded.cc:
Instantiate tests for layout_right_padded.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
6 days agolibstdc++: Implement submdspan_mapping for layout_left_padded. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:44 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_left_padded. [PR110352]

Implements submdspan for layout_left_padded as described in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (__mdspan::__is_padded_mapping): Define.
(__mdspan::_SubMdspanMapping): Add _Padded template parameter.
(__mdspan::_SubMdspanMapping<_LayoutSide::__left, true>): Define.
(__mdspan::__submdspan_mapping_impl): Updated _Trait alias.
(layout_left_padded::submdspan_mapping): New friend method.
* testsuite/23_containers/mdspan/layout_traits.h
(LayoutTraits::layout_same_padded): New template type alias.
* testsuite/23_containers/mdspan/submdspan/selections/left_padded.cc:
Instantiate tests for layout_left_padded.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agoRISC-V: Add test for vec_duplicate + vmslt.vv combine with GR2VR cost 0, 1 and 15
Pan Li [Mon, 8 Dec 2025 12:48:29 +0000 (20:48 +0800)] 
RISC-V: Add test for vec_duplicate + vmslt.vv combine with GR2VR cost 0, 1 and 15

Add asm dump check and run test for vec_duplicate + vmslt.vv
combine to vmslt.vx, with the GR2VR cost is 0, 2 and 15.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add asm check
for vmslt.vx.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-2-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i16.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i32.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i64.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx-3-i8.c: Ditto.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary.h: Add test
helper macros.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_binary_data.h: Add test
data for run test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i16.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i32.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i64.c: New test.
* gcc.target/riscv/rvv/autovec/vx_vf/vx_vmslt-run-1-i8.c: New test.

Signed-off-by: Pan Li <pan2.li@intel.com>
7 days agoRISC-V: Combine vec_duplicate + vmslt.vv to vmslt.vx on GR2VR cost
Pan Li [Mon, 8 Dec 2025 12:45:56 +0000 (20:45 +0800)] 
RISC-V: Combine vec_duplicate + vmslt.vv to vmslt.vx on GR2VR cost

This patch would like to combine the vec_duplicate + vmslt.wv to the
vmslt.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 asm code like below, GR2VR cost is 0.

Before this patch:
  11       beq a3,zero,.L8
  12       vsetvli a5,zero,e32,m1,ta,ma
  13       vmv.v.x v2,a2
  ...
  16   .L3:
  17       vsetvli a5,a3,e32,m1,ta,ma
  ...
  22       vmslt.vv v1,v2,v3
  ...
  25       bne a3,zero,.L3

After this patch:
  11       beq a3,zero,.L8
  ...
  14    .L3:
  15       vsetvli a5,a3,e32,m1,ta,ma
  ...
  20       vmslt.vx v1,a2,v3
  ...
  23       bne a3,zero,.L3

gcc/ChangeLog:

* config/riscv/predicates.md: Append operator lt to
the comparison_swappable_operator.
* config/riscv/riscv-v.cc (get_swapped_cmp_rtx_code): Add
swappable operator lt handing.

Signed-off-by: Pan Li <pan2.li@intel.com>
7 days agotarget/121230 - x86 vector CTOR cost with 387 math
Richard Biener [Mon, 8 Dec 2025 13:36:58 +0000 (14:36 +0100)] 
target/121230 - x86 vector CTOR cost with 387 math

The following adjusts costing of vector construction from scalars for
FP modes which with 387 math can reside in FP regs which need spilling
to be reloaded to XMM.  I've played on the safe side with mixed
SSE/387 math.

PR target/121230
* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
With FP mode and 387 math cost spill/reload.

* gcc.target/i386/pr121230.c: New testcase.

7 days agotestsuite/120167 - avoid IPA messing up with test
Richard Biener [Tue, 9 Dec 2025 13:54:39 +0000 (14:54 +0100)] 
testsuite/120167 - avoid IPA messing up with test

The following avoids cloning / IPA CP to mess up dump counting.

PR testsuite/120167
libgomp/
* testsuite/libgomp.graphite/force-parallel-1.c: Make parloop
noipa.

7 days agoRISC-V: Regenerate opt urls.
Robin Dapp [Tue, 9 Dec 2025 13:22:47 +0000 (14:22 +0100)] 
RISC-V: Regenerate opt urls.

I forgot to regenerate the opt urls.  This patch makes up for it.

gcc/ChangeLog:

* config/riscv/riscv.opt.urls:  Regenerate.

7 days agolibstdc++: Implement submdspan_mapping for layout_stride. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:43 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_stride. [PR110352]

Add submdspan_mapping for layout_stride as in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (layout_stride::mapping::submdspan_mapping): New
friend function.
* testsuite/23_containers/mdspan/submdspan/selections/stride.cc:
Instantiate tests for layout_stride.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc:
Ditto.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Add tests for layout_stride.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agolibstdc++: Implement submdspan_mapping for layout_right. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:42 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan_mapping for layout_right. [PR110352]

Adds submdspan_mapping for layout_right as described in P3663.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan
(__mdspan::_SubMdspanMapping<_LayoutSide::__right>): Define.
(layout_right::mapping::submdspan_mapping): New friend function.
* testsuite/23_containers/mdspan/submdspan/selections/right.cc:
Instantiate tests for layout_right.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc:
Ditto.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc:
Ditto.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agolibstdc++: Implement submdspan and submdspan_mapping for layout_left. [PR110352]
Luc Grosheintz [Mon, 8 Dec 2025 20:23:41 +0000 (21:23 +0100)] 
libstdc++: Implement submdspan and submdspan_mapping for layout_left. [PR110352]

Implements `submdspan` and `submdspan_mapping` for layout_left as
described in P3663 (Future proofing mdspan).

When computing the offset of the submdspan, one must check that the
lower bound of the slice range isn't out-of-range. There's a few
cases when the lower bound is never out-of-range:

  - full_extent and exts.extent(k) != 0,
  - collapsing slice types.

If those conditions are known to hold, no checks are generated.

Similarly, if all slices are full_extent, there's no need to call
mapping(0,...,0) for standardized mappings.

The implementation prepares to use the symmetry between layout_left and
layout_right and introduces concepts like a "layout side", i.e. left,
right or unknown/strided.

The tests use an iterator to replace nested for-loops. Which also makes
it easier to write the core test logic in a rank-independent manner.

PR libstdc++/110352

libstdc++-v3/ChangeLog:

* include/std/mdspan (__mdspan::__is_submdspan_mapping_result)
(__mdspan::__submdspan_mapping_result, __mdspan::__fwd_prod)
(__mdspan::__acceptable_slice_type, __mdspan::__slice_begin)
(__mdspan::__suboffset, __mdspan::_LayoutSide, __mdspan::__mapping_side)
(__mdspan::_StridesTrait, __mdspan::__substrides_generic)
(__mdspan::__substrides_standardized, __mdspan::__substrides)
(__mdspan::__is_unit_stride_slice, __mdspan::_SliceKind)
(__mdspan::__make_slice_kind, __mdspan::__make_slice_kind_array)
(__mdspan::__is_block, __mdspan::__padded_block_begin_generic)
(__mdspan::__padded_block_begin, __mpdspan::_SubMdspanMapping)
(__mdspan::__submdspan_mapping_impl): Define.
(__mdspan::__dynamic_slice_extent, __mdspan::__static_slice_extent)
(__mdspan::__subextents): Move earlier in the file.
(layout_left::mapping::submdspan_mapping, __mdspan::__sliceable_mapping)
(__mdspan::__submapping, submdspan): Define.
* src/c++23/std.cc.in: Add submdspan.
* testsuite/23_containers/mdspan/submdspan/generic.cc: New test.
* testsuite/23_containers/mdspan/submdspan/selections/left.cc:
Instantiate selection tests for layout_left.
* testsuite/23_containers/mdspan/submdspan/selections/testcases.h: Generic
tests different selections.
* testsuite/23_containers/mdspan/submdspan/submdspan_mapping.cc: New test.
* testsuite/23_containers/mdspan/submdspan/submdspan_neg.cc: New test.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agoRevert "c++: Non-inline temploid friends should still be COMDAT [PR122819]"
Nathaniel Shead [Tue, 9 Dec 2025 12:33:41 +0000 (23:33 +1100)] 
Revert "c++: Non-inline temploid friends should still be COMDAT [PR122819]"

This reverts commit cf22e30f0cfae65dd012966cab657583e2be667e.

7 days agolibstdc++: Silence warning in mdspan.
Luc Grosheintz [Mon, 8 Dec 2025 20:23:40 +0000 (21:23 +0100)] 
libstdc++: Silence warning in mdspan.

Splitting the tests for submdspan triggered a compiler warning. This
commit changes the implementation of __dynamic_extents. In particular,
how the span is created. Functionally, the two are equivalent.

libstdc++-v3/ChangeLog:

* include/std/mdspan (_ExtentsStorage::_M_dynamic_extents):
Create span from pointer + size, not begin and end iterators.

Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
Signed-off-by: Luc Grosheintz <luc.grosheintz@gmail.com>
7 days agoamdgcn: Adjust failure mode for gfx908 USM
Andrew Stubbs [Mon, 8 Dec 2025 16:18:59 +0000 (16:18 +0000)] 
amdgcn: Adjust failure mode for gfx908 USM

Unified Shared Memory does not appear to work well on gfx908, which is why we
disabled xnack by default.  For this reason it makes sense to inform the user
as compile time, but this is causing trouble in the testsuite which assumes
that USM only fails at runtime.

This patch changes the gfx908 compile time message to a warning only (in case
some other target does this differently), and prevents the tests from
attempting to run in host-fallback mode (given that that is not what they are
trying to test).  It also changes the existing warning to only fire once.

The patch assumes that effective target "omp_usm" also implies self-maps.

gcc/ChangeLog:

* config/gcn/gcn.cc (gcn_init_cumulative_args): Only warn once.
Use "required" instead of "enabled" in the warning.
* config/gcn/mkoffload.cc (process_asm): Warn, don't error.
Use "required" instead of "on" in the warning.

libgomp/ChangeLog:

* testsuite/lib/libgomp.exp (check_effective_target_omp_usm): New.
* testsuite/libgomp.c++/target-std__array-concurrent-usm.C: Require
working Unified Shared Memory to run the test.
* testsuite/libgomp.c++/target-std__bitset-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__deque-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__forward_list-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__list-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__map-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__multimap-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__multiset-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__set-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__span-concurrent-usm.C: Likewise.
* testsuite/libgomp.c++/target-std__valarray-concurrent-usm.C:
Likewise.
* testsuite/libgomp.c++/target-std__vector-concurrent-usm.C: Likewise.
* testsuite/libgomp.c-c++-common/target-implicit-map-4.c: Likewise.
* testsuite/libgomp.c-c++-common/target-link-3.c: Likewise.
* testsuite/libgomp.c-c++-common/target-link-4.c: Likewise.
* testsuite/libgomp.fortran/self_maps.f90: Likewise.

7 days agoc: Reject vector type bit-fields [PR123018]
Jakub Jelinek [Tue, 9 Dec 2025 09:22:26 +0000 (10:22 +0100)] 
c: Reject vector type bit-fields [PR123018]

The following testcase ICEs since checking has been added to TYPE_PRECISION
macro.  check_bitfield_type_and_width is called when attributes haven't
been applied to the bit-field decl yet and so it still has INTEGER_TYPE
type, while at finish_struct time it already has VECTOR_TYPE.

The following patch just repeats the check_bitfield_type_and_width
in there.

Another option would be let handle_vector_size_attribute check for
bit-fields and error out there.

2025-12-09  Jakub Jelinek  <jakub@redhat.com>

PR c/123018
* c-decl.cc (finish_struct): Diagnose bit-fields with vector type.

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

7 days agofold: Elide MASK_LEN_LOAD/STORE with zero length [PR122635].
Robin Dapp [Tue, 25 Nov 2025 09:34:55 +0000 (10:34 +0100)] 
fold: Elide MASK_LEN_LOAD/STORE with zero length [PR122635].

This patch adds zero-length handling to gimple_fold_partial_store and
gimple_fold_partial_load and unifies them into
gimple_fold_partial_load_store.

It introduces a new function partial_load_store_mask_state that
returns
 MASK_ALL_INACTIVE,
 MASK_ALL_ACTIVE, or
 MASK_UNKNOWN.

This result is used to either replace a load with its else value and
elide a store (when all inactive), turn the load/store into a regular
mem ref (all_active), or do nothing.

PR tree-optimization/122635

gcc/ChangeLog:

* gimple-fold.cc (enum mask_load_store_state): New enum.
(gimple_fold_partial_load_store_mem_ref): Only fold
"all active" loads/stores.
(partial_load_store_mask_state): New function to compute mask
state.
(gimple_fold_partial_load): Remove.
(gimple_fold_partial_load_store): New function.
(gimple_fold_partial_store): Remove.
(gimple_fold_call): Use new function.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/pfalse-store.c: Expect more elided
stores.
* gcc.target/riscv/rvv/autovec/pr122635-1.c: New test.
* gcc.target/riscv/rvv/autovec/pr122635-2.c: New test.
* gcc.target/powerpc/p9-vec-length-epil-8.c: Expect two lxvl
less.

7 days agooptabs: Add else operand to LEN_LOAD.
Robin Dapp [Fri, 28 Nov 2025 15:24:38 +0000 (16:24 +0100)] 
optabs: Add else operand to LEN_LOAD.

When adding else operands to maskload and friends we didn't bother to do
the same for len_load (as we never use the residual elements anyway).
In order to simplify handling in gimple-fold, this patch adds the else
operand now.  Both, power and s390, zero out inactive elements.

gcc/ChangeLog:

* config/rs6000/predicates.md (lxvl_else_operand): New
predicate.
* config/rs6000/vsx.md: Add else operand.
* config/s390/predicates.md (vll_else_operand): New predicate.
* config/s390/vector.md: Add else operand.
* doc/md.texi: Document else operand.
* internal-fn.cc (internal_fn_len_index): Adjust IFN_LEN_LOAD.
(internal_fn_else_index): Add IFN_LEN_LOAD.
* optabs-tree.cc (target_supports_len_load_store_p): Get else
value for len_load.
* tree-vect-stmts.cc (vectorizable_load): Pun the else value
type.

7 days agoRISC-V: -mmax-vectorization.
Robin Dapp [Fri, 14 Nov 2025 14:50:05 +0000 (15:50 +0100)] 
RISC-V: -mmax-vectorization.

This adds an -mmax-vectorization option to riscv, a verbatim copy from
aarch64.  It is an option for vector code analysis.  Internally it increases
scalar costs by a large factor so every vector approach will be
profitable.  As opposed to -fno-vect-cost-model, we will still compare
the vector approaches amongst each other, though.

In order to handle this argument without an '=' I needed to change the
parsing flow slightly.

gcc/ChangeLog:

* config/riscv/riscv-target-attr.cc (riscv_target_attr_parser::handle_max_vect):
New parser entry.
(riscv_target_attr_parser::update_settings): Set max-vect
option.
(riscv_process_one_target_attr): Change null-arg handling.
* config/riscv/riscv.cc (riscv_override_options_internal): Set
max-vect option.
* config/riscv/riscv.opt: Add -mmax-vectorization option.
* doc/extend.texi: Document new option.
* doc/invoke.texi: Ditto.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/max-vect-1.c: New test.
* gcc.target/riscv/rvv/autovec/max-vect-2.c: New test.

7 days agoRISC-V: Add more mode_idx attributes [PR123022].
Robin Dapp [Mon, 8 Dec 2025 09:22:51 +0000 (10:22 +0100)] 
RISC-V: Add more mode_idx attributes [PR123022].

Similar to 116149 we use the mode size of operand MODE_IDX but that
one could refer to a broadcast scalar.  Use operand 3 for scalar
broadcast patterns instead.

PR target/123022

gcc/ChangeLog:

* config/riscv/vector.md: Add mode_idx attribute.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr123022-2.c: New test.
* gcc.target/riscv/rvv/autovec/pr123022.c: New test.

7 days agoRISC-V: Pragma target [PR115325].
Robin Dapp [Fri, 5 Dec 2025 09:55:18 +0000 (10:55 +0100)] 
RISC-V: Pragma target [PR115325].

This implements #pragma GCC target () for riscv.

All the functionality was already there so we only need to wrap existing
functions.

PR target/115325

gcc/ChangeLog:

* config/riscv/riscv-c.cc (riscv_pragma_target_parse): New
function.
(riscv_register_pragmas): Register riscv_pragma_target_parse.
* config/riscv/riscv-protos.h (riscv_process_target_attr_for_pragma):
Declare.
(riscv_reset_previous_fndecl): Ditto.
* config/riscv/riscv-target-attr.cc (riscv_process_target_attr_for_pragma):
New function.
* config/riscv/riscv.cc (riscv_reset_previous_fndecl): Reset.
(riscv_option_save): New function.
(riscv_option_print): Ditto.
(riscv_get_interrupt_type): Adjust docs.
(TARGET_OPTION_SAVE): Implement.
(TARGET_OPTION_PRINT): Ditto.
* doc/extend.texi: Document that riscv can do target pragams.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/pragma-target-1.c: New test.
* gcc.target/riscv/pragma-target-2.c: New test.

7 days agoRISC-V: Implement mask reduction.
Robin Dapp [Mon, 20 Oct 2025 08:47:45 +0000 (10:47 +0200)] 
RISC-V: Implement mask reduction.

This implements mask reductions by first counting the bits in the mask
(vcpop.m) and then comparing the resulting scalar against 0 or len.

gcc/ChangeLog:

* config/riscv/autovec.md (reduc_sbool_and_scal_<mode>): New
expander.
(reduc_sbool_ior_scal_<mode>): Ditto.
(reduc_sbool_xor_scal_<mode>): Ditto.
* config/riscv/riscv-protos.h (expand_mask_reduction): Declare.
* config/riscv/riscv-v.cc (expand_mask_reduction): New function.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-1.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-2.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-3.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-4.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-5.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-6.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-7.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8-run.c: New test.
* gcc.target/riscv/rvv/autovec/reduc/reduc-bool-8.c: New test.

7 days agotarget/123027 - handle min/max expansion when -ffinite-math-only
Richard Biener [Mon, 8 Dec 2025 09:14:19 +0000 (10:14 +0100)] 
target/123027 - handle min/max expansion when -ffinite-math-only

When we get a <= b ? b : a into ix86_expand_sse_fp_minmax we can
swap and invert this with -ffinite-math-only to get a < b ? a : b.

PR target/123027
* config/i386/i386-expand.cc (ix86_expand_sse_fp_minmax):
With !HONOR_NANS we can handle LE by swapping and inverting.

* gcc.target/i386/pr123027.c: New testcase.
* gcc.dg/torture/pr123027.c: Likewise.

7 days agoc++: Non-inline temploid friends should still be COMDAT [PR122819]
Nathaniel Shead [Sun, 7 Dec 2025 12:17:15 +0000 (23:17 +1100)] 
c++: Non-inline temploid friends should still be COMDAT [PR122819]

Modules allow temploid friends to no longer be implicitly inline, as
functions defined in a class body will not be implicitly inline if
attached to a named module.

This requires us to clean up linkage handling a little bit, mostly by
replacing usages of 'DECL_TEMPLATE_INSTANTIATION' with
'DECL_TEMPLOID_INSTANTIATION' when determining if an entity has vague
linkage.

PR c++/122819

gcc/cp/ChangeLog:

* decl.cc (start_preparsed_function): Use
DECL_TEMPLOID_INSTANTIATION instead of
DECL_TEMPLATE_INSTANTIATION to check vague linkage.
* decl2.cc (vague_linkage_p): Likewise.
(c_parse_final_cleanups): Simplify condition.
* semantics.cc (expand_or_defer_fn_1): Also check for temploid
friend functions.

gcc/testsuite/ChangeLog:

* g++.dg/modules/tpl-friend-22.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
7 days agoDaily bump.
GCC Administrator [Tue, 9 Dec 2025 00:16:30 +0000 (00:16 +0000)] 
Daily bump.

7 days agofinal_cleanup: Call make_forwarders_with_degenerate_phis [PR46555]
Andrew Pinski [Sat, 6 Dec 2025 09:11:29 +0000 (01:11 -0800)] 
final_cleanup: Call make_forwarders_with_degenerate_phis [PR46555]

This fixes a regression introduced with r16-5258-g1d8e2d51e5c5cb.
With GCC 12+, we would not merge forwarders (with phis, vops included),
this meant that after the last cddce, degenerate phis would stay not
merged which allowed for better expansion. Now after my patch, the forwarder
block would be removed and get worse expansion. This fixes the problem
by creating the forwarder blocks in "optimized" and no other cleanupcfg
is called afterwards.

Oh this also fixes the problem at -O1 which was missed because the agressive
version of dce was not done at -O1.

Bootstrapped and tested on x86_64-linux-gnu.

PR tree-optimization/46555
gcc/ChangeLog:

* tree-cfgcleanup.cc (execute_cleanup_cfg_post_optimizing):
Don't set todo to include cleanupcfg; do it manually.
Call make_forwarders_with_degenerate_phis if optimizing.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>