Commit Graph

186085 Commits

Author SHA1 Message Date
Gary Dismukes eb077d7047 [Ada] Compiler crash on sliding of fixed-lower-bound object in Loop_Invariant
gcc/ada/

	* exp_util.adb (Expand_Sliding_Conversion): Only perform
	expansion when Expander_Active is True. Add a comment about this
	and refine existing comment regarding string literals.
2021-06-21 06:45:01 -04:00
Piotr Trojanek c9fcf01172 [Ada] Simplify detection of statically overlapping slices
gcc/ada/

	* sem_util.adb (Denotes_Same_Object): Simplify handling of
	slices.
2021-06-21 06:45:00 -04:00
Piotr Trojanek 58484cdf4e [Ada] Fix detection of overlapping actuals with renamings
gcc/ada/

	* sem_util.adb (Is_Object_Renaming): Rename from Is_Renaming;
	simplify; adapt callers.
2021-06-21 06:44:59 -04:00
Frederic Konrad 3045dd3c17 [Ada] powerpc64-wrs-vxworks7r2: build shared libgnat
gcc/ada/

	* Makefile.rtl: Compiles both static and dynamic libgnat for
	powerpc64-wrs-vxworks7r2.
2021-06-21 06:44:58 -04:00
prathamesh.kulkarni 316dd79876 arm/66791: Replace builtins in vceq_* (a, b) with a == b.
gcc/ChangeLog:
	* config/arm/arm_neon.h (vceq_s8): Replace builtin with __a == __b.
	(vceq_s16): Likewise.
	(vceq_s32): Likewise.
	(vceq_u8): Likewise.
	(vceq_u16): Likewise.
	(vceq_u32): Likewise.
	(vceq_p8): Likewise.
	(vceqq_s8): Likewise.
	(vceqq_s16): Likewise.
	(vceqq_s32): Likewise.
	(vceqq_u8): Likewise.
	(vceqq_u16): Likewise.
	(vceqq_u32): Likewise.
	(vceqq_p8): Likewise.
	(vceq_f32): Gate __a == __b on __FAST_MATH__.
	(vceqq_f32): Likewise.
	(vceq_f16): Likewise.
	(vceqq_f16): Likewise.
2021-06-21 14:52:54 +05:30
prathamesh.kulkarni 29a539a675 arm/97906: Adjust neon_vca patterns to use GLTE instead of GTGE iterator.
gcc/ChangeLog:
	PR target/97906
	* config/arm/iterators.md (NEON_VACMP): Remove.
	* config/arm/neon.md (neon_vca<cmp_op><mode>): Use GLTE instead of GTGE
	iterator.
	(neon_vca<cmp_op><mode>_insn): Likewise.
	(neon_vca<cmp_op_unsp><mode>_insn_unspec): Use NEON_VAGLTE instead of
	NEON_VACMP.

gcc/testsuite/ChangeLog:
	PR target/97906
	* gcc.target/arm/simd/pr97906.c: New test.
2021-06-21 14:41:12 +05:30
Richard Biener 90f78d5d86 tree-optimization/101121 - avoid infinite SLP build
The following plugs another hole where we cache a failed SLP build
attempt with an all-success 'matches'.  It also adds checking that
we don't do that.

2021-06-21  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101121
	* tree-vect-slp.c (vect_build_slp_tree_2): To not fail fatally
	when we just lack a stmt with the desired op when doing permutation.
	(vect_build_slp_tree): When caching a failed SLP build attempt
	assert that at least one lane is marked as not matching.

	* gfortran.dg/pr101121.f: New testcase.
2021-06-21 11:06:27 +02:00
liuhongt 08c85f609a Disparage slightly the mask register alternative for bitwise operations.
The avx512 supports bitwise operations with mask registers, but the
throughput of those instructions is much lower than that of the
corresponding gpr version, so we would additionally disparages
slightly the mask register alternative for bitwise operations in the
LRA.

Also when allocano cost of GENERAL_REGS is same as MASK_REGS, allocate
MASK_REGS first since it has already been disparaged.

