From: Eric Botcazou Date: Sat, 4 Jul 2026 08:13:13 +0000 (+0200) Subject: Remove obsolete support for ADA_LONG_TYPE_SIZE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc8a4e9a96c1789e1da4aacba188cf2ece1d493e;p=thirdparty%2Fgcc.git 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 --git a/gcc/ada/gcc-interface/targtyps.cc b/gcc/ada/gcc-interface/targtyps.cc index 4768322e15a..772e965162e 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 85517bf3318..2e27d3cf130 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 fc77cafaaff..f217f188bf5 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 30ca0b3081a..1401b9cbf89 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 f8b3b1d5e7a..ef3a3f8470d 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 f142e8a3656..fec92bd9db3 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 cfbfb0a79c4..247a13e53d7 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 b23706db1f7..bf29e930edc 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 b986f41406b..0951887dd92 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 a5785b93720..85e17525683 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 3d295eb5b49..1a9edd0635d 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 36f73a70f70..5b8323c28e5 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 \