Commit Graph

177455 Commits

Author SHA1 Message Date
Eric Botcazou
ba62193179 [Ada] Use uniform type resolution for membership tests
2020-06-15  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Set_Membership): Remove local variable.
	In the non-overloaded case, call Intersect_Types on the left
	operand and the first alternative to get the resolution type.
	But test the subtype of the left operand to give the warning.
2020-06-15 04:04:17 -04:00
Kito Cheng
82a3008e56 RISC-V: Suppress warning for signed and unsigned integer comparison.
gcc/ChangeLog:

	* config/riscv/riscv.c (riscv_gen_gpr_save_insn): Change type to
	unsigned for i.
	(riscv_gpr_save_operation_p): Change type to unsigned for i and
	len.
2020-06-15 11:55:11 +08:00
liuhongt
54cdb2f5a5 Optimize multiplication for V8QI,V16QI,V32QI under TARGET_AVX512BW.
2020-06-13   Hongtao Liu  <hongtao.liu@intel.com>

gcc/ChangeLog:
	PR target/95488
	* config/i386/i386-expand.c (ix86_expand_vecmul_qihi): New
	function.
	* config/i386/i386-protos.h (ix86_expand_vecmul_qihi): Declare.
	* config/i386/sse.md (mul<mode>3): Drop mask_name since
	there's no real simd int8 multiplication instruction with
	mask. Also optimize it under TARGET_AVX512BW.
	(mulv8qi3): New expander.

gcc/testsuite/ChangeLog:
	* gcc.target/i386/avx512bw-pr95488-1.c: New test.
	* gcc.target/i386/avx512bw-pr95488-2.c: Ditto.
	* gcc.target/i386/avx512vl-pr95488-1.c: Ditto.
	* gcc.target/i386/avx512vl-pr95488-2.c: Ditto.
2020-06-15 09:43:15 +08:00
GCC Administrator
0dcb572c08 Daily bump. 2020-06-15 00:16:21 +00:00
Thomas Koenig
3de12cc548 Avoid crash when global symbol table is empty with -fdump-fortran-global.
This just avoids a crash with -fdump-fortran-global when the
global symbol table is empty.  This is strictly a developer's
option, no user impact.

gcc/fortran/ChangeLog:

2020-06-14  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/42122
	* dump-parse-tree.c (gfc_dump_global_symbols):  If the symroot is
	empty, just output "empty".
2020-06-14 17:38:31 +02:00
Harald Anlauf
3ee9d82484 PR fortran/95088 - Buffer overflows with PDTs, submodules and long symbols
With PDTs (parameterized derived types) and submodules, name mangling
results in variably long internal symbols.  Instead of using a fixed-size
intermediate buffer, which is actually not really needed, just use a
pointer to strings.

2020-06-14  Harald Anlauf  <anlauf@gmx.de>

gcc/fortran/
	PR fortran/95088
	* class.c (get_unique_type_string): Replace use of fixed size
	buffer by internally passing a pointer to strings.
2020-06-14 16:12:47 +02:00
Thomas Koenig
4644e8f15f Always use locations from get and put arguments for error messages.
A simple and obvios patch - the error location was taken
from a variable that was not initialized for optional
variables.

gcc/fortran/ChangeLog:

	* check.c (gfc_check_random_seed): Always use locations
	from get and put arguments for error messages.

gcc/testsuite/ChangeLog:

	* gfortran.dg/random_seed_4.f90: New test.
2020-06-14 14:39:03 +02:00
Thomas Koenig
1af22e4555 When avoiding double deallocation, look at namespace, expression and component.
Our finalization handling is a mess.  Really, we should get to try and get
this fixed for gcc 11.

In the meantime, here is a patch which fixes a regression I introduced
when fixing a regression with a memory leak.  The important thing
here is to realize that we do not need to finalize (and deallocate)
multiple times for the same expression and the same component
in the same namespace.  It might cause code size regressions, but
better big code than wrong code...