gcc/ChangeLog:

	PR target/101142
	* config/i386/i386.md: (*anddi_1): Disparage slightly the mask
	register alternative.
	(*and<mode>_1): Ditto.
	(*andqi_1): Ditto.
	(*andn<mode>_1): Ditto.
	(*<code><mode>_1): Ditto.
	(*<code>qi_1): Ditto.
	(*one_cmpl<mode>2_1): Ditto.
	(*one_cmplsi2_1_zext): Ditto.
	(*one_cmplqi2_1): Ditto.
	* config/i386/i386.c (x86_order_regs_for_local_alloc): Change
	the order of mask registers to be before general registers.

gcc/testsuite/ChangeLog:

	PR target/101142
	* gcc.target/i386/spill_to_mask-1.c: Adjust testcase.
	* gcc.target/i386/spill_to_mask-2.c: Adjust testcase.
	* gcc.target/i386/spill_to_mask-3.c: Adjust testcase.
	* gcc.target/i386/spill_to_mask-4.c: Adjust testcase.
2021-06-21 16:05:35 +08:00
Roger Sayle 9cedbaab8e PR target/11877: Use xor to write zero to memory with -Os
The following patch attempts to resolve PR target/11877 (without
triggering PR/23102).  On x86_64, writing an SImode or DImode zero
to memory uses an instruction encoding that is larger than first
clearing a register (using xor) then writing that to memory.  Hence,
after reload, the peephole2 pass can determine if there's a suitable
free register, and if so, use that to shrink the code size with -Os.

To improve code size, and avoid inserting a large number of xor
instructions (PR target/23102), this patch makes use of peephole2's
efficient pattern matching to use a single temporary for a run of
consecutive writes.  In theory, one could do better still with a
new target-specific pass, gated on -Os, to shrink these instructions
(like stv), but that's probably overkill for the little remaining
space savings.

Evaluating this patch on the CSiBE benchmark (v2.1.1) results in a
0.26% code size improvement (3715273 bytes down to 3705477) on x86_64
with -Os [saving 1 byte every 400].  549 of 894 tests improve, two
tests grow larger.  Analysis of these 2 pathological cases reveals
that although peephole2's match_scratch prefers to use a call-clobbered
register (to avoid requiring a new stack frame), very rarely this
interacts with GCC's shrink wrapping optimization, which may previously
have avoided saving/restoring a call clobbered register, such as %eax,
in the calling function.

2021-06-21  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR target/11877
	* config/i386/i386.md: New define_peephole2s to shrink writing
	1, 2 or 4 consecutive zeros to memory when optimizing for size.

gcc/testsuite/ChangeLog
	PR target/11877
	* gcc.target/i386/pr11877.c: New test case.
2021-06-21 08:54:50 +01:00
liuhongt e24379c789 MAINTAINERS: Add myself as maintainer of the i386 vector extensions.
ChangeLog:

	* MAINTAINERS: Add myself as maintainer of the i386 vector
	extensions.
2021-06-21 10:41:36 +08:00
GCC Administrator 3e42ff7156 Daily bump. 2021-06-21 00:16:25 +00:00
Patrick Palka 69d80f0f2f libstdc++: Implement new views::split as per P2210
This implements the new views::split from P2210R2 "Superior String
Splitting".

libstdc++-v3/ChangeLog:

	* include/std/ranges (__non_propagating_cache::operator bool):
	Define for split_view::begin().
	(split_view): Define as per P2210.
	(views::__detail::__can_split_view): Define.
	(views::_Split, views::split): Define.
	* testsuite/std/ranges/adaptors/100577.cc (test01, test02):
	Test views::split.
	* testsuite/std/ranges/adaptors/split.cc: New test.
	* testsuite/std/ranges/p2325.cc (test08a): New test.
	* testsuite/std/ranges/p2367.cc (test01): Test views::split.
2021-06-20 12:47:18 -04:00
Patrick Palka adbd2c7102 libstdc++: Implement P2210 changes to rename views::split to lazy_split
This mostly mechanical patch renames split to lazy_split throughout.

