Commit Graph

177447 Commits

Author SHA1 Message Date
Bob Duff
338c32f137 [Ada] Add debugging message
2020-06-09  Bob Duff  <duff@adacore.com>

gcc/ada/

	* bindo-graphs.adb (Add_Edge_Kind_Check): Add the Image of the
	old and new Kinds to the raise Program_Error message.
2020-06-09 04:09:02 -04:00
Eric Botcazou
dc8adf598f [Ada] Remove bypass for instance bodies from Is_Visible_Component
2020-06-09  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch3.adb (Is_Visible_Component): Do not special-case
	bodies of instances.
2020-06-09 04:09:02 -04:00
Arnaud Charlet
11381028a6 [Ada] Membership test against a non-excluding subtype
2020-06-09  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* exp_ch4.adb (Expand_N_In): Fix handling of null exclusion.
2020-06-09 04:09:01 -04:00
Ed Schonberg
8e6ca7a87b [Ada] Ada2020 AI12-0282: Shared variable control aspects in generics
2020-06-09  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require
	exact match between formal and actual for aspects Atomic,
	Atomic_Component, Volatile, and Volatile_Components.
2020-06-09 04:09:01 -04:00
Bob Duff
05cb816ba5 [Ada] gnatpp: documentation for --no-separate-return switch
2020-06-09  Bob Duff  <duff@adacore.com>

gcc/ada/

	* doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
	the --no-separate-return switch of gnatpp.
2020-06-09 04:09:01 -04:00
Arnaud Charlet
881d7a9f46 [Ada] Add missing tag with -gnatw.d
2020-06-09  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Constant_Valid_Condition): Add proper
	warning tag.
2020-06-09 04:09:01 -04:00
Arnaud Charlet
742048af50 [Ada] Refine implementation of AI05-0149 missing conversion checks
2020-06-09  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_type.adb (Covers): Fix implementation of AI05-0149.
	* sem_res.adb: Fix typo.
2020-06-09 04:09:00 -04:00
Ed Schonberg
54025948c0 [Ada] Spurious error on instantiations with Taft_Amendment types and tasks
2020-06-09  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_ch9.adb (Build_Master_Renaming): Make name in renaming
	declaration unique by adding a numeric suffix, to prevent
	accidental name conflict when several instantiations of a
	package containing an access_to_incomplete type that designate
	tasks appear in the same scope.
