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

--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
This fails for all versions (7,8,9) for me:

$ cat pr91042.cc
typedef enum { Op_swap_rb, Op_matrix_3x3 } Op;
template <int N, typename T> struct A {
  typedef T __attribute__((vector_size(N * sizeof(T)))) V;
};
template <int N, typename T> using Vec = typename A<N, T>::V;
using F = Vec<4, float>;
using U8 = Vec<4, unsigned char>;
template <typename T, typename P> void store(P p1, T p2) {
  __builtin_memcpy(p1, &p2, sizeof(p2));
}
template <typename D, typename S> D cast(S p1) { return D{p1[3]}; }
Op *a;
int b;
F c, d;
void exec_ops() {
  while (true)
    switch (*a) {
    case Op_swap_rb: {
      F t = c;
      c = d;
      d = t;
    }
    case Op_matrix_3x3:
      __attribute__((__vector_size__(4))) unsigned char e = cast<U8>(d);
      store(&b, e);
    }
}

Reply via email to