]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix fixed point text-io when subtype has dynamic range
authorMarc Poulhiès <poulhies@adacore.com>
Fri, 29 Nov 2024 08:15:42 +0000 (09:15 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 13 Dec 2024 08:36:02 +0000 (09:36 +0100)
When the fixed point subtype has dynamic range, for example in the
context of a generic procedure Test where Fixed_Type is a type formal:

  procedure Test (Low, High : Fixed_Type) is
    type New_Subtype is new Fixed_Type range Low .. High;
    package New_Io is new Text_IO.Fixed_IO (New_Subtype);

the compiler would complain with:
 non-static universal integer value out of range

Have the check use the Base type for checking what integer type can be
used. If a given integer type can be used for a base type, it can
also be used for any of its subtypes.

gcc/ada/ChangeLog:

* libgnat/a-tifiio.adb (OK_Get_32): Use 'Base.
(OK_Put_32, OK_Get_64, OK_Put_64): Likewise.
* libgnat/a-tifiio__128.adb (OK_Get_32, OK_Put_32, OK_Get_64)
(OK_Put_64, OK_Get_128, OK_Put_128): Likewise.
* libgnat/a-wtfiio.adb (OK_Get_32): Likewise.
(OK_Put_32, OK_Get_64, OK_Put_64): Likewise.
* libgnat/a-wtfiio__128.adb (OK_Get_32, OK_Put_32, OK_Get_64)
(OK_Put_64, OK_Get_128, OK_Put_128): Likewise.
* libgnat/a-ztfiio.adb (OK_Get_32): Likewise.
(OK_Put_32, OK_Get_64, OK_Put_64): Likewise.
* libgnat/a-ztfiio__128.adb (OK_Get_32, OK_Put_32, OK_Get_64)
(OK_Put_64, OK_Get_128, OK_Put_128): Likewise.

gcc/ada/libgnat/a-tifiio.adb
gcc/ada/libgnat/a-tifiio__128.adb
gcc/ada/libgnat/a-wtfiio.adb
gcc/ada/libgnat/a-wtfiio__128.adb
gcc/ada/libgnat/a-ztfiio.adb
gcc/ada/libgnat/a-ztfiio__128.adb

index 7358d123313733a97f2d005111e3915b5444ce99..e4642185b0030930b1f004e10eddb2cecd90ef32 100644 (file)
@@ -191,51 +191,59 @@ package body Ada.Text_IO.Fixed_IO with SPARK_Mode => Off is
    OK_Get_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator <= 2**27
-            and then Num'Small_Denominator <= 2**27));
+          (Num'Base'Small_Numerator <= 2**27
+            and then Num'Base'Small_Denominator <= 2**27));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**27)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**27)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**25));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**25));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator <= 2**59
-            and then Num'Small_Denominator <= 2**59));
+          (Num'Base'Small_Numerator <= 2**59
+            and then Num'Base'Small_Denominator <= 2**59));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**59)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**59)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**53));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**53));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    E : constant Natural := 63 - 32 * Boolean'Pos (OK_Put_32);
index 59ce81cc706c9980d57523fe919c0408276f74b6..57ddfbcedcb523cbfbb8dcc620fc0341bc90be07 100644 (file)
@@ -198,76 +198,88 @@ package body Ada.Text_IO.Fixed_IO with SPARK_Mode => Off is
    OK_Get_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator <= 2**27
-            and then Num'Small_Denominator <= 2**27));
+          (Num'Base'Small_Numerator <= 2**27
+            and then Num'Base'Small_Denominator <= 2**27));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**27)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**27)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**25));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**25));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator <= 2**59
-            and then Num'Small_Denominator <= 2**59));
+          (Num'Base'Small_Numerator <= 2**59
+            and then Num'Base'Small_Denominator <= 2**59));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**59)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**59)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**53));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**53));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_128 : constant Boolean :=
      Num'Base'Object_Size <= 128
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**127)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**127)
            or else
-          (Num'Small_Numerator <= 2**123
-            and then Num'Small_Denominator <= 2**123));
+          (Num'Base'Small_Numerator <= 2**123
+            and then Num'Base'Small_Denominator <= 2**123));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_128 : constant Boolean :=
      Num'Base'Object_Size <= 128
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**127)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**127)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**123)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**123)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**122));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**122));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    E : constant Natural :=
index 195a695d14bf5491fd1d9158e576f22bb6492389..c90760786ad1ba25910443453e4f0918cdfc331f 100644 (file)
@@ -70,51 +70,59 @@ package body Ada.Wide_Text_IO.Fixed_IO is
    OK_Get_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator <= 2**27