gcc/fortran/ChangeLog:

	PR fortran/94109
	* class.c (finalize_component): Return early if finalization has
	already happened for expression and component within namespace.
	* gfortran.h (gfc_was_finalized): New type.
	(gfc_namespace): Add member was_finalzed.
	(gfc_expr): Remove finalized.
	* symbol.c (gfc_free_namespace): Free was_finalized.

gcc/testsuite/ChangeLog:

	PR fortran/94109
	* gfortran.dg/finalize_34.f90: Adjust free counts.
	* gfortran.dg/finalize_36.f90: New test.
2020-06-14 13:01:24 +02:00
Iain Buclaw
275bef5fba d: Fix line lengths after mechanical field renames.
gcc/d/ChangeLog:

	* expr.cc (ExprVisitor::visit (AssocArrayLiteralExp *)): Fix line
	lengths, no functional change.
	* typeinfo.cc (TypeInfoVisitor::layout_interfaces): Likewise.
	(layout_classinfo_interfaces): Likewise.
2020-06-14 11:45:52 +02:00
Iain Buclaw
4a557dc456 testsuite: Re-add gdc.test prefix in test names (PR testsuite/95575)
gcc/testsuite/ChangeLog:

	PR testsuite/95575
	* lib/gdc-utils.exp (gdc-do-test): Re-add $subdir link and inclusion
	in filename.
2020-06-14 11:04:17 +02:00
GCC Administrator
efb4d74555 Daily bump. 2020-06-14 00:16:18 +00:00
Martin Sebor
678178cbf3 Correct test to avoid failures in ILP32.
Amends: PR middle-end/95353 - spurious -Wstringop-overflow writing to a trailing array plus offset.

gcc/testsuite/ChangeLog:
	* gcc.dg/builtin-stringop-chk-5.c: Make assertions independent of
	data model.
2020-06-13 11:29:01 -06:00
Thomas Koenig
c19ef23bb9 Remove failing test case accidentally committed.
When committing 0cfc34ad12, I
accidentylly committed gcc/testsuite/gfortran.dg/finalize_36.f90 .
This removes this, again.

gcc/testsuite/ChangeLog:

	* gfortran.dg/finalize_36.f90: Remove accidentally
	committed test case.
2020-06-13 11:42:17 +02:00
Thomas Koenig
0cfc34ad12 Disable -Wstringop-overflow warning after checking code path of caller.
The warning that is disabled, only on this single line, has been
inspected and found to be not applicable; it is known that the size
of the buffer is safe.

libgfortran/ChangeLog:

2020-06-13  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR libfortran/95313
	* io/write.c (ztoa_big): Disable -Wstringop-overflow for one
	line.
2020-06-13 10:04:33 +02:00
GCC Administrator
8e3b453e08 Daily bump. 2020-06-13 00:16:25 +00:00
Clément Chigot
75452d6867 runtime: fix arenaBaseOffset for aix/ppc
The arenaBaseOffset modifications was aimed only for aix/ppc64.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/237038
2020-06-12 16:30:53 -07:00
Ian Lance Taylor
309a6c468f go.test: update issue4085b.go to version from Go 1.13
This lets the test pass on AIX.

Not updating to master because we get slightly different error messages,
so that is a more complex change.
2020-06-12 14:00:11 -07:00
Marco Elver
06712fc68d tsan: Add param to disable func-entry-exit instrumentation
Adds param tsan-instrument-func-entry-exit, which controls if
__tsan_func_{entry,exit} calls should be emitted or not. The default
behaviour is to emit the calls.

This may be required by alternative race detection runtimes. One such
runtime is the Kernel Concurrency Sanitizer (KCSAN):

	https://github.com/google/ktsan/wiki/KCSAN

After this change, GCC should satisfy all requirements for KCSAN:

	https://lore.kernel.org/lkml/20200515150338.190344-7-elver@google.com/

