https://gcc.gnu.org/g:fc8a4e9a96c1789e1da4aacba188cf2ece1d493e

commit r17-2166-gfc8a4e9a96c1789e1da4aacba188cf2ece1d493e
Author: Eric Botcazou <[email protected]>
Date:   Sat Jul 4 10:13:13 2026 +0200

    Remove obsolete support for ADA_LONG_TYPE_SIZE
    
    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.

Diff:
---
 gcc/ada/gcc-interface/targtyps.cc     | 8 +-------
 gcc/ada/gnatlink.adb                  | 3 ---
 gcc/ada/libgnat/i-c.ads               | 8 +++-----
 gcc/ada/libgnat/i-cstrin.ads          | 2 ++
 gcc/ada/libgnat/s-crtl.ads            | 5 +----
 gcc/ada/libgnat/s-parame.ads          | 5 -----
 gcc/ada/libgnat/s-parame__hpux.ads    | 5 -----
 gcc/ada/libgnat/s-parame__vxworks.ads | 5 -----
 gcc/config/vms/vms.h                  | 3 +--
 gcc/doc/tm.texi                       | 8 --------
 gcc/doc/tm.texi.in                    | 8 --------
 gcc/system.h                          | 2 +-
 12 files changed, 9 insertions(+), 53 deletions(-)

diff --git a/gcc/ada/gcc-interface/targtyps.cc 
b/gcc/ada/gcc-interface/targtyps.cc
index 4768322e15ae..772e965162ea 100644
--- a/gcc/ada/gcc-interface/targtyps.cc
+++ b/gcc/ada/gcc-interface/targtyps.cc
@@ -39,12 +39,6 @@
 #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
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index 85517bf3318d..2e27d3cf130f 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -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;
diff --git a/gcc/ada/libgnat/i-c.ads b/gcc/ada/libgnat/i-c.ads
index fc77cafaaffe..f217f188bf55 100644
--- a/gcc/ada/libgnat/i-c.ads
+++ b/gcc/ada/libgnat/i-c.ads
@@ -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;
diff --git a/gcc/ada/libgnat/i-cstrin.ads b/gcc/ada/libgnat/i-cstrin.ads
index 30ca0b3081a5..1401b9cbf892 100644
--- a/gcc/ada/libgnat/i-cstrin.ads
+++ b/gcc/ada/libgnat/i-cstrin.ads
@@ -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)),
diff --git a/gcc/ada/libgnat/s-crtl.ads b/gcc/ada/libgnat/s-crtl.ads
index f8b3b1d5e7a6..ef3a3f8470d7 100644
--- a/gcc/ada/libgnat/s-crtl.ads
+++ b/gcc/ada/libgnat/s-crtl.ads
@@ -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;
 
diff --git a/gcc/ada/libgnat/s-parame.ads b/gcc/ada/libgnat/s-parame.ads
index f142e8a3656a..fec92bd9db3f 100644
--- a/gcc/ada/libgnat/s-parame.ads
+++ b/gcc/ada/libgnat/s-parame.ads
@@ -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
diff --git a/gcc/ada/libgnat/s-parame__hpux.ads 
b/gcc/ada/libgnat/s-parame__hpux.ads
index cfbfb0a79c40..247a13e53d75 100644
--- a/gcc/ada/libgnat/s-parame__hpux.ads
+++ b/gcc/ada/libgnat/s-parame__hpux.ads
@@ -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
diff --git a/gcc/ada/libgnat/s-parame__vxworks.ads 
b/gcc/ada/libgnat/s-parame__vxworks.ads
index b23706db1f79..bf29e930edc0 100644
--- a/gcc/ada/libgnat/s-parame__vxworks.ads
+++ b/gcc/ada/libgnat/s-parame__vxworks.ads
@@ -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
diff --git a/gcc/config/vms/vms.h b/gcc/config/vms/vms.h
index b986f41406b2..0951887dd92e 100644
--- a/gcc/config/vms/vms.h
+++ b/gcc/config/vms/vms.h
@@ -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
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index a5785b93720c..85e175256833 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -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
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 3d295eb5b49e..1a9edd0635d0 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -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
diff --git a/gcc/system.h b/gcc/system.h
index 36f73a70f708..5b8323c28e51 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -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  \

Reply via email to