aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-01-22 09:50:53 +0100
committerJakub Jelinek <jakub@redhat.com>2020-01-22 09:50:53 +0100
commita38979d9d7a4ab08336436052704028c56187618 (patch)
tree874a306b03c7a122a71ead76e83a91a9a708f494 /gcc/fortran
parent5a8ea165926cb0737ab03bc48c18dc5198ab5305 (diff)
downloadgcc-a38979d9d7a4ab08336436052704028c56187618.zip
gcc-a38979d9d7a4ab08336436052704028c56187618.tar.gz
gcc-a38979d9d7a4ab08336436052704028c56187618.tar.bz2
openmp: Teach omp_code_to_statement about rest of OpenMP statements
The omp_code_to_statement function added with the initial OpenACC support only handled small subset of the OpenMP statements, leading to ICE if any other OpenMP directive appeared inside of OpenACC directive. 2020-01-22 Jakub Jelinek <jakub@redhat.com> PR fortran/93329 * openmp.c (omp_code_to_statement): Handle remaining EXEC_OMP_* cases. * gfortran.dg/goacc/pr93329.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/openmp.c75
2 files changed, 81 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8d963a5..031c75b 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2020-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/93329
+ * openmp.c (omp_code_to_statement): Handle remaining EXEC_OMP_*
+ cases.
+
2020-01-21 Tobias Burnus <tobias@codesourcery.com>
PR fortran/93309
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 1062212..3c61385 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -5898,6 +5898,81 @@ omp_code_to_statement (gfc_code *code)
return ST_OMP_PARALLEL_WORKSHARE;
case EXEC_OMP_DO:
return ST_OMP_DO;
+ case EXEC_OMP_ATOMIC:
+ return ST_OMP_ATOMIC;
+ case EXEC_OMP_BARRIER:
+ return ST_OMP_BARRIER;
+ case EXEC_OMP_CANCEL:
+ return ST_OMP_CANCEL;
+ case EXEC_OMP_CANCELLATION_POINT:
+ return ST_OMP_CANCELLATION_POINT;
+ case EXEC_OMP_FLUSH:
+ return ST_OMP_FLUSH;
+ case EXEC_OMP_DISTRIBUTE:
+ return ST_OMP_DISTRIBUTE;
+ case EXEC_OMP_DISTRIBUTE_PARALLEL_DO:
+ return ST_OMP_DISTRIBUTE_PARALLEL_DO;
+ case EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD:
+ return ST_OMP_DISTRIBUTE_PARALLEL_DO_SIMD;
+ case EXEC_OMP_DISTRIBUTE_SIMD:
+ return ST_OMP_DISTRIBUTE_SIMD;
+ case EXEC_OMP_DO_SIMD:
+ return ST_OMP_DO_SIMD;
+ case EXEC_OMP_SIMD:
+ return ST_OMP_SIMD;
+ case EXEC_OMP_TARGET:
+ return ST_OMP_TARGET;
+ case EXEC_OMP_TARGET_DATA:
+ return ST_OMP_TARGET_DATA;
+ case EXEC_OMP_TARGET_ENTER_DATA:
+ return ST_OMP_TARGET_ENTER_DATA;
+ case EXEC_OMP_TARGET_EXIT_DATA:
+ return ST_OMP_TARGET_EXIT_DATA;
+ case EXEC_OMP_TARGET_PARALLEL:
+ return ST_OMP_TARGET_PARALLEL;
+ case EXEC_OMP_TARGET_PARALLEL_DO:
+ return ST_OMP_TARGET_PARALLEL_DO;
+ case EXEC_OMP_TARGET_PARALLEL_DO_SIMD:
+ return ST_OMP_TARGET_PARALLEL_DO_SIMD;
+ case EXEC_OMP_TARGET_SIMD:
+ return ST_OMP_TARGET_SIMD;
+ case EXEC_OMP_TARGET_TEAMS:
+ return ST_OMP_TARGET_TEAMS;
+ case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE:
+ return ST_OMP_TARGET_TEAMS_DISTRIBUTE;
+ case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO:
+ return ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO;
+ case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
+ return ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD;
+ case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD:
+ return ST_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD;
+ case EXEC_OMP_TARGET_UPDATE:
+ return ST_OMP_TARGET_UPDATE;
+ case EXEC_OMP_TASKGROUP:
+ return ST_OMP_TASKGROUP;
+ case EXEC_OMP_TASKLOOP:
+ return ST_OMP_TASKLOOP;
+ case EXEC_OMP_TASKLOOP_SIMD:
+ return ST_OMP_TASKLOOP_SIMD;
+ case EXEC_OMP_TASKWAIT:
+ return ST_OMP_TASKWAIT;
+ case EXEC_OMP_TASKYIELD:
+ return ST_OMP_TASKYIELD;
+ case EXEC_OMP_TEAMS:
+ return ST_OMP_TEAMS;
+ case EXEC_OMP_TEAMS_DISTRIBUTE:
+ return ST_OMP_TEAMS_DISTRIBUTE;
+ case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO:
+ return ST_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO;
+ case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
+ return ST_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD;
+ case EXEC_OMP_TEAMS_DISTRIBUTE_SIMD:
+ return ST_OMP_TEAMS_DISTRIBUTE_SIMD;
+ case EXEC_OMP_PARALLEL_DO:
+ return ST_OMP_PARALLEL_DO;
+ case EXEC_OMP_PARALLEL_DO_SIMD:
+ return ST_OMP_PARALLEL_DO_SIMD;
+
default:
gcc_unreachable ();
}