Commit eeb1d9e0 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/27416 (ICE on invalid firstprivate/lastprivate)

	PR middle-end/27416
	* omp-low.c (build_outer_var_ref): If VAR is reference in orphaned
	construct, return *VAR.

	* libgomp.fortran/pr27416-1.f90: New test.

From-SVN: r113788
parent 5b8fdd1f
2006-05-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/27416
* omp-low.c (build_outer_var_ref): If VAR is reference in orphaned
construct, return *VAR.
2006-05-14 Kaz Kojima <kkojima@gcc.gnu.org> 2006-05-14 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/27406 PR rtl-optimization/27406
......
...@@ -577,6 +577,10 @@ build_outer_var_ref (tree var, omp_context *ctx) ...@@ -577,6 +577,10 @@ build_outer_var_ref (tree var, omp_context *ctx)
} }
else if (ctx->outer) else if (ctx->outer)
x = lookup_decl (var, ctx->outer); x = lookup_decl (var, ctx->outer);
else if (is_reference (var))
/* This can happen with orphaned constructs. If var is reference, it is
possible it is shared and as such valid. */
x = var;
else else
gcc_unreachable (); gcc_unreachable ();
......
2006-05-15 Jakub Jelinek <jakub@redhat.com>
PR middle-end/27416
* libgomp.fortran/pr27416-1.f90: New test.
2006-05-03 Jakub Jelinek <jakub@redhat.com> 2006-05-03 Jakub Jelinek <jakub@redhat.com>
PR fortran/27395 PR fortran/27395
......
! PR middle-end/27416
! { dg-do run }
integer :: j
j = 6
!$omp parallel num_threads (4)
call foo (j)
!$omp end parallel
if (j.ne.6+16) call abort
end
subroutine foo (j)
integer :: i, j
!$omp do firstprivate (j) lastprivate (j)
do i = 1, 16
if (i.eq.16) j = j + i
end do
end subroutine foo
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