view gcc/testsuite/c-c++-common/vector-subscript-4.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized -w -Wno-psabi" } */

#define foobar(n) \
    typedef int v##n##si __attribute__ ((vector_size (4 * n))); \
\
int \
foo##n(int x, v##n##si v) \
{ \
  v[0] ^= v[1]; \
  return ((v##n##si)v)[x]; \
} \
\
int \
bar##n(int x, v##n##si v) \
{ \
  v[0] ^= v[1]; \
  return v[x]; \
}

foobar(2)
foobar(4)
foobar(8)
foobar(16)
foobar(32)
foobar(64)

/* Verify we don't have any vector temporaries in the IL.  */
/* { dg-final { scan-tree-dump-not "vector" "optimized" } } */