+2019-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/87887
+ * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
+ Punt with warning on aggregate return or argument types. Ignore
+ type/mode checking for uniform arguments.
+
2019-02-01 Segher Boessenkool <segher@kernel.crashing.org>
* combine.c (try_combine): Do not print "Can't combine" messages unless
case E_DFmode:
/* case E_SCmode: */
/* case E_DCmode: */
- break;
+ if (!AGGREGATE_TYPE_P (ret_type))
+ break;
+ /* FALLTHRU */
default:
warning_at (DECL_SOURCE_LOCATION (node->decl), 0,
"unsupported return type %qT for simd", ret_type);
int i;
for (t = DECL_ARGUMENTS (node->decl), i = 0; t; t = DECL_CHAIN (t), i++)
- /* FIXME: Shouldn't we allow such arguments if they are uniform? */
switch (TYPE_MODE (TREE_TYPE (t)))
{
case E_QImode:
case E_DFmode:
/* case E_SCmode: */
/* case E_DCmode: */
- break;
+ if (!AGGREGATE_TYPE_P (TREE_TYPE (t)))
+ break;
+ /* FALLTHRU */
default:
+ if (clonei->args[i].arg_type == SIMD_CLONE_ARG_TYPE_UNIFORM)
+ break;
warning_at (DECL_SOURCE_LOCATION (node->decl), 0,
"unsupported argument type %qT for simd", TREE_TYPE (t));
return 0;
+2019-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/87887
+ * gcc.dg/gomp/pr87887-1.c: New test.
+ * gcc.dg/gomp/pr87887-2.c: New test.
+
2019-02-01 Jakub Jelinek <jakub@redhat.com>
PR fortran/83246
--- /dev/null
+/* PR middle-end/87887 */
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_simd_clones } */
+/* { dg-additional-options "-w" } */
+
+struct S { int n; };
+#pragma omp declare simd
+struct S
+foo (int x)
+{
+ return (struct S) { x };
+}
+
+#pragma omp declare simd
+int
+bar (struct S x)
+{
+ return x.n;
+}
+
+#pragma omp declare simd uniform (x)
+int
+baz (int w, struct S x, int y)
+{
+ return w + x.n + y;
+}
--- /dev/null
+/* PR middle-end/87887 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-effective-target vect_simd_clones } */
+
+struct S { int n; };
+#pragma omp declare simd
+struct S
+foo (int x) /* { dg-warning "unsupported return type 'struct S' for simd" } */
+{
+ return (struct S) { x };
+}
+
+#pragma omp declare simd
+int
+bar (struct S x) /* { dg-warning "unsupported argument type 'struct S' for simd" } */
+{
+ return x.n;
+}
+
+#pragma omp declare simd uniform (x)
+int
+baz (int w, struct S x, int y)
+{
+ return w + x.n + y;
+}