* [Ada] Fix bug in handling of Predicate_Failure aspect
@ 2022-05-19 14:16 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-19 14:16 UTC (permalink / raw)
To: gcc-patches; +Cc: Steve Baird
[-- Attachment #1: Type: text/plain, Size: 2054 bytes --]
The run-time behavior of the Ada 2022 Predicate_Failure aspect was
incorrectly implemented. This could cause incorrect exception messages
at execution time in the case of a predicate check failure, as
demonstrated by ACATS test C324006. In addition, a new attribute
(Predicate_Expression) is defined in order to improve the FE/SPARK
interface.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* einfo-utils.ads, einfo-utils.adb: Delete Predicate_Function_M
function and Set_Predicate_Function_M procedure.
* einfo.ads: Delete comments for Is_Predicate_Function_M and
Predicate_Function_M functions. Add comment for new
Predicate_Expression function. Update comment describing
predicate functions.
* exp_util.ads, exp_util.adb (Make_Predicate_Call): Replace Mem
formal parameter with Static_Mem and Dynamic_Mem formals.
(Make_Predicate_Check): Delete Add_Failure_Expression and call
to it.
* exp_ch4.adb (Expand_N_In.Predicate_Check): Update
Make_Predicate_Call call to match profile change.
* gen_il-fields.ads: Delete Is_Predicate_Function_M field, add
Predicate_Expression field.
* gen_il-gen-gen_entities.adb: Delete Is_Predicate_Function_M
use, add Predicate_Expression use.
* sem_ch13.adb (Build_Predicate_Functions): Rename as singular,
not plural; we no longer build a Predicate_M function. Delete
Predicate_M references. Add new Boolean parameter for predicate
functions when needed. Restructure body of generated predicate
functions to implement required Predicate_Failure behavior and
to set new Predicate_Expression attribute. Remove special
treatment of raise expressions within predicate expressions.
* sem_util.ads (Predicate_Failure_Expression,
Predicate_Function_Needs_Membership_Parameter): New functions.
* sem_util.adb (Is_Current_Instance): Fix bugs which caused
wrong result.
(Is_Current_Instance_Reference_In_Type_Aspect): Delete
Is_Predicate_Function_M reference.
(Predicate_Failure_Expression): New function.
(Propagate_Predicate_Attributes): Delete Is_Predicate_Function_M
references.
[-- Attachment #2: patch.diff.gz --]
[-- Type: application/gzip, Size: 12914 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-19 14:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19 14:16 [Ada] Fix bug in handling of Predicate_Failure aspect Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).