aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils2.c
diff options
context:
space:
mode:
authorDoug Rupp <rupp@adacore.com>2008-04-09 07:29:49 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2008-04-09 09:29:49 +0200
commit6d21c8af174ff13abfce72ca8be40c1def60c53f (patch)
tree3bed774c159dc49c2f890569006e31cfddf96381 /gcc/ada/utils2.c
parentbcac2b894be79264093f09938da22bf52bbeb6bb (diff)
downloadgcc-6d21c8af174ff13abfce72ca8be40c1def60c53f.zip
gcc-6d21c8af174ff13abfce72ca8be40c1def60c53f.tar.gz
gcc-6d21c8af174ff13abfce72ca8be40c1def60c53f.tar.bz2
decl.c (validate_size): Set minimum size for fat pointers same as access types.
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. From-SVN: r134131
Diffstat (limited to 'gcc/ada/utils2.c')
-rw-r--r--gcc/ada/utils2.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 170fad7..a380d44 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -1918,7 +1918,14 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align,
{
if (Nkind (gnat_node) != N_Allocator || !Comes_From_Source (gnat_node))
Check_No_Implicit_Heap_Alloc (gnat_node);
- return build_call_1_expr (malloc_decl, gnu_size);
+
+ /* If the allocator size is 32bits but the pointer size is 64bits then
+ allocate 32bit memory (sometimes necessary on 64bit VMS). Otherwise
+ default to standard malloc. */
+ if (UI_To_Int (Esize (Etype (gnat_node))) == 32 && POINTER_SIZE == 64)
+ return build_call_1_expr (malloc32_decl, gnu_size);
+ else
+ return build_call_1_expr (malloc_decl, gnu_size);
}
}