]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
14 months agoAvoid splitting store dataref groups during SLP discovery
Richard Biener [Fri, 29 Sep 2023 11:13:16 +0000 (13:13 +0200)] 
Avoid splitting store dataref groups during SLP discovery

The following avoids splitting store dataref groups during SLP
discovery but instead forces (eventually single-lane) consecutive
lane SLP discovery for all lanes of the group, creating VEC_PERM
SLP nodes merging them so the store will always cover the whole group.

With this for example

int x[1024], y[1024], z[1024], w[1024];
void foo (void)
{
  for (int i = 0; i < 256; i++)
    {
      x[4*i+0] = y[2*i+0];
      x[4*i+1] = y[2*i+1];
      x[4*i+2] = z[i];
      x[4*i+3] = w[i];
    }
}

which was previously using hybrid SLP can now be fully SLPed and
SSE code generated looks better (but of course you never know,
I didn't actually benchmark).  We of course need a VF of four here.

.L2:
        movdqa  z(%rax), %xmm0
        movdqa  w(%rax), %xmm4
        movdqa  y(%rax,%rax), %xmm2
        movdqa  y+16(%rax,%rax), %xmm1
        movdqa  %xmm0, %xmm3
        punpckhdq       %xmm4, %xmm0
        punpckldq       %xmm4, %xmm3
        movdqa  %xmm2, %xmm4
        shufps  $238, %xmm3, %xmm2
        movaps  %xmm2, x+16(,%rax,4)
        movdqa  %xmm1, %xmm2
        shufps  $68, %xmm3, %xmm4
        shufps  $68, %xmm0, %xmm2
        movaps  %xmm4, x(,%rax,4)
        shufps  $238, %xmm0, %xmm1
        movaps  %xmm2, x+32(,%rax,4)
        movaps  %xmm1, x+48(,%rax,4)
        addq    $16, %rax
        cmpq    $1024, %rax
        jne     .L2

The extra permute nodes merging distinct branches of the SLP
tree might be unexpected for some code, esp. since
SLP_TREE_REPRESENTATIVE cannot be meaningfully set and we
cannot populate SLP_TREE_SCALAR_STMTS or SLP_TREE_SCALAR_OPS
consistently as we can have a mix of both.

The patch keeps the sub-trees form consecutive lanes but that's
in principle not necessary if we for example have an even/odd
split which now would result in N single-lane sub-trees.  That's
left for future improvements.

The interesting part is how VLA vector ISAs handle merging of
two vectors that's not trivial even/odd merging.  The strathegy
of how to build the permute tree might need adjustments for that
(in the end splitting each branch to single lanes and then doing
even/odd merging would be the brute-force fallback).  Not sure
how much we can or should rely on the SLP optimize pass to handle
this.

The gcc.dg/vect/slp-12a.c case is interesting as we currently split
the 8 store group into lanes 0-5 which we SLP with an unroll factor
of two (on x86-64 with SSE) and the remaining two lanes are using
interleaving vectorization with a final unroll factor of four.  Thus
we're using hybrid SLP within a single store group.  After the change
we discover the same 0-5 lane SLP part as well as two single-lane
parts feeding the full store group.  But that results in a load
permutation that isn't supported (I have WIP patchs to rectify that).
So we end up cancelling SLP and vectorizing the whole loop with
interleaving which is IMO good and results in better code.

This is similar for gcc.target/i386/pr52252-atom.c where interleaving
generates much better code than hybrid SLP.  I'm unsure how to update
the testcase though.

gcc.dg/vect/slp-21.c runs into similar situations.  Note that when
when analyzing SLP operations we discard an instance we currently
force the full loop to have no SLP because hybrid detection is
broken.  It's probably not worth fixing this at this moment.

For gcc.dg/vect/pr97428.c we are not splitting the 16 store group
into two but merge the two 8 lane loads into one before doing the
store and thus have only a single SLP instance.  A similar situation
happens in gcc.dg/vect/slp-11c.c but the branches feeding the
single SLP store only have a single lane.  Likewise for
gcc.dg/vect/vect-complex-5.c and gcc.dg/vect/vect-gather-2.c.

gcc.dg/vect/slp-cond-1.c has an additional SLP vectorization
with a SLP store group of size two but two single-lane branches.

* tree-vect-slp.cc (vect_build_slp_instance): Do not split
store dataref groups on loop SLP discovery failure but create
a single SLP instance for the stores but branch to SLP sub-trees
and merge with a series of VEC_PERM nodes.

* gcc.dg/vect/pr97428.c: Expect a single store SLP group.
* gcc.dg/vect/slp-11c.c: Likewise, if !vect_load_lanes.
* gcc.dg/vect/vect-complex-5.c: Likewise.
* gcc.dg/vect/slp-12a.c: Do not expect SLP.
* gcc.dg/vect/slp-21.c: Remove not important scanning for SLP.
* gcc.dg/vect/slp-cond-1.c: Expect one more SLP if !vect_load_lanes.
* gcc.dg/vect/vect-gather-2.c: Expect SLP to be used.
* gcc.target/i386/pr52252-atom.c: XFAIL test for palignr.

14 months agoDaily bump.
GCC Administrator [Fri, 24 May 2024 00:17:25 +0000 (00:17 +0000)] 
Daily bump.

14 months agoc++/modules: Ensure all partial specialisations are tracked [PR114947]
Nathaniel Shead [Sun, 12 May 2024 12:31:01 +0000 (22:31 +1000)] 
c++/modules: Ensure all partial specialisations are tracked [PR114947]

Constrained partial specialisations aren't all necessarily tracked on
the instantiation table.  The modules code uses a separate
'partial_specializations' table to track them instead to ensure that
they get walked and emitted when emitting a module, but currently this
does not always happen.

The attached testcase fails in two ways.  First, because the partial
specialisation is just a declaration (and not a definition),
'set_defining_module' never ends up getting called on it and so it never
gets added to the partial specialisation table.  We fix this by ensuring
that when partial specializations are created they always get added, and
so we never miss one. To prevent adding partial specialisations multiple
times we split this out as a new function.

The second way it fails is that when exporting the primary interface for
a module with partitions, we also re-walk the specializations of all
imported partitions to merge them into a single BMI.  So this patch
ensures that after calling 'match_mergeable_specialization' we also
ensure that if the name came from a partition it gets added to the
specialization table so that a dependency is correctly created for it.

PR c++/114947

gcc/cp/ChangeLog:

* cp-tree.h (set_defining_module_for_partial_spec): Declare.
* module.cc (trees_in::decl_value): Track partial specs coming
from partitions.
(set_defining_module): Don't track partial specialisations here
anymore.
(set_defining_module_for_partial_spec): New function.
* pt.cc (process_partial_specialization): Call it.

gcc/testsuite/ChangeLog:

* g++.dg/modules/partial-4_a.C: New test.
* g++.dg/modules/partial-4_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
14 months agolibstdc++: Implement ranges::concat_view from P2542R7
Patrick Palka [Thu, 23 May 2024 22:03:56 +0000 (18:03 -0400)] 
libstdc++: Implement ranges::concat_view from P2542R7

libstdc++-v3/ChangeLog:

* include/bits/version.def (ranges_concat): Define.
* include/bits/version.h: Regenerate.
* include/std/ranges (__detail::__concat_reference_t): Define
for C++26.
(__detail::__concat_value_t): Likewise.
(__detail::__concat_rvalue_reference_t): Likewise.
(__detail::__concat_indirectly_readable_impl): Likewise.
(__detail::__concat_indirectly_readable): Likewise.
(__detail::__concatable): Likewise.
(__detail::__all_but_last_common): Likewise.
(__detail::__concat_is_random_access): Likewise.
(__detail::__concat_is_bidirectional): Likewise.
(__detail::__last_is_common): Likewise.
(concat_view): Likewise.
(__detail::__concat_view_iter_cat): Likewise.
(concat_view::iterator): Likewise.
(views::__detail::__can_concat_view): Likewise.
(views::_Concat, views::concat): Likewise.
* testsuite/std/ranges/concat/1.cc: New test.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
14 months agoMove condexpr_adjust into gimple-range-fold
Andrew MacLeod [Tue, 21 May 2024 16:41:49 +0000 (12:41 -0400)] 
Move condexpr_adjust into gimple-range-fold

Certain components of GORI were needed in order to process a COND_EXPR
expression and calculate the 2 operands as if they were true and false edges
based on the condition.   With GORI available from the range_query
objcet now, this can be moved into the fold_using_range code where it
really belongs.

* gimple-range-edge.h (range_query::condexpr_adjust): Delete.
* gimple-range-fold.cc (fold_using_range::range_of_range_op): Use
gori_ssa routine.
(fold_using_range::range_of_address): Likewise.
(fold_using_range::range_of_phi): Likewise.
(fold_using_range::condexpr_adjust): Relocated from gori_compute.
(fold_using_range::range_of_cond_expr): Use local condexpr_adjust.
(fur_source::register_outgoing_edges): Use gori_ssa routine.
* gimple-range-fold.h (gori_ssa): Rename from gori_bb.
(fold_using_range::condexpr_adjust): Add prototype.
* gimple-range-gori.cc (gori_compute::condexpr_adjust): Relocate.
* gimple-range-gori.h (gori_compute::condexpr_adjust): Delete.

14 months agoMake gori_map a shared component.
Andrew MacLeod [Tue, 21 May 2024 18:20:52 +0000 (14:20 -0400)] 
Make gori_map a shared component.

Move gori_map dependency and import/export object into a range query and
construct it simultaneously with a gori object.

* gimple-range-cache.cc (ranger_cache::ranger_cache): Use gori_ssa.
(ranger_cache::dump): Likewise.
(ranger_cache::get_global_range): Likewise.
(ranger_cache::set_global_range): Likewise.
(ranger_cache::register_inferred_value): Likewise.
* gimple-range-edge.h (gimple_outgoing_range::map): Remove.
* gimple-range-fold.cc (fold_using_range::range_of_range_op): Use
gori_ssa.
(fold_using_range::range_of_address): Likewise.
(fold_using_range::range_of_phi): Likewise.
(fur_source::register_outgoing_edges): Likewise.
* gimple-range-fold.h (fur_source::query): Make const.
(gori_ssa): New.
* gimple-range-gori.cc (gori_map::dump): Use 'this' pointer.
(gori_compute::gori_compute): Construct with a gori_map.
* gimple-range-gori.h (gori_compute:gori_compute): Change
prototype.
(gori_compute::map): Delete.
(gori_compute::m_map): Change to a reference.
(FOR_EACH_GORI_IMPORT_NAME): Change parameter gori to gorimap.
(FOR_EACH_GORI_EXPORT_NAME): Likewise.
* gimple-range-path.cc (path_range_query::compute_ranges_in_block):
Use gori_ssa method.
(path_range_query::compute_exit_dependencies): Likewise.
* gimple-range.cc (gimple_ranger::range_of_stmt): Likewise.
(gimple_ranger::register_transitive_inferred_ranges): Likewise.
* tree-ssa-dom.cc (set_global_ranges_from_unreachable_edges):
Likewise.
* tree-ssa-threadedge.cc (compute_exit_dependencies): Likewise.
* tree-vrp.cc (remove_unreachable::handle_early): Likewise.
(remove_unreachable::remove_and_update_globals): Likewise.
* value-query.cc (range_query::create_gori): Create gori map.
(range_query::share_query): Copy gori map member.
(range_query::range_query): Initiialize gori_map member.
* value-query.h (range_query::gori_ssa): New.
(range_query::m_map): New.

14 months agoMake GORI a range_query component.
Andrew MacLeod [Fri, 17 May 2024 18:27:12 +0000 (14:27 -0400)] 
Make GORI a range_query component.

This patch moves the GORI component into the range_query object, and
makes it generally available.  This makes it much easier to share
between ranger and the passes.

* gimple-range-cache.cc (ranger_cache::ranger_cache): Create
GORi via the range_query instead of a local member.
(ranger_cache::dump_bb): Use gori via from the range_query parent.
(ranger_cache::get_global_range): Likewise.
(ranger_cache::set_global_range): Likewise.
(ranger_cache::edge_range): Likewise.
(anger_cache::block_range): Likewise.
(ranger_cache::fill_block_cache): Likewise.
(ranger_cache::range_from_dom): Likewise.
(ranger_cache::register_inferred_value): Likewise.
* gimple-range-cache.h (ranger_cache::m_gori): Delete.
* gimple-range-fold.cc (fur_source::fur_source): Set m_depend_p.
(fur_depend::fur_depend): Remove gori parameter.
* gimple-range-fold.h (fur_source::gori): Adjust.
(fur_source::m_gori): Delete.
(fur_source::m_depend): New.
(fur_depend::fur_depend): Adjust prototype.
* gimple-range-path.cc (path_range_query::path_range_query): Share
ranger oracles.
(path_range_query::range_defined_in_block): Use oracle directly.
(path_range_query::compute_ranges_in_block): Use new gori() method.
(path_range_query::adjust_for_non_null_uses): Use oracle directly.
(path_range_query::compute_exit_dependencies): Likewise.
(jt_fur_source::jt_fur_source): No gori in the parameters.
(path_range_query::range_of_stmt): Likewise.
(path_range_query::compute_outgoing_relations): Likewise.
* gimple-range.cc (gimple_ranger::fold_range_internal): Likewise.
(gimple_ranger::range_of_stmt): Access gori via gori () method.
(assume_query::range_of_expr): Create a gori object.
(assume_query::~assume_query): Destroy a gori object.
(assume_query::calculate_op): Remove old gori() accessor.
* gimple-range.h (gimple_ranger::gori): Delete.
(assume_query::~assume_query): New.
(assume_query::m_gori): Delete.
* tree-ssa-dom.cc (set_global_ranges_from_unreachable_edges): use
gori () method.
* tree-ssa-threadedge.cc (compute_exit_dependencies): Likewise.
* value-query.cc (default_gori): New.
(range_query::create_gori): New.
(range_query::destroy_gori): New.
(range_query::share_oracles): Set m_gori.
(range_query::range_query): Set m_gori to default.
(range_query::~range_query): call destroy gori.
* value-query.h (range_query): Adjust prototypes
(range_query::m_gori): New.

14 months agoGori_compute inherits from gimple_outgoing_range.
Andrew MacLeod [Thu, 9 May 2024 20:34:12 +0000 (16:34 -0400)] 
Gori_compute inherits from gimple_outgoing_range.

Make gimple_outgoing_range a base class for the GORI API, and provide
base routines returning false.   gori_compute inherits from
gimple_outgoing_range and no longer needs it as a private member.
Rename outgoing_edge_range_p to edge_range_p.

* gimple-range-cache.cc (ranger_cache::ranger_cache): Adjust
m_gori constructor.
(ranger_cache::edge_range): Use renamed edge_range_p name.
(ranger_cache::range_from_dom): Likewise.
* gimple-range-edge.h (gimple_outgoing_range::condexpr_adjust): New.
(gimple_outgoing_range::has_edge_range_p): New.
(gimple_outgoing_range::dump): New.
(gimple_outgoing_range::compute_operand_range): New.
(gimple_outgoing_range::map): New.
* gimple-range-fold.cc (fur_source::register_outgoing_edges ): Use
renamed edge_range_p routine
* gimple-range-gori.cc (gori_compute::gori_compute): Adjust
constructor.
(gori_compute::~gori_compute): New.
(gori_compute::edge_range_p): Rename from outgoing_edge_range_p
and use inherited routine instead of member method.
* gimple-range-gori.h (class gori_compute): Inherit from
gimple_outgoing_range, adjust protoypes.
(gori_compute::outgpoing): Delete.
* gimple-range-path.cc (path_range_query::compute_ranges_in_block): Use
renamed edge_range_p routine.
* tree-ssa-loop-unswitch.cc (evaluate_control_stmt_using_entry_checks):
Likewise.

14 months agoGori_compute no longer inherits from gori_map.
Andrew MacLeod [Thu, 9 May 2024 18:14:31 +0000 (14:14 -0400)] 
Gori_compute no longer inherits from gori_map.

This patch moves the gori_compute object away from inheriting a
gori_map object and instead it as a local member.  Export it via map ().

* gimple-range-cache.cc (ranger_cache::ranger_cache): Access
gori_map via member call.
(ranger_cache::dump_bb): Likewise.
(ranger_cache::get_global_range): Likewise.
(ranger_cache::set_global_range): Likewise.
(ranger_cache::register_inferred_value): Likewise.
* gimple-range-fold.cc (fold_using_range::range_of_range_op): Likewise.
(fold_using_range::range_of_address): Likewise.
(fold_using_range::range_of_phi): Likewise.
* gimple-range-gori.cc (gori_compute::compute_operand_range_switch):
likewise.
(gori_compute::compute_operand_range): Likewise.
(gori_compute::compute_logical_operands): Likewise.
(gori_compute::refine_using_relation): Likewise.
(gori_compute::compute_operand1_and_operand2_range): Likewise.
(gori_compute::may_recompute_p): Likewise.
(gori_compute::has_edge_range_p): Likewise.
(gori_compute::outgoing_edge_range_p): Likewise.
(gori_compute::condexpr_adjust): Likewise.
* gimple-range-gori.h (class gori_compute): Do not inherit from
gori_map.
(gori_compute::m_map): New.
* gimple-range-path.cc (gimple-range-path.cc): Use gori_map member.
(path_range_query::compute_exit_dependencies): Likewise.
* gimple-range.cc (gimple_ranger::range_of_stmt): Likewise.
(gimple_ranger::register_transitive_inferred_ranges): Likewise.
* tree-ssa-dom.cc (set_global_ranges_from_unreachable_edges): Likewise.
* tree-ssa-threadedge.cc (compute_exit_dependencies): Likewise.
* tree-vrp.cc (remove_unreachable::handle_early): Likewise.
(remove_unreachable::remove_and_update_globals): Likewise.

14 months agoDefault gimple_outgoing_range to not process switches.
Andrew MacLeod [Mon, 6 May 2024 16:04:24 +0000 (12:04 -0400)] 
Default gimple_outgoing_range to not process switches.

Change the default constructor to not process switches, add method to
enable/disable switch processing.

* gimple-range-edge.cc (gimple_outgoing_range::gimple_outgoing_range):
Do not allocate a range allocator at construction time.
(gimple_outgoing_range::~gimple_outgoing_range): Delete allocator
if one was allocated.
(gimple_outgoing_range::set_switch_limit): New.
(gimple_outgoing_range::switch_edge_range): Create an allocator if one
does not exist.
(gimple_outgoing_range::edge_range_p): Check for zero edges.
* gimple-range-edge.h (class gimple_outgoing_range): Adjust prototypes.

14 months agoAdd inferred ranges for range-ops based statements.
Andrew MacLeod [Thu, 2 May 2024 16:23:18 +0000 (12:23 -0400)] 
Add inferred ranges for range-ops based statements.

Gimple_range_fold contains some shorthand fold_range routines for
easy user consumption of that range-ops interface, but there is no equivalent
routines for op1_range and op2_range.  This patch provides basic versions.

Any range-op entry which has an op1_range or op2_range implemented can
potentially also provide inferred ranges.  This is a step towards
PR 113879.  Default is currently OFF for performance reasons as it
dramtically increases the number of inferred ranges.

PR tree-optimization/113879
* gimple-range-fold.cc (op1_range): New.
(op2_range): New.
* gimple-range-fold.h (op1_range): New prototypes.
(op2_range): New prototypes.
* gimple-range-infer.cc (gimple_infer_range::add_range): Do not
add an inferred range if it is VARYING.
(gimple_infer_range::gimple_infer_range): Add inferred ranges
for any range-op statements if requested.
* gimple-range-infer.h (gimple_infer_range): Add parameter.

14 months agoMove infer_manager to a range_query oracle.
Andrew MacLeod [Fri, 17 May 2024 14:50:24 +0000 (10:50 -0400)] 
Move infer_manager to a range_query oracle.

Turn the infer_manager class into an always available oracle accessible via a
range_query object.  Also assocaite each inferrred range with it's
originating stmt.

* gimple-range-cache.cc (ranger_cache::ranger_cache): Create an infer
oracle instead of a local member.
(ranger_cache::~ranger_cache): Destroy the oracle.
(ranger_cache::edge_range): Use oracle.
(ranger_cache::fill_block_cache): Likewise.
(ranger_cache::range_from_dom): Likewise.
(ranger_cache::apply_inferred_ranges): Likewise.
* gimple-range-cache.h (ranger_cache::m_exit): Delete.
* gimple-range-infer.cc (infer_oracle): New static object;
(class infer_oracle): New.
(non_null_wrapper::non_null_wrapper): New.
(non_null_wrapper::add_nonzero): New.
(non_null_wrapper::add_range): New.
(non_null_loadstore): Use nonnull_wrapper.
(gimple_infer_range::gimple_infer_range): New alternate constructor.
(exit_range::stmt): New.
(infer_range_manager::has_range_p): Combine seperate methods.
(infer_range_manager::maybe_adjust_range): Adjust has_range_p call.
(infer_range_manager::add_ranges): New.
(infer_range_manager::add_range): Take stmt rather than BB.
(infer_range_manager::add_nonzero): Adjust from BB to stmt.
* gimple-range-infer.h (class gimple_infer_range): Adjust methods.
(infer_range_oracle): New.
(class infer_range_manager): Inherit from infer_range_oracle.
Adjust methods.
* gimple-range-path.cc (path_range_query::range_defined_in_block): Use
oracle.
(path_range_query::adjust_for_non_null_uses): Likewise.
* gimple-range.cc (gimple_ranger::range_on_edge): Likewise
(gimple_ranger::register_transitive_inferred_ranges): Likewise.
* value-query.cc (default_infer_oracle): New.
(range_query::create_infer_oracle): New.
(range_query::destroy_infer_oracle): New.
(range_query::share_query): Copy infer pointer.
(range_query::range_query): Initialize infer pointer.
(range_query::~range_query): destroy infer object.
* value-query.h (range_query::infer_oracle): New.
(range_query::create_infer_oracle): New prototype.
(range_query::destroy_infer_oracle): New prototype.
(range_query::m_infer): New.

14 months agoAllow components to be shared among range-queries.
Andrew MacLeod [Fri, 17 May 2024 14:44:27 +0000 (10:44 -0400)] 
Allow components to be shared among range-queries.

Ranger and the ranger cache need to share components, this provides a
blessed way to do so.

* gimple-range.cc (gimple_ranger::gimple_ranger): Share the
components from ranger_cache.
(gimple_ranger::~gimple_ranger): Don't clear pointer.
* value-query.cc (range_query::share_query): New.
(range_query::range_query): Clear shared component flag.
(range_query::~range_query): Don't free shared component copies.
* value-query.h (share_query): New prototype.
(m_shared_copy_p): New member.

14 months agoRename relation oracle and API.
Andrew MacLeod [Fri, 17 May 2024 14:18:39 +0000 (10:18 -0400)] 
Rename relation oracle and API.

With more oracles incoming, rename the range_query oracle () method to
relation (), and remove the redundant 'relation' text from register and query
methods, resulting in calls that look like:
  relation ()->record (...)   and
  relation ()->query (...)

* gimple-range-cache.cc (ranger_cache::dump_bb): Use m_relation.
(ranger_cache::fill_block_cache): Likewise
* gimple-range-fold.cc (fur_stmt::get_phi_operand): Use new names.
(fur_depend::register_relation): Likewise.
(fold_using_range::range_of_phi): Likewise.
* gimple-range-path.cc (path_range_query::path_range_query): Likewise.
(path_range_query::~path_range_query): Likewise.
(ath_range_query::compute_ranges): Likewise.
(jt_fur_source::register_relation): Likewise.
(jt_fur_source::query_relation): Likewise.
(path_range_query::maybe_register_phi_relation): Likewise.
* gimple-range-path.h (get_path_oracle): Likewise.
* gimple-range.cc (gimple_ranger::gimple_ranger): Likewise.
(gimple_ranger::~gimple_ranger): Likewise.
* value-query.cc (range_query::create_relation_oracle): Likewise.
(range_query::destroy_relation_oracle): Likewise.
(range_query::share_oracles): Likewise.
(range_query::range_query): Likewise.
* value-query.h (value_query::relation): Rename from oracle.
(m_relation): Rename from m_oracle.
* value-relation.cc (relation_oracle::query): Rename from
query_relation.
(equiv_oracle::query): Likewise.
(equiv_oracle::record): Rename from register_relation.
(relation_oracle::record): Likewise.
(dom_oracle::record): Likewise.
(dom_oracle::query): Rename from query_relation.
(path_oracle::record): Rename from register_relation.
(path_oracle::query): Rename from query_relation.
* value-relation.h (*::record): Rename from register_relation.
(*::query): Rename from query_relation.

14 months agoMove to an always available relation oracle.
Andrew MacLeod [Tue, 30 Apr 2024 13:35:23 +0000 (09:35 -0400)] 
Move to an always available relation oracle.

This eliminates the need to check if the relation oracle pointer is NULL
before every call by providing a default oracle which does nothing.
REmove unused routines, and Unify register_relation method names.

* gimple-range-cache.cc (ranger_cache::dump_bb): Remove check for
NULL oracle pointer.
(ranger_cache::fill_block_cache): Likewise.
* gimple-range-fold.cc (fur_stmt::get_phi_operand): Likewise.
(fur_depend::fur_depend): Likewise.
(fur_depend::register_relation): Likewise, use qury_relation.
(fold_using_range::range_of_phi): Likewise.
(fold_using_range::relation_fold_and_or): Likewise.
* gimple-range-fold.h (fur_source::m_oracle): Delete.  Oracle
can be accessed dirctly via m_query now.
* gimple-range-path.cc (path_range_query::path_range_query):
Adjust for oracle reference pointer.
(path_range_query::compute_ranges): Likewise.
(jt_fur_source::jt_fur_source): Adjust for no m_oracle member.
(jt_fur_source::register_relation): Do not check for NULL
pointer.
(jt_fur_source::query_relation): Likewise.
* gimple-range.cc (gimple_ranger::gimple_ranger):  Adjust for
reference pointer.
* value-query.cc (default_relation_oracle): New.
(range_query::create_relation_oracle): Relocate from header.
Ensure not being added to global query.
(range_query::destroy_relation_oracle): Relocate from header.
(range_query::range_query): Initailize to default oracle.
(ange_query::~range_query): Call destroy_relation_oracle.
* value-query.h (class range_query): Adjust prototypes.
(range_query::create_relation_oracle): Move to source file.
(range_query::destroy_relation_oracle): Move to source file.
* value-relation.cc (relation_oracle::validate_relation): Delete.
(relation_oracle::register_stmt): Rename to register_relation.
(relation_oracle::register_edge): Likewise.
* value-relation.h (register_stmt): Rename to register_relation and
provide default function in base class.
(register_edge): Likewise.
(relation_oracle::validate_relation): Delete.
(relation_oracle::query_relation): Provide default in base class.
(relation_oracle::dump): Likewise.
(relation_oracle::equiv_set): Likewise.
(default_relation_oracle): New extenal reference.
(partial_equiv_set, add_partial_equiv): Move to protected.

14 months agoMove all relation queries into relation_oracle.
Andrew MacLeod [Mon, 29 Apr 2024 17:32:00 +0000 (13:32 -0400)] 
Move all relation queries into relation_oracle.

Move relation queries from range_query object into the relation oracle.

* gimple-range-cache.cc (ranger_cache::ranger_cache): Call
create_relation_oracle.
(ranger_cache::~ranger_cache): Call destroy_relation_oracle.
* gimple-range-fold.cc (fur_stmt::get_phi_operand): Check for
relation oracle bnefore calling query_relation.
(fold_using_range::range_of_phi): Likewise.
* gimple-range-path.cc (path_range_query::~path_range_query): Set
relation oracle pointer to NULL when done.
* gimple-range.cc (gimple_ranger::~gimple_ranger): Likewise.
* value-query.cc (range_query::~range_query): Ensure any
relation oracle is destroyed.
(range_query::query_relation): relocate to relation_oracle object.
* value-query.h (class range_query): Adjust method proototypes.
(range_query::create_relation_oracle): New.
(range_query::destroy_relation_oracle): New.
* value-relation.cc (relation_oracle::query_relation): Relocate
from range query class.
* value-relation.h (Call relation_oracle): New prototypes.

14 months agoc++: deleting array temporary [PR115187]
Jason Merrill [Wed, 22 May 2024 22:41:27 +0000 (18:41 -0400)] 
c++: deleting array temporary [PR115187]

Decaying the array temporary to a pointer and then deleting that crashes in
verify_gimple_stmt, because the TARGET_EXPR is first evaluated inside the
TRY_FINALLY_EXPR, but the cleanup point is outside.  Fixed by using
get_target_expr instead of save_expr.

I also adjust the stabilize_expr comment to prevent me from again thinking
it's a suitable replacement.

PR c++/115187

gcc/cp/ChangeLog:

* init.cc (build_delete): Use get_target_expr instead of save_expr.
* tree.cc (stabilize_expr): Update comment.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/array-prvalue3.C: New test.

14 months agoAnother small fix to implementation of -fdump-ada-spec
Eric Botcazou [Thu, 23 May 2024 16:26:12 +0000 (18:26 +0200)] 
Another small fix to implementation of -fdump-ada-spec

This avoids generating invalid Ada code for function with a multidimensional
array parameter and also cleans things up left and right.

gcc/c-family/
* c-ada-spec.cc (check_type_name_conflict): Add guard.
(is_char_array): Simplify.
(dump_ada_array_type): Use strip_array_types.
(dump_ada_node) <POINTER_TYPE>: Deal with anonymous array types.
(dump_nested_type): Use strip_array_types.

14 months agoMatch: Add overloaded types_match to avoid code dup [NFC]
Pan Li [Thu, 23 May 2024 00:09:40 +0000 (08:09 +0800)] 
Match: Add overloaded types_match to avoid code dup [NFC]

There are sorts of match pattern for SAT related cases,  there will be
some duplicated code to check the dest, op_0, op_1 are same tree types.
Aka ternary tree type matches.  Thus,  add overloaded types_match func
do this and avoid match code duplication.

The below test suites are passed for this patch:
* The rv64gcv fully regression test.
* The x86 bootstrap test.
* The x86 regression test.

gcc/ChangeLog:

* generic-match-head.cc (types_match): Add overloaded types_match
for 3 types.
* gimple-match-head.cc (types_match): Ditto.
* match.pd: Leverage overloaded types_match.

Signed-off-by: Pan Li <pan2.li@intel.com>
14 months agotree-optimization/115197 - fix ICE w/ constant in LC PHI and loop distribution
Richard Biener [Thu, 23 May 2024 12:36:39 +0000 (14:36 +0200)] 
tree-optimization/115197 - fix ICE w/ constant in LC PHI and loop distribution

Forgot a check for an SSA name before trying to replace a PHI arg with
its current definition.

PR tree-optimization/115197
* tree-loop-distribution.cc (copy_loop_before): Constant PHI
args remain the same.

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

14 months agotree-optimization/115199 - fix PTA constraint processing for &ANYTHING LHS
Richard Biener [Thu, 23 May 2024 11:33:15 +0000 (13:33 +0200)] 
tree-optimization/115199 - fix PTA constraint processing for &ANYTHING LHS

When processing a &ANYTHING = X constraint we treat it as *ANYTHING = X
during constraint processing but then end up recording it as
&ANYTHING = X anyway, breaking constraint graph building.  This is
because we only update the local copy of the LHS and not the constraint
itself.

PR tree-optimization/115199
* tree-ssa-structalias.cc (process_constraint): Also
record &ANYTHING = X as *ANYTING = X in the end.

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

14 months agotree-optimization/115138 - ptr-vs-ptr and FUNCTION_DECLs
Richard Biener [Thu, 23 May 2024 09:26:14 +0000 (11:26 +0200)] 
tree-optimization/115138 - ptr-vs-ptr and FUNCTION_DECLs

I failed to realize we do not represent FUNCTION_DECLs or LABEL_DECLs
in vars explicitly and thus have to compare pt.vars_contains_nonlocal.

PR tree-optimization/115138
* tree-ssa-alias.cc (ptrs_compare_unequal): Make sure
pt.vars_contains_nonlocal differs since we do not represent
FUNCTION_DECLs or LABEL_DECLs in vars explicitly.

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

14 months agomissing require target has_arch_ppc64 for pr106550.c
Jiufu Guo [Wed, 22 May 2024 02:33:11 +0000 (10:33 +0800)] 
missing require target has_arch_ppc64 for pr106550.c

Hi,

Case pr106550.c is testing constant building for 64bit
register. It fails with -m32 without having the expected rldimi.
So, this case requires target of has_arch_ppc64.

Bootstrap and regtest pass on ppc64{,le}.
Is this ok for trunk?

BR,
Jeff(Jiufu) Guo

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/pr106550.c: Adjust by requiring has_arch_ppc64
effective target. And remove power10_ok.

14 months agotestsuite: vect: Fix gcc.dg/vect/vect-pr111779.c on SPARC [PR114072]
Rainer Orth [Thu, 23 May 2024 07:53:45 +0000 (09:53 +0200)] 
testsuite: vect: Fix gcc.dg/vect/vect-pr111779.c on SPARC [PR114072]

gcc.dg/vect/vect-pr111779.c FAILs on 32 and 64-bit Solaris/SPARC:

FAIL: gcc.dg/vect/vect-pr111779.c -flto -ffat-lto-objects  scan-tree-dump vect "LOOP VECTORIZED"
FAIL: gcc.dg/vect/vect-pr111779.c scan-tree-dump vect "LOOP VECTORIZED"

This patch implements Richard's analysis from the PR, skipping the
scan-tree-dump part for big-endian targets without vect_shift_char
support.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11 (32 and 64-bit each).

2024-05-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

gcc/testsuite:
PR tree-optimization/114072
* gcc.dg/vect/vect-pr111779.c (scan-tree-dump): Require
vect_shift_char on big-endian targets.

14 months agoFortran: Fix ICEs due to comp calls in initialization exprs [PR103312]
Paul Thomas [Thu, 23 May 2024 06:59:46 +0000 (07:59 +0100)] 
Fortran: Fix ICEs due to comp calls in initialization exprs [PR103312]

2024-05-23  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran
PR fortran/103312
* dependency.cc (gfc_dep_compare_expr): Handle component call
expressions. Return -2 as default and return 0 if compared with
a function expression that is from an interface body and has
the same name.
* expr.cc (gfc_reduce_init_expr): If the expression is a comp
call do not attempt to reduce, defer to resolution and return
false.
* trans-types.cc (gfc_get_dtype_rank_type,
gfc_get_nodesc_array_type): Fix whitespace.

gcc/testsuite/
PR fortran/103312
* gfortran.dg/pr103312.f90: New test.

14 months agos390: Implement TARGET_NOCE_CONVERSION_PROFITABLE_P [PR109549]
Stefan Schulze Frielinghaus [Thu, 23 May 2024 06:43:35 +0000 (08:43 +0200)] 
s390: Implement TARGET_NOCE_CONVERSION_PROFITABLE_P [PR109549]

Consider a NOCE conversion as profitable if there is at least one
conditional move.

gcc/ChangeLog:

PR target/109549
* config/s390/s390.cc (TARGET_NOCE_CONVERSION_PROFITABLE_P):
Define.
(s390_noce_conversion_profitable_p): Implement.

gcc/testsuite/ChangeLog:

* gcc.target/s390/ccor.c: Order of loads are reversed, now, as a
consequence the condition has to be reversed.

14 months ago[testsuite] xfail pr79004 on longdouble64; drop long_double_64bit
Alexandre Oliva [Thu, 23 May 2024 06:20:19 +0000 (03:20 -0300)] 
[testsuite] xfail pr79004 on longdouble64; drop long_double_64bit

Some of the asm opcodes expected by pr79004 depend on
-mlong-double-128 to be output.  E.g., without this flag, the
conditions of patterns @extenddf<mode>2 and extendsf<mode>2 do not
hold, and so GCC resorts to libcalls instead of even trying
rs6000_expand_float128_convert.

Perhaps the conditions are too strict, and they could enable the use
of conversion insns involving __ieee128/_Float128 even with 64-bit
long doubles.

For now, xfail the opcodes that are not available on longdouble64.

While at that, drop long_double_64bit, since it's broken and sort of
redundant.

for  gcc/testsuite/ChangeLog

PR target/105359
* gcc.target/powerpc/pr79004.c: Xfail opcodes not available on
longdouble64.
* lib/target-supports.exp
(check_effective_target_long_double_64bit): Drop.
(add_options_for_long_double_64bit): Likewise.

14 months ago[prange] Use type agnostic range in phiopt [PR115191]
Aldy Hernandez [Wed, 22 May 2024 20:32:57 +0000 (22:32 +0200)] 
[prange] Use type agnostic range in phiopt [PR115191]

Fix a use of int_range_max in phiopt that should be a type agnostic
range, because it could be either a pointer or an int.

PR tree-optimization/115191

gcc/ChangeLog:

* tree-ssa-phiopt.cc (value_replacement): Use Value_Range instead
of int_range_max.

gcc/testsuite/ChangeLog:

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

14 months agoAARCH64: Add Qualcomnm oryon-1 core
Andrew Pinski [Fri, 5 Apr 2024 20:40:35 +0000 (13:40 -0700)] 
AARCH64: Add Qualcomnm oryon-1 core

This patch adds Qualcomm's new oryon-1 core; this is enough
to recongize the core and later on will add the tuning structure.

gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (oryon-1): New entry.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi  (AArch64 Options): Document oryon-1.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Co-authored-by: Joel Jones <quic_joeljone@quicinc.com>
Co-authored-by: Wei Zhao <quic_wezhao@quicinc.com>
14 months agoDaily bump.
GCC Administrator [Thu, 23 May 2024 00:16:45 +0000 (00:16 +0000)] 
Daily bump.

14 months agolibstdc++: Add [[nodiscard]] to some std::locale functions
Jonathan Wakely [Wed, 22 May 2024 17:38:36 +0000 (18:38 +0100)] 
libstdc++: Add [[nodiscard]] to some std::locale functions

libstdc++-v3/ChangeLog:

* include/bits/locale_classes.h (locale::combine)
(locale::name, locale::operator==, locale::operator!=)
(locale::operator(), locale::classic): Add nodiscard
attribute.
* include/bits/locale_classes.tcc (has_facet, use_facet):
Likewise.
* testsuite/22_locale/locale/cons/12438.cc: Add dg-warning for
nodiscard diagnostic.
* testsuite/22_locale/locale/cons/2.cc: Cast use_facet
expression to void, to suppress diagnostic.
* testsuite/22_locale/locale/cons/unicode.cc: Likewise.
* testsuite/22_locale/locale/operations/2.cc: Add dg-warning.

14 months agolibstdc++: Fix effects of combining locales [PR108323]
Jonathan Wakely [Tue, 30 Jan 2024 14:48:28 +0000 (14:48 +0000)] 
libstdc++: Fix effects of combining locales [PR108323]

This fixes a bug in locale::combine where we fail to meet the standard's
requirement that the result is unnamed. It also implements two library
issues related to the names of combined locales (2295 and 3676).

libstdc++-v3/ChangeLog:

PR libstdc++/108323
* include/bits/locale_classes.tcc (locale(const locale&, Facet*)):
Return a copy of the first argument when the facet pointer is
null, as per LWG 2295.
(locale::combine): Ensure the result is unnamed.
* src/c++11/localename.cc (_M_replace_categories): Ignore
whether the second locale has a name when cat == none, as per
LWG 3676.
* src/c++98/locale.cc (_M_install_facet): Use __builtin_expect
to predict that the facet pointer is non-null.
* testsuite/22_locale/locale/cons/names.cc: New test.

14 months agolibstdc++: Guard use of sized deallocation [PR114940]
Jonathan Wakely [Wed, 22 May 2024 09:32:43 +0000 (10:32 +0100)] 
libstdc++: Guard use of sized deallocation [PR114940]

Clang does not enable -fsized-deallocation by default, which means it
can't compile our <stacktrace> and <generator> headers.

Make the __cpp_lib_generator macro depend on the compiler-defined
__cpp_sized_deallocation macro, and change <stacktrace> to use unsized
deallocation when __cpp_sized_deallocation isn't defined.

libstdc++-v3/ChangeLog:

PR libstdc++/114940
* include/bits/version.def (generator): Depend on
__cpp_sized_deallocation.
* include/bits/version.h: Regenerate.
* include/std/stacktrace (_GLIBCXX_SIZED_DELETE): New macro.
(basic_stacktrace::_Impl::_M_deallocate): Use it.

14 months agoc++: canonicity of fn types w/ complex eh specs [PR115159]
Patrick Palka [Wed, 22 May 2024 21:45:04 +0000 (17:45 -0400)] 
c++: canonicity of fn types w/ complex eh specs [PR115159]

Here the member functions QList::g and QList::h are given the same
function type by build_cp_fntype_variant since their noexcept-specs are
equivalent according to cp_tree_equal.  In doing so however this means
that the function type of QList::h refers to a function parameter from
QList::g, which ends up confusing modules streaming.

I'm not sure if modules can be fixed to handle this situation, but
regardless it seems weird in principle that a function parameter can
escape in such a way.  The analogous situation with a trailing return
type and decltype

  auto g(QList &other) -> decltype(f(other));
  auto h(QList &other) -> decltype(f(other));

behaves better because we don't canonicalize decltype, and so the
function types of g and h are non-canonical and therefore not shared.

In light of this, it seems natural to treat function types with complex
noexcept-specs as non-canonical as well so that each such function
declaration is given a unique function type node.  (The main benefit of
type canonicalization is to speed up repeated type comparisons, but it
should be rare to repeatedly compare two otherwise compatible function
types with complex noexcept-specs.)

To that end, this patch strengthens the ce_exact case of comp_except_specs
to require identity instead of equivalence of the noexcept-spec so that
build_cp_fntype_variant doesn't reuse a variant when it shouldn't.  In
turn we need to use structural equality for types with a complex eh spec.
This lets us get rid of the tricky handling of canonical types when updating
unparsed noexcept-spec variants.

PR c++/115159

gcc/cp/ChangeLog:

* tree.cc (build_cp_fntype_variant): Always use structural
equality for types with a complex exception specification.
(fixup_deferred_exception_variants): Use structural equality
for adjusted variants.
* typeck.cc (comp_except_specs): Require == instead of
cp_tree_equal for ce_exact noexcept-spec comparison.

gcc/testsuite/ChangeLog:

* g++.dg/modules/noexcept-2_a.H: New test.
* g++.dg/modules/noexcept-2_b.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
14 months agoaarch64: Fold vget_high_* intrinsics to BIT_FIELD_REF [PR102171]
Pengxuan Zheng [Tue, 21 May 2024 17:55:06 +0000 (10:55 -0700)] 
aarch64: Fold vget_high_* intrinsics to BIT_FIELD_REF [PR102171]

This patch is a follow-up of r15-697-ga2e4fe5a53cf75 to also fold vget_high_*
intrinsics to BIT_FILED_REF and remove the vget_high_* definitions from
arm_neon.h to use the new intrinsics framework.

PR target/102171

gcc/ChangeLog:

* config/aarch64/aarch64-builtins.cc (AARCH64_SIMD_VGET_HIGH_BUILTINS):
New macro to create definitions for all vget_high intrinsics.
(VGET_HIGH_BUILTIN): Likewise.
(enum aarch64_builtins): Add vget_high function codes.
(AARCH64_SIMD_VGET_LOW_BUILTINS): Delete duplicate macro.
(aarch64_general_fold_builtin): Fold vget_high calls.
* config/aarch64/aarch64-simd-builtins.def: Delete vget_high builtins.
* config/aarch64/aarch64-simd.md (aarch64_get_high<mode>): Delete.
(aarch64_vget_hi_halfv8bf): Likewise.
* config/aarch64/arm_neon.h (__attribute__): Delete.
(vget_high_f16): Likewise.
(vget_high_f32): Likewise.
(vget_high_f64): Likewise.
(vget_high_p8): Likewise.
(vget_high_p16): Likewise.
(vget_high_p64): Likewise.
(vget_high_s8): Likewise.
(vget_high_s16): Likewise.
(vget_high_s32): Likewise.
(vget_high_s64): Likewise.
(vget_high_u8): Likewise.
(vget_high_u16): Likewise.
(vget_high_u32): Likewise.
(vget_high_u64): Likewise.
(vget_high_bf16): Likewise.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/vget_high_2.c: New test.
* gcc.target/aarch64/vget_high_2_be.c: New test.

Signed-off-by: Pengxuan Zheng <quic_pzheng@quicinc.com>
14 months agotestsuite: Verify r0-r3 are extended with CMSE
Torbjörn SVENSSON [Sat, 27 Apr 2024 13:57:27 +0000 (15:57 +0200)] 
testsuite: Verify r0-r3 are extended with CMSE

Add regression test to the existing zero/sign extend tests for CMSE to
verify that r0, r1, r2 and r3 are properly extended, not just r0.

boolCharShortEnumSecureFunc test is done using -O0 to ensure the
instructions are in a predictable order.

gcc/testsuite/ChangeLog:

* gcc.target/arm/cmse/extend-param.c: Add regression test. Add
-fshort-enums.
* gcc.target/arm/cmse/extend-return.c: Add -fshort-enums option.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
14 months agoFix internal error in seh_cfa_offset with -O2 -fno-omit-frame-pointer
Eric Botcazou [Wed, 22 May 2024 16:10:39 +0000 (18:10 +0200)] 
Fix internal error in seh_cfa_offset with -O2 -fno-omit-frame-pointer

The problem directly comes from the -ffold-mem-offsets pass messing up with
the prologue and the frame-related instructions, which is a no-no with SEH,
so the fix simply disconnects the pass in these circumstances.

gcc/
PR rtl-optimization/115038
* fold-mem-offsets.cc (fold_offsets): Return 0 if the defining
instruction of the register is frame related.

gcc/testsuite/
* g++.dg/opt/fmo1.C: New test.

14 months agoi386: Correct insn_cost of movabsq.
Roger Sayle [Wed, 22 May 2024 15:45:48 +0000 (16:45 +0100)] 
i386: Correct insn_cost of movabsq.

This single line patch fixes a strange quirk/glitch in i386's rtx_costs,
which considers an instruction loading a 64-bit constant to be significantly
cheaper than loading a 32-bit (or smaller) constant.

Consider the two functions:
unsigned long long foo() { return 0x0123456789abcdefULL; }
unsigned int bar() { return 10; }

and the corresponding lines from combine's dump file:
  insn_cost 1 for #: r98:DI=0x123456789abcdef
  insn_cost 4 for #: ax:SI=0xa

The same issue can be seen in -dP assembler output.
  movabsq $81985529216486895, %rax    # 5  [c=1 l=10]  *movdi_internal/4

The problem is that pattern_costs interpretation of rtx_costs contains
"return cost > 0 ? cost : COSTS_N_INSNS (1)" where a zero value (for
example a register or small immediate constant) is considered special,
and equivalent to a single instruction, but all other values are treated
as verbatim.  Hence to x86_64's 10-byte long movabsq instruction slightly
more expensive than a simple constant, rtx_costs needs to return
COSTS_N_INSNS(1)+1 and not 1.  With this change, the insn_cost of
movabsq is the intended value 5:
  insn_cost 5 for #: r98:DI=0x123456789abcdef
and
  movabsq $81985529216486895, %rax    # 5  [c=5 l=10]  *movdi_internal/4

2024-05-22  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* config/i386/i386.cc (ix86_rtx_costs) <case CONST_INT>:
A CONST_INT that isn't x86_64_immediate_operand requires an extra
(expensive) movabsq insn to load, so return COSTS_N_INSNS (1) + 1.

14 months agoAvoid ICE in except.cc on targets that don't support exceptions.
Roger Sayle [Wed, 22 May 2024 12:48:52 +0000 (13:48 +0100)] 
Avoid ICE in except.cc on targets that don't support exceptions.

A number of testcases currently fail on nvptx with the ICE:

during RTL pass: final
openmp-simd-2.c: In function 'foo':
openmp-simd-2.c:28:1: internal compiler error: in get_personality_function, at expr.cc:14037
   28 | }
      | ^
