I need to access unbalanced values using the GCC vector extension
The program below crashes - both in clang and gcc
typedef int __attribute__((vector_size(16))) int4;
typedef int __attribute__((vector_size(16),aligned(4))) *int4p;
int main()
{
int v[64] __attribute__((aligned(16))) = {};
int4p ptr = reinterpret_cast<int4p>(&v[7]);
int4 val = *ptr;
}
However, if I change
typedef int __attribute__((vector_size(16),aligned(4))) *int4p;
to
typedef int __attribute__((vector_size(16),aligned(4))) int4u;
typedef int4u *int4up;
The generated assembly code is correct (using uncluttered load) - both in clang and in gcc.
What is wrong with a single definition or what will I skip? Could this be the same error in both clang and gcc?
Note: this happens in both clang and gcc
source
share