2020-06-09 04:09:00 -04:00
Piotr Trojanek
6859ef4893 [Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => Off
2020-06-09  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* libgnarl/a-synbar.ads, libgnarl/a-synbar.adb,
	libgnarl/a-synbar__posix.ads, libgnarl/a-synbar__posix.adb
	(Ada.Synchronous_Barriers): Annotate with SPARK_Mode => Off.
2020-06-09 04:09:00 -04:00
Arnaud Charlet
3795dac6fa [Ada] AI1-0201 Relational operators of static string types are now static
2020-06-09  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_eval.adb (Eval_Relational_Op, Eval_String_Literal,
	Eval_Type_Conversion): Relax rules on relational operators and
	type conversions of static string types.
2020-06-09 04:09:00 -04:00
Arnaud Charlet
c68d70e8bd [Ada] Ada2020: AI12-0301 Predicates and Default_Value
2020-06-09  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_util.ads, sem_util.adb (Is_Partially_Initialized_Type):
	Take Default_Value and Default_Component_Value into account.
	* sem_ch3.adb (Analyze_Object_Declaration): Update comment.
2020-06-09 04:09:00 -04:00
Bob Duff
d68c6d7dcc [Ada] Disable assertion regarding Body_Before_Spec_Edge
2020-06-09  Bob Duff  <duff@adacore.com>

gcc/ada/

	* bindo-graphs.adb (Add_Edge_Kind_Check): Disable failing part
	of the assertion.
2020-06-09 04:08:59 -04:00
Martin Liska
942a384ef9
libsanitizer: use gnu++14
libsanitizer/ChangeLog:

	* asan/Makefile.am: Replace gnu++11 with gnu++14.
	* interception/Makefile.am: Likewise.
	* libbacktrace/Makefile.am: Likewise.
	* lsan/Makefile.am: Likewise.
	* sanitizer_common/Makefile.am: Likewise.
	* tsan/Makefile.am: Likewise.
	* ubsan/Makefile.am: Likewise.
	* asan/Makefile.in: Regenerate.
	* interception/Makefile.in: Likewise.
	* libbacktrace/Makefile.in: Likewise.
	* lsan/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.
	* tsan/Makefile.in: Likewise.
	* ubsan/Makefile.in: Likewise.
2020-06-09 10:07:24 +02:00
Martin Liska
4373fd2c7f
gcc-changelog: fix deduction for root ChangeLog
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Fix ChangeLog regex in order to
	match the top-level ChangeLog.
	* gcc-changelog/test_email.py: Add test.
	* gcc-changelog/test_patches.txt: Likewise.
2020-06-09 10:01:52 +02:00
Jakub Jelinek
d6dbb71e46 c-family: Fix up MEM_REF printing [PR95580]
The C FE in the MEM_REF printing ICEs if the type of the first argument
(which due to useless pointer conversions can be an arbitrary type) is a
pointer to an incomplete type.  The code just wants to avoid printing a cast
if it is a pointer to single byte elements.

2020-06-09  Jakub Jelinek  <jakub@redhat.com>

	PR c/95580
	* c-pretty-print.c (c_pretty_printer::unary_expression): Handle the
	case when MEM_REF's first argument has type pointer to incomplete type.

	* gcc.dg/pr95580.c: New test.
2020-06-09 08:39:36 +02:00
Jakub Jelinek
653ab08139 match.pd: Optimize ffs comparisons against constants [PR95527]
The following patch implements various optimizations of __builtin_ffs*
against constants.

2020-06-09  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/95527
	* match.pd (__builtin_ffs (X) cmp CST): New optimizations.

	* gcc.dg/tree-ssa/pr95527.c: New test.
2020-06-09 08:38:19 +02:00
Jakub Jelinek
9a39b91d93 testsuite: Fix g++.dg/torture/pr95493.C FAIL on i686-linux with -O0.
2020-06-09  Jakub Jelinek  <jakub@redhat.com>

	* g++.dg/torture/pr95493.C: Add -Wno-psabi -w to dg-additional-options.
2020-06-09 08:34:13 +02:00
Max Filippov
1d9921cbdc xtensa: libgcc: fix PR target/95571
Rewrite uw_install_context without function calls to avoid register
spilling in _Unwind_RaiseException during return context installation.

2020-06-08  Max Filippov  <jcmvbkbc@gmail.com>
gcc/testsuite/
	* g++.target/xtensa/pr95571.C: New test.
	* g++.target/xtensa/xtensa.exp: New testsuite.

libgcc/
	* config/xtensa/unwind-dw2-xtensa.c (uw_install_context): Merge
	with uw_install_context_1.
2020-06-08 18:30:07 -07:00
Segher Boessenkool
df2c0060e5 rs6000/testsuite: Allow xxperm* instead of only vperm*
Some testcases failed (esp. with --with-cpu=power9) after my change to
prefer xxperm over vperm when all else is equal.  Fix that.  (This also
tightens the relevant REs somewhat).

2020-06-09  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
	* gcc.target/powerpc/fold-vec-perm-char.c: Allow both vperm/vpermr and
	xxperm/xxpermr.
	* gcc.target/powerpc/fold-vec-perm-double.c: Ditto.
	* gcc.target/powerpc/fold-vec-perm-float.c: Ditto.
	* gcc.target/powerpc/fold-vec-perm-int.c: Ditto.
	* gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto.
	* gcc.target/powerpc/fold-vec-perm-pixel.c: Ditto.
	* gcc.target/powerpc/fold-vec-perm-short.c: Ditto.
	* gcc.target/powerpc/lvsl-lvsr.c: Ditto.
	* gcc.target/powerpc/vec-mult-char-2.c: Ditto.
	* gcc.target/powerpc/vsx-vector-6.p9.c: Also allow xxpermr.
2020-06-09 00:59:12 +00:00
GCC Administrator
2c455ae06c Daily bump. 2020-06-09 00:16:47 +00:00
Tobias Burnus
1c0fdaf79e openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)
gcc/ChangeLog:

	PR lto/94848
	PR middle-end/95551
	* omp-offload.c (add_decls_addresses_to_decl_constructor,
	omp_finish_file): Skip removed items.
	* lto-cgraph.c (output_offload_tables): Likewise; set force_output
	to this node for variables and functions.

