From: Jakub Jelinek Date: Thu, 3 Apr 2008 21:02:44 +0000 (+0200) Subject: re PR middle-end/35818 (ICE on incomplete array in shared clause) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5da250fca2d707547044284a84e94beb0c74bb5a;p=gcc.git re PR middle-end/35818 (ICE on incomplete array in shared clause) PR middle-end/35818 * omp-low.c (scan_sharing_clauses) : Don't call is_variable_sized if decl has incomplete type. * gcc.dg/gomp/pr35818.c: New test. From-SVN: r133875 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aec6128ea84..29a3cce9711 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-04-03 Jakub Jelinek + + PR middle-end/35818 + * omp-low.c (scan_sharing_clauses) : Don't + call is_variable_sized if decl has incomplete type. + 2008-04-03 H.J. Lu * config/i386/i386-protos.h (ix86_aligned_p): Removed. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 45602c24d74..ffdf447d329 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 bd7e6e5815d..1bad997c7fa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2008-04-03 Jakub Jelinek + 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 00000000000..b2165eb3973 --- /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; +}