gcc/ChangeLog:

	* gimplify.c (gimplify_function_tree): Optimize and do not emit
	IFN_TSAN_FUNC_EXIT in a finally block if we do not need it.
	* params.opt: Add --param=tsan-instrument-func-entry-exit=.
	* tsan.c (instrument_memory_accesses): Make
	fentry_exit_instrument bool depend on new param.

gcc/testsuite/ChangeLog:

	* c-c++-common/tsan/func_entry_exit.c: New test.
	* c-c++-common/tsan/func_entry_exit_disabled.c: New test.
2020-06-12 17:29:45 +02:00
Martin Liska
1432bc3681
Add .clang-tidy to git ignored.
Installed as obvious.

ChangeLog:

	* .gitignore: Add .clang-tidy.
2020-06-12 16:03:02 +02:00
Richard Biener
4544793ef6 testcase for shared DR alignment
This adds a reduced C testcase from libgomp.fortran/examples-4/target-1.f90
and libgomp.fortran/examples-4/target_data-1.f90 FAILs, showing a case
of SLP instance stmt sharing that affects the shared dataref alignment
info.

2020-06-12  Richard Biener  <rguenther@suse.de>

	* gcc.dg/vect/bb-slp-44.c: New testcase.
2020-06-12 13:05:30 +02:00
Fei Yang
d30846a02e vect: Fix an ICE in vect_loop_versioning [PR95570]
In the test case for PR95570, the only data reference in the loop is a
gather-statter access.  Scalar evolution analysis for this data reference
failed, so DR_STEP is NULL_TREE.  This leads to the segmentation fault.
We should filter out scatter-gather access in vect_enhance_data_refs_alignment.

2020-06-12  Felix Yang  <felix.yang@huawei.com>

gcc/
	PR tree-optimization/95570
	* tree-vect-data-refs.c (vect_relevant_for_alignment_p): New function.
	(vect_verify_datarefs_alignment): Call it to filter out data references
	in the loop whose alignment is irrelevant.
	(vect_get_peeling_costs_all_drs): Likewise.
	(vect_peeling_supportable): Likewise.
	(vect_enhance_data_refs_alignment): Likewise.

gcc/testsuite/

	PR tree-optimization/95570
	* gcc.dg/vect/pr95570.c: New test.
2020-06-12 11:37:00 +01:00
Richard Biener
135a8ad3a5 fix vectorizable_condition ICE with EXTRACT_LAST_REDUCTION
The previous reorg missed a guard around the else clause access.

2020-06-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95633
	* tree-vect-stmts.c (vectorizable_condition): Properly
	guard the vec_else_clause access with EXTRACT_LAST_REDUCTION.
2020-06-12 12:09:01 +02:00
Jonathan Wakely
e784f98027 libstdc++: Improve tests for std::atomic_flag
The tests for clear() and test_and_set() didn't cover all cases.

	* testsuite/29_atomics/atomic_flag/clear/1.cc: Also test clear()
	when the value is currently set.
	* testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc:
	Actually check the return value.
	* testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc:
	Likewise.
2020-06-12 10:43:06 +01:00
Jonathan Wakely
17412a74c5 libstdc++: Make std::atomic_flag::test members const
Also fix the tests so they run without an explicit -std=gnu++2a in the
RUNTESTFLAGS, and test the new function on const-qualified objects.

	* include/bits/atomic_base.h (atomic_flag::test): Add missing
	const qualifiers.
	* testsuite/29_atomics/atomic_flag/test/explicit.cc: Add
	dg-options and verify results of test function.
	* testsuite/29_atomics/atomic_flag/test/implicit.cc: Likewise.
