diff options
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r-- | gcc/ada/checks.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 6162a0e38c0..a6670fa7697 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -1818,6 +1818,13 @@ package body Checks is and then ((not LOK) or else (Llo = LLB)) then + -- Ensure that expressions are not evaluated twice (once + -- for their runtime checks and once for their regular + -- computation). + + Force_Evaluation (Left, Mode => Strict); + Force_Evaluation (Right, Mode => Strict); + Insert_Action (N, Make_Raise_Constraint_Error (Loc, Condition => |