Commit Graph

188333 Commits

Author SHA1 Message Date
liuhongt
0eeb8c81e8 AVX512FP16: Add expander for cstorehf4.
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.
2021-09-22 12:56:31 +08:00
liuhongt
338abd0bf7 AVX512FP16: Add expander for ceil/floor/trunc/roundeven.
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.
2021-09-22 12:56:31 +08:00
liuhongt
59e9c4cbe6 AVX512FP16: Add expander for sqrthf2.
gcc/ChangeLog:

	* config/i386/i386-features.c (i386-features.c): Handle
	E_HFmode.
	* config/i386/i386.md (sqrthf2): New expander.
	(*sqrthf2): New define_insn.
	* config/i386/sse.md
	(*<sse>_vmsqrt<mode>2<mask_scalar_name><round_scalar_name>):
	Extend to VFH_128.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512fp16-builtin-sqrt-1.c: New test.
	* gcc.target/i386/avx512fp16vl-builtin-sqrt-1.c: New test.
2021-09-22 12:56:31 +08:00
liuhongt
8a5837cfb7 AVX512FP16: Add testcases for vfcmaddcsh/vfmaddcsh/vfcmulcsh/vfmulcsh.
gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512fp16-vfcmaddcsh-1a.c: New test.
	* gcc.target/i386/avx512fp16-vfcmaddcsh-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-vfcmulcsh-1a.c: Ditto.
	* gcc.target/i386/avx512fp16-vfcmulcsh-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmaddcsh-1a.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmaddcsh-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmulcsh-1a.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmulcsh-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-complex-constraints.c: Ditto.
2021-09-22 12:56:30 +08:00
liuhongt
db3b96df03 AVX512FP16: Add vfcmaddcsh/vfmaddcsh/vfcmulcsh/vfmulcsh.
gcc/ChangeLog:

	* config/i386/avx512fp16intrin.h (_mm_mask_fcmadd_sch):
	New intrinsic.
	(_mm_mask3_fcmadd_sch): Likewise.
	(_mm_maskz_fcmadd_sch): Likewise.
	(_mm_fcmadd_sch): Likewise.
	(_mm_mask_fmadd_sch): Likewise.
	(_mm_mask3_fmadd_sch): Likewise.
	(_mm_maskz_fmadd_sch): Likewise.
	(_mm_fmadd_sch): Likewise.
	(_mm_mask_fcmadd_round_sch): Likewise.
	(_mm_mask3_fcmadd_round_sch): Likewise.
	(_mm_maskz_fcmadd_round_sch): Likewise.
	(_mm_fcmadd_round_sch): Likewise.
	(_mm_mask_fmadd_round_sch): Likewise.
	(_mm_mask3_fmadd_round_sch): Likewise.
	(_mm_maskz_fmadd_round_sch): Likewise.
	(_mm_fmadd_round_sch): Likewise.
	(_mm_fcmul_sch): Likewise.
	(_mm_mask_fcmul_sch): Likewise.
	(_mm_maskz_fcmul_sch): Likewise.
	(_mm_fmul_sch): Likewise.
	(_mm_mask_fmul_sch): Likewise.
	(_mm_maskz_fmul_sch): Likewise.
	(_mm_fcmul_round_sch): Likewise.
	(_mm_mask_fcmul_round_sch): Likewise.
	(_mm_maskz_fcmul_round_sch): Likewise.
	(_mm_fmul_round_sch): Likewise.
	(_mm_mask_fmul_round_sch): Likewise.
	(_mm_maskz_fmul_round_sch): Likewise.
	* config/i386/i386-builtin.def: Add corresponding new builtins.
	* config/i386/sse.md
	(avx512fp16_fmaddcsh_v8hf_maskz<round_expand_name>): New expander.
	(avx512fp16_fcmaddcsh_v8hf_maskz<round_expand_name>): Ditto.
	(avx512fp16_fma_<complexopname>sh_v8hf<mask_scalarcz_name><round_scalarcz_name>):
	New define insn.
	(avx512fp16_<complexopname>sh_v8hf_mask<round_name>): Ditto.
	(avx512fp16_<complexopname>sh_v8hf<mask_scalarc_name><round_scalarcz_name>):
	Ditto.
	* config/i386/subst.md (mask_scalarcz_name): New.
	(mask_scalarc_name): Ditto.
	(mask_scalarc_operand3): Ditto.
	(mask_scalarcz_operand4): Ditto.
	(round_scalarcz_name): Ditto.
	(round_scalarc_mask_operand3): Ditto.
	(round_scalarcz_mask_operand4): Ditto.
	(round_scalarc_mask_op3): Ditto.
	(round_scalarcz_mask_op4): Ditto.
	(round_scalarcz_constraint): Ditto.
	(round_scalarcz_nimm_predicate): Ditto.
	(mask_scalarcz): Ditto.
	(mask_scalarc): Ditto.
	(round_scalarcz): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx-1.c: Add test for new builtins.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* gcc.target/i386/sse-14.c: Add test for new intrinsics.
	* gcc.target/i386/sse-22.c: Ditto.
