This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR middle-end/28862, losing user alignment for vectors


I was thinking about a portable way to test this does not happen again
but all I could think of was looking at the asm but now I just
remembered about the alignof expressions.  Here is a testcase which
passes now but failed before the patch:
float x __attribute__((aligned(128),vector_size(8)));
int f[__alignof__(x) == 128?1:-1];

GCC may complain about too high an alignment. Maybe just aligned(16)? Or a smaller vector:


char x __attribute__((aligned(4),vector_size(2)));
int f[__alignof__(x) == 4?1:-1];

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]