Commit e740ff85 by Yannick Moy Committed by Pierre-Marie de Rodat

[Ada] Further evaluation of type bounds in GNATprove mode

Some static bounds of types are not recognized and evaluated as such in the
semantic analysis phase of the frontend, which leads to incomplete information
in GNATprove. Fix that in the GNATprove mode only, as this is not needed when
full expansion is used.

There is no impact on compilation.

2018-05-28  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
	GNATprove mode, as the order of resolution (low then high) means that
	all the information is not available when resolving the low bound the
	first time.

From-SVN: r260816
parent 7672ab42
2018-05-28 Yannick Moy <moy@adacore.com>
* sem_res.adb (Resolve_Range): Re-resolve the low bound of a range in
GNATprove mode, as the order of resolution (low then high) means that
all the information is not available when resolving the low bound the
first time.
2018-05-28 Eric Botcazou <ebotcazou@adacore.com>
* repinfo.adb (List_Array_Info): Start with an explicit blank line and
......
......@@ -9800,6 +9800,17 @@ package body Sem_Res is
Resolve (L, Typ);
Resolve (H, Base_Type (Typ));
-- Reanalyze the lower bound after both bounds have been analyzed, so
-- that the range is known to be static or not by now. This may trigger
-- more compile-time evaluation, which is useful for static analysis
-- with GNATprove. This is not needed for compilation or static analysis
-- with CodePeer, as full expansion does that evaluation then.
if GNATprove_Mode then
Set_Analyzed (L, False);
Resolve (L, Typ);
end if;
-- Check for inappropriate range on unordered enumeration type
if Bad_Unordered_Enumeration_Reference (N, Typ)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment