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.


-- 
           Summary: Cygwin/mingw do not support 16 byte alignment of
                    struct/union  fields
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: dannysmith at users dot sourceforge dot net
        ReportedBy: dannysmith at users dot sourceforge dot net
 GCC build triplet: i686-pc-mingw32
  GCC host triplet: i686-pc-mingw32
GCC target triplet: i686-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33774

Reply via email to