From b51d4ebc38cf4852b9c7746647526097f5bd00e9 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 19 Nov 2019 09:51:31 +0100 Subject: [PATCH] re PR tree-optimization/92557 (ICE in omp_clause_aligned_alignment, at omp-low.c:4090) PR tree-optimization/92557 * omp-low.c (omp_clause_aligned_alignment): Punt if TYPE_MODE is not vmode rather than asserting it always is. * gcc.dg/gomp/pr92557.c: New test. From-SVN: r278432 --- gcc/ChangeLog | 6 ++++++ gcc/omp-low.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/gomp/pr92557.c | 13 +++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/gomp/pr92557.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3bd06229c64..3b9e7a85ff7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-11-19 Jakub Jelinek + + PR tree-optimization/92557 + * omp-low.c (omp_clause_aligned_alignment): Punt if TYPE_MODE is not + vmode rather than asserting it always is. + 2019-11-19 Richard Biener PR tree-optimization/92554 diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 3e470afe32b..19132f76da2 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -4086,8 +4086,8 @@ omp_clause_aligned_alignment (tree clause) if (type == NULL_TREE || TYPE_MODE (type) != mode) continue; type = build_vector_type_for_mode (type, vmode); - /* The functions above are not allowed to return invalid modes. */ - gcc_assert (TYPE_MODE (type) == vmode); + if (TYPE_MODE (type) != vmode) + continue; if (TYPE_ALIGN_UNIT (type) > al) al = TYPE_ALIGN_UNIT (type); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 22b54da233c..193a8d84890 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-19 Jakub Jelinek + + PR tree-optimization/92557 + * gcc.dg/gomp/pr92557.c: New test. + 2019-11-19 Richard Biener PR tree-optimization/92554 diff --git a/gcc/testsuite/gcc.dg/gomp/pr92557.c b/gcc/testsuite/gcc.dg/gomp/pr92557.c new file mode 100644 index 00000000000..3d80ca28608 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr92557.c @@ -0,0 +1,13 @@ +/* PR tree-optimization/92557 */ +/* { dg-do compile } */ +/* { dg-additional-options "-maltivec" { target powerpc*-*-* } } */ + +void +foo (double *p) +{ + int i; + +#pragma omp simd aligned (p) + for (i = 0; i < 1; ++i) + p[i] = 7.0; +} -- 2.30.2