libgomp/ChangeLog:

	PR lto/94848
	PR middle-end/95551
	* testsuite/libgomp.fortran/target-var.f90: New test.
2020-06-08 23:24:57 +02:00
Jason Merrill
ffac959725 bootstrap: Fix --disable-bootstrap with older g++.
Previously I had AX_CXX_COMPILE_STDCXX in the gcc directory configure, which
added -std=c++11 to CXX if needed, but then CXX is overridden from the
toplevel directory, so it didn't have the desired effect.  Fixed by moving
the check to the toplevel.  Currently it is only used when building GCC
without bootstrapping; other packages that share the toplevel directory
can adjust the condition if they also want to require C++11 support.

/ChangeLog:

	* configure.ac: Check AX_CXX_COMPILE_STDCXX if not bootstrapping.
	* configure: Regenerate.

gcc/ChangeLog:

	* aclocal.m4: Remove ax_cxx_compile_stdcxx.m4.
	* configure.ac: Remove AX_CXX_COMPILE_STDCXX.
	* configure: Regenerate.
2020-06-08 16:42:35 -04:00
Jonathan Wakely
a37fbff12c libstdc++: Fix failing tests
These started failing with the previous commit, because I forgot to add
the tests after adjusting them.

	* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/default_delete/void_neg.cc: Likewise.
2020-06-08 21:34:46 +01:00
Jason Merrill
931fdcc532 Add missing ChangeLog entries 2020-06-08 16:22:02 -04:00
Jonathan Wakely
187da2ce31 libstdc++: Implement operator<< for std::unique_ptr (LWG 2948)
libstdc++-v3/ChangeLog:

	* include/bits/unique_ptr.h (operator<<): Define for C++20.
	* testsuite/20_util/unique_ptr/io/lwg2948.cc: New test.
2020-06-08 21:21:31 +01:00
Iain Buclaw
5fceefeee9 d: Fix regression caused by recent refactoring
gcc/d/ChangeLog:

	PR d/95573
	* dmd/MERGE: Merge upstream dmd 5041e56f1.
2020-06-08 22:11:00 +02:00
Iain Buclaw
49a09af117 d: Merge upstream dmd 955b8b36f.
Merges AndAndExp and OrOrExp into a LogicalExp AST node.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd 955b8b36f.
	* expr.cc (ExprVisitor::visit (AndAndExp *)): Rename type to ...
	(ExprVisitor::visit (LogicalExp *)): ... this.  Handle both 'and if'
	and 'or if' expression nodes.
	(ExprVisitor::visit (OrOrExp *)): Remove.
2020-06-08 22:02:18 +02:00
Harald Anlauf
8cd239614e PR fortran/95195 - Fortran testcase should clean up afterwards
Change testcase to check error message (iomsg) at runtime, rather than to crash.

libgfortran/
	PR fortran/95091
	* io/transfer.c (finalize_transfer): Fix type in error message.

gcc/testsuite/
	PR fortran/95195
	* gfortran.dg/namelist_97.f90: Adjust testcase.
2020-06-08 21:01:06 +02:00
Martin Sebor
c1057cc0a8 PR bootstrap/95555 - powepc64 bootstrap failure due to -Wmaybe-uninitialized in reload_cse_simplify_operands
gcc/ChangeLog:

	* postreload.c (reload_cse_simplify_operands): Clear first array element
	before using it.  Assert a precondition.
2020-06-08 09:06:48 -06:00
Mark Eggleston
5dc3986103 Fortran : ICE in maybe_canonicalize_comparison_1 PR92993
This issue has been fixed by PR94090.  Add test case to ensure that
this does not re-occur.

2020-06-08  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

	PR fortran/92993
	* gfortran.dg/pr92993.f90: New test.
