diff options
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
| -rw-r--r-- | gcc/ada/exp_ch4.adb | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 520ab68..1c9dc07 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -2240,7 +2240,7 @@ package body Exp_Ch4 is -- Note: Entity for the comparison may be wrong, but it's not worth -- the effort to change it, since the back end does not use it. - if Is_Signed_Integer_Type (Ltype) + if Has_Overflow_Operations (Ltype) and then Base_Type (Ltype) = Base_Type (Rtype) then return; @@ -4386,7 +4386,7 @@ package body Exp_Ch4 is for J in 1 .. Number_Dimensions (E) loop - if not Is_Modular_Integer_Type (Etype (Idx)) then + if not Has_Modular_Operations (Etype (Idx)) then Len := Make_Attribute_Reference (Loc, Prefix => New_Occurrence_Of (E, Loc), @@ -7825,7 +7825,7 @@ package body Exp_Ch4 is -- Deal with software overflow checking - if Is_Signed_Integer_Type (Typ) + if Has_Overflow_Operations (Typ) and then Do_Overflow_Check (N) then -- The only case to worry about is when the argument is equal to the @@ -7898,11 +7898,8 @@ package body Exp_Ch4 is -- Arithmetic overflow checks for signed integer/fixed point types, -- and signed integer types with unsigned base range aspect. - if Is_Signed_Integer_Type (Typ) + if Has_Overflow_Operations (Typ) or else Is_Fixed_Point_Type (Typ) - or else - (Is_Modular_Integer_Type (Typ) - and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) then Apply_Arithmetic_Overflow_Check (N); return; @@ -9073,7 +9070,7 @@ package body Exp_Ch4 is -- therefore we might need to generate an overflow check here -- if the type is signed. - if Is_Signed_Integer_Type (Typ) and then Ovflo then + if Has_Overflow_Operations (Typ) and then Ovflo then declare OK : Boolean; Lo : Uint; @@ -9112,7 +9109,7 @@ package body Exp_Ch4 is -- First deal with modular case - if Is_Modular_Integer_Type (Rtyp) then + if Has_Modular_Operations (Rtyp) then -- Nonbinary modular case, we call the special exponentiation -- routine for the nonbinary case, converting the argument to @@ -9173,7 +9170,7 @@ package body Exp_Ch4 is -- checks are required, and one when they are not required, since there -- is a real gain in omitting checks on many machines. - elsif Is_Signed_Integer_Type (Rtyp) then + elsif Has_Overflow_Operations (Rtyp) then if Esize (Rtyp) <= Standard_Integer_Size then Etyp := Standard_Integer; @@ -9494,11 +9491,7 @@ package body Exp_Ch4 is end if; if not Backend_Overflow_Checks_On_Target - and then - (Is_Signed_Integer_Type (Typ) - or else - (Is_Modular_Integer_Type (Typ) - and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ)))) + and then Has_Overflow_Operations (Typ) and then Do_Overflow_Check (N) then -- Software overflow checking expands -expr into (0 - expr) @@ -9809,7 +9802,7 @@ package body Exp_Ch4 is -- If the result is modular, perform the reduction of the result -- appropriately. - if Is_Modular_Integer_Type (Typ) + if Has_Modular_Operations (Typ) and then not Non_Binary_Modulus (Typ) then Rewrite (N, @@ -9837,7 +9830,7 @@ package body Exp_Ch4 is -- Same processing for the operands the other way round elsif Lp2 then - if Is_Modular_Integer_Type (Typ) + if Has_Modular_Operations (Typ) and then not Non_Binary_Modulus (Typ) then Rewrite (N, @@ -9922,11 +9915,7 @@ package body Exp_Ch4 is -- Non-fixed point cases, check software overflow checking required - elsif Is_Signed_Integer_Type (Etype (N)) - or else - (Is_Modular_Integer_Type (Typ) - and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) - then + elsif Has_Overflow_Operations (Etype (N)) then Apply_Arithmetic_Overflow_Check (N); end if; @@ -10493,11 +10482,8 @@ package body Exp_Ch4 is -- Arithmetic overflow checks for signed integer/fixed point types, -- and signed integer types with unsigned base range aspect. - if Is_Signed_Integer_Type (Typ) + if Has_Overflow_Operations (Typ) or else Is_Fixed_Point_Type (Typ) - or else - (Is_Modular_Integer_Type (Typ) - and then Has_Unsigned_Base_Range_Aspect (Base_Type (Typ))) then Apply_Arithmetic_Overflow_Check (N); end if; |