libstdc++-v3/ChangeLog:

	* include/std/ranges: Rename views::split to views::lazy_split,
	split_view to lazy_split_view, etc. throughout.
	* testsuite/std/ranges/*: Likewise.
2021-06-20 12:41:42 -04:00
Patrick Palka 3f631671f1 libstdc++: Implement P2210 changes to split_view resolving LWG 3478
This implements the part of P2210R2 "Superior String Splitting" that
resolves LWG 3478.

libstdc++-v3/ChangeLog:

	* include/std/ranges (split_view::_OuterIter::__at_end):
	Check _M_trailing_empty.
	(split_view::_OuterIter::_M_trailing_empty): Define this
	data member.
	(split_view::_OuterIter::operator++): Set _M_trailing_empty
	appropriately.
	(split_view::_OuterIter::operator==): Compare
	_M_trailing_empty.
	* testsuite/std/ranges/adaptors/100479.cc (test03): Expect two
	split parts instead of one.
	* testsuite/std/ranges/adaptors/split.cc (test11): New test.
2021-06-20 12:38:43 -04:00
Patrick Palka 85a594f7dc libstdc++: Define split_view::_InnerIter::base as per P2210
libstdc++-v3/ChangeLog:

	* include/std/ranges (split_view::_InnerIter::base): Define as
	per P2210.
2021-06-20 12:38:35 -04:00
GCC Administrator b245d1c3d6 Daily bump. 2021-06-20 00:16:21 +00:00
Patrick Palka bc046a60cf libstdc++: Implement LWG 3555 changes to transform/elements_view
libstdc++-v3/ChangeLog:

	* include/std/ranges (transform_view::_Iterator::_S_iter_concept):
	Consider _Base instead of _Vp as per LWG 3555.
	(elements_view::_Iterator::_S_iter_concept): Likewise.
2021-06-18 20:50:23 -04:00
Patrick Palka 15736576df libstdc++: Implement LWG 3553 changes to split_view
libstdc++-v3/ChangeLog:

	* include/std/ranges (split_view::_OuterIter::value_type::begin):
	Remove the non-const overload, and remove the copyable constraint
	on the const overload as per LWG 3553.
2021-06-18 20:50:22 -04:00
Patrick Palka 4123650bd0 libstdc++: Implement LWG 3546 changes to common_iterator
libstdc++-v3/ChangeLog:

	* include/bits/stl_iterator.h
	(__detail::__common_iter_use_postfix_proxy): Add
	move_constructible constraint as per LWG 3546.
	(common_iterator::__postfix_proxy): Adjust initializer of
	_M_keep as per LWG 3546.
2021-06-18 20:50:13 -04:00
GCC Administrator c5581d4842 Daily bump. 2021-06-19 00:16:33 +00:00
Patrick Palka cc9c94d43d libstdc++: Reduce ranges::minmax/minmax_element comparison complexity
This rewrites ranges::minmax and ranges::minmax_element so that it
performs at most 3*N/2 many comparisons, as required by the standard.
In passing, this also fixes PR100387 by avoiding a premature std::move
in ranges::minmax and in std::shift_right.

	PR libstdc++/100387

libstdc++-v3/ChangeLog:

	* include/bits/ranges_algo.h (__minmax_fn::operator()): Rewrite
	to limit comparison complexity to 3*N/2.
	(__minmax_element_fn::operator()): Likewise.
	(shift_right): Avoid premature std::move of __result.
	* testsuite/25_algorithms/minmax/constrained.cc (test04, test05):
	New tests.
	* testsuite/25_algorithms/minmax_element/constrained.cc (test02):
	Likewise.
2021-06-18 19:33:39 -04:00
Aaron Sawdey a798b3f15c Fix p10 fusion regtests
Update the count of matches for the fusion combine patterns after
the recent changes to them.  At Segher's request, used \m and \M
in the match patterns. Also I have grouped together all alternatives of
each fusion insn, which should hopefully make this test a little less
fragile.

gcc/testsuite/ChangeLog

	* gcc.target/powerpc/fusion-p10-2logical.c: Update pattern
	match counts.
	* gcc.target/powerpc/fusion-p10-addadd.c: Update pattern match
	counts.
	* gcc.target/powerpc/fusion-p10-ldcmpi.c: Update pattern match
	counts.
	* gcc.target/powerpc/fusion-p10-logadd.c: Update pattern match
	counts.
2021-06-18 17:14:39 -05:00
Jeff Law 629cbc682a [committed] More useless code elimination on the H8
gcc/
	* config/h8300/h8300.c (h8300_select_cc_mode): Handle SYMBOL_REF.
	* config/h8300/logical.md (<code><mode>3 logcial expander): Generate
	more efficient code when the source can be trivially simplified.
2021-06-18 18:05:08 -04:00
Andrew MacLeod cb448ade74 Calculate a global definition if one has not been registered.
With poor values gone, Pick up range restrictions from statements
by folding them with global cache values.

	* gimple-range-cache.cc (ranger_cache::range_of_def):  Calculate
	a range if global is not available.
	(ranger_cache::entry_range): Fallback to range_of_def.
	* gimple-range-cache.h (range_of_def): Adjust prototype.
2021-06-18 17:43:28 -04:00
Andrew MacLeod 870b674f72 Remove poor value computations.
Remove the old "poor value" approach which made callbacks into ranger
from the cache.  Use only the best available value for all propagation.

	PR tree-optimization/101014
	* gimple-range-cache.cc (ranger_cache::ranger_cache): Remove poor
	value list.
	(ranger_cache::~ranger_cache): Ditto.
	(ranger_cache::enable_new_values): Delete.
	(ranger_cache::push_poor_value): Delete.
	(ranger_cache::range_of_def): Remove poor value processing.
	(ranger_cache::entry_range): Ditto.
	(ranger_cache::fill_block_cache): Ditto.
	* gimple-range-cache.h (class ranger_cache): Remove poor value members.
	* gimple-range.cc (gimple_ranger::range_of_expr): Remove call.
	* gimple-range.h (class gimple_ranger): Adjust.
2021-06-18 17:43:28 -04:00
Antoni Boucher 93022946df MAINTAINERS: Add myself for write after approval
ChangeLog:

2021-06-18  Antoni Boucher  <bouanto@zoho.com>

	* MAINTAINERS (Write After Approval): Add myself.
2021-06-18 16:52:55 -04:00
Harald Anlauf 6fc5433963 Fortran - fix conversion to result type for the min/max intrinsic
gcc/fortran/ChangeLog:

	PR fortran/100283
	PR fortran/101123
	* trans-intrinsic.c (gfc_conv_intrinsic_minmax): Unconditionally
	convert result of min/max to result type.

gcc/testsuite/ChangeLog:

	PR fortran/100283
	PR fortran/101123
	* gfortran.dg/min0_max0_1.f90: New test.
	* gfortran.dg/min0_max0_2.f90: New test.
2021-06-18 19:34:15 +02:00
David Malcolm 3bb85b8687 analyzer: fix issue with symbolic reads with concrete bindings
gcc/analyzer/ChangeLog:
	* store.cc (binding_cluster::get_any_binding): Make symbolic reads
	from a cluster with concrete bindings return unknown.

gcc/testsuite/ChangeLog:
	* gcc.dg/analyzer/symbolic-7.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-06-18 13:24:19 -04:00
Patrick Palka 83faf7eacd libstdc++: Implement LWG 3557 change to convertible_to
libstdc++-v3/ChangeLog:

	* include/std/concepts (convertible_to): Just use declval as per
	LWG 3557.
2021-06-18 11:51:33 -04:00
David Malcolm 1aff29d426 analyzer: add region_model_manager::get_or_create_int_cst
gcc/analyzer/ChangeLog:
	* region-model-manager.cc
	(region_model_manager::get_or_create_int_cst): New.
	(region_model_manager::maybe_undo_optimize_bit_field_compare): Use
	it to simplify away a local tree.
	* region-model.cc (region_model::on_setjmp): Likewise.
	(region_model::on_longjmp): Likewise.
	* region-model.h (region_model_manager::get_or_create_int_cst):
	New decl.
	* store.cc (binding_cluster::zero_fill_region): Use it to simplify
	away a local tree.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-06-18 11:19:30 -04:00
David Malcolm 86606d2ab7 analyzer: refactor custom_event, introducing precanned_custom_event class
I have followup work where a custom event's description would be better
handled via a vfunc rather that a precanned string, hence this
refactoring to make it easy to add custom_event subclasses.

gcc/analyzer/ChangeLog:
	* checker-path.cc (class custom_event): Make abstract to allow for
	custom vfuncs, splitting existing implementation into...
	(class precanned_custom_event): New subclass.
	(custom_event::get_desc): Move to...
	(precanned_custom_event::get_desc): ...subclass.
	* checker-path.h (class custom_event): Make abstract to allow for
	custom vfuncs, splitting existing implementation into...
	(class precanned_custom_event): New subclass.
	* diagnostic-manager.cc (diagnostic_manager::add_events_for_eedge):
	Use precanned_custom_event.
	* engine.cc
	(stale_jmp_buf::maybe_add_custom_events_for_superedge): Likewise.
	* sm-signal.cc (signal_delivery_edge_info_t::add_events_to_path):
	Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
2021-06-18 11:18:10 -04:00
Jonathan Wakely 0532452dcd libstdc++: Replace incorrect static assertion in std::reduce [PR95833]
The standard does not require the iterator's value type to be
convertible to the result type, it only requires that the result of
dereferencing the iterator can be passed to the binary function.

libstdc++-v3/ChangeLog:

	PR libstdc++/95833
	* include/std/numeric (reduce(Iter, Iter, T, BinaryOp)): Replace
	incorrect static_assert with ones matching the 'Mandates'
	conditions in the standard.
	* testsuite/26_numerics/reduce/95833.cc: New test.
2021-06-18 14:46:58 +01:00
Srinath Parvathaneni f58d03b5df arm: Fix multilib mapping for CDE extensions [PR100856].
On passing +cdecp[0-7] extension to the -march string in command line options,
multilib linking is failing as mentioned in PR100856. This patch fixes this issue by
generating a separate canonical string by removing compiler options which are not
required for multilib linking from march string and assign the new string to mlibarch
option. This mlibarch string is used for multilib comparison.

gcc/ChangeLog:

2021-06-10  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/100856
	* common/config/arm/arm-common.c (arm_canon_arch_option_1): New function
	derived from arm_canon_arch.
	(arm_canon_arch_option): Call it.
	(arm_canon_arch_multilib_option): New function.
	* config/arm/arm-cpus.in (IGNORE_FOR_MULTILIB): New fgroup.
	* config/arm/arm.h (arm_canon_arch_multilib_option): New prototype.
	(CANON_ARCH_MULTILIB_SPEC_FUNCTION): New macro.
	(MULTILIB_ARCH_CANONICAL_SPECS): New macro.
	(DRIVER_SELF_SPECS): Add MULTILIB_ARCH_CANONICAL_SPECS.
	* config/arm/arm.opt (mlibarch): New option.
	* config/arm/t-rmprofile (MULTILIB_MATCHES): For armv8*-m, replace use
	of march on RHS with mlibarch.

gcc/testsuite/ChangeLog:

2021-06-10  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

	PR target/100856
	* gcc.target/arm/acle/pr100856.c: New test.
	* gcc.target/arm/multilib.exp: Add tests for cde options.
2021-06-18 13:22:02 +01:00
Marcel Vollweiler cfa1f8226f gcc/configure.ac: fix register issue for global_load assembler functions
gcc/ChangeLog:

	* config.in: Regenerate.
	* config/gcn/gcn.c (print_operand_address): Fix for global_load assembler
	functions.
	* configure: Regenerate.
	* configure.ac: Fix for global_load assembler functions.
2021-06-18 04:57:25 -07:00
Richard Biener 17a4bee01c tree-optimization/101112 - fix pattern stmt def lookup in SLP reassoc
This fixes the lookup of a pattern stmt def operand.

2021-06-18  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/101112
	* tree-vect-slp.c (vect_slp_linearize_chain): Fix condition
	to lookup a pattern stmt def.
2021-06-18 13:43:21 +02:00
Jonathan Wakely 92edc4a768 libstdc++: Suppress -Wstringop-overread warning in test
When compiled with -m32 -O2 -D_GLIBCXX_USE_CXX11_ABI=0 we get a warning
for 21_strings/basic_string/cons/char/1.cc:

bits/char_traits.h:409:56: warning: ‘void* __builtin_memcpy(void*, const void*, unsigned int)’ reading 1073741821 bytes from a region of size 19 [-Wstringop-overread]

The warning is legitimate, even if that line cannot be reached because
we throw std::length_error before getting there. Since the invalid
length is deliberate (and mentioned in a comment) just suppress the
warning, so that the test can verify we get the exception.

Also remove an unused typedef that produces another warning.

libstdc++-v3/ChangeLog:

	* testsuite/21_strings/basic_string/cons/char/1.cc: Use
	diagnostic pragma to suppress -Wstringop-overread error.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
2021-06-18 11:15:28 +01:00
Jakub Jelinek 76e990fd21 stor-layout: Don't create DECL_BIT_FIELD_REPRESENTATIVE for QUAL_UNION_TYPE [PR101062]
> The following patch does create them, but treats all such bitfields as if
> they were in a structure where the particular bitfield is the only field.

While the patch passed bootstrap/regtest on the trunk, when trying to
backport it to 11 branch the bootstrap failed with
atree.ads:3844:34: size for "Node_Record" too small
errors.  Turns out the error is not about size being too small, but actually
about size being non-constant, and comes from:
 /* In a FIELD_DECL of a RECORD_TYPE, this is a pointer to the storage
    representative FIELD_DECL.  */
 #define DECL_BIT_FIELD_REPRESENTATIVE(NODE) \
   (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)

 /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
    if nonzero, indicates that the field occupies the type.  */
  #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
