]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove obsolete support for ADA_LONG_TYPE_SIZE
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 4 Jul 2026 08:13:13 +0000 (10:13 +0200)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 6 Jul 2026 08:43:44 +0000 (10:43 +0200)
The macro was only defined for VMS and VMS is no longer supported in Ada.

gcc/
* config/vms/vms.h (ADA_LONG_TYPE_SIZE): Delete.
* doc/tm.texi.in (ADA_LONG_TYPE_SIZE): Likewise.
* doc/tm.texi: Regenerate.
* system.h (ADA_LONG_TYPE_SIZE): Poison.

gcc/ada/
* gnatlink.adb: Remove clause for System.CRTL.
(Store_File_Context): Remove clause for System.CRTL.long.
* gcc-interface/targtyps.cc (ADA_LONG_TYPE_SIZE): Delete.
(get_target_long_size): Use LONG_TYPE_SIZE.
* libgnat/i-c.ads: Remove clause for System.Parameters.
(long): Declare as derived from Long_Integer.
* libgnat/i-cstrin.ads: Add clause for System.Parameters.
* libgnat/s-crtl.ads: Remove clause for System.Parameters.
(long): Declare as subtype of Long_Integer.
* libgnat/s-parame.ads (long_bits): Delete.
* libgnat/s-parame__hpux.ads (long_bits): Likewise.
* libgnat/s-parame__vxworks.ads (long_bits): Likewise.

12 files changed:
gcc/ada/gcc-interface/targtyps.cc
gcc/ada/gnatlink.adb
gcc/ada/libgnat/i-c.ads
gcc/ada/libgnat/i-cstrin.ads
gcc/ada/libgnat/s-crtl.ads
gcc/ada/libgnat/s-parame.ads
gcc/ada/libgnat/s-parame__hpux.ads
gcc/ada/libgnat/s-parame__vxworks.ads
gcc/config/vms/vms.h
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/system.h

index 4768322e15ae8449895f65abb7a711146ccd0ee7..772e965162eae8b7e4ad810679f7ef71d7241f53 100644 (file)
 #include "ada-tree.h"
 #include "gigi.h"
 
-/* If we don't have a specific size for Ada's equivalent of `long', use that
-   of C.  */
-#ifndef ADA_LONG_TYPE_SIZE
-#define ADA_LONG_TYPE_SIZE LONG_TYPE_SIZE
-#endif
-
 /* The following provide a functional interface for the front end Ada code
    to determine the sizes that are used for various C types. */
 
@@ -88,7 +82,7 @@ get_target_int_size (void)
 Pos
 get_target_long_size (void)
 {
-  return ADA_LONG_TYPE_SIZE;
+  return LONG_TYPE_SIZE;
 }
 
 Pos
index 85517bf3318dc9e66fc5f4b39491af8267f1055a..2e27d3cf130f2bbcde5983d217f2e263649eae3b 100644 (file)
@@ -45,7 +45,6 @@ with Ada.Exceptions;   use Ada.Exceptions;
 with Ada.Strings.Fixed;
 
 with System.OS_Lib; use System.OS_Lib;
-with System.CRTL;
 
 with Interfaces.C_Streams; use Interfaces.C_Streams;
 with Interfaces.C.Strings; use Interfaces.C.Strings;
@@ -897,8 +896,6 @@ procedure Gnatlink is
       ------------------------
 
       procedure Store_File_Context is
-         use type System.CRTL.long;
-
       begin
          RB_Next_Line := Next_Line;
          RB_Nfirst    := Nfirst;