-            and then Num'Small_Denominator <= 2**27));
+          (Num'Base'Small_Numerator <= 2**27
+            and then Num'Base'Small_Denominator <= 2**27));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**27)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**27)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**25));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**25));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator <= 2**59
-            and then Num'Small_Denominator <= 2**59));
+          (Num'Base'Small_Numerator <= 2**59
+            and then Num'Base'Small_Denominator <= 2**59));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**59)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**59)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**53));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**53));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    E : constant Natural := 63 - 32 * Boolean'Pos (OK_Put_32);
index 5e0787966988bcdbb7124701973185b07f28d34f..b3ecb46ac47022e324a4fe77e854f7ad18af945f 100644 (file)
@@ -77,76 +77,88 @@ package body Ada.Wide_Text_IO.Fixed_IO is
    OK_Get_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator <= 2**27
-            and then Num'Small_Denominator <= 2**27));
+          (Num'Base'Small_Numerator <= 2**27
+            and then Num'Base'Small_Denominator <= 2**27));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**27)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**27)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**25));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**25));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator <= 2**59
-            and then Num'Small_Denominator <= 2**59));
+          (Num'Base'Small_Numerator <= 2**59
+            and then Num'Base'Small_Denominator <= 2**59));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**59)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**59)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**53));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**53));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_128 : constant Boolean :=
      Num'Base'Object_Size <= 128
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**127)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**127)
            or else
-          (Num'Small_Numerator <= 2**123
-            and then Num'Small_Denominator <= 2**123));
+          (Num'Base'Small_Numerator <= 2**123
+            and then Num'Base'Small_Denominator <= 2**123));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_128 : constant Boolean :=
      Num'Base'Object_Size <= 128
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**127)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**127)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**123)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**123)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**122));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**122));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    E : constant Natural :=
index 011dc903d7b11d5ea347485207a69d4cc25b7b35..1e765ef54741ed836024911b1f545f607db419b7 100644 (file)
@@ -70,51 +70,59 @@ package body Ada.Wide_Wide_Text_IO.Fixed_IO is
    OK_Get_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator <= 2**27
-            and then Num'Small_Denominator <= 2**27));
+          (Num'Base'Small_Numerator <= 2**27
+            and then Num'Base'Small_Denominator <= 2**27));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**27)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**27)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**25));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**25));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator <= 2**59
-            and then Num'Small_Denominator <= 2**59));
+          (Num'Base'Small_Numerator <= 2**59
+            and then Num'Base'Small_Denominator <= 2**59));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**59)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**59)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**53));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**53));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    E : constant Natural := 63 - 32 * Boolean'Pos (OK_Put_32);
index b0556ba44a2c611726173b35006092c3b35bac5e..40d791e8791a12205cbbb607455eab21608a653c 100644 (file)
@@ -78,76 +78,88 @@ package body Ada.Wide_Wide_Text_IO.Fixed_IO is
    OK_Get_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator <= 2**27
-            and then Num'Small_Denominator <= 2**27));
+          (Num'Base'Small_Numerator <= 2**27
+            and then Num'Base'Small_Denominator <= 2**27));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_32 : constant Boolean :=
      Num'Base'Object_Size <= 32
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**31)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**31)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**31)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**31)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**27)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**27)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**25));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**25));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator <= 2**59
-            and then Num'Small_Denominator <= 2**59));
+          (Num'Base'Small_Numerator <= 2**59
+            and then Num'Base'Small_Denominator <= 2**59));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_64 : constant Boolean :=
      Num'Base'Object_Size <= 64
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**63)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**63)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**63)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**63)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**59)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**59)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**53));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**53));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    OK_Get_128 : constant Boolean :=
      Num'Base'Object_Size <= 128
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**127)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**127)
            or else
-          (Num'Small_Numerator <= 2**123
-            and then Num'Small_Denominator <= 2**123));
+          (Num'Base'Small_Numerator <= 2**123
+            and then Num'Base'Small_Denominator <= 2**123));
    --  These conditions are derived from the prerequisites of System.Value_F
 
    OK_Put_128 : constant Boolean :=
      Num'Base'Object_Size <= 128
        and then
-         ((Num'Small_Numerator = 1 and then Num'Small_Denominator <= 2**127)
+         ((Num'Base'Small_Numerator = 1
+            and then Num'Base'Small_Denominator <= 2**127)
            or else
-          (Num'Small_Denominator = 1 and then Num'Small_Numerator <= 2**127)
+          (Num'Base'Small_Denominator = 1
+            and then Num'Base'Small_Numerator <= 2**127)
            or else
-          (Num'Small_Numerator < Num'Small_Denominator
-            and then Num'Small_Denominator <= 2**123)
+          (Num'Base'Small_Numerator < Num'Base'Small_Denominator
+            and then Num'Base'Small_Denominator <= 2**123)
            or else
-          (Num'Small_Denominator < Num'Small_Numerator
-            and then Num'Small_Numerator <= 2**122));
+          (Num'Base'Small_Denominator < Num'Base'Small_Numerator
+            and then Num'Base'Small_Numerator <= 2**122));
    --  These conditions are derived from the prerequisites of System.Image_F
 
    E : constant Natural :=