gcc/ChangeLog:
* config/i386/i386.md (cstorehf3): New define_expand.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-fpcompare-1.c: New test.
* gcc.target/i386/avx512fp16-builtin-fpcompare-2.c: New test.
gcc/ChangeLog:
* config/i386/i386.md (<rounding_insn>hf2): New expander.
(sse4_1_round<mode>2): Extend from MODEF to MODEFH.
* config/i386/sse.md (*sse4_1_round<ssescalarmodesuffix>):
Extend from VF_128 to VFH_128.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-round-1.c: New test.
This patch follows the discussion here[1], where Segher suggested
parameterizing those exact magic constants for density heuristics,
to make it easier to tweak if need.
The change here should be "No Functional Change". But I verified
it with SPEC2017 at option sets O2-vect and Ofast-unroll on Power8,
the result is neutral as expected.
[1]https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579121.html
gcc/ChangeLog:
* config/rs6000/rs6000.opt (rs6000-density-pct-threshold,
rs6000-density-size-threshold, rs6000-density-penalty,
rs6000-density-load-pct-threshold,
rs6000-density-load-num-threshold): New parameter.
* config/rs6000/rs6000.c (rs6000_density_test): Adjust with
corresponding parameters.
This change fixes a primordial c++11 frontend defect where function template
redeclarations with trailing return types that used dependent
sizeof/alignof/noexcept expressions in template value arguments failed to
compare as equivalent to the identical primary template declaration. By
forcing structural AST comparison of the template arguments, we no longer
require TYPE_CANONICAL to match in this case. The new canon-type-{15..18}.C
tests failed with all prior GCC versions, where the redeclarations were
incorrectly reported as ambiguous overloads. The new dependent-name{15,16}.C
tests are regression tests for sneaky problems encountered during
development of this fix. Note that this fix does not address the use of parm
objects' constexpr members as template arguments within a declaration (a
superficially similar longstanding defect).
gcc/cp/ChangeLog:
* pt.c (find_parm_usage_r): New walk_tree callback to find func
parms.
(any_template_arguments_need_structural_equality_p): New special
case.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-52830.C: Remove unwanted dg-ice.
* g++.dg/template/canon-type-15.C: New test.
* g++.dg/template/canon-type-16.C: New test.
* g++.dg/template/canon-type-17.C: New test.
* g++.dg/template/canon-type-18.C: New test.
* g++.dg/template/dependent-name15.C: New regression test.
* g++.dg/template/dependent-name16.C: New regression test.
In Go 1.17 the gc toolchain changed to set runtime.GOROOT in cmd/link
(previously it was runtime/internal/sys.GOROOT). Do the same in libgo.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/351313
gotools/:
* Makefile.am (check-runtime): Add goroot.go to --extrafiles.
* Makefile.in: Regenerate.
The default behavior for the path solver is to resort to VARYING when
the range for an unknown SSA is outside the given path. This is both
cheap and fast, but fails to get a significant amount of ranges that
traditionally the DOM and VRP threaders could get.
This patch uses the ranger to resolve any unknown names upon entry to
the path. It also uses equivalences to improve ranges.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::defined_outside_path):
New.
(path_range_query::range_on_path_entry): New.
(path_range_query::internal_range_of_expr): Resolve unknowns
with ranger.
(path_range_query::improve_range_with_equivs): New.
(path_range_query::ssa_range_in_phi): Resolve unknowns with
ranger.
* gimple-range-path.h (class path_range_query): Add
defined_outside_path, range_on_path_entry, and
improve_range_with_equivs.
The path solver takes an initial set of SSA names which are deemed
interesting. These are then solved along the path. Adding any copies
of said SSA names to the list of interesting names yields significantly
better results. This patch adds said copies to the already provided
list.
Currently this code is guarded by "m_resolve", which is the more
expensive mode, but it would be reasonable to make it available always,
especially since adding more imports usually has minimal impact on the
processing time. I will investigate and make it universally available
if this is indeed the case.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::add_to_imports): New.
(path_range_query::add_copies_to_imports): New.
(path_range_query::precompute_ranges): Call
add_copies_to_imports.
* gimple-range-path.h (class path_range_query): Add prototypes
for add_copies_to_imports and add_to_imports.
This patch adds relational support to the path solver. It uses a
path_oracle that keeps track of relations within a path which are
augmented by relations on entry to the path. With it, range_of_stmt,
range_of_expr, and friends can give relation aware answers.
gcc/ChangeLog:
* gimple-range-fold.h (class fur_source): Make oracle protected.
* gimple-range-path.cc (path_range_query::path_range_query): Add
resolve argument. Initialize oracle.
(path_range_query::~path_range_query): Delete oracle.
(path_range_query::range_of_stmt): Adapt to use relations.
(path_range_query::precompute_ranges): Pre-compute relations.
(class jt_fur_source): New
(jt_fur_source::jt_fur_source): New.
(jt_fur_source::register_relation): New.
(jt_fur_source::query_relation): New.
(path_range_query::precompute_relations): New.
(path_range_query::precompute_phi_relations): New.
* gimple-range-path.h (path_range_query): Add resolve argument.
Add oracle, precompute_relations, precompute_phi_relations.
* tree-ssa-threadbackward.c (back_threader::back_threader): Pass
resolve argument to solver.
The code registering outgoing edges from a cond is living in
fold_using_range, which makes it difficult to be called from other
places. Also, it refuses to register relations on the outgoing
destinations that have more than one predecessor. This latter issue is
a problem because we would like to register outgoing edges along a path
in the path solver (regardless of single_pred_p).
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_range_op):
Rename postfold_gcond_edges to register_outgoing_edges and
adapt.
(fold_using_range::postfold_gcond_edges): Rename...
(fur_source::register_outgoing_edges): ...to this.
* gimple-range-fold.h (postfold_gcond_edges): Rename to
register_outgoing_edges and move to fur_source.
SCEV won't work without dominators and we can get called without
dominators from debug_ranger.
Another option would be to rename scev_initialized_p to something like
scev_available_p and move the check there. For now, this will do.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_phi): Check
dom_info_available_p.
Preallocating the space is slightly cheaper than calling
safe_grow_cleared.
gcc/ChangeLog:
* gimple-range-cache.cc (non_null_ref::non_null_ref): Use create
and quick_grow_cleared instead of safe_grow_cleared.
gcc/ada/
* sem_util.adb (Accessibility_Level): Remove spurious special
case for protected type components.
* exp_ch4.adb (Generate_Accessibility_Check): Use general
Accessibility_Level instead of the low-level function
Type_Access_Level.
gcc/ada/
* gen_il-gen.adb (Put_Opt_Subtype): Print out subtypes of the
form:
subtype Opt_N_Declaration is
Node_Id with Predicate =>
Opt_N_Declaration = Empty or else
Opt_N_Declaration in N_Declaration_Id;
One for each node or entity type, with the predicate allowing
Empty.
* atree.adb (Parent, Set_Parent): Remove unnecessary "Atree.".
gcc/ada/
* bindgen.adb (Gen_Adainit): For targets that suppress the
standard library: set the default stack size global variable if
a value is provided via the -d switch, and generate a call to
__gnat_initialize_stack_limit if stack checking using stack
limits is enabled.
gcc/ada/
* sem_ch13.adb (Stream_Size): Print message about allowed stream
sizes even if other error were already found. This avoids
falling into the 'else', which prints "Stream_Size cannot be
given for...", which is misleading -- the Size COULD be given if
it were correct.
gcc/ada/
* exp_util.adb (Build_Temporary): In case of an external DISCR
symbol, set the related expression for CodePeer so that a more
comprehensible message can be emitted to the user.
gcc/ada/
* uintp.ads, uintp.adb (UI_Is_In_Int_Range): Change the type of
the formal parameter to Valid_Uint. Remove code that preserved
the previous behavior, and replace it with an assertion. The
previous behavior is no longer needed given the recent change to
gigi.
(No, Present): Add comment.
gcc/ada/
* uintp.ads, uintp.adb: Add assertions.
(Ubool, Opt_Ubool): New "boolean" subtypes.
(UI_Is_In_Int_Range): The parameter should probably be
Valid_Uint, but we don't change that for now, because it causes
failures in gigi.
* sem_util.ads, sem_util.adb (Is_True, Is_False,
Static_Boolean): Use Opt_Ubool subtype. Document the fact that
Is_True (No_Uint) = True. Implement Is_False in terms of
Is_True. We considered changing Static_Boolean to return Uint_1
in case of error, but that doesn't fit in well with
Static_Integer.
(Has_Compatible_Alignment_Internal): Deal with cases where Offs
is No_Uint. Change one "and" to "and then" to ensure we don't
pass No_Uint to ">", which would violate the new assertions.
* exp_util.adb, freeze.adb, sem_ch13.adb: Avoid violating new
assertions in Uintp.
gcc/ada/
* Makefile.rtl (aarch64-rtems*): Add GNATRTL_128BIT_PAIRS to
the LIBGNAT_TARGET_PAIRS list and also GNATRTL_128BIT_OBJS to
the EXTRA_GNATRTL_NONTASKING_OBJS list.
gcc/ada/
* sem_ch4.adb (Remove_Abstract_Operations): Add condition to
test for an E_Operator as part of criteria for setting
Abstract_Op on interpretations involving predefined operators.
gcc/ada/
* exp_ch6.adb (Expand_Simple_Function_Return): For explicit
dereference of type conversion, enable code that ensures that
the tag of the result is that of the result type.
gcc/ada/
* einfo-utils.adb: Add support (currently disabled) for using
"initial zero" instead of "Uint_0" to represent "unknown". Call
Known_ functions, instead of evilly duplicating their code
inline.
* fe.h (No_Uint_To_0): New function to convert No_Uint to
Uint_0, in order to preserve existing behavior.
(Copy_Esize, Copy_RM_Size): New imports from Einfo.Utils.
* cstand.adb: Set size fields of Standard_Debug_Renaming_Type
and Standard_Exception_Type.
* checks.adb, exp_attr.adb, exp_ch3.adb, exp_ch5.adb,
exp_ch6.adb, exp_pakd.adb, exp_util.adb, freeze.adb, itypes.adb,
layout.adb, repinfo.adb, sem_attr.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch7.adb,
sem_util.adb: Protect calls with Known_..., use Copy_... Remove
assumption that Uint_0 represents "unknown".
* types.ads (Nonzero_Int): New subtype.
* gcc-interface/decl.c, gcc-interface/trans.c: Protect calls
with Known_... and use Copy_... as appropriate, to avoid
blowing up in unknown cases. Similarly, call No_Uint_To_0 to
preserve existing behavior.
gcc/ada/
* sem_ch13.adb (Analyze_Aspect_Specifications): Add a new nested
function, Directly_Specified, and then use it in the
implementation of the required check.
gcc/ada/
* libgnat/a-costso.ads, libgnat/a-costso.adb: A new library
unit, Ada.Containers.Stable_Sorting, which exports a pair of
generics (one within the other) which are instantiated by each
of the 5 doubly-linked list container generics to implement
their respective Sort procedures. We use a pair of generics,
rather than a single generic, in order to further reduce code
duplication. The outer generic takes a formal private Node_Ref
type representing a reference to a linked list element. For some
instances, the corresponding actual parameter will be an access
type; for others, it will be the index type for an array.
* Makefile.rtl: Include new Ada.Containers.Stable_Sorting unit.
* libgnat/a-cbdlli.adb, libgnat/a-cdlili.adb,
libgnat/a-cfdlli.adb, libgnat/a-cidlli.adb, libgnat/a-crdlli.adb
(Sort): Replace existing Sort implementation with a call to an
instance of
Ada.Containers.Stable_Sorting.Doubly_Linked_List_Sort. Declare
the (trivial) actual parameters needed to declare that instance.
* libgnat/a-cfdlli.ads: Fix a bug encountered during testing in
the postcondition for M_Elements_Sorted. With a partial
ordering, it is possible for all three of (X < Y), (Y < X),
and (X = Y) to be simultaneously false, so that case needs to
handled correctly.
gcc/ada/
* sem_ch3.adb (Process_Discriminant_Expressions): If the
constraint is for a Component_Definition that appears in a
Component_Declaration, the entity to be used to create the
potentially global symbol is the Defining_Identifier of the
Component_Declaration.
Julian Brown,
<http://mid.mail-archive.com/20210920134603.16459021@squid.athome>:
| [...] the randomness shouldn't be necessary for the
| correctness of the patch (i.e. it could just be "base = bounds_lo", or
| indeed folded into the line after).
|
| The "ar.invalid ()" case happens when we fail to allocate a block of
| memory in LDS space for broadcasting a particular set of variables,
| and trigger a fall-back path in the broadcasting code that adds extra
| barriers around the broadcast in question. I imagine I was thinking
| that adding randomness could mean we can "get lucky" sometimes and
| avoid needing those barriers in some cases, but in fact I don't think
| that was implemented, so the randomness is useless. (Or it could just
| have been leftover debug code... oops).
gcc/
PR other/102408
* omp-oacc-neuter-broadcast.cc (oacc_do_neutering): Evaluate
'random ()' to '0'.
When I originally added the new extended architecture features support
to GCC, the assembler was unable to parse the new feature lists on the
command-line and would throw an error. This has now been fixed in GAS
and the behaviour is the same as GCC.
So this patch adds a configure-time test for the assembler in use to
detect that it is recent enough to support this behaviour and then
enables passing the architecture extensions to the assembler when this
is the case.
Although the assembly output generated by GCC does not rely on this,
this should ease some issues when using GCC as a driver for compiling
source written directly in assembly language when the programmer was
expecting the appropriate options to be passed on the command line.
gcc/ChangeLog:
* configure.ac: Detect when the assembler supports new-style
architecture extensions.
* common/config/arm/arm-common.c (arm_rewrite_mcpu): Return
the full CPU string if the assembler can grok it.
(arm_rewrite_march): Likewise but for the architecture.
* config.in: Regenerate.
* configure: Regenerate.