PR middle-end/35818
* omp-low.c (scan_sharing_clauses) <case OMP_CLAUSE_SHARED>: Don't
call is_variable_sized if decl has incomplete type.
* gcc.dg/gomp/pr35818.c: New test.
From-SVN: r133875
+2008-04-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/35818
+ * omp-low.c (scan_sharing_clauses) <case OMP_CLAUSE_SHARED>: Don't
+ call is_variable_sized if decl has incomplete type.
+
2008-04-03 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386-protos.h (ix86_aligned_p): Removed.
case OMP_CLAUSE_SHARED:
gcc_assert (is_parallel_ctx (ctx));
decl = OMP_CLAUSE_DECL (c);
- gcc_assert (!is_variable_sized (decl));
+ gcc_assert (!COMPLETE_TYPE_P (TREE_TYPE (decl))
+ || !is_variable_sized (decl));
by_ref = use_pointer_for_field (decl, ctx);
/* Global variables don't need to be copied,
the receiver side will use them directly. */
2008-04-03 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/35818
+ * gcc.dg/gomp/pr35818.c: New test.
+
PR fortran/35786
* gfortran.dg/gomp/pr35786-1.f90: New test.
* gfortran.dg/gomp/pr35786-2.f90: New test.
--- /dev/null
+/* PR middle-end/35818 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp" } */
+
+extern int a[];
+
+void
+foo (void)
+{
+#pragma omp parallel
+#pragma omp master
+ a[3] = 1;
+#pragma omp parallel shared(a)
+#pragma omp master
+ a[3] = 1;
+}