so by setting up DECL_BIT_FIELD_REPRESENTATIVE in QUAL_UNION_TYPE we
actually set or modify DECL_QUALIFIER and then construct size as COND_EXPRs
with those bit field representatives (e.g. with array type) as conditions
which doesn't fold into constant.

The following patch fixes it by not creating DECL_BIT_FIELD_REPRESENTATIVEs
for QUAL_UNION_TYPE as there is nowhere to store them,

Shall we change tree.h to document that DECL_BIT_FIELD_REPRESENTATIVE
is valid also on UNION_TYPE?
I see:
tree-ssa-alias.c-  if (TREE_CODE (type1) == RECORD_TYPE
tree-ssa-alias.c:      && DECL_BIT_FIELD_REPRESENTATIVE (field1))
tree-ssa-alias.c:    field1 = DECL_BIT_FIELD_REPRESENTATIVE (field1);
tree-ssa-alias.c-  if (TREE_CODE (type2) == RECORD_TYPE
tree-ssa-alias.c:      && DECL_BIT_FIELD_REPRESENTATIVE (field2))
tree-ssa-alias.c:    field2 = DECL_BIT_FIELD_REPRESENTATIVE (field2);
Shall we change that to || == UNION_TYPE or do we assume all fields
are overlapping in a UNION_TYPE already?
At other spots (asan, ubsan, expr.c) it is unclear what will happen
if they see a QUAL_UNION_TYPE with a DECL_QUALIFIER (or does the Ada FE
lower that somehow)?

