https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98317

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'm not convinced it is a bug.  Because vector_size by definition increases the
alignment, say if you have vector_size on int, the vector type doesn't have
alignof(int) alignment, but alignment of the vector type.
Similarly, if one uses
typedef int T __attribute__((aligned (1)));
typedef T V __attribute__((vector_size (16)));
I'd argue that V should have still 16-byte alignment.
Having the attributes on the same typedef or on the same type is a grey area,
but what we do currently matches what is done with the separate typedefs.
I'd strongly suggest to use separate typedefs, i.e. one that makes a vector
type
typedef float V __attribute__((vector_size (16)));
and then another one that makes it unaligned:
typedef V U __attribute__((aligned (1)));

Reply via email to