2020-06-08 11:17:40 +01:00
Jakub Jelinek
8be374e027 forwprop: Ignore scalar mode vectors in simplify_vector_constructor [PR95528]
As mentioned in the PR, the problem is that at least the x86 backend asumes
that the vec_unpack* and vec_pack* optabs with integral modes are for the
AVX512-ish vector masks rather than for very small vectors done in GPRs.
The only other target that seems to have a scalar mode vec_{,un}pack* optab
is aarch64 as discussed in the PR, so there is also a condition for that.
All other targets have just vector mode optabs.

2020-06-08  Jakub Jelinek  <jakub@redhat.com>

	PR target/95528
	* tree-ssa-forwprop.c (simplify_vector_constructor): Don't use
	VEC_UNPACK*_EXPR or VEC_PACK_TRUNC_EXPR with scalar modes unless the
	type is vector boolean.

	* g++.dg/opt/pr95528.C: New test.
2020-06-08 11:05:10 +02:00
Jakub Jelinek
296d644b9f testsuite: Fix up pr95548.C testcase.
2020-06-08  Jakub Jelinek  <jakub@redhat.com>

	PR lto/95548
	* g++.dg/torture/pr95548.C: Change from dg-do compile to dg-do link,
	add return type for main, for __SIZEOF_INT128__ test with __uint128_t
	enumerator constants and add a test with unsigned long long
	enumerators for all targets.
2020-06-08 10:31:35 +02:00
Tamar Christina
d6430e3ccc AArch64: Expand on comment of stack-clash and implicit probing through LR.
This expands the comment on an assert we have in aarch64_layout_frame
and points to an existing comment somewhere else that has a much longer
explanation of what's going on.

Committed under the GCC Obvious rule.

gcc/ChangeLog:

	* config/aarch64/aarch64.c (aarch64_layout_frame): Expand comments.
2020-06-08 09:23:10 +01:00
Christophe Lyon
635408da1e [arm] Fix vfp_operand_register for VFP HI regs
While looking at PR target/94743 I noticed an ICE when I tried to save
all the FP registers: this was because all HI registers wouldn't match
vfp_register_operand.

gcc/ChangeLog:

	* config/arm/predicates.md (vfp_register_operand): Use VFP_HI_REGS
	instead of VFP_REGS.
2020-06-08 08:19:04 +00:00
Martin Liska
291f65f15a
rs6000: Replace FAIL with gcc_unreachable
gcc/ChangeLog:

	* config/rs6000/vector.md: Replace FAIL with gcc_unreachable
	in all vcond* patterns.
2020-06-08 10:16:59 +02:00
Christophe Lyon
e7b3f654f2 [arm] (header usage fix) include c++ algorithm header via system.h
After the recent commit that forces uses of c++11, the arm part failed
to build because it does not include <algorithm> via system.h as
should be done.

This results in:
from /gcc/common/config/arm/arm-common.c:34:
/usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h:42:12: error:
attempt to use poisoned "malloc"
     return malloc (size);

This patch fixes the problem by defining INCLUDE_ALGORITHM before
including system.h and no longer includes <algorithm> directly.

gcc/ChangeLog:

	* common/config/arm/arm-common.c (INCLUDE_ALGORITHM):
	Define. No longer include <algorithm>.
2020-06-08 08:16:15 +00:00
Steve Baird
48b799ea9a [Ada] Implement AI12-0073 (Ravenscar disallows Synchronous_Barriers)
2020-06-08  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_prag.adb (Analyze_Pragma.Set_Ravenscar_Profile): Add
	appropriate call to Set_Restriction_No_Dependence if Ada_Version
	>= Ada2012 and Profile is either Ravenscar or a GNAT-defined
	Ravenscar variant (i.e., not Jorvik).
2020-06-08 03:51:16 -04:00
Arnaud Charlet
63408d0eb2 [Ada] AI12-0204 Renaming of a prefixed view
2020-06-08  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch5.adb: Fix typo.
	* sem_ch8.adb (Analyze_Renamed_Primitive_Operation): Check that
	the prefix of a prefixed view must be renamable as an object.