2021-06-18  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/101062
	* stor-layout.c (finish_bitfield_layout): Don't add bitfield
	representatives in QUAL_UNION_TYPE.
2021-06-18 11:20:40 +02:00
Gary Dismukes ba71587184 [Ada] Additional error checking on index constraints with fixed-lower-bound ranges
gcc/ada/

	* sem_ch3.adb (Constrain_Array): Add error checking for
	fixed-lower-bound and constrained index ranges applied
	inappropriately on subtypes of unconstrained and
	fixed-lower-bound array types.
	(Constrain_Index): Correct and refine comment related to
	fixed-lower-bound index ranges.
2021-06-18 04:36:54 -04:00
Bob Duff 161e220201 [Ada] Minor comment cleanups
gcc/ada/

	* gen_il-gen.adb: Improve comments.
	* snames.ads-tmpl (Convention_Id): Remove "--  Plenty of space
	for expansion", because that's irrelevant now that we are no
	longer laying out node fields by hand.
2021-06-18 04:36:54 -04:00
Piotr Trojanek b3fa853aba [Ada] Fix detection of overlapping slices indexed by characters
gcc/ada/

	* sem_util.adb (Denotes_Same_Object): Handle character literals
	just like integer literals.
2021-06-18 04:36:54 -04:00
Piotr Trojanek cbe87f4582 [Ada] Fix detection of overlapping actuals with renamings
gcc/ada/

	* sem_util.adb (Denotes_Same_Object): Explicitly test for node
	kinds being the same; deal with renamings one-by-one; adjust
	numbers in references to the Ada RM.
