re PR tree-optimization/62021 (ICE in verify_gimple_assign_single)
PR tree-optimization/62021 * omp-low.c (simd_clone_adjust_return_type): Use vector of pointer_sized_int_node types instead vector of pointer types. (simd_clone_adjust_argument_types): Likewise. * gcc.dg/vect/pr62021.c: New test. From-SVN: r218603
This commit is contained in:
parent
3ec5dd98f0
commit
1c4967b998
4 changed files with 59 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
|||
2014-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/62021
|
||||
* omp-low.c (simd_clone_adjust_return_type): Use
|
||||
vector of pointer_sized_int_node types instead vector of pointer
|
||||
types.
|
||||
(simd_clone_adjust_argument_types): Likewise.
|
||||
|
||||
2014-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||
Evgeny Stupachenko <evstupac@gmail.com>
|
||||
|
||||
|
|
|
@ -11590,24 +11590,24 @@ simd_clone_adjust_return_type (struct cgraph_node *node)
|
|||
if (orig_rettype == void_type_node)
|
||||
return NULL_TREE;
|
||||
TREE_TYPE (fndecl) = build_distinct_type_copy (TREE_TYPE (fndecl));
|
||||
if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl)))
|
||||
|| POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))))
|
||||
t = TREE_TYPE (TREE_TYPE (fndecl));
|
||||
if (INTEGRAL_TYPE_P (t) || POINTER_TYPE_P (t))
|
||||
veclen = node->simdclone->vecsize_int;
|
||||
else
|
||||
veclen = node->simdclone->vecsize_float;
|
||||
veclen /= GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (fndecl))));
|
||||
veclen /= GET_MODE_BITSIZE (TYPE_MODE (t));
|
||||
if (veclen > node->simdclone->simdlen)
|
||||
veclen = node->simdclone->simdlen;
|
||||
if (POINTER_TYPE_P (t))
|
||||
t = pointer_sized_int_node;
|
||||
if (veclen == node->simdclone->simdlen)
|
||||
TREE_TYPE (TREE_TYPE (fndecl))
|
||||
= build_vector_type (TREE_TYPE (TREE_TYPE (fndecl)),
|
||||
node->simdclone->simdlen);
|
||||
t = build_vector_type (t, node->simdclone->simdlen);
|
||||
else
|
||||
{
|
||||
t = build_vector_type (TREE_TYPE (TREE_TYPE (fndecl)), veclen);
|
||||
t = build_vector_type (t, veclen);
|
||||
t = build_array_type_nelts (t, node->simdclone->simdlen / veclen);
|
||||
TREE_TYPE (TREE_TYPE (fndecl)) = t;
|
||||
}
|
||||
TREE_TYPE (TREE_TYPE (fndecl)) = t;
|
||||
if (!node->definition)
|
||||
return NULL_TREE;
|
||||
|
||||
|
@ -11696,7 +11696,10 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
|
|||
if (veclen > node->simdclone->simdlen)
|
||||
veclen = node->simdclone->simdlen;
|
||||
adj.arg_prefix = "simd";
|
||||
adj.type = build_vector_type (parm_type, veclen);
|
||||
if (POINTER_TYPE_P (parm_type))
|
||||
adj.type = build_vector_type (pointer_sized_int_node, veclen);
|
||||
else
|
||||
adj.type = build_vector_type (parm_type, veclen);
|
||||
node->simdclone->args[i].vector_type = adj.type;
|
||||
for (j = veclen; j < node->simdclone->simdlen; j += veclen)
|
||||
{
|
||||
|
@ -11737,7 +11740,10 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
|
|||
veclen /= GET_MODE_BITSIZE (TYPE_MODE (base_type));
|
||||
if (veclen > node->simdclone->simdlen)
|
||||
veclen = node->simdclone->simdlen;
|
||||
adj.type = build_vector_type (base_type, veclen);
|
||||
if (POINTER_TYPE_P (base_type))
|
||||
adj.type = build_vector_type (pointer_sized_int_node, veclen);
|
||||
else
|
||||
adj.type = build_vector_type (base_type, veclen);
|
||||
adjustments.safe_push (adj);
|
||||
|
||||
for (j = veclen; j < node->simdclone->simdlen; j += veclen)
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2014-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/62021
|
||||
* gcc.dg/vect/pr62021.c: New test.
|
||||
|
||||
2014-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||
Evgeny Stupachenko <evstupac@gmail.com>
|
||||
|
||||
|
|
30
gcc/testsuite/gcc.dg/vect/pr62021.c
Normal file
30
gcc/testsuite/gcc.dg/vect/pr62021.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* { dg-require-effective-target vect_simd_clones } */
|
||||
/* { dg-additional-options "-fopenmp-simd" } */
|
||||
/* { dg-additional-options "-mavx" { target avx_runtime } } */
|
||||
|
||||
#pragma omp declare simd linear(y)
|
||||
__attribute__((noinline)) int *
|
||||
foo (int *x, int y)
|
||||
{
|
||||
return x + y;
|
||||
}
|
||||
|
||||
int a[1024];
|
||||
int *b[1024] = { &a[0] };
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 1024; i++)
|
||||
b[i] = &a[1023 - i];
|
||||
#pragma omp simd
|
||||
for (i = 0; i < 1024; i++)
|
||||
b[i] = foo (b[i], i);
|
||||
for (i = 0; i < 1024; i++)
|
||||
if (b[i] != &a[1023])
|
||||
__builtin_abort ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
Loading…
Add table
Reference in a new issue