When I defined MALLOC_ABI_ALIGNMENT, I inadvertently changed the default alignment for various hppa*-*-*bsd* targets. Nick Hudson is still maintaining the netbsd target.

This patch corrects the default malloc alignment for 32-bit targest and moves the linux special
case to its own file.

Committed to trunk.

Dave

--
John David Anglin  dave.ang...@bell.net

2018-01-16  John David Anglin  <dang...@gcc.gnu.org>

        * config/pa.h (MALLOC_ABI_ALIGNMENT): Set 32-bit alignment default to
        64 bits.
        * config/pa/pa32-linux.h (MALLOC_ABI_ALIGNMENT): Set alignment to
        128 bits.

Index: config/pa/pa.h
===================================================================
--- config/pa/pa.h      (revision 256561)
+++ config/pa/pa.h      (working copy)
@@ -307,7 +307,7 @@
    POSIX types such as pthread_mutex_t require 16-byte alignment.  Again,
    this is non critical since 16-byte alignment is no longer needed for
    atomic operations.  */
-#define MALLOC_ABI_ALIGNMENT (TARGET_SOM ? 64 : 128)
+#define MALLOC_ABI_ALIGNMENT (TARGET_64BIT ? 128 : 64)
 
 /* Make arrays of chars word-aligned for the same reasons.  */
 #define DATA_ALIGNMENT(TYPE, ALIGN)            \
Index: config/pa/pa32-linux.h
===================================================================
--- config/pa/pa32-linux.h      (revision 256561)
+++ config/pa/pa32-linux.h      (working copy)
@@ -62,3 +62,8 @@
 
 #undef  WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE BITS_PER_WORD
+
+/* POSIX types such as pthread_mutex_t require 16-byte alignment to retain
+   layout compatibility with the original linux thread implementation.  */
+#undef MALLOC_ABI_ALIGNMENT
+#define MALLOC_ABI_ALIGNMENT 128

Reply via email to