0x98a38f get_personality_function(tree_node*)
        /home/roger/GCC/nvptx-none/gcc/gcc/expr.cc:14037
0x969d3b output_function_exception_table(int)
        /home/roger/GCC/nvptx-none/gcc/gcc/except.cc:3226
0x9b760d rest_of_handle_final
        /home/roger/GCC/nvptx-none/gcc/gcc/final.cc:4252

The simple oversight in output_function_exception_table is that it calls
get_personality_function (immediately) before checking the target's
except_unwind_info hook (which on nvptx always returns UI_NONE).
The (perhaps obvious) fix is to move the assignments of fname and
personality after the tests that they are needed, and before their
first use.

2024-05-22  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
* except.cc (output_function_exception_table): Move call to
get_personality_function after targetm_common.except_unwind_info
check, to avoid ICE on targets that don't support exceptions.

14 months agoFix mixed input kind permute optimization
Richard Biener [Tue, 21 May 2024 17:15:33 +0000 (19:15 +0200)] 
Fix mixed input kind permute optimization

When change_vec_perm_layout runs into a permute combining two
nodes where one is invariant and one internal the partition of
one input can be -1 but the other might not be.  The following
supports this case by simply ignoring inputs with input partiton -1.

I'm not sure this is correct but it avoids ICEing when accessing
that partitions layout for gcc.target/i386/pr98928.c with the
change to avoid splitting store dataref groups during SLP discovery.

