The following testcase fails on mingw32 ======================================================================= typedef int __m128 __attribute__ ((__vector_size__ (16), __may_alias__)); typedef union { float f[4]; __m128 m; } foo; int test1[__alignof(__m128) >= 16 ? 1 : -1 ]; // OK int test2[__alignof(foo) >= 16 ? 1 : -1 ]; // Fails: alignof foo = 8 ======================================================================== with: > foo.c:11: error: size of array 'test2' is negative. The problem is config/i386/cygming.h #define BIGGEST_FIELD_ALIGNMENT 64 which is a leftover from a time when this define was necessary and sufficient to enable 8 byte alignment for doubles--consistent with the target default MASK_ALIGN_DOUBLE--and when GNU ld could only handle 8 byte alignment. Currently testing a patch.
Subject: Bug number PR target/33774 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00853.html
The native compiler MSVC++ does not limit field alignment to 64 bits, but as documented here Windows Data Alignment on IPF, x86, and x64 http://msdn2.microsoft.com/en-us/library/Aa290049(VS.71).aspx supports at least up to 256-bit field alignment (see Listing 5 in above article).
Subject: Bug 33774 Author: dannysmith Date: Thu Nov 8 20:20:02 2007 New Revision: 130024 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130024 Log: PR target/33774 * config/i386/cygming.h (BIGGEST_FIELD_ALIGNMENT): Define only if IN_TARGET_LIBS. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/cygming.h
Fixed on trunk. Danny