2021-09-22 12:56:30 +08:00
liuhongt
ed643e9f17 AVX512FP16: Add testcases for vfcmaddcph/vfmaddcph/vfcmulcph/vfmulcph.
gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512fp16-helper.h
	(init_src): Adjust init value.
	(NET_CMASK): New net mask for complex input.
	* gcc.target/i386/avx512fp16-vfcmaddcph-1a.c: New test.
	* gcc.target/i386/avx512fp16-vfcmaddcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-vfcmulcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16-vfcmulcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmaddcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmaddcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmulcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16-vfmulcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfcmaddcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfcmulcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfmaddcph-1b.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfmulcph-1a.c: Ditto.
	* gcc.target/i386/avx512fp16vl-vfmulcph-1b.c: Ditto.
2021-09-22 12:56:30 +08:00
liuhongt
081070bce2 AVX512FP16: Add vfcmaddcph/vfmaddcph/vfcmulcph/vfmulcph
gcc/ChangeLog:

	* config/i386/avx512fp16intrin.h (_mm512_fcmadd_pch):
	New intrinsic.
	(_mm512_mask_fcmadd_pch): Likewise.
	(_mm512_mask3_fcmadd_pch): Likewise.
	(_mm512_maskz_fcmadd_pch): Likewise.
	(_mm512_fmadd_pch): Likewise.
	(_mm512_mask_fmadd_pch): Likewise.
	(_mm512_mask3_fmadd_pch): Likewise.
	(_mm512_maskz_fmadd_pch): Likewise.
	(_mm512_fcmadd_round_pch): Likewise.
	(_mm512_mask_fcmadd_round_pch): Likewise.
	(_mm512_mask3_fcmadd_round_pch): Likewise.
	(_mm512_maskz_fcmadd_round_pch): Likewise.
	(_mm512_fmadd_round_pch): Likewise.
	(_mm512_mask_fmadd_round_pch): Likewise.
	(_mm512_mask3_fmadd_round_pch): Likewise.
	(_mm512_maskz_fmadd_round_pch): Likewise.
	(_mm512_fcmul_pch): Likewise.
	(_mm512_mask_fcmul_pch): Likewise.
	(_mm512_maskz_fcmul_pch): Likewise.
	(_mm512_fmul_pch): Likewise.
	(_mm512_mask_fmul_pch): Likewise.
	(_mm512_maskz_fmul_pch): Likewise.
	(_mm512_fcmul_round_pch): Likewise.
	(_mm512_mask_fcmul_round_pch): Likewise.
	(_mm512_maskz_fcmul_round_pch): Likewise.
	(_mm512_fmul_round_pch): Likewise.
	(_mm512_mask_fmul_round_pch): Likewise.
	(_mm512_maskz_fmul_round_pch): Likewise.
	* config/i386/avx512fp16vlintrin.h (_mm_fmadd_pch):
	New intrinsic.
	(_mm_mask_fmadd_pch): Likewise.
	(_mm_mask3_fmadd_pch): Likewise.
	(_mm_maskz_fmadd_pch): Likewise.
	(_mm256_fmadd_pch): Likewise.
	(_mm256_mask_fmadd_pch): Likewise.
	(_mm256_mask3_fmadd_pch): Likewise.
	(_mm256_maskz_fmadd_pch): Likewise.
	(_mm_fcmadd_pch): Likewise.
	(_mm_mask_fcmadd_pch): Likewise.
	(_mm_mask3_fcmadd_pch): Likewise.
	(_mm_maskz_fcmadd_pch): Likewise.
	(_mm256_fcmadd_pch): Likewise.
	(_mm256_mask_fcmadd_pch): Likewise.
	(_mm256_mask3_fcmadd_pch): Likewise.
	(_mm256_maskz_fcmadd_pch): Likewise.
	(_mm_fmul_pch): Likewise.
	(_mm_mask_fmul_pch): Likewise.
	(_mm_maskz_fmul_pch): Likewise.
	(_mm256_fmul_pch): Likewise.
	(_mm256_mask_fmul_pch): Likewise.
	(_mm256_maskz_fmul_pch): Likewise.
	(_mm_fcmul_pch): Likewise.
	(_mm_mask_fcmul_pch): Likewise.
	(_mm_maskz_fcmul_pch): Likewise.
	(_mm256_fcmul_pch): Likewise.
	(_mm256_mask_fcmul_pch): Likewise.
	(_mm256_maskz_fcmul_pch): Likewise.
	* config/i386/i386-builtin-types.def (V8HF_FTYPE_V8HF_V8HF_V8HF,
	V8HF_FTYPE_V16HF_V16HF_V16HF, V16HF_FTYPE_V16HF_V16HF_V16HF_UQI,
	V32HF_FTYPE_V32HF_V32HF_V32HF_INT,
	V32HF_FTYPE_V32HF_V32HF_V32HF_UHI_INT): Add new builtin types.
	* config/i386/i386-builtin.def: Add new builtins.
	* config/i386/i386-expand.c: Handle new builtin types.
	* config/i386/subst.md (SUBST_CV): New.
	(maskc_name): Ditto.
	(maskc_operand3): Ditto.
	(maskc): Ditto.
	(sdc_maskz_name): Ditto.
	(sdc_mask_op4): Ditto.
	(sdc_mask_op5): Ditto.
	(sdc_mask_mode512bit_condition): Ditto.
	(sdc): Ditto.
	(round_maskc_operand3): Ditto.
	(round_sdc_mask_operand4): Ditto.
	(round_maskc_op3): Ditto.
	(round_sdc_mask_op4): Ditto.
	(round_saeonly_sdc_mask_operand5): Ditto.
	* config/i386/sse.md (unspec): Add complex fma unspecs.
	(avx512fmaskcmode): New.
	(UNSPEC_COMPLEX_F_C_MA): Ditto.
	(UNSPEC_COMPLEX_F_C_MUL): Ditto.
	(complexopname): Ditto.
	(<avx512>_fmaddc_<mode>_maskz<round_expand_name>): New expander.
	(<avx512>_fcmaddc_<mode>_maskz<round_expand_name>): Ditto.
	(fma_<complexopname>_<mode><sdc_maskz_name><round_name>): New
	define insn.
	(<avx512>_<complexopname>_<mode>_mask<round_name>): Ditto.
	(<avx512>_<complexopname>_<mode><maskc_name><round_name>): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx-1.c: Add test for new builtins.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* gcc.target/i386/sse-14.c: Add test for new intrinsics.
	* gcc.target/i386/sse-22.c: Ditto.