2020-06-12 10:31:07 +01:00
Steve Baird
a6db99a61a [Ada] Fix anonymous-to-named access type implicit conversion legality checking
2020-06-12  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_res.adb (Valid_Conversion): The simpler cases of
	violations of the aforementioned 8.6 rule are already handled
	correctly. These include cases where the operand of the type
	conversion is an access parameter or a stand-alone object of an
	anonymous access type. Add code to detect violations where the
	operand of the type conversion is an access discriminant whose
	accessibility level is tied to one of the other simpler cases.
	This is implemented in a new function,
	Valid_Conversion.Is_Discrim_Of_Bad_Access_Conversion_Argument,
	which is called in place of the previous test.
2020-06-12 04:29:33 -04:00
Bob Duff
a3483a77e5 [Ada] Enable Put_Image in pre-Ada-2020 modes
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* exp_attr.adb (Put_Image): Remove assertion. This assertion is
	False in mixed-Ada-version programs.
	* exp_put_image.adb (Tagged_Put_Image_Enabled): New flag to make
	it easy to experiment with Put_Image on tagged types. False in
	this version.
	(Enable_Put_Image): Enable in pre-2020.  Workarounds: Disable
	for tagged types if Tagged_Put_Image_Enabled is False. Disable
	for access-to-subprogram types.  Disable if errors have been
	detected, or Sink is unavailable.
	(Preload_Sink): Move all conditionals here, from Sem_Ch10, so
	they can be nearby related code in Enable_Put_Image.  Load Sink
	only if we have seen a tagged type.  This removes the dilemma
	about calling Preload_Sink when compiling the compiler, which
	caused unwanted dependences.
	* exp_put_image.ads (Preload_Sink): New formal Compilation_Unit,
	needed to move all conditionals here, from Sem_Ch10.
	* libgnat/a-stouut.adb (Put_UTF_8): Make this suitable for
	inlining, so we don't get warnings about inlining in some tests.
	And so it can be inlined!
	* opt.ads (Tagged_Seen): New flag (see Preload_Sink).
	* scng.adb (Scan): Set new Tagged_Seen flag.
	* sem_ch10.adb (Analyze_Compilation_Unit): Move conditionals and
	comments regarding Preload_Sink into Preload_Sink.
2020-06-12 04:29:32 -04:00
Arnaud Charlet
3961bedab9 [Ada] AI12-0074 View conversions and out parameters passed by copy
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Actuals): Check for AI12-0074.
2020-06-12 04:29:31 -04:00
Olivier Hainque
4739f95b00 [Ada] Bump secondary stack alignment factor in full runtimes
2020-06-12  Olivier Hainque  <hainque@adacore.com>

gcc/ada/

	* libgnat/s-secsta.ads (Memory_Alignment): New constant, memory
	alignment for chunks and allocated blocks. Initialize to
	Standard'Maximum_Alignment * 2.
	(Chunk_Memory): Use it.
	* libgnat/s-secsta.adb (Round_Up): Likewise.
2020-06-12 04:29:30 -04:00
Piotr Trojanek
cb539f3b30 [Ada] Alphabetic ordering for name and pragmas
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* par-prag.adb: Fix ordering.
	* snames.ads-tmpl (Name_Test_Case, Pragma_Test_Case): Likewise.
	* sem_prag.adb (Sig_Flags): Likewise.
2020-06-12 04:29:29 -04:00
Arnaud Charlet
f40a4e4cab [Ada] Fix handling of Ada 83 OUT parameter rule
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Entity_Name): Fix handling of expressions
	containing array attributes wrt Ada 83 detection.
