+2016-09-19 Joseph Myers <joseph@codesourcery.com>
+
+ * ginclude/stddef.h (max_align_t) [__i386__]: Add __float128
+ element.
+
2016-09-19 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/77416
+2016-09-19 Joseph Myers <joseph@codesourcery.com>
+
+ * c-common.c (max_align_t_align): Also consider alignment of
+ float128_type_node.
+
2016-09-15 Jason Merrill <jason@redhat.com>
* c-common.c (check_cxx_fundamental_alignment_constraints): Check
unsigned
max_align_t_align ()
{
- return MAX (TYPE_ALIGN (long_long_integer_type_node),
- TYPE_ALIGN (long_double_type_node));
+ unsigned int max_align = MAX (TYPE_ALIGN (long_long_integer_type_node),
+ TYPE_ALIGN (long_double_type_node));
+ if (float128_type_node != NULL_TREE)
+ max_align = MAX (max_align, TYPE_ALIGN (float128_type_node));
+ return max_align;
}
/* Return true iff ALIGN is an integral constant that is a fundamental
typedef struct {
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
+ /* _Float128 is defined as a basic type, so max_align_t must be
+ sufficiently aligned for it. This code must work in C++, so we
+ use __float128 here; that is only available on some
+ architectures, but only on i386 is extra alignment needed for
+ __float128. */
+#ifdef __i386__
+ __float128 __max_align_f128 __attribute__((__aligned__(__alignof(__float128))));
+#endif
} max_align_t;
#endif
#endif /* C11 or C++11. */
+2016-09-19 Joseph Myers <joseph@codesourcery.com>
+
+ * gcc.dg/float128-align.c, gcc.dg/float128x-align.c,
+ gcc.dg/float16-align.c, gcc.dg/float32-align.c,
+ gcc.dg/float32x-align.c, gcc.dg/float64-align.c,
+ gcc.dg/float64x-align.c, gcc.dg/floatn-align.h: New tests.
+
2016-09-19 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/77416
--- /dev/null
+/* Test _Float128 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float128 } */
+/* { dg-require-effective-target float128 } */
+
+#define WIDTH 128
+#define EXT 0
+#include "floatn-align.h"
--- /dev/null
+/* Test _Float128 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float128x } */
+/* { dg-require-effective-target float128x } */
+
+#define WIDTH 128
+#define EXT 1
+#include "floatn-align.h"
--- /dev/null
+/* Test _Float16 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float16 } */
+/* { dg-require-effective-target float16 } */
+
+#define WIDTH 16
+#define EXT 0
+#include "floatn-align.h"
--- /dev/null
+/* Test _Float32 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float32 } */
+/* { dg-require-effective-target float32 } */
+
+#define WIDTH 32
+#define EXT 0
+#include "floatn-align.h"
--- /dev/null
+/* Test _Float32 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float32x } */
+/* { dg-require-effective-target float32x } */
+
+#define WIDTH 32
+#define EXT 1
+#include "floatn-align.h"
--- /dev/null
+/* Test _Float64 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float64 } */
+/* { dg-require-effective-target float64 } */
+
+#define WIDTH 64
+#define EXT 0
+#include "floatn-align.h"
--- /dev/null
+/* Test _Float64 alignment. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+/* { dg-add-options float64x } */
+/* { dg-require-effective-target float64x } */
+
+#define WIDTH 64
+#define EXT 1
+#include "floatn-align.h"
--- /dev/null
+/* Tests for _FloatN / _FloatNx types: test max_align_t alignment.
+ Before including this file, define WIDTH as the value N; define EXT
+ to 1 for _FloatNx and 0 for _FloatN. */
+
+#define CONCATX(X, Y) X ## Y
+#define CONCAT(X, Y) CONCATX (X, Y)
+#define CONCAT3(X, Y, Z) CONCAT (CONCAT (X, Y), Z)
+
+#if EXT
+# define TYPE CONCAT3 (_Float, WIDTH, x)
+#else
+# define TYPE CONCAT (_Float, WIDTH)
+#endif
+
+#include <stddef.h>
+
+_Static_assert (_Alignof (max_align_t) >= _Alignof (TYPE),
+ "max_align_t must be at least as aligned as _Float* types");