2021-09-22 12:56:30 +08:00
Kewen Lin
144c498465 rs6000: Parameterize some const values for density 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.
2021-09-21 23:47:33 -05:00
Barrett Adair
72394d38d9 c++: fix template instantiation comparison in redeclarations
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.
2021-09-22 00:03:12 -04:00
GCC Administrator
2c41dd82e2 Daily bump. 2021-09-22 00:16:28 +00:00
Ian Lance Taylor
09e18d113b runtime: set runtime.GOROOT value at build time
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.
2021-09-21 14:31:10 -07:00
Aldy Hernandez
97cfb54c3f path solver: Use ranger to solve unknowns.
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.
2021-09-21 18:55:14 +02:00
Aldy Hernandez
e4249b1003 path solver: Add related SSAs to solvable set.
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.
2021-09-21 18:55:14 +02:00
Aldy Hernandez
062c8727df path solver: Remove useless code.
gcc/ChangeLog:

	* gimple-range-path.cc (path_range_query::range_defined_in_block):
	Remove useless code.
2021-09-21 18:55:14 +02:00
Aldy Hernandez
f46d33637c path solver: Add relation support.
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.
2021-09-21 18:55:14 +02:00
Aldy Hernandez
198bc5ece9 Move postfold_gcond_edges into fur_source.
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.
2021-09-21 18:55:13 +02:00
Aldy Hernandez
64b80b8819 Do not query SCEV in range_of_phi unless dominators are available.
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.
2021-09-21 18:55:13 +02:00
Aldy Hernandez
08f392534a Allocate non_null_ref tables at creation.
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.
2021-09-21 18:55:13 +02:00
Doug Rupp
303b5d8747 [Ada] Add some comments in init.c about the lynx178 signal handler
gcc/ada/

	* init.c (__gnat_error_handler) [LynxOS]: Add a comment about
	missing optional args.