2020-06-12 04:29:29 -04:00
Steve Baird
7c3e76b8dc [Ada] Implement AI12-0369
2020-06-12  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_util.ads, sem_util.adb: Define 3 new Boolean-valued
	functions - Statically_Denotes_Entity,
	Statically_Denotes_Object, and Statically_Names_Object. The
	first two were taken from sem_attr.adb. The term "statically
	names" is defined in the Ada RM and the new function
	Statically_Names_Object is intended to reflect that definition,
	or more precisely, as described in a comment in the code, to
	reflect the expected future definition of that term.
	* sem_attr.adb: Delete functions Statically_Denotes_Object and
	Statically_Denotes_Entity; these two functions have been moved
	to package Sem_Util. Replace call to Statically_Denotes_Object
	with a call to Statically_Names_Object as per AI12-0217 (a
	binding interpretation, so no Ada_Version check).
	* exp_ch9.adb (Expand_Entry_Barrier.Is_Simple_Barrier): Change
	name of function (it was previously Is_Simple_Barrier_Name)
	because the function should return True in the case of a static
	expression; implement this requirement.  Change function to
	include a call to Statically_Names_Object so that, for Ada_2020
	and later, it will return True for appropriate subcomponent
	names.
	(Expand_Entry_Barrier.Is_Pure_Barrier): Handle
	N_Indexed_Component and N_Selected_Component cases by calling
	Statically_Names_Object.
	(Expand_Entry_Barrier): Reorganize to treat Simple_Barriers and
	Pure_Barriers more uniformly.  Prevent cascaded errors.
2020-06-12 04:29:28 -04:00
Ed Schonberg
834bb57ac5 [Ada] Compiler locks up with -gnatX and formal subprogram with aspects
2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch12.adb (Find_Matching_Actual): Add guard on search loops
	to detect a compilation error when using a compiler built
	without assertions.
	(Instantiate_Formal_Subprogram): Create a new subprogram name
	for the actual only if formal has contract aspects and expansion
	is enabled.
2020-06-12 04:29:27 -04:00
Eric Botcazou
a80b1eb72d [Ada] Improve code generated for assignment of dynamic record aggregates
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_aggr.adb: Add with and use clauses for Sem_Mech.
	(Get_Base_Object): New function to get the base object of a node.
	(In_Place_Assign_OK): Add Target_Object parameter.  Deal with a
	qualified expression on entry.  Remove short-circuit for array
	aggregates with a single "others" choice.  Do not look into the
	components of the aggregate if the parent is an allocator.
	(Check_Component): Add T_OK parameter and rewrite.
	(Safe_Component): Invoke Check_Component with T_OK set to False.
	(Convert_To_Assignments): Try to use an in-place assignment for
	any target; for that, call Get_Base_Object on the target and pass
	the result to In_Place_Assign_OK.
	(Expand_Array_Aggregate): Use Parent_Kind and Parent_Node more
	consistently.  For an assignment, call Get_Base_Object on the
	target and pass the result to In_Place_Assign_OK.
2020-06-12 04:29:26 -04:00
Dmitriy Anisimkov
e2b7399e34 [Ada] Don't correct socket timeout on Windows Server 2019
2020-06-12  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

	* socket.c (__gnat_minus_500ms): Use GetVersionEx to detect
	Windows Server version.
	* libgnat/g-sothco.ads (Minus_500ms_Windows_Timeout): Remade to
	Boolean constant.
	* libgnat/g-socket.adb (Set_Socket_Option): Use
	Minus_500ms_Windows_Timeout constant instead of function call.
2020-06-12 04:29:25 -04:00
Arnaud Charlet
5052a270c0 [Ada] AI12-0350 Swap for Indefinite_Holders
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/a-coinho.ads, libgnat/a-coinho.adb,
	libgnat/a-coinho__shared.ads, libgnat/a-coinho__shared.adb
	(Swap): New procedure.
2020-06-12 04:29:24 -04:00
Arnaud Charlet
842d28d2ac [Ada] Fix handling of subprograms declared in a protected body
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* exp_ch6.adb (Expand_N_Subprogram_Declaration): Do nothing for
	a subprogram declared in a protected body.
	* exp_ch9.ads, exp_ch9.adb
	(Build_Private_Protected_Declaration): Moved to sem_ch6.adb.
	(Expand_N_Protected_Body): Do nothing for a subprogram declared
	in a protected body.
	* sem_ch6.adb (Build_Internal_Protected_Declaration): Moved from
	exp_ch9.adb and renamed and fixed to ensure in particular that
	such subprograms have convention Intrinsic and have no protected
	version.
	(Analyze_Subprogram_Body_Helper): Call
	Build_Internal_Protected_Declaration.
	(Move_Pragmas): Moved up and merged with the more general
	version from Build_Private_Protected_Declaration. We only want
	to copy selected pragmas, most pragmas are not suitable for a
	copy on the spec.
