This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Enhance VMS runtime to use 64bit heap allocation


Manually tested on alpha-openvms and ia64-openvms,
Tested on i686-linux, committed on trunk

Heretofor the VMS runtime was restricted to 32bit heap allocation due to
restrictions on Task_id (an access type) being a 32bit parameter in calls to
certain legacy VMS Starlet, AST, and RMS functions. This enhancement causes
allocators with 32bit 'size attributes to call the available C RTL 32 bit malloc.

Test program (relebant for VMS only) follows
Expected output is
OK

--
with System.Aux_DEC;
with Text_IO;
with Unchecked_Conversion;
procedure Test1 is

   Type Foo is new Integer;

   type FooA1 is access all Foo;
   for FooA1'Size use System.Aux_DEC.Short_Address_Size;
   Bar1 : FooA1 := new Foo'(1);

   type FooA2 is access all Foo;
   for FooA2'Size use Standard'Address_Size;
   Bar2 : FooA2 := new Foo'(1);

   pragma Warnings (Off);
   function To_Int1 is new Unchecked_Conversion (FooA1, Long_Integer);
   function To_Int2 is new Unchecked_Conversion (FooA2, Long_Integer);
   pragma Warnings (On);

begin
   if FooA1'Size = 32 and FooA2'Size = 64 then
      if To_Int1 (Bar1) < 2**31 and then To_Int2 (Bar2) > 2 ** 31 then
         Text_IO.Put_Line ("OK");
      else
         Text_IO.Put_Line ("Failed");
      end if;
   else
      Text_IO.Put_Line ("OK");
   end if;
end;

2008-04-09  Doug Rupp  <rupp@adacore.com>

	* decl.c (validate_size): Set minimum size for fat pointers same as
	access types. Code clean ups.

	* gmem.c (xstrdup32): New macro for 32bit dup on VMS, noop otherwise
	(__gnat_gmem_a2l_initialize): Dup exename into 32 bit memory on VMS

	* s-auxdec-vms_64.ads, s-auxdec.ads (Short_Address_Size): New constant

	* s-crtl.ads (malloc32) New function, alias for malloc
	(realloc32) New function, alias for realloc

	* socket.c (__gnat_new_socket_set): Malloc fd_set in 32 bits on VMS

	* utils2.c (build_call_alloc_dealloc): Return call to short malloc if
	allocator size is 32 and default pointer size is 64.
	(find_common_type): Document assumption on t1/t2 vs lhs/rhs. Force use of
	lhs type if smaller, whatever the modes.

	* gigi.h (malloc32_decl): New macro definition

	* utils.c (init_gigi_decls): New malloc32_decl
	Various code clean ups.

	* s-asthan-vms-alpha.adb (Process_AST.To_Address): Unchecked convert to
	Task_Address vice System.Address.

	* s-taspri-vms.ads: Import System.Aux_DEC
	(Task_Address): New subtype of System.Aux_DEC.Short_Address
	(Task_Address_Size): New constant size of System.Aux_DEC.Short_Address

	* s-asthan-vms-alpha.adb (Process_AST.To_Address): Unchecked convert to
	Task_Address vice System.Address.

	* s-inmaop-vms.adb: Import System.Task_Primitives
	(To_Address): Unchecked convert to Task_Address vice System.Address

	* s-taprop-vms.adb (Timed_Delay): Always set the timer even if delay
	expires now.
	(To_Task_ID) Unchecked convert from Task_Adddress vice System.Address
	(To_Address) Unchecked convert to Task_Address vice System.Address

	* s-tpopde-vms.adb: Remove unnecessary warning pragmas

	* g-socthi-vms.ads: Add 32bit size clauses on socket access types.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]