]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2008-08-06 Doug Rupp <rupp@adacore.com>
authorDoug Rupp <rupp@adacore.com>
Wed, 6 Aug 2008 07:57:04 +0000 (07:57 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Aug 2008 07:57:04 +0000 (09:57 +0200)
* gcc-interface/utils2.c (snames.h) Include
(TARGET_ABI_OPEN_VMS): Initialize.
(build_call_alloc_dealloc); [TARGET_ABI_OPEN_VMS] Allocate on 32bit heap
for Convention C.

From-SVN: r138767

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils2.c

index 80d4385182c8ad02513199418fbb6000a10b5fe1..72bbd6b393c92149b96dbafcda056406034da4f7 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-06  Doug Rupp  <rupp@adacore.com>
+
+       * gcc-interface/utils2.c (snames.h) Include
+       (TARGET_ABI_OPEN_VMS): Initialize.
+       (build_call_alloc_dealloc); [TARGET_ABI_OPEN_VMS] Allocate on 32bit heap
+       for Convention C.
+
 2008-08-06  Ed Schonberg  <schonberg@adacore.com>
 
        * sem_ch3.adb (Process_Discriminants): diagnose redundant or improper
index 89fb5f0f419254ca1492a80da68a1e2596b11734..84d5a587f5bd92194146c985c31c3d2739d1ce4d 100644 (file)
 #include "einfo.h"
 #include "ada-tree.h"
 #include "gigi.h"
+#include "snames.h"
+
+/* Let code below know whether we are targetting VMS without need of
+   intrusive preprocessor directives.  */
+#ifndef TARGET_ABI_OPEN_VMS
+#define TARGET_ABI_OPEN_VMS 0
+#endif
 
 static tree find_common_type (tree, tree);
 static bool contains_save_expr_p (tree);
@@ -1950,7 +1957,9 @@ build_call_alloc_dealloc (tree gnu_obj, tree gnu_size, unsigned align,
       /* 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)
+      if (TARGET_ABI_OPEN_VMS && POINTER_SIZE == 64
+         && (UI_To_Int (Esize (Etype (gnat_node))) == 32
+             || Convention (Etype (gnat_node)) == Convention_C))
         return build_call_1_expr (malloc32_decl, gnu_size);
       else
         return build_call_1_expr (malloc_decl, gnu_size);