===================================================================
@@ -1584,8 +1584,14 @@
elsif ASIS_Mode then
return;
- -- See if we need elaboration entity.
+ -- Do not generate an elaboration entity in GNATprove move because the
+ -- elaboration counter is a form of expansion.
+ elsif GNATprove_Mode then
+ return;
+
+ -- See if we need elaboration entity
+
-- We always need an elaboration entity when preserving control flow, as
-- we want to remain explicit about the unit's elaboration order.
===================================================================
@@ -2573,9 +2573,15 @@
-- Call is not at outer level
else
+ -- Do not generate elaboration checks in GNATprove mode because the
+ -- elaboration counter and the check are both forms of expansion.
+
+ if GNATprove_Mode then
+ null;
+
-- Deal with dynamic elaboration check
- if not Elaboration_Checks_Suppressed (E) then
+ elsif not Elaboration_Checks_Suppressed (E) then
Set_Elaboration_Entity_Required (E);
-- Case of no elaboration entity allocated yet