"parallel/kernel loop" is handled by the function being patched (an
assert ensures that no other directives end here). The first part of the
function handles the parallel and kernel part, the loop itself should be
handled by the called function. However, it currently passes the
"kernel/parallel loop" op on, instead of only the "loop" part. That
fails in the called function in an assert.
Build and regtested on x86-64-gnu-linux.
OK for the trunk?
Tobias
2015-01-22 Tobias Burnus <bur...@net-b.de>
PR fortran/64726
* trans-openmp.c (gfc_trans_oacc_combined_directive): Fix
loop generation.
2015-01-22 Tobias Burnus <bur...@net-b.de>
PR fortran/64726
* gfortran.dg/goacc/combined_loop.f90: New.
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index fe47a96..cdd1885 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -3438,7 +3438,7 @@ gfc_trans_oacc_combined_directive (gfc_code *code)
pblock = █
else
pushlevel ();
- stmt = gfc_trans_omp_do (code, code->op, pblock, &loop_clauses, NULL);
+ stmt = gfc_trans_omp_do (code, EXEC_OACC_LOOP, pblock, &loop_clauses, NULL);
if (TREE_CODE (stmt) != BIND_EXPR)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0));
else
diff --git a/gcc/testsuite/gfortran.dg/goacc/combined_loop.f90 b/gcc/testsuite/gfortran.dg/goacc/combined_loop.f90
new file mode 100644
index 0000000..b8be649
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/goacc/combined_loop.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR fortran/64726
+!
+subroutine oacc1()
+ implicit none
+ integer :: i
+ integer :: a
+ !$acc parallel loop reduction(+:a) ! { dg-excess-errors "sorry, unimplemented: directive not yet implemented" }
+ do i = 1,5
+ enddo
+end subroutine oacc1