2020-06-12 04:29:24 -04:00
Ed Schonberg
3ca9a460f0 [Ada] Diagnose illegal overriding indicators in protected bodies
2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch6.adb (Check_Overriding_Indicatior): Reject an
	overriding indicator on a subprogram declared within a protected
	body.
2020-06-12 04:29:23 -04:00
Piotr Trojanek
019e90494b [Ada] Reuse Is_Entry where possible
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* contracts.adb, einfo.adb, sem_ch4.adb, sem_ch6.adb,
	sem_res.adb, sem_util.adb: Replace Ekind_In with Is_Entry.
2020-06-12 04:29:22 -04:00
Piotr Trojanek
c0cecc953a [Ada] Detect overlapping actuals in entry calls
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Entry_Call): Add call to
	Warn_On_Overlapping_Actuals.
2020-06-12 04:29:21 -04:00
Arnaud Charlet
e7148bc74f [Ada] ACATS 4.2Q - BDD2007
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* aspects.ads (Is_Representation_Aspect): New array.
	* sem_ch13.adb (Analyze_Aspect_Specifications): Check
	13.1(9.2/5) for representation aspects.

gcc/testsuite/

	* gnat.dg/rep_clause8.adb: Update error location.
2020-06-12 04:29:20 -04:00
Bob Duff
05f799de94 [Ada] Put_Image: preload type Sink, change what types have it enabled
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* exp_put_image.ads, exp_put_image.adb (Preload_Sink): Procedure
	for preloading type Sink.  This has the side effect of loading
	various dependents, including Ada.Strings.UTF_Encoding.
	(Enable_Put_Image): Disable Put_Image in pre-2020 versions of
	Ada.  This limitation can probably be lifted later.  Enable for
	tagged types except in predefined units.  Disable for CPP types;
	Put_Image is legal, just prints the type name.
	* sem_attr.adb (Check_Put_Image_Attribute): Don't complain about
	Put_Image of CPP types; instead call the "unknown" version of
	Put_Image.
	* sem_ch10.adb (Analyze_Compilation_Unit): Call Preload_Sink.
2020-06-12 04:29:19 -04:00
Piotr Trojanek
052d648847 [Ada] Remove redundant iterations in checks for overlapping actuals
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Simplify.
2020-06-12 04:29:18 -04:00
Piotr Trojanek
879f6fa876 [Ada] Remove suppression for overlapping actuals in internal units
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Overlapping_Actuals): Remove suppression
	for internal units.
2020-06-12 04:29:18 -04:00
Arnaud Charlet
1ed0551d5a [Ada] ACATS 4.1Q - CDD2A04 - RLS not followed
2020-06-12  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* exp_strm.adb (Build_Elementary_Input_Call): Add support for 24
	bits elementary types.
	* rtsfind.ads: Add 24 bits integer streaming routines.
	* sem_ch13.adb (Analyze_Attribute_Definition_Clause
	[Attribute_Stream_Size]): Add support for 24 bits elementary
	types.
	* libgnat/s-stratt.ads, libgnat/s-stratt.adb,
	libgnat/s-stratt__xdr.adb: Add support for signed and unsigned
	24 bits integers.
