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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
So like this where we should return 2 directly

typedef int v2si __attribute__((vector_size(__SIZEOF_INT__ * 2)));
int foo (int *a)
{
  a[0] = 1;
  a[1] = 2;
  v2si x = *(v2si *)a;
  *(v2si *)&a[2] = x;
  return a[3];
}

but also the following where the redundant { x, y } should be used for
the last store and x returned directly.

typedef int v2si __attribute__((vector_size(__SIZEOF_INT__ * 2)));
int foo (int *a, int x, int y)
{
  *(v2si *)a = (v2si){ x, y };
  a[2] = x;
  a[3] = y;
  v2si z = *(v2si *)&a[2];
  *(v2si *)&a[4] = z;
  return a[4];
}

Reply via email to