index fc77cafaaffe5ff68fbcc34def8d9dc85150a61b..f217f188bf55ba5abf12148d1b58485717dbd951 100644 (file)
@@ -28,7 +28,6 @@ pragma Assertion_Policy (Pre            => Ignore,
 --  in order to work around an internal limitation of the compiler.
 
 with System;
-with System.Parameters;
 
 package Interfaces.C with
   SPARK_Mode,
@@ -59,10 +58,9 @@ is
    --  avoid ambiguities when compiling in the presence of s-auxdec.ads and
    --  a non-private system.address type.
 
-   type int   is new Integer;
-   type short is new Short_Integer;
-   type long  is range -(2 ** (System.Parameters.long_bits - Integer'(1)))
-     .. +(2 ** (System.Parameters.long_bits - Integer'(1))) - 1;
+   type int       is new Integer;
+   type short     is new Short_Integer;
+   type long      is new Long_Integer;
    type long_long is new Long_Long_Integer;
 
    type signed_char is range SCHAR_MIN .. SCHAR_MAX;
index 30ca0b3081a560b6bbe1384e7558602b94fb23b5..1401b9cbf8926f2bc7ded276967bea22bdac4d5f 100644 (file)
@@ -45,6 +45,8 @@
 
 pragma Assertion_Policy (Pre => Ignore);
 
+with System.Parameters;
+
 package Interfaces.C.Strings with
   SPARK_Mode     => On,
   Abstract_State => (C_Memory, (C_Addresses with Synchronous)),
index f8b3b1d5e7a61e8704b4d4c7c3f0cc3f3da7f2c3..ef3a3f8470d739390ee631e6b82f52afca4cc3d6 100644 (file)
@@ -31,8 +31,6 @@
 
 --  This package provides the low level interface to the C runtime library
 
-with System.Parameters;
-
 package System.CRTL is
    pragma Preelaborate;
 
@@ -53,8 +51,7 @@ package System.CRTL is
    type unsigned is mod 2 ** 32;
    for unsigned'Size use 32;
 
-   type long is range -(2 ** (System.Parameters.long_bits - 1))
-                   .. +(2 ** (System.Parameters.long_bits - 1)) - 1;
+   subtype long is Long_Integer;
 
    subtype off_t is Long_Integer;
 
index f142e8a3656ac629f7b42c33e5180b33d131c6c4..fec92bd9db3fdc6b0fcce4befa558548f3854f47 100644 (file)
@@ -101,11 +101,6 @@ package System.Parameters is
    -- Characteristics of types in Interfaces.C --
    ----------------------------------------------
 
-   long_bits : constant := Long_Integer'Size;
-   --  Number of bits in type long and unsigned_long. The normal convention
-   --  is that this is the same as type Long_Integer, but this may not be true
-   --  of all targets.
-
    ptr_bits  : constant := Standard'Address_Size;
    subtype C_Address is System.Address;
    --  Number of bits in Interfaces.C pointers, normally a standard address
index cfbfb0a79c40eac7820a85d673f325926a5748c4..247a13e53d75afc7c796c1288be68c256e1e1248 100644 (file)
@@ -100,11 +100,6 @@ package System.Parameters is
    -- Characteristics of Types in Interfaces.C --
    ----------------------------------------------
 
-   long_bits : constant := Long_Integer'Size;
-   --  Number of bits in type long and unsigned_long. The normal convention
-   --  is that this is the same as type Long_Integer, but this may not be true
-   --  of all targets.
-
    ptr_bits  : constant := Standard'Address_Size;
    subtype C_Address is System.Address;
    --  Number of bits in Interfaces.C pointers, normally a standard address
index b23706db1f79ba0b274c5e26c55212bcd9b0a06a..bf29e930edc02fb80fe99de3fd56893728d0b73e 100644 (file)
@@ -102,11 +102,6 @@ package System.Parameters is
    -- Characteristics of types in Interfaces.C --
    ----------------------------------------------
 
-   long_bits : constant := Long_Integer'Size;
-   --  Number of bits in type long and unsigned_long. The normal convention
-   --  is that this is the same as type Long_Integer, but this may not be true
-   --  of all targets.
-
    ptr_bits  : constant := Standard'Address_Size;
    subtype C_Address is System.Address;
    --  Number of bits in Interfaces.C pointers, normally a standard address
index b986f41406b2aace8125aebef56ae9c83ffd4bd8..0951887dd92e2e9d2b5b0864566263ba273b08a4 100644 (file)
@@ -50,10 +50,9 @@ extern void vms_c_register_includes (const char *, const char *, int);
 #undef TARGET_ABI_OPEN_VMS
 #define TARGET_ABI_OPEN_VMS 1
 
-/* "long" is 32 bits, but 64 bits for Ada.  */
+/* "long" is 32 bits.  */
 #undef LONG_TYPE_SIZE
 #define LONG_TYPE_SIZE 32
-#define ADA_LONG_TYPE_SIZE 64
 
 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended.  */
 #undef POINTER_SIZE
index a5785b93720cfcb2789268d851ed2c4d34e4daf2..85e175256833316597b0ab944e8c1f9cfe8d68c6 100644 (file)
@@ -1627,14 +1627,6 @@ A C expression for the size in bits of the type @code{long} on the
 target machine.  If you don't define this, the default is one word.
 @end defmac
 
-@defmac ADA_LONG_TYPE_SIZE
-On some machines, the size used for the Ada equivalent of the type
-@code{long} by a native Ada compiler differs from that used by C@.  In
-that situation, define this macro to be a C expression to be used for
-the size of that type.  If you don't define this, the default is the
-value of @code{LONG_TYPE_SIZE}.
-@end defmac
-
 @defmac LONG_LONG_TYPE_SIZE
 A C expression for the size in bits of the type @code{long long} on the
 target machine.  If you don't define this, the default is two
index 3d295eb5b49e60d4d0047b02e8251c0dd7a870c6..1a9edd0635d03cc7afbffee8e2ec028d6097a5e1 100644 (file)
@@ -1362,14 +1362,6 @@ A C expression for the size in bits of the type @code{long} on the
 target machine.  If you don't define this, the default is one word.
 @end defmac
 
-@defmac ADA_LONG_TYPE_SIZE
-On some machines, the size used for the Ada equivalent of the type
-@code{long} by a native Ada compiler differs from that used by C@.  In
-that situation, define this macro to be a C expression to be used for
-the size of that type.  If you don't define this, the default is the
-value of @code{LONG_TYPE_SIZE}.
-@end defmac
-
 @defmac LONG_LONG_TYPE_SIZE
 A C expression for the size in bits of the type @code{long long} on the
 target machine.  If you don't define this, the default is two
index 36f73a70f70851c3010fa317d9557fa973155c68..5b8323c28e518e0544a0a96e6548d9792c521cdf 100644 (file)
@@ -1087,7 +1087,7 @@ extern void fancy_abort (const char *, int, const char *)
        JCR_SECTION_NAME TARGET_USE_JCR_SECTION SDB_DEBUGGING_INFO         \
        SDB_DEBUG NO_IMPLICIT_EXTERN_C NOTICE_UPDATE_CC                    \
        CC_STATUS_MDEP_INIT CC_STATUS_MDEP CC_STATUS SLOW_SHORT_ACCESS     \
-       WIDEST_HARDWARE_FP_SIZE
+       WIDEST_HARDWARE_FP_SIZE ADA_LONG_TYPE_SIZE
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE  \