2020-06-12 04:29:17 -04:00
Piotr Trojanek
51ebdbc91a [Ada] Simplify getting discriminant value from a list of constraints
2020-06-12  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_ch3.adb (Get_Discr_Value): Cleanup.
2020-06-12 04:29:16 -04:00
Eric Botcazou
ec772e4b26 [Ada] Implement AI12-0175 Preelaborable packages with address clauses
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* rtsfind.ads (RTU_Id): Add System_Address_To_Access_Conversions.
	* sem_elab.adb (Elaboration_Phase_Active): Alphabetize.
	(Finalize_All_Data_Structures): Likewise.
	(Error_Preelaborated_Call): New procedure.
	(Build_Call_Marker): Set Is_Preelaborable_Call flag in marker.
	(Build_Access_Marker): Likewise.
	(Build_Subprogram_Invocation): Likewise.
	(Build_Task_Activation): Likewise.
	(Check_Preelaborated_Call): Return when the call is preelaborable.
	Call Error_Preelaborated_Call to give the error otherwise.
	(Check_Elab_Call): Likewise.
	* sem_util.adb (Is_Preelaborable_Function): New predicate.
	(Is_Non_Preelaborable_Construct.Visit): Recurse on the
	Explicit_Actual_Parameter field of N_Parameter_Association.
	(Is_Non_Preelaborable_Construct.Visit_Subexpression): In Ada 2020,
	for a call to a preelaborable function, visit the parameter list;
	otherwise, raise Non_Preelaborable exception.
	(Is_Preelaborable_Construct): Likewise, but recursively check the
	parameters instead and return false upon failure, otherwise true.
	* sinfo.ads (Is_Preelaborable_Call): New flag in call marker nodes.
	(Is_Preelaborable_Call): New inline function.
	(Set_Is_Preelaborable_Call): New inline procedure.
	* sinfo.adb (Is_Preelaborable_Call): New inline function.
	(Set_Is_Preelaborable_Call): New inline procedure.
2020-06-12 04:29:15 -04:00
Bob Duff
6f6f89a494 [Ada] Remove unnecessary use_clause from stringt.ads
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* stringt.ads: Remove "use System;".
2020-06-12 04:29:14 -04:00
Eric Botcazou
4459999864 [Ada] Small cleanup in handling of Ada 2012 implicit dereferences
2020-06-12  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch4.adb (Try_Container_Indexing): Replace call to
	First_Discriminant by Get_Reference_Discriminant to get the
	reference discriminant.
	* sem_ch13.adb (Check_Indexing_Functions): Likewise.
	* sem_ch5.adb (Preanalyze_Range): Call Get_Reference_Discriminant
	to get the reference discriminant.
	* sem_util.adb (Is_OK_Variable_For_Out_Formal): Treat all
	Ada 2012 implicit dereferences in only one place.
	(Is_Variable): Minor tweak.
2020-06-12 04:29:13 -04:00
Ed Schonberg
c14b424ec7 [Ada] Compiler crash on instance with overloaded actual and aspects
2020-06-12  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch12.adb (Has_Contracts): New predicate to check whether a
	formal subprogram carries an aspect specification for a pre- or
	postcondition.
	(Build_Subprogram_Wrappers): If actual is overloaded, create a
	new name to be used in call inside wrapper body. This names
	carries the interpretations of the actual, and is resolved when
	the body is analyzed.
	(Build_Subprogram_Body_Wrapper): Use this generated name in
	call.
	(Build_Subprogram_Decl_Wrapper): Build profile of wrapper from
	the profile of formal, and reset type entities for subsequent
	analysis.
2020-06-12 04:29:12 -04:00
Bob Duff
c324c77eed [Ada] Put_Image attribute
2020-06-12  Bob Duff  <duff@adacore.com>

gcc/ada/

	* debug.adb: Remove usage of -gnatd_z.
	* exp_attr.adb, exp_put_image.ads, exp_put_image.adb: Clean up
	the enable/disable code. If Put_Image is disabled for a type,
	systematically call the "unknown" version.  Improve comments.
	Consolidate workarounds.  Remove usage of -gnatd_z.
2020-06-12 04:29:12 -04:00