* tree-vect-slp.cc (change_vec_perm_layout): Ignore an
input partition of -1.

14 months agoAvoid SLP_REPRESENTATIVE access for VEC_PERM in SLP scheduling
Richard Biener [Fri, 17 May 2024 13:23:38 +0000 (15:23 +0200)] 
Avoid SLP_REPRESENTATIVE access for VEC_PERM in SLP scheduling

SLP permute nodes can end up without a SLP_REPRESENTATIVE now,
the following avoids touching it in this case in vect_schedule_slp_node.

* tree-vect-slp.cc (vect_schedule_slp_node): Avoid looking
at SLP_REPRESENTATIVE for VEC_PERM nodes.

14 months agoAvoid requiring VEC_PERM represenatives
Richard Biener [Fri, 17 May 2024 12:26:38 +0000 (14:26 +0200)] 
Avoid requiring VEC_PERM represenatives

The following plugs one hole where we require a VEC_PERM node
representative unnecessarily.  This is for vect_check_store_rhs
which looks at the RHS and checks whether a constant can be
native encoded.  The fix is to guard that with vect_constant_def
additionally and making vect_is_simple_use forgiving for a missing
SLP_TREE_REPRESENTATIVE when the child is a VEC_PERM node,
initializing the scalar def to error_mark_node.

