re PR tree-optimization/92557 (ICE in omp_clause_aligned_alignment, at omp-low.c...
authorJakub Jelinek <jakub@redhat.com>
Tue, 19 Nov 2019 08:51:31 +0000 (09:51 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 19 Nov 2019 08:51:31 +0000 (09:51 +0100)
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
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gomp/pr92557.c [new file with mode: 0644]

index 3bd06229c64426ba9ae786af13551c572bdd21f6..3b9e7a85ff7b91d48cb80c02bf534b8e79b08afb 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-19  Jakub Jelinek  <jakub@redhat.com>
+
+       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  <rguenther@suse.de>
 
        PR tree-optimization/92554
index 3e470afe32b018770bb9470f9ff71136d4b63108..19132f76da2625e669d2ac45f42b9889d2294907 100644 (file)
@@ -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);
       }
index 22b54da233c446890539c7650a85ebaeda9ca32f..193a8d84890b5f19319ddade0b1ce4b3fd8087c4 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-19  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/92557
+       * gcc.dg/gomp/pr92557.c: New test.
+
 2019-11-19  Richard Biener  <rguenther@suse.de>
 
        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 (file)
index 0000000..3d80ca2
--- /dev/null
@@ -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;
+}