mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-25 05:30:25 +08:00
s-arit64.adb (Double_Divide): Put back changes that got accidentally removed during the previous update (test...
* s-arit64.adb (Double_Divide): Put back changes that got accidentally removed during the previous update (test properly for case of dividing largest negative number by -1, which generates overflow). From-SVN: r92847
This commit is contained in:
parent
01af9aff56
commit
4bb6d5fd42
@ -232,6 +232,19 @@ package body System.Arith_64 is
|
||||
end if;
|
||||
|
||||
Du := Lo (T2) & Lo (T1);
|
||||
|
||||
-- Set final signs (RM 4.5.5(27-30))
|
||||
|
||||
Den_Pos := (Y < 0) = (Z < 0);
|
||||
|
||||
-- Check overflow case of largest negative number divided by 1
|
||||
|
||||
if X = Int64'First and then Du = 1 and then not Den_Pos then
|
||||
Raise_Error;
|
||||
end if;
|
||||
|
||||
-- Perform the actual division
|
||||
|
||||
Qu := Xu / Du;
|
||||
Ru := Xu rem Du;
|
||||
|
||||
@ -241,10 +254,6 @@ package body System.Arith_64 is
|
||||
Qu := Qu + Uns64'(1);
|
||||
end if;
|
||||
|
||||
-- Set final signs (RM 4.5.5(27-30))
|
||||
|
||||
Den_Pos := (Y < 0) = (Z < 0);
|
||||
|
||||
-- Case of dividend (X) sign positive
|
||||
|
||||
if X >= 0 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user