* tree-vect-stmts.cc (vect_check_store_rhs): Look at *rhs
only when it's a vec_constant_def.
(vect_is_simple_use): When we have no representative for
an internal node, fill in *op with error_mark_node.

14 months agolibstdc++: Implement std::formatter<std::thread::id> without <sstream> [PR115099]
Jonathan Wakely [Fri, 17 May 2024 09:55:32 +0000 (10:55 +0100)] 
libstdc++: Implement std::formatter<std::thread::id> without <sstream> [PR115099]

The std::thread::id formatter uses std::basic_ostringstream without
including <sstream>, which went unnoticed because the test for it uses
a stringstream to check the output is correct.

The fix implemented here is to stop using basic_ostringstream for
formatting thread::id and just use std::format instead.

As a drive-by fix, the formatter specialization is constrained to
require that the thread::id::native_handle_type can be formatted, to
avoid making the formatter ill-formed if the pthread_t type is not a
pointer or integer. Since non-void pointers can't be formatted, ensure
that we convert pointers to const void* for formatting. Make a similar
change to the existing operator<< overload so that in the unlikely case
that pthread_t is a typedef for char* we don't treat it as a
null-terminated string when inserting into a stream.

libstdc++-v3/ChangeLog:

PR libstdc++/115099
* include/bits/std_thread.h: Declare formatter as friend of
thread::id.
* include/std/thread (operator<<): Convert non-void pointers to
void pointers for output.
(formatter): Add constraint that thread::native_handle_type is a
pointer or integer.
(formatter::format): Reimplement without basic_ostringstream.
* testsuite/30_threads/thread/id/output.cc: Check output
compiles before <sstream> has been included.