2021-06-18 04:36:54 -04:00
Bob Duff ca5cdc9053 [Ada] Make "gcc -gnatDGL" handle unterminated last lines properly
gcc/ada/

	* sprint.adb (Write_Source_Line): Check for EOF in
	Line_Terminator loop.  Note that when a source file is read in,
	an EOF character is added to the end.
2021-06-18 04:36:53 -04:00
Piotr Trojanek f86c2f9c8e [Ada] Reuse Package_Specification in Is_Incomplete_Or_Private_Type
gcc/ada/

	* sem_aux.adb (Package_Specification): Add assertions to confirm
	the kind of the of parameter and returned node.
	* sem_ch12.adb (Remove_Parent): Reorder conditions; this change
	appears to be semantically neutral, but is enough to avoid the
	problematic call to Package_Specification.
	* sem_util.adb (Is_Incomplete_Or_Private_Type): Replace loop
	with a call to Package_Specification.
2021-06-18 04:36:53 -04:00
Bob Duff a34ce7c5df [Ada] Avoid passing Enum_Lit'Size to the back end
gcc/ada/

	* sem_attr.adb (Eval_Attribute): For Enum_Lit'Size, use
	Enum_Type'Object_Size.
2021-06-18 04:36:53 -04:00
Olivier Hainque 548280b996 [Ada] Fix inaccuracies in signal handler trampoline for aarch64-vxworks
gcc/ada/

	* sigtramp-vxworks-target.inc (__aarch64__): Sync
	REGNO_PC_OFFSET with the back-end DWARF_ALT_FRAME_RETURN_COLUMN.
	In CFI_COMMON_REGS, leave r18 alone, VxWorks private.