2021-09-21 15:25:04 +00:00
Yannick Moy
e839168738 [Ada] Rename "optional" node subtypes that allow Empty
gcc/ada/

	* gen_il-gen.adb (Put_Opt_Subtype): Add suffix.
2021-09-21 15:25:03 +00:00
Justin Squirek
7d9735bbb8 [Ada] Spurious dynamic accessibility check on allocator
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.
2021-09-21 15:25:03 +00:00
Eric Botcazou
f6ccb788f2 [Ada] Regenerate gnat_ugn.texi
gcc/ada/

	* gnat_ugn.texi: Regenerate.
2021-09-21 15:25:03 +00:00
Matthieu Eyraud
57fb9d3820 [Ada] SCOs: generate 'P' decisions for [Type_]Invariant pragmas
gcc/ada/

	* par_sco.adb (Traverse_One): Add support for pragma Invariant /
	Type_Invariant.
2021-09-21 15:25:02 +00:00
Bob Duff
bd413702ce [Ada] Add "optional" node subtypes that allow Empty
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.".
2021-09-21 15:25:02 +00:00
Patrick Bernardi
0df911d905 [Ada] bindgen: support additional features on targets suppressing the standard lib
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.
2021-09-21 15:25:02 +00:00
Bob Duff
618fff6043 [Ada] Fix regression in ACATS bdd2006 and bdd2007
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.
2021-09-21 15:25:01 +00:00
Daniel Mercier
900f9d999c [Ada] Set related expression for external DISCR symbols in Build_Temporary
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.
2021-09-21 15:25:01 +00:00
Eric Botcazou
13b594411d [Ada] Minor tweaks to System.Dwarf_Line
gcc/ada/

	* libgnat/s-dwalin.adb (Parse_Header): Tweak comments.
	(Read_Entry_Format_Array): Tweak exception message.
	(Symbolic_Address.Set_Result): Likewise.
2021-09-21 15:25:01 +00:00
Ed Schonberg
dbea36c6bd [Ada] Crash on build of Initialization procedure for derived container
gcc/ada/

	* exp_ch7.adb (Make_Init_Call): Add guard to protect against a
	missing initialization procedure for a type.
2021-09-21 15:25:01 +00:00
Doug Rupp
1d8617eb8c [Ada] Cleanup old VxWorks in Makefile.rtl
gcc/ada/

	* Makefile.rtl: Remove unused VxWorks sections.
	* libgnarl/s-vxwext__noints.adb: Remove.
	* libgnarl/s-vxwext__vthreads.ads: Remove.
	* libgnat/a-elchha__vxworks-ppc-full.adb: Remove.
	* libgnat/s-osprim__vxworks.adb: Remove.
	* libgnat/s-osvers__vxworks-653.ads: Remove.
	* libgnat/system-vxworks-e500-vthread.ads: Remove.
	* libgnat/system-vxworks-ppc-vthread.ads: Remove.
	* libgnat/system-vxworks-x86-vthread.ads: Remove.
2021-09-21 15:25:00 +00:00
Bob Duff
b6bb60b241 [Ada] Add assertions to Uintp (UI_Is_In_Int_Range)
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.
2021-09-21 15:25:00 +00:00
Bob Duff
911b00fba9 [Ada] Remove if_expression
gcc/ada/

	* sem_eval.adb (Fold_Shift): Replace an if_expression with an
	if_statement.
