This turns the call to Directly_Designated_Type into a call to Designated_Type in the recently applied change aimed at improving the handling of the indirect array case. It is OK to look at the actual designated type here.
Tested on x86_64-pc-linux-gnu, committed on trunk 2011-09-27 Eric Botcazou <ebotca...@adacore.com> * checks.adb (Apply_Scalar_Range_Check): Use Designated_Type instead of Directly_Designated_Type in the indirect array case.
Index: checks.adb =================================================================== --- checks.adb (revision 179247) +++ checks.adb (working copy) @@ -1879,7 +1879,7 @@ Arr_Typ := Get_Actual_Subtype_If_Available (Arr); if Is_Access_Type (Arr_Typ) then - Arr_Typ := Directly_Designated_Type (Arr_Typ); + Arr_Typ := Designated_Type (Arr_Typ); end if; end if;