2021-06-18 04:36:52 -04:00
Javier Miranda c37c13e15e [Ada] Ada2020: AI12-0195 overriding class-wide pre/post conditions
gcc/ada/

	* contracts.adb (Process_Spec_Postconditions): Add missing
	support for aliased subprograms and handle wrappers of
	class-wide pre/post conditions.
	(Process_Inherited_Preconditions): Add missing support for
	aliased subprograms and handle wrappers of class-wide pre/post
	conditions.
	* einfo.ads (Class_Wide_Clone): Fix typo.
	(Is_Class_Wide_Clone): Removed since it is not referenced.
	(Is_Wrapper): Documenting new flag.
	(LSP_Subprogram): Documenting new attribute.
	* exp_ch3.adb (Make_Controlling_Function_Wrappers): Decorate
	wrapper as Is_Wrapper and adjust call to
	Override_Dispatching_Operation.
	* freeze.adb (Build_Inherited_Condition_Pragmas): Fix typo in
	documentation.
	(Check_Inherited_Conditions): Handle LSP wrappers; ensure
	correct decoration of LSP wrappers.
	* gen_il-fields.ads (Is_Class_Wide_Clone): Removed.
	(Is_Wrapper): Added.
	(LSP_Subprogram): Added.
	* gen_il-gen-gen_entities.adb (Is_Class_Wide_Clone): Removed.
	(Is_Wrapper): Added.
	(LSP_Subprogram): Added.
	* gen_il-internals.adb (Image): Adding uppercase image of
	LSP_Subprogram.
	* sem_ch6.adb (New_Overloaded_Entity): Fix decoration of LSP
	wrappers.
	* sem_disp.ads (Override_Dispatching_Operation): Remove
	parameter Is_Wrapper; no longer needed.
	* sem_disp.adb (Check_Dispatching_Operation): Adjust assertion.
	(Override_Dispatching_Operation): Remove parameter Is_Wrapper;
	no longer needed.
	* treepr.adb (Image): Adding uppercase image of LSP_Subprogram.