2021-09-21 15:25:00 +00:00
Bob Duff
b12d18a825 [Ada] Add assertions to Uintp
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.
2021-09-21 15:24:59 +00:00
Eric Botcazou
97a5ed2071 [Ada] Small optimization to DWARF 5 mode in System.Dwarf_Line
gcc/ada/

	* libgnat/s-dwalin.adb (To_File_Name): Fetch only the last string
	from the .debug_line_str section.
	(Symbolic_Address.Set_Result): Likewise.
2021-09-21 15:24:59 +00:00
Eric Botcazou
97c5d522c6 [Ada] Follow-up tweaks to System.Dwarf_Line
gcc/ada/

	* libgnat/s-dwalin.adb (Skip_Form): Fix cases of DW_FORM_addrx
	and DW_FORM_implicit_const.  Replace Constraint_Error with
	Dwarf_Error.
2021-09-21 15:24:59 +00:00
Ghjuvan Lacambre
cf7aa7d8e8 [Ada] exp_pakd.adb: work around spurious Codepeer warnings
gcc/ada/

	* exp_pakd.adb (Expand_Packed_Not): Replace expression with
	statement.
2021-09-21 15:24:58 +00:00
Ghjuvan Lacambre
69a0ff3416 [Ada] Fix ignored dynamic predicates specified through "predicate" aspect
gcc/ada/

	* sem_eval.adb (Is_Static_Subtype): Take predicates created
	through "predicate" pragma into account.
2021-09-21 15:24:58 +00:00
Frederic Konrad
566b479011 [Ada] rtems: add 128bit support for aarch64
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.
2021-09-21 15:24:58 +00:00
Gary Dismukes
704d03a4e3 [Ada] Presence of abstract operator function causes resolution problems
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.
2021-09-21 15:24:57 +00:00
Javier Miranda
16e307b9a4 [Ada] Interface behaves differently from abstract tagged null
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.
2021-09-21 15:24:57 +00:00
Bob Duff
b23cdc0158 [Ada] Clean up uses of Esize and RM_Size
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.
2021-09-21 15:24:57 +00:00
Steve Baird
e906896787 [Ada] Enforce legality rule for Predicate_Failure aspect specifications
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.
2021-09-21 15:24:56 +00:00
Steve Baird
3598c8db40 [Ada] Refactor sort procedures of doubly linked list containers
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.
2021-09-21 15:24:56 +00:00
Piotr Trojanek
2528d0c7ce [Ada] Update comment for Error_Msg_Internal
gcc/ada/

	* errout.adb (Error_Msg_Internal): Fix references to Sptr and
	Optr in comment; fix grammar of "low-level" where it is used as
	an adjective.
2021-09-21 15:24:55 +00:00
Piotr Trojanek
255279b91e [Ada] Simplify iteration when printing error message spans
gcc/ada/

	* errout.adb (Write_Source_Code_Lines): Use Cur_Loc before
	incrementing it, so that we don't need to decrement it.
2021-09-21 15:24:55 +00:00
Yannick Moy
ea3789f6a2 [Ada] Exception raised on empty file in GNATprove mode
gcc/ada/

	* errout.adb (Get_Line_End): Do not allow the result to go past
	the end of the buffer.
2021-09-21 15:24:55 +00:00
Ed Schonberg
c36332031c [Ada] Refine patch for spurious link error involving discriminated types
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.
2021-09-21 15:24:55 +00:00
Bob Duff
4d027eea55 [Ada] Remove "with GNAT.OS_Lib;" from libgnat/a-stbufi.ads
gcc/ada/

	* libgnat/a-stbufi.ads, libgnat/a-stbufi.adb: Change all
	occurrences of GNAT.OS_Lib to System.OS_Lib.
2021-09-21 15:24:54 +00:00
Thomas Schwinge
e87789f197 Evaluate 'random ()' to '0' in 'pass_omp_oacc_neuter_broadcast'
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'.
2021-09-21 12:38:44 +02:00
Richard Earnshaw
4e7a92c0ff arm: pass architecture extensions to assembler if supported
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.
2021-09-21 11:20:37 +01:00