14 months agolibstdc++: Ensure std::variant relops convert to bool [PR115145]
Jonathan Wakely [Tue, 21 May 2024 14:13:01 +0000 (15:13 +0100)] 
libstdc++: Ensure std::variant relops convert to bool [PR115145]

Ensure that the result of comparing the variant alternatives is
converted to bool immediately rather than copied.

libstdc++-v3/ChangeLog:

PR libstdc++/115145
* include/std/variant (operator==, operator!=, operator<)
(operator<=, operator>, operator>=): Add trailing-return-type to
lambda expressions to trigger conversion to bool.
* testsuite/20_util/variant/relops/115145.cc: New test.

14 months agoweb/115183 - fix typo in C++ docs
Richard Biener [Wed, 22 May 2024 08:19:08 +0000 (10:19 +0200)] 
web/115183 - fix typo in C++ docs

The following fixes a reported typo.

* doc/invoke.texi (C++ Modules): Fix typo.

14 months agotestsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]
Tom de Vries [Wed, 22 May 2024 08:06:10 +0000 (10:06 +0200)] 
testsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]

gcc.dg/pr115066.c currently FAILs on Solaris/SPARC with the native as:

FAIL: gcc.dg/pr115066.c scan-assembler \\\\.byte\\\\t0xb\\\\t# Define macro strx

Instead of the expected

.byte   0xb     ! Define macro strx

the assembler output contains

.byte   0x1     ! Define macro

Apparently this happens because the Solaris as/ld combo doesn't support
SHF_MERGE.

While I initially meant to just skip the test on sparc*-*-solaris2* && !gas,
Tom suggested to allow for both forms instead, which is what his patch
does.

Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11 (as and gas
each) and x86_64-pc-linux-gnu.

2024-05-21  Tom de Vries  <tdevries@suse.de>

gcc/testsuite:
PR debug/115066
* gcc.dg/pr115066.c (scan-assembler): Allow for alternative form
of Define macro.

14 months agostrlen: Fix up !si->full_string_p handling in count_nonzero_bytes_addr [PR115152]
Jakub Jelinek [Wed, 22 May 2024 07:13:50 +0000 (09:13 +0200)] 
strlen: Fix up !si->full_string_p handling in count_nonzero_bytes_addr [PR115152]

The following testcase is miscompiled because
strlen_pass::count_nonzero_bytes_addr doesn't handle correctly
the !si->full_string_p case.
If si->full_string_p, it correctly computes minlen and maxlen as
minimum and maximum length of the '\0' terminated stgring and
clears *nulterm (ie. makes sure !full_string_p in the ultimate
caller) if minlen is equal or larger than nbytes and so
'\0' isn't guaranteed to be among those bytes.
But in the !si->full_string_p case, all we know is that there
are [minlen,maxlen] non-zero bytes followed by unknown bytes,
so effectively the maxlen is infinite (but caller cares about only
the first nbytes bytes) and furthermore, we never know if there is
any '\0' char among those, so *nulterm needs to be always cleared.

2024-05-22  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/115152
* tree-ssa-strlen.cc (strlen_pass::count_nonzero_bytes_addr): If
!si->full_string_p, clear *nulterm and set maxlen to nbytes.

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

14 months agoubsan: Use right address space for MEM_REF created for bool/enum sanitization [PR115172]
Jakub Jelinek [Wed, 22 May 2024 07:12:28 +0000 (09:12 +0200)] 
ubsan: Use right address space for MEM_REF created for bool/enum sanitization [PR115172]

The following testcase is miscompiled, because -fsanitize=bool,enum
creates a MEM_REF without propagating there address space qualifiers,
so what should be normally loaded using say %gs:/%fs: segment prefix
isn't.  Together with asan it then causes that load to be sanitized.

2024-05-22  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/115172
* ubsan.cc (instrument_bool_enum_load): If rhs is not in generic
address space, use qualified version of utype with the right
address space.  Formatting fix.

* gcc.dg/asan/pr115172.c: New test.

14 months agoi386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW
Haochen Jiang [Tue, 21 May 2024 06:10:43 +0000 (14:10 +0800)] 
i386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW

Since vpermq is really slow, we should avoid using it for permutation
when vpmovwb is not available (needs AVX512BW) for ix86_expand_vecop_qihi2
and fall back to ix86_expand_vecop_qihi.

gcc/ChangeLog:

PR target/115069
* config/i386/i386-expand.cc (ix86_expand_vecop_qihi2):
Do not enable the optimization when AVX512BW is not enabled.

gcc/testsuite/ChangeLog:

PR target/115069
* gcc.target/i386/pr115069.c: New.

14 months agoRISC-V: Enable vectorization for vect-early-break_124-pr114403.c
xuli [Mon, 20 May 2024 01:56:47 +0000 (01:56 +0000)] 
RISC-V: Enable vectorization for vect-early-break_124-pr114403.c

Because "targetm.slow_unaligned_access" is set to true by default
(aka -mtune=rocket) for RISC-V, it causes the __builtin_memcpy with
8 bytes failed to folded into int64 assignment during ccp1.

So adding "-mtune=generic-ooo" to the RISC-V target can vectorize
vect-early-break_124-pr114403.c.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/vect-early-break_124-pr114403.c: Enable vectrization for RISC-V target.

14 months agoc++: Strengthen checks on 'main'
Nathaniel Shead [Sat, 11 May 2024 12:25:44 +0000 (22:25 +1000)] 
c++: Strengthen checks on 'main'

This patch adds some missing requirements for legal main declarations,
as according to [basic.start.main] p2.

gcc/cp/ChangeLog:

* decl.cc (grokfndecl): Check for main functions with language
linkage or module attachment.
(grokvardecl): Check for extern 'C' entities named main.

gcc/testsuite/ChangeLog:

* g++.dg/abi/main.C: Check pedwarn for main with linkage-spec.
* g++.dg/modules/contracts-1_b.C: Don't declare main in named
module.
* g++.dg/modules/contracts-3_b.C: Likewise.
* g++.dg/modules/contracts-4_d.C: Likewise.
* g++.dg/modules/horcrux-1_a.C: Export declarations, so that...
* g++.dg/modules/horcrux-1_b.C: Don't declare main in named
module.
* g++.dg/modules/main-1.C: New test.
* g++.dg/parse/linkage5.C: New test.
* g++.dg/parse/linkage6.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
14 months agoDaily bump.
GCC Administrator [Wed, 22 May 2024 00:17:38 +0000 (00:17 +0000)] 
Daily bump.

14 months agoc++: Fix std dialect hint for std::to_address [PR107800]
Jonathan Wakely [Tue, 21 May 2024 12:16:33 +0000 (13:16 +0100)] 
c++: Fix std dialect hint for std::to_address [PR107800]

The correct dialect for std::to_address is cxx20 not cxx11.

gcc/cp/ChangeLog:

PR libstdc++/107800
* cxxapi-data.csv <to_address>: Change dialect to cxx20.
* std-name-hint.gperf: Regenerate.
* std-name-hint.h: Regenerate.

14 months agoc++: folding non-dep enumerator from current inst [PR115139]
Patrick Palka [Tue, 21 May 2024 19:54:10 +0000 (15:54 -0400)] 
c++: folding non-dep enumerator from current inst [PR115139]

After the tsubst_copy removal r14-4796-g3e3d73ed5e85e7 GCC 14 ICEs during
fold_non_dependent_expr for 'e1 | e2' below ultimately because we no
longer exit early when substituting the CONST_DECLs for e1 and e2 with
args=NULL_TREE and instead proceed to substitute the class context A<Ts...>
(also with args=NULL_TREE) which ends up ICEing from tsubst_pack_expansion
(due to processing_template_decl being cleared).

Incidentally, the ICE went away on trunk ever since the tsubst_aggr_type
removal r15-123-gf04dc89a991ddc since it changed the CONST_DECL case of
tsubst_expr to use tsubst to substitute the context, which short circuits
for empty args and so avoids the ICE.

This patch fixes this ICE for GCC 14 by narrowly restoring the early exit
for empty args that would've happened in tsubst_copy when substituting an
enumerator CONST_DECL.  We might as well apply this to trunk too, as a
small optimization.

PR c++/115139

gcc/cp/ChangeLog:

* pt.cc (tsubst_expr) <case CONST_DECL>: Exit early if args
is empty.

gcc/testsuite/ChangeLog:

* g++.dg/template/non-dependent33.C: New test.

Reviewed-by: Marek Polacek <mpolacek@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
14 months agoRISC-V: avoid LUI based const mat in alloca epilogue expansion
Vineet Gupta [Wed, 6 Mar 2024 23:44:27 +0000 (15:44 -0800)] 
RISC-V: avoid LUI based const mat in alloca epilogue expansion

This is continuing on the prev patch in function epilogue expansion.
Broken out of easy of review.

gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_expand_epilogue): Handle offset
being sum of two S12.

Tested-by: Patrick O'Neill <patrick@rivosinc.com> # pre-commit-CI #1569
Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
14 months agoRISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733]
Vineet Gupta [Mon, 13 May 2024 18:46:03 +0000 (11:46 -0700)] 
RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733]

If the constant used for stack offset can be expressed as sum of two S12
values, the constant need not be materialized (in a reg) and instead the
two S12 bits can be added to instructions involved with frame pointer.
This avoids burning a register and more importantly can often get down
to be 2 insn vs. 3.

The prev patches to generally avoid LUI based const materialization didn't
fix this PR and need this directed fix in funcion prologue/epilogue
expansion.

This fix doesn't move the neddle for SPEC, at all, but it is still a
win considering gcc generates one insn fewer than llvm for the test ;-)

   gcc-13.1 release   |      gcc 230823     |                   |
                      |    g6619b3d4c15c    |   This patch      |  clang/llvm
---------------------------------------------------------------------------------
li      t0,-4096     | li    t0,-4096      | addi  sp,sp,-2048 | addi sp,sp,-2048
addi    t0,t0,2016   | addi  t0,t0,2032    | add   sp,sp,-16   | addi sp,sp,-32
li      a4,4096      | add   sp,sp,t0      | add   a5,sp,a0    | add  a1,sp,16
add     sp,sp,t0     | addi  a5,sp,-2032   | sb    zero,0(a5)  | add  a0,a0,a1
li      a5,-4096     | add   a0,a5,a0      | addi  sp,sp,2032  | sb   zero,0(a0)
addi    a4,a4,-2032  | li    t0, 4096      | addi  sp,sp,32    | addi sp,sp,2032
add     a4,a4,a5     | sb    zero,2032(a0) | ret               | addi sp,sp,48
addi    a5,sp,16     | addi  t0,t0,-2032   |                   | ret
add     a5,a4,a5     | add   sp,sp,t0      |
add     a0,a5,a0     | ret                 |
li      t0,4096      |
sd      a5,8(sp)     |
sb      zero,2032(a0)|
addi    t0,t0,-2016  |
add     sp,sp,t0     |
ret                  |

gcc/ChangeLog:
PR target/105733
* config/riscv/riscv.h: New macros for with aligned offsets.
* config/riscv/riscv.cc (riscv_split_sum_of_two_s12): New
function to split a sum of two s12 values into constituents.
(riscv_expand_prologue): Handle offset being sum of two S12.
(riscv_expand_epilogue): Ditto.
* config/riscv/riscv-protos.h (riscv_split_sum_of_two_s12): New.

gcc/testsuite/ChangeLog:
* gcc.target/riscv/pr105733.c: New Test.
* gcc.target/riscv/rvv/autovec/vls/spill-1.c: Adjust to not
expect LUI 4096.
* gcc.target/riscv/rvv/autovec/vls/spill-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/spill-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/spill-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/spill-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/spill-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/vls/spill-7.c: Ditto.

Tested-by: Edwin Lu <ewlu@rivosinc.com> # pre-commit-CI #1568
Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
14 months agomodula2: use groups in the type resolver of the bootstrap tool mc
Gaius Mulley [Tue, 21 May 2024 14:46:46 +0000 (15:46 +0100)] 
modula2: use groups in the type resolver of the bootstrap tool mc

This patch introduces groups to maintain the lists used when resolving
types in the bootstrap tool mc.  The groups and type resolver are very
similar to that used in cc1gm2.  Specifically the resolver uses the group
to detect any change to any element in any list within a group.  This is
much cleaner and safer than the previous list length comparisons.

gcc/m2/ChangeLog:

* Make-lang.in (MC_EXTENDED_OPAQUE): New definition.
* mc-boot/GDynamicStrings.cc: Rebuild.
* mc-boot/GDynamicStrings.h: Rebuild.
* mc-boot/Galists.cc: Rebuild.
* mc-boot/Galists.h: Rebuild.
* mc-boot/Gdecl.cc: Rebuild.
* mc/alists.def (equalList): New procedure.
* mc/alists.mod (equalList): New procedure implementation.
* mc/decl.mod (group): New type.
(freeGroup): New variable.
(globalGroup): Ditto.
(todoQ): Remove declaration and prefix all occurances with globalGroup^.
(partialQ): Ditto.
(doneQ): Ditto.
(newGroup): New procedure.
(initGroup): Ditto.
(killGroup): Ditto.
(dupGroup): Ditto.
(equalGroup): Ditto.
(topologicallyOut): Rewrite.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
14 months agomatch: Disable `(type)zero_one_valuep*CST` for 1bit signed types [PR115154]
Andrew Pinski [Mon, 20 May 2024 07:16:40 +0000 (00:16 -0700)] 
match: Disable `(type)zero_one_valuep*CST` for 1bit signed types [PR115154]

The problem here is the pattern added in r13-1162-g9991d84d2a8435
assumes that it is well defined to multiply zero_one_valuep by the truncated
converted integer constant. It is well defined for all types except for signed 1bit types.
Where `a * -1` is produced which is undefined/
So disable this pattern for 1bit signed types.

Note the pattern added in r14-3432-gddd64a6ec3b38e is able to workaround the undefinedness except when
`-fsanitize=undefined` is turned on, this is why I added a testcase for that.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/115154

gcc/ChangeLog:

* match.pd (convert (mult zero_one_valued_p@1 INTEGER_CST@2)): Disable
for 1bit signed types.

gcc/testsuite/ChangeLog:

* c-c++-common/ubsan/signed1bitfield-1.c: New test.
* gcc.c-torture/execute/signed1bitfield-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
14 months agomodula2: Pass --destdir for dir index during install of m2.info.
Sam James [Tue, 21 May 2024 11:31:47 +0000 (12:31 +0100)] 
modula2: Pass --destdir for dir index during install of m2.info.

This patch adds DESTDIR to the infodir when installing m2.info.

gcc/m2/ChangeLog

* Make-lang.in (m2.install-info): Pass --destdir for dir index.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
14 months agotree-optimization/115137 - more ptr-vs-ptr compare fixes
Richard Biener [Tue, 21 May 2024 08:12:40 +0000 (10:12 +0200)] 
tree-optimization/115137 - more ptr-vs-ptr compare fixes

The following fixes the omission of const-pool included in NONLOCAL.

PR tree-optimization/115137
* tree-ssa-structalias.cc (pt_solution_includes_const_pool): NONLOCAL
also includes constant pool entries.

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

14 months agoCache the set of EH_RETURN_DATA_REGNOs
Richard Sandiford [Tue, 21 May 2024 09:21:16 +0000 (10:21 +0100)] 
Cache the set of EH_RETURN_DATA_REGNOs

While reviewing Andrew's fix for PR114843, it seemed like it would
be convenient to have a HARD_REG_SET of EH_RETURN_DATA_REGNOs.
This patch adds one and uses it to simplify a couple of use sites.

gcc/
* hard-reg-set.h (target_hard_regs::x_eh_return_data_regs): New field.
(eh_return_data_regs): New macro.
* reginfo.cc (init_reg_sets_1): Initialize x_eh_return_data_regs.
* df-scan.cc (df_get_exit_block_use_set): Use it.
* ira-lives.cc (process_out_of_region_eh_regs): Likewise.

14 months agoFix Ada runtime library breakage on Solaris (bis)
Eric Botcazou [Tue, 21 May 2024 09:11:02 +0000 (11:11 +0200)] 
Fix Ada runtime library breakage on Solaris (bis)

Recent changes made to the runtime library broke again its build on Solaris
because it uses Solaris threads instead of POSIX threads on this platform.

gcc/ada/
PR ada/115168
* libgnarl/s-taprop__solaris.adb (Initialize): Fix pasto.
* libgnat/s-oslock__solaris.ads (Owner_Int): Delete.
(Owner_ID): Change the designated type to Integer.

14 months agotree-optimization/115149 - VOP live and missing PHIs
Richard Biener [Tue, 21 May 2024 07:48:04 +0000 (09:48 +0200)] 
tree-optimization/115149 - VOP live and missing PHIs

The following fixes a bug in vop-live get_live_in which was using
NULL to indicate the first processed edge but at the same time
using it for the case the live-in virtual operand cannot be computed.
The following fixes this, avoiding sinking a load to a place where
we'd have to insert virtual PHIs to make the virtual operand SSA
web OK.

PR tree-optimization/115149
* tree-ssa-live.cc (virtual_operand_live::get_live_in):
Explicitly track the first processed edge.

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

14 months agocontrib/gcc-changelog/git_update_version.py: Improve diagnostic
Tobias Burnus [Tue, 21 May 2024 08:13:13 +0000 (10:13 +0200)] 
contrib/gcc-changelog/git_update_version.py: Improve diagnostic

contrib/ChangeLog:

* gcc-changelog/git_update_version.py: Add '-i'/'--ignore' argument
to add to-be-ignored commits via the command line.
(ignored_commits): Rename from IGNORED_COMMITS and change
type from tuple to set.
(prepend_to_changelog_files): Show git hash if errors occurred.
(update_current_branch): Mark argument as optional by defaulting
to None.

14 months agoada: Streamline implementation of simple nonbinary modular operations
Eric Botcazou [Thu, 4 Apr 2024 14:39:55 +0000 (16:39 +0200)] 
ada: Streamline implementation of simple nonbinary modular operations

They are implemented by the nonbinary_modular_operation routine, which is
complex and, in particular, creates signed types and types with a partial
precision each time a subtraction or a multiplication resp. is generated.
Both are unnecessary and a simple approach even generates better code for
the subtraction on architectures with conditional moves.

gcc/ada/

* gcc-interface/utils2.cc (nonbinary_modular_operation): Rewrite.
Do not create signed types for subtraction, do not create types with
partial precision, call fold_convert instead of convert throughout.

14 months agoada: Simplify test for propagation of attributes to subtypes
Eric Botcazou [Fri, 29 Mar 2024 08:08:08 +0000 (09:08 +0100)] 
ada: Simplify test for propagation of attributes to subtypes

This changes the test to use the Is_Base_Type predicate and also removes the
superfluous call to Base_Type before First_Subtype.  No functional changes.

gcc/ada/

* gcc-interface/decl.cc (gnat_to_gnu_entity): Use the Is_Base_Type
predicate and remove superfluous calls to Base_Type.

14 months agoada: Fix internal error on discriminated record with Atomic aspect in Ada 2022
Eric Botcazou [Wed, 27 Mar 2024 23:02:11 +0000 (00:02 +0100)] 
ada: Fix internal error on discriminated record with Atomic aspect in Ada 2022

It occurs in build_load_modify_store where the pattern matching logic cannot
find the atomic load that is present in the tree because it has been wrapped
in a SAVE_EXPR by gnat_protect_expr, which is unnecessary.

gcc/ada/

* gcc-interface/utils2.cc (gnat_protect_expr): Deal specifically
with atomic loads. Document the relationship with gnat_save_expr.

14 months agoada: Fix strict aliasing violation in parameter passing (continued)
Eric Botcazou [Sun, 10 Mar 2024 12:22:55 +0000 (13:22 +0100)] 
ada: Fix strict aliasing violation in parameter passing (continued)

This fixes another long-standing (implicit) violation of the strict aliasing
rules that occurs when the result of a value conversion is directly passed
as an actual parameter in a call to a subprogram and the passing mechanism
is by reference.  In this case, the reference passed to the subprogram may
be to a type that is too different from the type of the underlying object,
which is the definition of such a violation.

The change reworks and strengthens the previous fix as follows: first, the
detection of these violations is moved into a dedicated predicate; second,
an assertion is added to check that none of them has been missed, which is
triggered by either -fchecking or -fstrict-aliasing, as the closely related
assertion that is present in relate_alias_sets.

The assertion uncovered two internal sources of violations: implementation
types for packed array types with peculiar index types and interface types,
which are fixed by propagating alias sets in the first case and resorting to
universal aliasing in the second case.