2021-06-18 04:36:52 -04:00
Arnaud Charlet 4edcee5b2b [Ada] Premature freezing of types
gcc/ada/

	* exp_ch4.adb (Expand_N_Quantified_Expression): Ensure the type
	of the name of a "for of" loop is frozen.
	* exp_disp.adb (Check_Premature_Freezing): Complete condition to
	take into account a private type completed by another private
	type now that the freezing rule are better implemented.
	* freeze.adb (Freeze_Entity.Freeze_Profile): Do not perform an
	early freeze on types if not in the proper scope. Special case
	expression functions that requires access to the dispatch table.
	(Should_Freeze_Type): New.
	* sem_ch13.adb (Resolve_Aspect_Expressions): Prevent assert
	failure in case of an invalid tree (previous errors detected).
	* sem_res.adb (Resolve): Remove kludge related to entities
	causing incorrect premature freezing.
	* sem_util.adb (Ensure_Minimum_Decoration): Add protection
	against non base types.
2021-06-18 04:36:52 -04:00
Gary Dismukes 33a3b5f3a5 [Ada] Missing check for assigning too-large array to fixed-lower-bound object
gcc/ada/

	* sem_ch3.adb (Constrain_Index): Set the High_Bound of a
	fixed-lower-bound subtype's range to T (the subtype of the FLB
	index being constrained) rather than Base_Type (T).
2021-06-18 04:36:51 -04:00
Bob Duff 9324e07dbd [Ada] Remove AAMP from compiler sources
gcc/ada/

	* ada_get_targ.adb, aspects.ads, checks.adb, cstand.adb,
	einfo.ads, exp_attr.adb, freeze.adb, get_targ.adb,
	libgnat/a-textio.ads, libgnat/g-memdum.ads,
	libgnat/s-scaval__128.adb, libgnat/s-scaval.adb, make.adb,
	osint.ads, par-prag.adb, sem_ch13.adb, sem_prag.adb,
	sem_prag.ads, set_targ.adb, set_targ.ads, snames.ads-tmpl,
	targparm.ads, types.ads: Remove AAMP-specific code.
	* switch.ads: Minor reformatting.
	* gen_il-fields.ads, gen_il-gen.adb,
	gen_il-gen-gen_entities.adb, gen_il-types.ads, einfo-utils.adb,
	einfo-utils.ads: Package Types now contains "type Float_Rep_Kind
	is (IEEE_Binary);", which used to also have an enumeral AAMP.
	Gen_IL can't handle fields of this type, which would be zero
	sized. Therefore, we move the Float_Rep field into Einfo.Utils
	as a synthesized attribute. (We do not delete the field
	altogether, in case we want new floating-point representations
	in the future.)
	* doc/gnat_rm/implementation_defined_pragmas.rst,
	doc/gnat_rm/implementation_defined_aspects.rst,
	doc/gnat_ugn/building_executable_programs_with_gnat.rst,
	doc/gnat_ugn/the_gnat_compilation_model.rst: Remove
	AAMP-specific documentation.
	* gnat_rm.texi, gnat_ugn.texi: Regenerate.
2021-06-18 04:36:51 -04:00
Gary Dismukes f44441d80f [Ada] Error issued on string literal assigned to fixed-lower-bound array
gcc/ada/

	* exp_util.adb (Expand_Sliding_Conversion): Move test of
	Is_Fixed_Lower_Bound_Subtype to an assertion. Exclude string
	literals from sliding expansion.
2021-06-18 04:36:51 -04:00