From: Jakub Jelinek Date: Wed, 10 Dec 2014 20:01:12 +0000 (+0100) Subject: re PR tree-optimization/62021 (ICE in verify_gimple_assign_single) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c4967b998b0171712d7a208c6bb68528a5449a1;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cce54061e4d..29f3e6bd25b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-12-10 Jakub Jelinek + + 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 Evgeny Stupachenko diff --git a/gcc/omp-low.c b/gcc/omp-low.c index a5cf9251973..ef143ab5651 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0f204acd684..0352b28df04 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-10 Jakub Jelinek + + PR tree-optimization/62021 + * gcc.dg/vect/pr62021.c: New test. + 2014-12-10 Jakub Jelinek Evgeny Stupachenko diff --git a/gcc/testsuite/gcc.dg/vect/pr62021.c b/gcc/testsuite/gcc.dg/vect/pr62021.c new file mode 100644 index 00000000000..e0208e63b36 --- /dev/null +++ b/gcc/testsuite/gcc.dg/vect/pr62021.c @@ -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" } } */