aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/targtyps.c
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2009-09-28 17:00:46 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2009-09-28 17:00:46 +0000
commit2d3a1837bcf31c9a622d810d29179081613346df (patch)
tree2f8f64723bebd4ae3286b02c84a5c7a1e7eb9732 /gcc/ada/gcc-interface/targtyps.c
parentd366d023cbfcdefc9aebbbef54e49acc4fe4a5dd (diff)
downloadgcc-2d3a1837bcf31c9a622d810d29179081613346df.zip
gcc-2d3a1837bcf31c9a622d810d29179081613346df.tar.gz
gcc-2d3a1837bcf31c9a622d810d29179081613346df.tar.bz2
ada/
* gcc-interface/targtyps.c * (get_target_default_allocator_alignment): Account for observable alignments out of default allocators. testsuite/ * gnat.dg (tagged_alloc_free.adb): New testcase. From-SVN: r152243
Diffstat (limited to 'gcc/ada/gcc-interface/targtyps.c')
-rw-r--r--gcc/ada/gcc-interface/targtyps.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ada/gcc-interface/targtyps.c b/gcc/ada/gcc-interface/targtyps.c
index 716550e..9bc8f0e 100644
--- a/gcc/ada/gcc-interface/targtyps.c
+++ b/gcc/ada/gcc-interface/targtyps.c
@@ -160,10 +160,21 @@ get_target_maximum_default_alignment (void)
handy and what alignment it honors). In the meantime, resort to malloc
considerations only. */
+/* Account for MALLOC_OBSERVABLE_ALIGNMENTs here. Use this or the ABI
+ guaranteed alignment if greater. */
+
+#ifdef MALLOC_OBSERVABLE_ALIGNMENT
+#define MALLOC_ALIGNMENT MALLOC_OBSERVABLE_ALIGNMENT
+#else
+#define MALLOC_OBSERVABLE_ALIGNMENT (2 * LONG_TYPE_SIZE)
+#define MALLOC_ALIGNMENT \
+ MAX (MALLOC_ABI_ALIGNMENT, MALLOC_OBSERVABLE_ALIGNMENT)
+#endif
+
Pos
get_target_default_allocator_alignment (void)
{
- return MALLOC_ABI_ALIGNMENT / BITS_PER_UNIT;
+ return MALLOC_ALIGNMENT / BITS_PER_UNIT;
}
/* Standard'Maximum_Allowed_Alignment. Maximum alignment that we may