2020-06-08 03:51:15 -04:00
Arnaud Charlet
072c5071e0 [Ada] AI12-0085 Missing aspect cases for Remote_Types
2020-06-08  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_cat.ads: Fix typo.
	* sem_cat.adb (Validate_Remote_Access_To_Class_Wide_Type): Add
	handling of N_Attribute_Definition_Clause.
	* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Call
	Validate_Remote_Access_To_Class_Wide_Type for Storage_Size and
	Storage_Pool.
	* sem_attr.adb, exp_ch4.adb: Update comments.
2020-06-08 03:51:14 -04:00
Justin Squirek
a689887372 [Ada] Spurious error on call to controlled primitive
2020-06-08  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* sem_ch4.adb (Analyze_One_Call): Add extra condition to the
	predicate for deciding when a given controlled call is visible.
2020-06-08 03:51:13 -04:00
Piotr Trojanek
5351d617ec [Ada] Port a modified expansion of Enum_Rep from GNAT to GNATprove
2020-06-08  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Port
	changes in frontend expander.
2020-06-08 03:51:12 -04:00
Piotr Trojanek
e344ec2553 [Ada] Style cleanups in new code for Pure_Barriers
2020-06-08  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_ch13.adb (All_Membership_Choices_Static): Fix style.
2020-06-08 03:51:12 -04:00
Steve Baird
a998e58bf0 [Ada] Implement AI12-0291 (Jorvik profile)
2020-06-08  Steve Baird  <baird@adacore.com>

gcc/ada/

	* libgnat/s-rident.ads: Add Jorvik to the Profile_Name
	enumeration type.  Add an element for Jorvik to the array
	aggregate that is the initial value of the constant
	Profile_Info.
	* targparm.adb (Get_Target_Parameters): Handle "pragma Profile
	(Jorvik);" similarly to "pragma Profile (Ravenscar);".
	* snames.ads-tmpl: Declare Name_Jorvik Name_Id. Unlike
	Ravenscar, Jorvik is not a pragma name and has no corresponding
	element in the Pragma_Id enumeration type; this means that its
	declaration must not occur between those of First_Pragma_Name
	and Last_Pragma_Name.
	* sem_prag.adb (Analyze_Pragma): Add call to
	Set_Ravenscar_Profile for Jorvik, similar to the existing calls
	for Ravenscar and the GNAT Ravenscar variants.
2020-06-08 03:51:11 -04:00
Arnaud Charlet
4b8c2c4ba3 [Ada] AI12-0228 Properties of qualified expressions used as names
2020-06-08  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch8.adb (Analyze_Object_Renaming): Update Get_Object_Name
	to go through N_Qualified_Expression and N_Type_Conversion.  Fix
	another case of wrong usage of E_Anonymous_Access_Type instead
	of Anonymous_Access_Kind.
	* sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Work
	on the original node.
	(Is_Aliased_View): Take into account N_Qualified_Expression.
2020-06-08 03:51:10 -04:00
Arnaud Charlet
8eda13a49e [Ada] Fix handling of 'Enum_Rep and renamings
2020-06-08  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_eval.adb (Eval_Type_Conversion): Fix handling of
	enumeration to integer conversions.
	* exp_attr.adb (Expand_N_Attribute_Reference
	[Attribute_Enum_Rep]): Remove special casing for first-level
	renaming, best left to the general folding mechanism via
	Eval_Type_Conversion.
2020-06-08 03:51:09 -04:00
Eric Botcazou
bbe7d67f5f [Ada] Remove the Has_Dynamic_Range_Check flag
2020-06-08  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* atree.adb (New_Copy): Do not clear Has_Dynamic_Range_Check.
	* checks.ads (Append_Range_Checks): Remove Flag_Node parameter.
	(Insert_Range_Checks): Likewise and remove default value of
	Static_Loc parameter.
	* checks.adb (Append_Range_Checks): Remove Flag_Node parameter.
	Do not test and set Has_Dynamic_Range_Check.
	(Insert_Range_Checks): Likewise and remove default value of
	Static_Loc parameter.
	* csinfo.adb (CSinfo): Remove 'L' from [NEUB]_Fields pattern and
	do not handle Has_Dynamic_Range_Check.
	* exp_ch5.adb (Expand_N_Assignment_Statement): Remove argument
	in call to Insert_Range_Checks.
	* sem_ch3.adb (Analyze_Subtype_Declaration): Do not fiddle
	with Has_Dynamic_Range_Check.
	(Process_Range_Expr_In_Decl): Remove argument in calls to
	Insert_Range_Checks and Append_Range_Checks.
	* sinfo.ads (Has_Dynamic_Range_Check): Delete.
	(Set_Has_Dynamic_Range_Check): Likewise.
	* sinfo.adb (Has_Dynamic_Range_Check): Delete.
	(Set_Has_Dynamic_Range_Check): Likewise.
	* treepr.adb (Print_Node): Do not print Has_Dynamic_Range_Check.
