aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-04-03 23:02:44 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2008-04-03 23:02:44 +0200
commit5da250fca2d707547044284a84e94beb0c74bb5a (patch)
tree7337ce1fc06ad5e8ff8f9584479ecb8e19b23807 /gcc
parent637b5a8e7ced71facbb36d9505b85ad3b991572b (diff)
downloadgcc-5da250fca2d707547044284a84e94beb0c74bb5a.zip
gcc-5da250fca2d707547044284a84e94beb0c74bb5a.tar.gz
gcc-5da250fca2d707547044284a84e94beb0c74bb5a.tar.bz2
re PR middle-end/35818 (ICE on incomplete array in shared clause)
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/omp-low.c3
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr35818.c16
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aec6128..29a3cce 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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.
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 45602c2..ffdf447 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -993,7 +993,8 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
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. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bd7e6e5..1bad997 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
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.
diff --git a/gcc/testsuite/gcc.dg/gomp/pr35818.c b/gcc/testsuite/gcc.dg/gomp/pr35818.c
new file mode 100644
index 0000000..b2165eb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr35818.c
@@ -0,0 +1,16 @@
+/* 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;
+}