From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 53CC33858C52; Wed, 18 May 2022 08:44:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53CC33858C52 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-609] [Ada] Fix proof of runtime unit s-valeu X-Act-Checkin: gcc X-Git-Author: Claire Dross X-Git-Refname: refs/heads/master X-Git-Oldrev: df4451ca663e251e5524ebedb34bbe0cbfc45e52 X-Git-Newrev: 6f8f9d1bcf55187cb81ef7b0ef1e23db1bc0d440 Message-Id: <20220518084459.53CC33858C52@sourceware.org> Date: Wed, 18 May 2022 08:44:59 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 08:44:59 -0000 https://gcc.gnu.org/g:6f8f9d1bcf55187cb81ef7b0ef1e23db1bc0d440 commit r13-609-g6f8f9d1bcf55187cb81ef7b0ef1e23db1bc0d440 Author: Claire Dross Date: Fri Apr 8 16:38:47 2022 +0200 [Ada] Fix proof of runtime unit s-valeu Update to provers caused some proof regressions. Fix the proof by changing ghost code. gcc/ada/ * libgnat/s-valueu.adb (Scan_Raw_Unsigned): Add assertions. Diff: --- gcc/ada/libgnat/s-valueu.adb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/ada/libgnat/s-valueu.adb b/gcc/ada/libgnat/s-valueu.adb index b8bfd447237..f5a6881dbc5 100644 --- a/gcc/ada/libgnat/s-valueu.adb +++ b/gcc/ada/libgnat/s-valueu.adb @@ -522,6 +522,9 @@ package body System.Value_U is Uval := Base; Base := 10; pragma Assert (Ptr.all = Last_Num_Init + 1); + pragma Assert + (if Starts_As_Based then P = Last_Num_Based + 1); + pragma Assert (not Is_Based); pragma Assert (if not Overflow then Uval = Init_Val.Value); exit; end if; @@ -569,10 +572,6 @@ package body System.Value_U is end if; end if; - Lemma_Scan_Digit - (Str, P, Last_Num_Based, Digit, Base, Old_Uval, Uval, - Based_Val, Old_Overflow, Overflow); - -- If at end of string with no base char, not a based number -- but we signal Constraint_Error and set the pointer past -- the end of the field, since this is what the ACVC tests @@ -580,6 +579,10 @@ package body System.Value_U is P := P + 1; + Lemma_Scan_Digit + (Str, P - 1, Last_Num_Based, Digit, Base, Old_Uval, Uval, + Based_Val, Old_Overflow, Overflow); + if P > Max then Ptr.all := P; Bad_Value (Str); @@ -590,6 +593,7 @@ package body System.Value_U is if Str (P) = Base_Char then Ptr.all := P + 1; pragma Assert (Ptr.all = Last_Num_Based + 2); + pragma Assert (Is_Based); pragma Assert (if not Overflow then Based_Val = Scan_Based_Number_Ghost