2020-06-08 03:51:08 -04:00
Steve Baird
6476fc372a [Ada] Implement AI12-0290 (Simple_Barriers restriction)
2020-06-08  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_ch13.ads: Export new function
	All_Membership_Choices_Static.
	* sem_ch13.adb: Implement new function
	All_Membership_Choices_Static.  This involves moving the
	functions Is_Static_Choice and All_Membership_Choices_Static,
	which were previously declared within the function
	Is_Predicate_Static, out to library level so that they can be
	called by the new function. The already-exisiting code in
	Is_Predicate_Static which became the body of
	All_Membership_Choices_Static is replaced with a call to the new
	function in order to avoid duplication.
	* exp_ch9.adb (Is_Pure_Barrier): Several changes needed to
	implement rules of AI12-0290 and RM D.7's definition of
	"pure-barrier-eligible". These changes include adding a call to
	the new function Sem_13.All_Membership_Choices_Static, as per
	the "see 4.9" in RM D.7(1.6/5).
2020-06-08 03:51:07 -04:00
Richard Kenner
8b0ec65d85 [Ada] Issue with unnesting of 'First/Last and renaming
2020-06-08  Richard Kenner  <kenner@adacore.com>

gcc/ada/

	* exp_unst.adb (Visit_Node): When visiting array attribute
	nodes, in addition to checking the type of Get_Referenced_Object
	of the prefix, also check the actual type of the prefix.
2020-06-08 03:51:06 -04:00
Gary Dismukes
24eda9e701 [Ada] Implement predicate checks on qualified expressions (AI12-0100)
2020-06-08  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* checks.adb (Apply_Predicate_Check): Refine test for being in a
	subprogram body to account for no Corresponding_Body case,
	avoiding blowups arising due to other changes here.
	* exp_ch4.adb (Expand_N_Qualified_Expression): Apply predicate
	checks, if any, after constraint checks are applied.
	* sem_eval.ads (Check_Expression_Against_Static_Predicate): Add
	Check_Failure_Is_Error formal for conditionalizing warning vs.
	error messages.
	* sem_eval.adb (Check_Expression_Against_Static_Predicate):
	Issue an error message rather than a warning when the new
	Check_Failure_Is_Error formal is True. In the nonstatic or
	Dynamic_Predicate case where the predicate is known to fail,
	emit the check to ensure that folded cases get checks applied.
	* sem_res.adb (Resolve_Qualified_Expression): Call
	Check_Expression_Against_Static_Predicate, passing True for
	Check_Failure_Is_Error, to ensure we reject static predicate
	violations. Remove code that was conditionally calling
	Apply_Predicate_Check, which is no longer needed, and that check
	procedure shouldn't be called from a resolution routine in any
	case. Also remove associated comment about preventing infinite
	recursion and consistency with Resolve_Type_Conversion, since
	that handling was already similarly removed from
	Resolve_Type_Convesion at some point.
	(Resolve_Type_Conversion): Add passing of True for
	Check_Failure_Is_Error parameter on call to
	Check_Expression_Against_Static_Predicate, to ensure that static
	conversion cases that violate a predicate are rejected as
	errors.
2020-06-08 03:51:06 -04:00
Piotr Trojanek
7b7f1ca1b2 [Ada] Restore Snames.Name_SPARK as it used in the GNATprove backend
2020-06-08  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* snames.ads-tmpl (Name_SPARK): Restore after being deleted.
2020-06-08 03:51:05 -04:00