Commit 5da250fc by Jakub Jelinek Committed by Jakub Jelinek

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
parent 637b5a8e
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> 2008-04-03 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386-protos.h (ix86_aligned_p): Removed. * config/i386/i386-protos.h (ix86_aligned_p): Removed.
......
...@@ -993,7 +993,8 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) ...@@ -993,7 +993,8 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
case OMP_CLAUSE_SHARED: case OMP_CLAUSE_SHARED:
gcc_assert (is_parallel_ctx (ctx)); gcc_assert (is_parallel_ctx (ctx));
decl = OMP_CLAUSE_DECL (c); 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); by_ref = use_pointer_for_field (decl, ctx);
/* Global variables don't need to be copied, /* Global variables don't need to be copied,
the receiver side will use them directly. */ the receiver side will use them directly. */
......
2008-04-03 Jakub Jelinek <jakub@redhat.com> 2008-04-03 Jakub Jelinek <jakub@redhat.com>
PR middle-end/35818
* gcc.dg/gomp/pr35818.c: New test.
PR fortran/35786 PR fortran/35786
* gfortran.dg/gomp/pr35786-1.f90: New test. * gfortran.dg/gomp/pr35786-1.f90: New test.
* gfortran.dg/gomp/pr35786-2.f90: New test. * gfortran.dg/gomp/pr35786-2.f90: New test.
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment