Hi Kwok, the TODO is fixed by the attached patch; I would be happy if you could handle this patch, e.g. together with your patch – or as follow up.
(Lightly tested only, i.e. it fixes the ICE but I did not do a full testsuite run. But I regard it as obvious.) Tobias On 6/24/20 6:47 PM, Kwok Cheung Yeung wrote:
+ ! TODO: This currently fails with an internal compiler error + ! (PR 95869) + !subroutine test_target_parallel + ! do j = 1, N + ! !$omp target parallel if(j .lt. LIMIT) map(tofrom: a(1:N)) + ! do i = 1, N + ! a(i) = a(i) + 1 + ! end do + ! !$omp end target parallel + ! end do + !end subroutine
At least with my build (w/o your patch but with other patches), I see in the original dump: D.4049 = j <= 59; #pragma omp target map( ...) { { logical(kind=4) D.4049; #pragma omp parallel private(i) if(D.4049) { Namely, the assignment is in a different scope than the declaration of the variable. At the moment, I do not see why this fails – at a glance, it l Tobias ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
* trans-openmp.c (gfc_trans_omp_target): Use correct scoping block. diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 3f4f06375ef..38a0d87d726 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -5488,7 +5488,7 @@ gfc_trans_omp_target (gfc_code *code) pushlevel (); gfc_start_block (&iblock); tree inner_clauses - = gfc_trans_omp_clauses (&block, &clausesa[GFC_OMP_SPLIT_PARALLEL], + = gfc_trans_omp_clauses (&iblock, &clausesa[GFC_OMP_SPLIT_PARALLEL], code->loc); stmt = gfc_trans_omp_code (code->block->next, true); stmt = build2_loc (input_location, OMP_PARALLEL, void_type_node, stmt,