Commit Graph

186632 Commits

Author SHA1 Message Date
Arnaud Charlet
9e76a063f1 [Ada] Minor code cleanup
gcc/ada/

	* libgnat/g-debpoo.adb (Code_Address_For_Allocate_End): Default
	Initialize.
2021-07-07 16:23:17 +00:00
Arnaud Charlet
347d939028 [Ada] Code cleanups in System.Atomic_Counters
gcc/ada/

	* libgnat/s-atocou.ads, libgnat/s-atocou__builtin.adb: Code
	cleanups.
2021-07-07 16:23:17 +00:00
Gary Dismukes
14212dc422 [Ada] Implement new legality checks specified by AI12-0412
gcc/ada/

	* freeze.adb (Check_Inherited_Conditions): Setting of Ekind,
	LSP_Subprogram, and Is_Wrapper needs to happen for null
	procedures as well as other wrapper cases, so the code is moved
	from the else part in front of the if statement.  (Fixes a
	latent bug encountered while working on this set of changes.)
	* sem_attr.adb (Resolve_Attribute): Report an error for the case
	of an Access attribute applied to a primitive of an abstract
	type when the primitive has any nonstatic Pre'Class or
	Post'Class expressions.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Report an error for
	the case of a actual subprogram associated with a nonabstract
	formal subprogram when the actual is a primitive of an abstract
	type and the primitive has any nonstatic Pre'Class or Post'Class
	expressions.
	* sem_disp.adb (Check_Dispatching_Context): Remove special
	testing for null procedures, and replace it with a relaxed test
	that avoids getting an error about illegal calls to abstract
	subprograms in cases where RM 6.1.1(7/5) applies in
	Pre/Post'Class aspects. Also, remove special test for
	Postcondition, which seems to be unnecessary, update associated
	comments, and fix a typo in one comment.
	(Check_Dispatching_Call): Remove an unneeded return statement,
	and report an error for the case of a nondispatching call to a
	nonabstract subprogram of an abstract type where the subprogram
	has nonstatic Pre/Post'Class aspects.
	* sem_util.ads
	(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function.
	(In_Pre_Post_Condition): Add a flag formal Class_Wide_Only,
	defaulted to False, for indicating whether the function should
	only test for the node being within class-wide pre- and
	postconditions.
	* sem_util.adb
	(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function
	to determine whether a subprogram is a primitive of an abstract
	type where the primitive has class-wide Pre/Post'Class aspects
	specified with nonstatic expressions.
	(In_Pre_Post_Condition): Extend testing to account for the new
	formal Class_Wide_Only.
2021-07-07 16:23:17 +00:00
Piotr Trojanek
e5be1e443c [Ada] Fix location of errors about volatile compatibility
gcc/ada/

	* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Errors
	emitted via Check_Volatility_Compatibility are now emitted at
	Actual, just like other errors emitted by
	Check_Shared_Variable_Control_Aspects.
2021-07-07 16:23:16 +00:00
Piotr Trojanek
768f69696a [Ada] Use bounded string buffer in Get_Unit_Name
gcc/ada/

	* uname.adb (Get_Unit_Name): Simplify with a bounded string
	buffer; also, this addresses a ??? comment about the max length
	being exceeded.
2021-07-07 16:23:16 +00:00
Piotr Trojanek
d1d2bbcc85 [Ada] Replace obsolete calls that use global name buffer
gcc/ada/

	* uname.adb (Get_Body_Name, Get_Parent_Body_Name,
	Get_Parent_Spec_Name, Get_Spec_Name, Is_Child_Name,
	Is_Body_Name, Is_Spec_Name, Name_To_Unit_Name): Use a local
	instead of the global buffer.
2021-07-07 16:23:16 +00:00
Bob Duff
a547eea266 [Ada] Fix bugs in Value_Size clauses and refactor
gcc/ada/

	* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Combine
	processing of Size and Value_Size clauses. Ensure that
	Value_Size is treated the same as Size, in the cases where both
	are allowed (i.e. the prefix denotes a first subtype).  Misc
	cleanup.
	* einfo-utils.adb (Init_Size): Add assertions.
	(Size_Clause): Return a Value_Size clause if present, instead of
	just looking for a Size clause.
	* einfo.ads (Has_Size_Clause, Size_Clause): Change documentation
	to include Value_Size.
	* sem_ch13.ads, layout.ads, layout.adb: Comment modifications.
2021-07-07 16:23:15 +00:00
Steve Baird
2d71668e64 [Ada] Improve interactions between DSA and Put_Image routines for tagged types
gcc/ada/

	* exp_dist.adb (Add_RACW_Primitive_Declarations_And_Bodies): Add
	TSS_Put_Image to list of predefined primitives that need special
	treatment.
	(Build_General_Calling_Stubs, Build_Subprogram_Receiving_Stubs):
	Remove previous hack for dealing with TSS_Put_Image procedures.
2021-07-07 16:23:15 +00:00
Dmitriy Anisimkov
4fa7097a14 [Ada] Timeout correction on Get_Socket_Option
gcc/ada/

	* libgnat/g-socket.adb (Get_Socket_Option): Add 500ms only when
	Minus_500ms_Windows_Timeout is True.
	(Set_Socket_Option): Use "* 1000" instead of "/ 0.001" to
	convert to milliseconds.
2021-07-07 16:23:15 +00:00
Bob Duff
ebef9784ef [Ada] Unchecked_Convert_To: set Parent
gcc/ada/

	* tbuild.adb (Unchecked_Convert_To): Set the Parent of the new
	node to the Parent of the old node.
	* tbuild.ads (Unchecked_Convert_To): Document differences
	between Convert_To and Unchecked_Convert_To. The previous
	documentation claimed they are identical except for the
	uncheckedness of the conversion.
2021-07-07 16:23:15 +00:00
Yannick Moy
a7f66404a6 [Ada] Simplify handling of sure errors in GNATprove mode
gcc/ada/

	* checks.adb (Apply_Scalar_Range_Check): Remove special case for
	GNATprove mode.
	* sem_res.adb (Resolve_Arithmetic_Op): Same.
	* sem_util.adb (Apply_Compile_Time_Constraint_Error): Same.
2021-07-07 16:23:14 +00:00
Piotr Trojanek
f78c17d267 [Ada] Reduce scope of local variables
gcc/ada/

	* sem_ch6.adb (Check_For_Primitive_Subprogram): Move
	declarations of local variables after nested subprogram bodies.
2021-07-07 16:23:14 +00:00
Piotr Trojanek
a7bb69067a [Ada] Simplify code by reusing List_Length
gcc/ada/

	* exp_disp.adb (CPP_Num_Prims): Reuse List_Length.
2021-07-07 16:23:14 +00:00
Piotr Trojanek
131c9affbd [Ada] Replace low-level membership tests with Is_Private_Type
gcc/ada/

	* exp_ch3.adb, exp_ch6.adb, sem_ch6.adb: Replace Ekind
	membership test in Private_Kind with a call to Is_Private_Type.
2021-07-07 16:23:13 +00:00
Bob Duff
19456797d1 [Ada] Linker_Section_Pragma cleanup
gcc/ada/

	* gen_il-gen-gen_entities.adb: Remove Linker_Section_Pragma
	field from Record_Field_Kind.  Minor comment improvement.
2021-07-07 16:23:13 +00:00
Yannick Moy
d557a5f9ce [Ada] Fix precondition of Cot for code analyzers
gcc/ada/

	* libgnat/a-ngelfu.ads (Cot): Fix precondition.
2021-07-07 16:23:13 +00:00
Piotr Trojanek
6dcf89443d [Ada] Replace chopped string copy with renaming
gcc/ada/

	* par.adb (Par): A local Name variable is now a renaming of a
	constant slice.
2021-07-07 16:23:12 +00:00
Piotr Trojanek
0543560936 [Ada] Simplify handling of Generate_Code flag for compilation units
gcc/ada/

	* gnat1drv.adb (Gnat1drv): Remove flagging of main unit and its
	corresponding spec as requiring code generation; now the flags
	are set much earlier.
	* lib-load.adb (Load_Main_Source): Set Generate_Code flag on the
	main unit source.
	(Make_Instance_Unit): Copy Generate_Code flag from the main unit
	to instance units.
	* lib-writ.adb (Write_ALI): Remove redundant condition;
	Generate_Code flag is always set for the main unit.
	* par-load.adb (Load): Set Generate_Code flag on the main unit's
	corresponding spec, if any.
2021-07-07 16:23:12 +00:00
Dmitriy Anisimkov
f3ff72939e [Ada] Add socket options to control keepalive on TCP connection
gcc/ada/

	* libgnat/g-socket.ads (Option_Name): Add Keep_Alive_Count,
	Keep_Alive_Idle, and Keep_Alive_Interval items to enumeration.
	(Option_Type): Add Keep_Alive_Count, Keep_Alive_Idle, and
	Keep_Alive_Interval alternatives to the case of discriminated
	record.
	* libgnat/g-socket.adb (Options): Add Keep_Alive_Count,
	Keep_Alive_Idle, and Keep_Alive_Interval to items enumerator to
	OS constant converter.
	(Set_Socket_Option): Process Keep_Alive_Count, Keep_Alive_Idle,
	and Keep_Alive_Interval socket options.
	(Get_Socket_Option): Idem.
2021-07-07 16:23:12 +00:00
Piotr Trojanek
f8776eeb36 [Ada] Tune discovery of No_Elaboration_Code restriction
gcc/ada/

	* lib-writ.adb (Write_ALI): Exit from loop after seeing first
	unit that violates No_Elaboration_Code restriction.
2021-07-07 16:23:12 +00:00
Piotr Trojanek
6feab95cbc [Ada] Simplify iteration over pending instantiations
gcc/ada/

	* inline.adb (Instantiate_Bodies): Fix white in declaration.
	(Remove_Dead_Instance): Change iteration from WHILE to FOR.
2021-07-07 16:23:11 +00:00
Bob Duff
738a0e8dd4 [Ada] Transient scope cleanup
gcc/ada/

	* checks.adb, exp_attr.adb, exp_ch4.adb, exp_ch6.adb,
	exp_ch9.adb, exp_disp.adb, exp_util.adb, inline.adb,
	sem_res.adb: Change all calls to Make_Unchecked_Type_Conversion
	to call Unchecked_Convert_To instead. This involves removing
	New_Occurrence_Of on the first parameter, because
	Unchecked_Convert_To expects a type entity, rather than the name
	of one. Also, removed calls to Relocate_Node, because
	Unchecked_Convert_To takes care of that.
	* sinfo.ads: Change comment to be worded more firmly.
2021-07-07 16:23:11 +00:00
Steve Baird
0dbe0e11eb [Ada] Unsynchronized access to a Boolean in tasking state
gcc/ada/

	* libgnarl/s-tassta.adb (Free_Task): Acquire the Task_Lock
	before, rather than after, querying the task's Terminated flag.
	Add a corresponding Task_Unlock call.
2021-07-07 16:23:10 +00:00
Martin Sebor
06357071d0 aarch64: Remove a vestigial %K [PR101363]
gcc/ChangeLog:
	PR target/101363
	* config/aarch64/aarch64.c (aarch64_simd_lane_bounds): Remove
	a stray %K from error_at() missed in r12-2088.
2021-07-07 08:56:19 -06:00
Christophe Lyon
e8073c0453 testsuite: gcc.dg/debug/btf/btf-bitfields-3.c remove -fno-short-enums PR debug/101321
After r12-2094, -fno-short-enums is non longer necessary.

2021-07-07  Christophe Lyon  <christophe.lyon@foss.st.com>

	PR debug/101321
	gcc/testsuite/
	* gcc.dg/debug/btf/btf-bitfields-3.c: Remove -fno-short-enums.
2021-07-07 12:44:36 +00:00
Richard Biener
005f31a037 tree-optimization/34195 - testcase for fixed vectorization
This adds a testcase for an old fixed PR.

2021-07-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/34195
	* gcc.dg/vect/pr34195.c: New testcase.
2021-07-07 13:48:26 +02:00
Richard Biener
9f34b780b0 tree-optimization/99728 - improve LIM for loops with aggregate copies
This improves LIM by recording aggregate copies for disambiguation
purposes instead of as UNANALYZABLE_MEM which will prevent any
invariant or store motion across it.  This allows four of the six
references in the loop of the testcase to be promoted.

2021-07-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/99728
	* tree-ssa-loop-im.c (gather_mem_refs_stmt): Record
	aggregate copies.
	(mem_refs_may_alias_p): Add assert we handled aggregate
	copies elsewhere.
	(sm_seq_valid_bb): Give up when running into aggregate copies.
	(ref_indep_loop_p): Handle aggregate copies as never
	being invariant themselves but allow other refs to be
	disambiguated against them.
	(can_sm_ref_p): Do not try to apply store-motion to aggregate
	copies.

	* g++.dg/opt/pr99728.C: New testcase.
2021-07-07 13:48:26 +02:00
liuhongt
98bfd845e9 Add avx512 tests for MADDSUB and FMSUBADD SLP vectorization patterns.
gcc/testsuite/ChangeLog:

	* gcc.target/i386/avx512f-vect-fmaddsubXXXpd.c: New test.
	* gcc.target/i386/avx512f-vect-fmaddsubXXXps.c: New test.
	* gcc.target/i386/avx512f-vect-fmsubaddXXXpd.c: New test.
	* gcc.target/i386/avx512f-vect-fmsubaddXXXps.c: New test.
2021-07-07 15:29:17 +08:00
GCC Administrator
6fba0eea8d Daily bump. 2021-07-07 00:17:12 +00:00
Indu Bhagat
d9e9532bb3 BTF testsuite: Remove explicit check on btm_type
The value of btm_type is the BTF type ID of the referred type.  The order in
which the BTF types are added can change across platforms and also as the code
evolves, hence changing the BTF type ID. As there is no direct and portable
method of testing that a BTF type refers to another BTF type of a specific
kind, remove the explicit check on btm_type.

This patch adjusts the testcase without affecting the test coverage as other
testcases already have similar constructs. It also fixes a subset of failures
as seen on Darwin.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/testsuite/ChangeLog:

	PR debug/101283
	* gcc.dg/debug/btf/btf-bitfields-3.c: Remove the check on btm_type.
2021-07-06 16:13:29 -07:00
Indu Bhagat
97bcacfb5a CTF testsuite: Remove explicit check on ctv_typeidx
The value of ctv_typeidx is the CTF type ID of the data type of the associated
variable.  The order in which the CTF types are added can change across
platforms and also as the code evolves, hence changing the CTF type ID. As
there is no direct and portable method of testing that the data type of a CTF
variable is of a specific kind, remove the check on ctv_typeidx.

This also fixes a subset of failures as seen on Darwin.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/testsuite/ChangeLog:

	PR debug/101283
	* gcc.dg/debug/ctf/ctf-attr-mode-1.c: Remove the check for ctv_typeidx.
2021-07-06 16:02:38 -07:00
Martin Sebor
e8db5f70f2 Add test for [PR55881].
PR c++/55881

gcc/testsuite/ChangeLog:

	* g++.dg/warn/uninit-pr55881.C: New test.
2021-07-06 15:58:02 -06:00
Martin Sebor
ee9a0e9315 Add test for [PR86650].
PR tree-optimization/86650 - -Warray-bounds missing inlining context

gcc/testsuite/ChangeLog:
	PR tree-optimization/86650
	* gcc.dg/Warray-bounds-76.c: New test.
2021-07-06 15:30:49 -06:00
Indu Bhagat
151b423a82 dwarf2ctf: the unit of sou field location is bits [PR101283]
If the value of the DW_AT_data_member_location attribute is constant, the
associated unit is bytes. This patch amends incorrect behaviour which was being
exercised with -gdwarf-2. This caused some of the failures as noted in PR
debug/101283 (specifically the BTF tests involving btm_offset).

The testcase ctf-struct-array-2.c was erroneously checking for the value of
ctm_offset in number of bytes.

The patch fixes the calculation of the field location value for a struct member
in dwarf2ctf and adjusts the testcase. This patch also fixes some of the
failing tests as noted in PR debug/101283.

2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

gcc/ChangeLog:

	PR debug/101283
	* dwarf2ctf.c (ctf_get_AT_data_member_location): Multiply by 8 to get
	number of bits.

gcc/testsuite/ChangeLog:

	PR debug/101283
	* gcc.dg/debug/ctf/ctf-struct-array-2.c: Adjust the value in the testcase.
2021-07-06 14:07:39 -07:00
Martin Sebor
4f6e181181 Remove support for %G and %K.
gcc/c-family/ChangeLog:

	* c-format.c (gcc_tdiag_char_table): Remove support for %G and %K.
	 (gcc_cdiag_char_table): Same.
	 (gcc_cxxdiag_char_table): Same.

gcc/c/ChangeLog:

	* c-objc-common.c (c_tree_printer): Remove support for %G and %K.

gcc/cp/ChangeLog:

	* error.c (cp_printer):  Remove support for %G and %K.

gcc/ChangeLog:

	* gimple-pretty-print.c (percent_G_format): Remove.
	* tree-diagnostic.c (default_tree_printer): Remove calls.
	* tree-pretty-print.c (percent_K_format): Remove.
	* tree-pretty-print.h (percent_K_format): Remove.

gcc/testsuite/ChangeLog:

	* gcc.dg/format/gcc_diag-10.c: Update expected warnings.
	* gcc.dg/plugin/diagnostic_plugin_test_inlining.c: Remove %G.
2021-07-06 14:14:25 -06:00
Martin Sebor
62e43587ef Improve warning suppression for inlined functions.
gcc/ChangeLog:

	* config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin):
	Remove %K and use error_at.
	(aarch64_expand_fcmla_builtin): Same.
	(aarch64_expand_builtin_tme): Same.
	(aarch64_expand_builtin_memtag): Same.
	* config/arm/arm-builtins.c (arm_expand_acle_builtin): Same.
	(arm_expand_builtin): Same.
	* config/arm/arm.c (bounds_check): Same.
2021-07-06 13:45:54 -06:00
Martin Sebor
6d3bab5d5a Improve warning suppression for inlined functions.
Resolves:
PR middle-end/98871 - Cannot silence -Wmaybe-uninitialized at declaration site
PR middle-end/98512 - #pragma GCC diagnostic ignored ineffective in conjunction with alias attribute

gcc/ChangeLog:

	* builtins.c (warn_string_no_nul): Remove %G.
	(maybe_warn_for_bound): Same.
	(warn_for_access): Same.
	(check_access): Same.
	(check_strncat_sizes): Same.
	(expand_builtin_strncat): Same.
	(expand_builtin_strncmp): Same.
	(expand_builtin): Same.
	(expand_builtin_object_size): Same.
	(warn_dealloc_offset): Same.
	(maybe_emit_free_warning): Same.
	* calls.c (maybe_warn_alloc_args_overflow): Same.
	(maybe_warn_nonstring_arg): Same.
	(maybe_warn_rdwr_sizes): Same.
	* expr.c (expand_expr_real_1): Remove %K.
	* gimple-fold.c (gimple_fold_builtin_strncpy): Remove %G.
	(gimple_fold_builtin_strncat): Same.
	* gimple-ssa-sprintf.c (format_directive): Same.
	(handle_printf_call): Same.
	* gimple-ssa-warn-alloca.c (pass_walloca::execute): Same.
	* gimple-ssa-warn-restrict.c (maybe_diag_overlap): Same.
	(maybe_diag_access_bounds): Same.  Call gimple_location.
	(check_bounds_or_overlap): Same.
	* trans-mem.c (ipa_tm_scan_irr_block): Remove %K.  Simplify.
	* tree-ssa-ccp.c (pass_post_ipa_warn::execute): Remove %G.
	* tree-ssa-strlen.c (maybe_warn_overflow): Same.
	(maybe_diag_stxncpy_trunc): Same.
	(handle_builtin_stxncpy_strncat): Same.
	(maybe_warn_pointless_strcmp): Same.
	* tree-ssa-uninit.c (maybe_warn_operand): Same.

gcc/testsuite/ChangeLog:

	* gcc.dg/Wobjsize-1.c: Prune expected output.
	* gcc.dg/Warray-bounds-71.c: New test.
	* gcc.dg/Warray-bounds-71.h: New test header.
	* gcc.dg/Warray-bounds-72.c: New test.
	* gcc.dg/Warray-bounds-73.c: New test.
	* gcc.dg/Warray-bounds-74.c: New test.
	* gcc.dg/Warray-bounds-75.c: New test.
	* gcc.dg/Wfree-nonheap-object-4.c: Adjust expected output.
	* gcc.dg/Wfree-nonheap-object-5.c: New test.
	* gcc.dg/Wfree-nonheap-object-6.c: New test.
	* gcc.dg/pragma-diag-10.c: New test.
	* gcc.dg/pragma-diag-9.c: New test.
	* gcc.dg/uninit-suppress_3.c: New test.
	* gcc.dg/pr79214.c: Xfail tests.
	* gcc.dg/tree-ssa/builtin-sprintf-warn-27.c: New test.
	* gcc.dg/format/c90-printf-1.c: Adjust expected output.
2021-07-06 13:43:11 -06:00
Clément Chigot
03b634c8e0 fixincludes: AIX socket.h.
Add more context to aix_externcpp1 selection to ensure
that the fix is correctly applied even in future AIX versions.

fixincludes/Changelog:
2021-07-01  Clément Chigot  <clement.chigot@atos.net>

	* inclhack.def (aix_externcpp1): Improve select regexp.
	* fixincl.x: Regenerate.
	* tests/base/sys/socket.h: Update.
2021-07-06 15:30:52 -04:00
Uros Bizjak
f65878178a i386: Add variable vec_set for 32bit vectors [PR97194]
To generate sane code a SSE4.1 variable PBLENDV instruction is needed.

Also enable variable vec_set through vec_setm_operand predicate
for TARGET_SSE4_1 instead of TARGET_AVX2.  ix86_expand_vector_init_duplicate
is able to emulate vpbroadcast{b,w} with pxor/pshufb.

2021-07-06  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/97194
	* config/i386/predicates.md (vec_setm_operand): Enable
	register_operand for TARGET_SSE4_1.
	* config/i386/mmx.md (vec_setv2hi): Use vec_setm_operand
	as operand 2 predicate.  Call ix86_expand_vector_set_var
	for non-constant index operand.
	(vec_setv4qi): Use vec_setm_mmx_operand as operand 2 predicate.
	Call ix86_expand_vector_set_var for non-constant index operand.

gcc/testsuite/

	PR target/97194
	* gcc.target/i386/sse4_1-vec-set-1a.c: New test.
	* gcc.target/i386/sse4_1-vec-set-2a.c: Ditto.
2021-07-06 19:28:35 +02:00
Gaius Mulley
6b096c1731 MAINTAINERS: Add myself for write after approval and DCO.
/
	* MAINTAINERS: Add myself for write after approval and DCO.

2021-07-06  Gaius Mulley  <gaius.mulley@southwales.ac.uk>

Signed-off-by: Gaius Mulley <gaius.mulley@southwales.ac.uk>
2021-07-06 16:51:23 +01:00
Jeff Law
73c49ff532 Use H8 nop moves as tst insns
gcc
	* config/h8300/jumpcall.md (*branch): When possible, generate
	the comparison in CCZN mode.
	* config/h8300/predicates.md (simple_memory_operand): Reject all
	auto-increment addressing modes.
2021-07-06 10:55:53 -04:00
Bob Duff
5db3ea9d74 [Ada] Initialize Current_Error_Node
gcc/ada/

	* atree.ads (Current_Error_Node): Initialize to Empty.
2021-07-06 14:46:59 +00:00
Steve Baird
09768159b3 [Ada] Enable Ada 2020 Put_Image and Image support for tagged types
gcc/ada/

	* exp_put_image.adb: Eliminate references to
	Debug_Flag_Underscore_Z.  Change the meaning of the function
	Enable_Put_Image. Previously, a result of False for a tagged
	type would mean that the type does not get a Put_Image (PI)
	routine at all. Now, it means that the type gets a PI routine
	with very abbreviated functionality (just a call to
	Unknown_Put_Image). This resolves problems in mixing code
	compiled with and without the -gnat2022 switch.
	* exp_ch3.adb: Enable_Put_Image no longer participates in
	determining whether a tagged type gets a Put_Image procedure.  A
	tagged type does not get a Put_Image procedure if the type
	Root_Buffer_Type is unavailable. This is needed to support cross
	targets where tagged types are supported but the type
	Root_Buffer_Type is not available.
	* exp_dist.adb: Add workarounds for some problems that arise
	when using the (obsolete?) Garlic implementation of the
	distributed systems annex with Ada 2022 constructs.
	* libgnat/a-sttebu.ads: Workaround a bootstrapping problem.
	Older compilers do not support raise expressions, so revise the
	the Pre'Class condition to meet this requirement without
	changing the condition's behavior at run time.
2021-07-06 14:46:59 +00:00
Eric Botcazou
4206000ac4 [Ada] Fix old typo in comment
gcc/ada/

	* repinfo-input.adb (JSON_Entity_Kind, Read_Variant_Part): Fix
	typo in comment.
2021-07-06 14:46:59 +00:00
Steve Baird
fb632ef567 [Ada] Implement missing constraint checks for default streaming operations
gcc/ada/

	* sem_ch5.adb (Analyze_Assignment): Add new nested function,
	Omit_Range_Check_For_Streaming, and make call to
	Apply_Scalar_Range_Check conditional on the result of this new
	function.
	* exp_attr.adb (Compile_Stream_Body_In_Scope): Eliminate Check
	parameter, update callers.  The new
	Omit_Range_Check_For_Streaming parameter takes the place of the
	old use of calling Insert_Action with Suppress => All_Checks,
	which was insufficiently precise (it did not allow suppressing
	checks for one component but not for another).
	(Expand_N_Attribute_Reference): Eliminate another "Suppress =>
	All_Checks" from an Insert_Action call, this one in generating
	the expansion of a T'Read attribute reference for a composite
	type T.
2021-07-06 14:46:59 +00:00
Ghjuvan Lacambre
8ff47b3f88 [Ada] Warn on statically known empty loop caused by constraint
gcc/ada/

	* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Check for
	empty loops caused by constraints.
2021-07-06 14:46:58 +00:00
Nicolas Roche
d8870b1f64 [Ada] Handle malformed command line on Win32
gcc/ada/

	* rtinit.c (skip_quoted_string): Handle malformed command line
	with no closing double quote.
	(skip_argument): Handle case in which a null character is
	encountered by skip_quote_string.
2021-07-06 14:46:58 +00:00
Piotr Trojanek
435e79cbe5 [Ada] Simplify code by removing local constant
gcc/ada/

	* uname.adb (Add_Node_Name): Replace local constant whose
	initial expression was evaluated even when unnecessary with just
	that expression that is evaluated at most once and only when
	needed.
2021-07-06 14:46:58 +00:00
Piotr Trojanek
b1c4989d17 [Ada] Replace a question mark comment with assertion
gcc/ada/

	* lib.adb (Remove_Unit): Replace defensive code with an
	assertion.
	* par-load.adb (Load): Address a question mark in the comment.
2021-07-06 14:46:58 +00:00
Piotr Trojanek
ddbe7338f1 [Ada] Simplify returning from Enclosing_Comp_Unit_Node
gcc/ada/

	* sem_util.adb (Enclosing_Comp_Unit_Node): When the loop exits
	the Current_Node is either an N_Compilation_Unit node or Empty,
	so simply return it without redundant checks.
2021-07-06 14:46:57 +00:00