summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-06 07:57:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-06 07:57:04 +0000
commit6e8c8b10223ad14319cd4bf1d36cefb3d72e82ff (patch)
tree71efd33f5f59a832e3b2d81100410ebdd6557ba1
parenta17cc77d593f88dd157c90597ec97bc8a649c121 (diff)
downloadppe42-gcc-6e8c8b10223ad14319cd4bf1d36cefb3d72e82ff.tar.gz
ppe42-gcc-6e8c8b10223ad14319cd4bf1d36cefb3d72e82ff.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138767 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/gcc-interface/utils2.c11
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 80d4385182c..72bbd6b393c 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 89fb5f0f419..84d5a587f5b 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -45,6 +45,13 @@
#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);
OpenPOWER on IntegriCloud