Finally, an unconditional warning is implemented to inform the user that the
temporary is created and to suggest a possible solution to prevent that.

gcc/ada/

* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: For a
packed type implemented specially, temporarily save the XUA type as
equivalent to the entity before processing the implementation type.
For this implementation type, if its component type is the same as
that of the original type, copy the alias set from the latter.
<types>: Resort to universal aliasing for all interface types.
* gcc-interface/trans.cc (Call_to_gnu): Add GNU_ACTUAL_TYPE local
variable and rename existing one to GNU_UNPADDED_ACTUAL_TYPE.
If the formal is passed by reference and the actual is a conversion,
call aliasable_p to detect aliasing violations, issue a warning upon
finding one and create the temporary in the target type.
Add an assertion that no such violation has been missed above.
(addressable_p): Revert latest changes.
(aliasable_p): New predicate.
* gcc-interface/utils2.cc (build_binary_op) <ARRAY_RANGE_REF>: When
creating a new array type on the fly, preserve the alias set of the
operation type.

14 months agoada: Make detection of useless copy for return more robust
Eric Botcazou [Tue, 12 Mar 2024 16:56:00 +0000 (17:56 +0100)] 
ada: Make detection of useless copy for return more robust

In the return-by-invisible-reference case, the return object of an extended
return statement is allocated directly on the return stack and, therefore,
the copy operation on return is useless.  The code detecting this was not
robust enough and missed some complex cases.

gcc/ada/

* gcc-interface/trans.cc (gnat_to_gnu) <N_Simple_Return_Statement>:
In the return-by-invisible-reference case, remove conversions before
looking for a dereference in the return values and building the test
protecting against a useless copy operation.

14 months agoada: Fix strict aliasing violation in parameter passing
Eric Botcazou [Thu, 29 Feb 2024 08:14:27 +0000 (09:14 +0100)] 
ada: Fix strict aliasing violation in parameter passing

This fixes a long-standing (implicit) violation of the strict aliasing rules
that occurs when the result of a call to an instance of Unchecked_Conversion
is directly passed as an actual parameter in a call to a subprogram and the
passing mechanism is by reference.  In this case, the reference passed to
the subprogram may be to a type that has nothing to do with the type of the
underlying object, which is the definition of such a violation.

This implements the following two-pronged approach: first, the problematic
cases are detected and a reference to a temporary is passed instead of the
direct reference to the underlying object; second, the implementation of
pragma Universal_Aliasing is enhanced so that it is propagated from the
component type of an array type to the array type itself, or else can be
applied to the array type directly, and may therefore be used to prevent
the violation from occurring in the first place, when the array type is
involved in the Unchecked_Conversion.

gcc/ada/

* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Array_Type>: Set
TYPE_TYPELESS_STORAGE on the array types if Universal_Aliasing is
set on the type or its component type.
<E_Array_Subtype>: Likewise.
For other aggregate types, set TYPE_TYPELESS_STORAGE in this case.
(set_typeless_storage_on_aggregate_type): New function.
(set_universal_aliasing_on_type): Likewise.
* gcc-interface/trans.cc (Call_to_gnu): Add const to local variable.
Adjust comment.  Pass GNAT_NAME in the call to addressable_p and add
a bypass for atomic types in case it returns false.
(addressable_p): Add GNAT_EXPR third parameter with default value
and add a default value to the existing second parameter.
<VIEW_CONVERT_EXPR:>: Return false if the expression comes from a
function call and if the alias sets of source and target types are
both distinct from zero and each other.

14 months agoada: Fix crash with aliased array and if expression
Ronan Desplanques [Fri, 23 Feb 2024 08:53:32 +0000 (09:53 +0100)] 
ada: Fix crash with aliased array and if expression

The way if expressions were translated led the gimplifying phase
to attempt to create a temporary of a variable-sized type in some
cases. This patch fixes this by adding an address indirection layer
in those cases.

gcc/ada/

* gcc-interface/utils2.cc (build_cond_expr): Also apply an
indirection when the result type is variable-sized.

14 months agoada: Minor typo fix in comment
Marc Poulhiès [Fri, 26 Jan 2024 12:58:34 +0000 (13:58 +0100)] 
ada: Minor typo fix in comment

gcc/ada/

* gcc-interface/decl.cc: Fix typo in comment.

14 months agoada: Follow-up adjustment to earlier fix in Build_Allocate_Deallocate_Proc
Eric Botcazou [Sun, 11 Feb 2024 18:18:46 +0000 (19:18 +0100)] 
ada: Follow-up adjustment to earlier fix in Build_Allocate_Deallocate_Proc

The deallocation call of the return and secondary stacks no longer matches
the profile built in Exp_Util.Build_Allocate_Deallocate_Proc, so this just
removes the code as unreachable and adds an assertion to that effect.

gcc/ada/

* gcc-interface/utils2.cc (build_call_alloc_dealloc_proc): Add an
assertion that this is not a deallocation of the return or secondary
stack and remove subsequent unreachable code.

14 months agoada: Avoid temporary for conditional expression of discriminated record type
Eric Botcazou [Tue, 6 Feb 2024 11:57:38 +0000 (12:57 +0100)] 
ada: Avoid temporary for conditional expression of discriminated record type

This just aligns the definite case (discriminants with default) with the
indefinite case (discriminants without default), the latter case having
been properly handled for long.  In the former case, the maximum size is
used so a temporary can be much larger than the actual data it contains.

gcc/ada/

* gcc-interface/utils2.cc (build_cond_expr): Use the indirect path
for all types containing a placeholder.

14 months agoada: Remove unused dependencies from gnatbind object list
Piotr Trojanek [Fri, 26 Jan 2024 10:08:35 +0000 (11:08 +0100)] 
ada: Remove unused dependencies from gnatbind object list

The gnatbind executable does not depend on aspects, SCIL, style checks,
etc. Also, these dependencies are not needed to actually build the
executable. Cleanup.

gcc/ada/

* gcc-interface/Make-lang.in (GNATBIND_OBJS): Remove unused
dependencies.

14 months agoada: Fix assembler error for gigantic library-level object on 64-bit Windows
Eric Botcazou [Mon, 22 Jan 2024 22:56:37 +0000 (23:56 +0100)] 
ada: Fix assembler error for gigantic library-level object on 64-bit Windows

Most small 64-bit code models have a limit of 2 GB on the span of binaries,
so we also use the limit for the size of the largest statically allocatable
object by the compiler.  If the limit is topped, the compiler switches over
to a dynamic allocation (if not forbidden) after giving a warning.

gcc/ada/

* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Give a
warning for a statically allocated object whose size is constant,
valid but too large.
(allocatable_size_p): In the static case, return false for a size
that is constant, valid but too large.

14 months agoada: Fix crash on aliased constant with packed array type and -g switch
Eric Botcazou [Fri, 12 Jan 2024 09:50:01 +0000 (10:50 +0100)] 
ada: Fix crash on aliased constant with packed array type and -g switch

The problem is that we build a template whose array field is not an array
in the case of an aliased object with nominal unconstrained array subtype.

gcc/ada/

* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: For an
array allocated with its bounds, make sure to have an array type
to build the template.

14 months agoada: Fix small inaccuracy for Size attribute applied to objects
Eric Botcazou [Thu, 14 Dec 2023 14:18:28 +0000 (15:18 +0100)] 
ada: Fix small inaccuracy for Size attribute applied to objects

This reverts a change made some time ago in lvalue_required_for_attribute_p
whereby the Size attribute applied to objects would no longer be considered
as requiring an lvalue.

While not wrong in principle, this turns out to be problematic because the
implementation in Attribute_to_gnu needs to look at the translated prefix
to spot particular cases and not only at the actual type of its value.

This of course requires a small adjustment in gnat_to_gnu to compensate.

gcc/ada/

* gcc-interface/trans.cc (access_attribute_p): New predicate.
(lvalue_required_for_attribute_p): Return again 1 for Size and add
the missing terminating call to gcc_unreachable.
(gnat_to_gnu): Return the result unmodified for a reference to an
unconstrained array only if it is the prefix of an access attribute.

14 months agoada: Fix oversight in previous change
Eric Botcazou [Thu, 14 Dec 2023 12:05:52 +0000 (13:05 +0100)] 
ada: Fix oversight in previous change

In rare cases, types using structural equality may reach relate_alias_sets.

gcc/ada/

* gcc-interface/utils.cc (relate_alias_sets): Restore previous code
when the type uses structural equality.

14 months agoada: Missing constraint check for initial value of object with address clause
Steve Baird [Fri, 5 Apr 2024 19:35:08 +0000 (12:35 -0700)] 
ada: Missing constraint check for initial value of object with address clause

In some cases where an object is declared with an initial value that is
an aggregate and also with a specified Address (either via an
aspect_specification or via an attribute_definition_clause), the
check that the initial value satisfies the constraints of the object's
subtype was incorrectly omitted.

gcc/ada/

* exp_util.adb (Remove_Side_Effects): Make_Reference assumes that
the referenced object satisfies the constraints of the designated
subtype of the access type. Ensure that this assumption holds by
introducing a qualified expression if needed (and then ensuring
that checking associated with evaluation of the qualified
expression is not suppressed).

14 months agoada: Fix layout in a list of aspects
Piotr Trojanek [Wed, 3 Apr 2024 11:36:35 +0000 (13:36 +0200)] 
ada: Fix layout in a list of aspects

Code cleanup; semantics is unaffected.

gcc/ada/

* aspects.ads (Nonoverridable_Aspect_Id): Fix layout.

14 months agoada: Remove duplicate statement
Ronan Desplanques [Tue, 2 Apr 2024 16:27:39 +0000 (18:27 +0200)] 
ada: Remove duplicate statement

This patch removes a duplicate statement that was useless and could
be misleading to the reader by suggesting that there are multiple
global variables named Style_Check, while there is just one.

gcc/ada/

* frontend.adb (Frontend): Remove duplicate statement.

14 months agoada: Remove useless trampolines caused by Unchecked_Conversion
Eric Botcazou [Thu, 4 Apr 2024 16:15:24 +0000 (18:15 +0200)] 
ada: Remove useless trampolines caused by Unchecked_Conversion

The partial solution implemented in Validate_Unchecked_Conversion to support
unchecked conversions between addresses and pointers to subprograms, for the
platforms where pointers to subprograms do not all have the same size, turns
out to be counter-productive for others because it may cause the creation of
useless trampolines, which in turn makes the stack executable.

gcc/ada/

* sem_ch13.adb (Validate_Unchecked_Conversion): Restrict forcing the
Can_Use_Internal_Rep flag to platforms that require unnesting.

14 months agoada: Add elaboration switch tags to info messages
Viljar Indus [Tue, 2 Apr 2024 11:32:04 +0000 (14:32 +0300)] 
ada: Add elaboration switch tags to info messages

Add the ?$? insertion characters for elaboration
message so they would be marked with the [-gnatel]
tag. Note that these insertion characters were
not added for SPARK elaboration messages:

gcc/ada/

* sem_elab.adb: Add missing elaboration insertion
characters to info messages.

14 months agoada: Simplify management of scopes while inlining
Piotr Trojanek [Wed, 3 Apr 2024 11:43:07 +0000 (13:43 +0200)] 
ada: Simplify management of scopes while inlining

Code cleanup; semantics is unaffected.

gcc/ada/

* inline.adb (Add_Scope_To_Clean): Use Append_Unique_Elmt.
(Analyze_Inlined_Bodies): Refine type of a local counter;
remove extra whitespace.

14 months agoada: Remove some explicit yields in tasking run-time
Ronan Desplanques [Tue, 2 Apr 2024 07:09:31 +0000 (09:09 +0200)] 
ada: Remove some explicit yields in tasking run-time

This patch removes three occurrences where tasking run-time
subprograms yielded control shortly before conditional calls to Sleep,
in order to avoid these calls more often. It was intended as an
optimization on systems where calls to Sleep are costly and in
particular VMS.

A problem was that two of the yields contained data races that were
reported by thread sanitizing tools on some platforms, and that's the
motivation for removing them.

gcc/ada/

* libgnarl/s-taenca.adb (Wait_For_Completion): Remove call to
Yield.
* libgnarl/s-tasren.adb (Timed_Selective_Wait, Wait_For_Call):
Remove calls to Yield.

