aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb29
1 files changed, 10 insertions, 19 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index c30e5f1..a943d00 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -590,20 +590,17 @@ package body Checks is
-- reset to reference the value expression of the constant).
begin
- -- See if alignment check needed. Note that we never need a check if the
- -- maximum alignment is one, since the check will always succeed.
+ -- See if alignment check needed
-- Note: we do not check for checks suppressed here, since that check
-- was done in Sem_Ch13 when the address clause was processed. We are
-- only called if checks were not suppressed. The reason for this is
- -- that we have to delay the call to Apply_Alignment_Check till freeze
- -- time (so that all types etc are elaborated), but we have to check
- -- the status of check suppressing at the point of the address clause.
+ -- that we have to delay the call to Apply_Address_Clause_Check till
+ -- freeze time (so that all types etc are elaborated), but we have to
+ -- check the status of check suppressing at the point of the address
+ -- clause.
- if No (AC)
- or else not Check_Address_Alignment (AC)
- or else Maximum_Alignment = 1
- then
+ if No (AC) or else not Check_Address_Alignment (AC) then
return;
end if;
@@ -5535,9 +5532,7 @@ package body Checks is
-- bound, because that means the result could wrap.
-- Same applies for the lower bound if it is negative.
- if Is_Modular_Integer_Type (Typ)
- and then not Has_Unsigned_Base_Range_Aspect (Btyp)
- then
+ if Has_Modular_Operations (Typ) then
if Lor > Lo and then Hir <= Hbound then
Lo := Lor;
end if;
@@ -6266,11 +6261,9 @@ package body Checks is
if Overflow_Checks_Suppressed (Etype (N)) then
return;
- -- Nothing to do for unsigned integer types, which do not overflow
+ -- Nothing to do for modular integer types, which do not overflow
- elsif Is_Modular_Integer_Type (Typ)
- and then not Has_Unsigned_Base_Range_Aspect (Typ)
- then
+ elsif Has_Modular_Operations (Typ) then
return;
end if;
@@ -8161,9 +8154,7 @@ package body Checks is
elsif Nkind (Expr) = N_Selected_Component
and then Present (Component_Clause (Entity (Selector_Name (Expr))))
- and then
- (Is_Modular_Integer_Type (Typ)
- and then not Has_Unsigned_Base_Range_Aspect (Base_Type (Typ)))
+ and then Has_Modular_Operations (Typ)
and then Modulus (Typ) = 2 ** Esize (Entity (Selector_Name (Expr)))
then
return;