[Bug tree-optimization/96133] [10/11 Regression] x86-64 gcc 10.1 using -O3 leads to wrong calculation since r10-1882-g831e688af50c5f77

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 9 12:18:30 GMT 2020


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Interestingly it works for int[4] but fails for int[2].

typedef int T;
static const T a[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
typedef T v2 __attribute__((vector_size(2*sizeof(T))));

int
main()
{
  const T *p = &a[0][2];
  v2 x = *(const v2 *)p;
  T z = x[1];
  if (z != 4)
    __builtin_abort ();
  return 0;
}


More information about the Gcc-bugs mailing list