14 months agoada: Fix formatting in list of implemented Ada 2012 features
Piotr Trojanek [Mon, 18 Mar 2024 21:43:54 +0000 (22:43 +0100)] 
ada: Fix formatting in list of implemented Ada 2012 features

Fix formatting; meaning is unaffected.

gcc/ada/

* doc/gnat_rm/implementation_of_ada_2012_features.rst:
Fix formatting.
* gnat_rm.texi: Regenerate.

14 months agoada: Sort list of implemented Ada 2012 features
Piotr Trojanek [Mon, 18 Mar 2024 17:00:55 +0000 (18:00 +0100)] 
ada: Sort list of implemented Ada 2012 features

The list of implemented Ada 2012 features is now ordered by the AI
numbers. It has been sorted mechanically using the csplit command with
a bit of shell scripting.

gcc/ada/

* doc/gnat_rm/implementation_of_ada_2012_features.rst:
Order list by AI number.
* gnat_rm.texi: Regenerate.

14 months agoada: Fix index entry for an implemented AI feature
Piotr Trojanek [Mon, 18 Mar 2024 16:29:07 +0000 (17:29 +0100)] 
ada: Fix index entry for an implemented AI feature

Fix inconsistent reference with "05" in the name of AI.

gcc/ada/

* doc/gnat_rm/implementation_of_ada_2012_features.rst
(AI-0216): Fix index reference.
* gnat_rm.texi: Regenerate.

14 months agoada: Update documentation of warning messages
Viljar Indus [Tue, 2 Apr 2024 10:48:55 +0000 (13:48 +0300)] 
ada: Update documentation of warning messages

Update the documentation of warning messages that only
emit info messages to clearly reflect that they only emit
info messages and not warning messages.

gcc/ada/

* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Update the documentation of -gnatw.n and -gnatw.l
* gnat_ugn.texi: Regenerate.

14 months agoada: Do not leak tagged type names when Discard_Names is enabled
Piotr Trojanek [Fri, 22 Mar 2024 22:11:10 +0000 (23:11 +0100)] 
ada: Do not leak tagged type names when Discard_Names is enabled

When both pragmas Discard_Names and No_Tagged_Streams apply to a tagged
type, the intended behavior is to prevent type names from leaking into
object code, as documented in GNAT RM.

However, while Discard_Names can be used as a configuration pragma,
No_Tagged_Streams must be applied to each type separately. This patch
enables the use of restriction No_Streams, which can be activated
globally, instead of No_Tagged_Streams on individual types.

When no tagged stream object can be created and allocated, then routines
that make use of the External_Tag won't be used.

gcc/ada/

* doc/gnat_rm/implementation_defined_pragmas.rst
(No_Tagged_Streams): Document how to avoid exposing entity names
for the entire partition.
* exp_disp.adb (Make_DT): Make use of restriction No_Streams.
* exp_put_image.adb (Build_Record_Put_Image_Procedure): Respect
Discard_Names in the generated Put_Image procedure.
* gnat_rm.texi: Regenerate.

14 months agoada: Remove conversion from String_Id to String and back to String_Id
Piotr Trojanek [Fri, 22 Mar 2024 18:06:48 +0000 (19:06 +0100)] 
ada: Remove conversion from String_Id to String and back to String_Id

Code cleanup; semantics is unaffected.

gcc/ada/

* exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
useless conversions.

14 months agoada: Remove trailing NUL in minimal expansion of Put_Image attribute
Piotr Trojanek [Fri, 22 Mar 2024 18:02:00 +0000 (19:02 +0100)] 
ada: Remove trailing NUL in minimal expansion of Put_Image attribute

When procedure that implements Put_Image attribute emits the type name,
this name was wrongly followed by a NUL character.

gcc/ada/

* exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove
trailing NUL from the fully qualified type name.

14 months agoada: Follow-up fix to previous change for Text_Ptr
Eric Botcazou [Tue, 2 Apr 2024 08:51:00 +0000 (10:51 +0200)] 
ada: Follow-up fix to previous change for Text_Ptr

The variable would be saved and restored while still uninitialized.

gcc/ada/

* err_vars.ads (Error_Msg_Sloc): Initialize to No_Location.

14 months agoada: Add new Mingw task priority mapping
Justin Squirek [Mon, 11 Mar 2024 15:15:34 +0000 (15:15 +0000)] 
ada: Add new Mingw task priority mapping

This patch adds a new mapping (Non_FIFO_Underlying_Priorities) for dynamically
setting task priorities in Windows when pragma Task_Dispatching_Policy
(FIFO_Within_Priorities) is not present. Additionally, it documents the
requirement to specify the pragma in order to use Set_Priority in the general
case.

gcc/ada/

* doc/gnat_ugn/platform_specific_information.rst: Add note about
different priority level granularities under different policies in
Windows and move POSIX related info into new section.
* libgnarl/s-taprop.ads: Add note about Task_Dispatching_Policy.
* libgnarl/s-taprop__mingw.adb:
(Set_Priority): Add use of Non_FIFO_Underlying_Priorities.
* libgnat/system-mingw.ads: Add documentation for modifying
priority mappings and add alternative mapping
Non_FIFO_Underlying_Priorities.
* gnat_ugn.texi: Regenerate.

14 months agoUse pblendw instead of pand to clear upper 16 bits.
liuhongt [Fri, 22 Mar 2024 06:40:00 +0000 (14:40 +0800)] 
Use pblendw instead of pand to clear upper 16 bits.

For vec_pack_truncv8si/v4si w/o AVX512,
(const_vector:v4si (const_int 0xffff) x4) is used as mask to clear
upper 16 bits, but vpblendw with zero_vector can also be used, and
zero vector is cheaper than (const_vector:v4si (const_int 0xffff) x4).

gcc/ChangeLog:
PR target/114427
* config/i386/i386-expand.cc (expand_vec_perm_even_odd_pack):
Use pblendw instead of pand to clear upper bits.

gcc/testsuite/ChangeLog:
* gcc.target/i386/pr114427.c: New test.

14 months agotestsuite, rs6000: Make powerpc_altivec consider current_compiler_flags [PR114842]
Kewen Lin [Tue, 21 May 2024 02:01:08 +0000 (21:01 -0500)] 
testsuite, rs6000: Make powerpc_altivec consider current_compiler_flags [PR114842]

As noted in PR114842, most of the test cases which require
effective target check powerpc_altivec_ok actually care
about if ALTIVEC feature is enabled, and they should adopt
effective target powerpc_altivec instead.  By considering
we already have a number of test cases having explicit
-maltivec in dg-options etc., to keep them still be tested
as before even without altivec enabled by default, this
patch makes powerpc_altivec consider current_compiler_flags
like what we do for powerpc_vsx.

PR testsuite/114842

gcc/testsuite/ChangeLog:

* lib/target-supports.exp (check_effective_target_powerpc_altivec):
Take current_compiler_flags into account.

14 months agotestsuite, rs6000: Make powerpc_vsx consider current_compiler_flags [PR114842]
Kewen Lin [Tue, 21 May 2024 02:01:08 +0000 (21:01 -0500)] 
testsuite, rs6000: Make powerpc_vsx consider current_compiler_flags [PR114842]

As noted in PR114842, most of the test cases which require
effective target check powerpc_vsx_ok actually care about
if VSX feature is enabled, and they should adopt effective
target powerpc_vsx instead.  By considering we already have
a number of test cases having explicit -mvsx in dg-options
etc., to keep them still be tested as before even without
vsx enabled by default, this patch is to make powerpc_vsx
consider current_compiler_flags.

PR testsuite/114842

gcc/testsuite/ChangeLog:

* lib/target-supports.exp (check_effective_target_powerpc_vsx): Take
current_compiler_flags into account.

14 months agotestsuite, rs6000: Remove effective target powerpc_405_nocache
Kewen Lin [Tue, 21 May 2024 02:01:08 +0000 (21:01 -0500)] 
testsuite, rs6000: Remove effective target powerpc_405_nocache

With the introduction of -mdejagnu-cpu=, when the test case
is specifying -mdejagnu-cpu=405, it would override the other
possibly given -mcpu=, so it would compile for PowerPC 405
for sure.  This patch is to remove the effective target
powerpc_405_nocache and update all its uses.

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/405-dlmzb-strlen-1.c: Remove the line using
powerpc_405_nocache check.
* gcc.target/powerpc/405-macchw-1.c: Likewise.
* gcc.target/powerpc/405-macchw-2.c: Likewise.
* gcc.target/powerpc/405-macchwu-1.c: Likewise.
* gcc.target/powerpc/405-macchwu-2.c: Likewise.
* gcc.target/powerpc/405-machhw-1.c: Likewise.
* gcc.target/powerpc/405-machhw-2.c: Likewise.
* gcc.target/powerpc/405-machhwu-1.c: Likewise.
* gcc.target/powerpc/405-machhwu-2.c: Likewise.
* gcc.target/powerpc/405-maclhw-1.c: Likewise.
* gcc.target/powerpc/405-maclhw-2.c: Likewise.
* gcc.target/powerpc/405-maclhwu-1.c: Likewise.
* gcc.target/powerpc/405-maclhwu-2.c: Likewise.
* gcc.target/powerpc/405-mulchw-1.c: Likewise.
* gcc.target/powerpc/405-mulchw-2.c: Likewise.
* gcc.target/powerpc/405-mulchwu-1.c: Likewise.
* gcc.target/powerpc/405-mulchwu-2.c: Likewise.
* gcc.target/powerpc/405-mulhhw-1.c: Likewise.
* gcc.target/powerpc/405-mulhhw-2.c: Likewise.
* gcc.target/powerpc/405-mulhhwu-1.c: Likewise.
* gcc.target/powerpc/405-mulhhwu-2.c: Likewise.
* gcc.target/powerpc/405-mullhw-1.c: Likewise.
* gcc.target/powerpc/405-mullhw-2.c: Likewise.
* gcc.target/powerpc/405-mullhwu-1.c: Likewise.
* gcc.target/powerpc/405-mullhwu-2.c: Likewise.
* gcc.target/powerpc/405-nmacchw-1.c: Likewise.
* gcc.target/powerpc/405-nmacchw-2.c: Likewise.
* gcc.target/powerpc/405-nmachhw-1.c: Likewise.
* gcc.target/powerpc/405-nmachhw-2.c: Likewise.
* gcc.target/powerpc/405-nmaclhw-1.c: Likewise.
* gcc.target/powerpc/405-nmaclhw-2.c: Likewise.
* lib/target-supports.exp
(check_effective_target_powerpc_405_nocache): Remove.

14 months agolibgcc, rs6000: Remove powerpcspe related code
Kewen Lin [Tue, 21 May 2024 02:01:08 +0000 (21:01 -0500)] 
libgcc, rs6000: Remove powerpcspe related code

Since r9-4728 the powerpcspe support had been removed, this
follow-up patch is to remove the remaining pieces in libgcc.

libgcc/ChangeLog:

* config.host: Remove powerpc-*-eabispe* support.
* config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Remove
__SPE__ code.
* config/rs6000/t-savresfgpr (LIB2ADD_ST): Remove e500crtres32gpr.S,
e500crtres32gpr.S, e500crtsav64gpr.S, e500crtsav64gprctr.S,
e500crtres64gpr.S, e500crtsav32gpr.S, e500crtsavg32gpr.S,
e500crtres64gprctr.S, e500crtsavg64gprctr.S, e500crtresx32gpr.S,
e500crtrest32gpr.S, e500crtrest64gpr.S and e500crtresx64gpr.S.
* config/rs6000/e500crtres32gpr.S: Remove.
* config/rs6000/e500crtres64gpr.S: Remove.
* config/rs6000/e500crtres64gprctr.S: Remove.
* config/rs6000/e500crtrest32gpr.S: Remove.
* config/rs6000/e500crtrest64gpr.S: Remove.
* config/rs6000/e500crtresx32gpr.S: Remove.
* config/rs6000/e500crtresx64gpr.S: Remove.
* config/rs6000/e500crtsav32gpr.S: Remove.
* config/rs6000/e500crtsav64gpr.S: Remove.
* config/rs6000/e500crtsav64gprctr.S: Remove.
* config/rs6000/e500crtsavg32gpr.S: Remove.
* config/rs6000/e500crtsavg64gpr.S: Remove.
* config/rs6000/e500crtsavg64gprctr.S: Remove.