]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix internal consistency error with Duration and 32-bit target file
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 16 Dec 2020 14:18:13 +0000 (15:18 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 29 Apr 2021 08:00:47 +0000 (04:00 -0400)
gcc/ada/

* gnat1drv.adb (Adjust_Global_Switches): Force a 32-bit Duration
type if the maximum integer size is lower than 64 bits.

gcc/ada/gnat1drv.adb

index 0318194e0dddd14ebef28be514e9c8268de5a5ae..4bdac5efd5ee901e65c2891ffb312f759c1d9e0c 100644 (file)
@@ -819,6 +819,12 @@ procedure Gnat1drv is
            Ttypes.Standard_Long_Long_Integer_Size;
       end if;
 
+      --  Forcefully use a 32-bit Duration with only 32-bit integer types
+
+      if Ttypes.System_Max_Integer_Size < 64 then
+         Targparm.Duration_32_Bits_On_Target := True;
+      end if;
+
       --  Finally capture adjusted value of Suppress_Options as the initial
       --  value for Scope_Suppress, which will be modified as we move from
       --  scope to scope (by Suppress/Unsuppress/Overflow_Checks pragmas).