+2020-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/93555
+ * omp-simd-clone.c (expand_simd_clones): If simd_clone_mangle or
+ simd_clone_create failed when i == 0, adjust clone->nargs by
+ clone->inbranch.
+
2020-02-05 Martin Liska <mliska@suse.cz>
PR c++/92717
already. */
tree id = simd_clone_mangle (node, clone);
if (id == NULL_TREE)
- continue;
+ {
+ if (i == 0)
+ clone->nargs += clone->inbranch;
+ continue;
+ }
/* Only when we are sure we want to create the clone actually
clone the function (or definitions) or create another
extern FUNCTION_DECL (for prototypes without definitions). */
struct cgraph_node *n = simd_clone_create (node);
if (n == NULL)
- continue;
+ {
+ if (i == 0)
+ clone->nargs += clone->inbranch;
+ continue;
+ }
n->simdclone = clone;
clone->origin = node;
-2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
+2020-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/93555
+ * c-c++-common/gomp/pr93555-1.c: New test.
+ * c-c++-common/gomp/pr93555-2.c: New test.
+ * gfortran.dg/gomp/pr93555.f90: New test.
+
+2020-02-05 Jun Ma <JunMa@linux.alibaba.com>
* g++.dg/coroutines/co-await-14-return-ref-to-auto.C: New test.
--- /dev/null
+/* PR middle-end/93555 */
+/* { dg-do compile } */
+
+#pragma omp declare simd
+#pragma omp declare simd inbranch
+int
+foo (int x)
+{
+ return x;
+}
+
+#pragma omp declare simd inbranch
+#pragma omp declare simd
+int
+bar (int x)
+{
+ return x;
+}
--- /dev/null
+/* PR middle-end/93555 */
+/* { dg-do compile } */
+
+#pragma omp declare simd
+#pragma omp declare simd inbranch
+void
+foo (void)
+{
+}
+
+#pragma omp declare simd inbranch
+#pragma omp declare simd
+void
+bar (void)
+{
+}
--- /dev/null
+! PR middle-end/93555
+! { dg-do compile }
+
+subroutine foo
+ !$omp declare simd(foo)
+ !$omp declare simd(foo) inbranch
+end
+subroutine bar
+ !$omp declare simd(bar) inbranch
+ !$omp declare simd(bar)
+end