aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2021-05-07 10:13:49 +0200
committerThomas Schwinge <thomas@codesourcery.com>2021-05-18 11:44:24 +0200
commite1cca88019ab1208f8389606dd18a25cd50c20e1 (patch)
tree298e7d4e481fc456dd5af824904ca1c55e64b06b /gcc
parent3e2c715823e6aa0bfd89e56046a1c237789cd27d (diff)
downloadgcc-e1cca88019ab1208f8389606dd18a25cd50c20e1.zip
gcc-e1cca88019ab1208f8389606dd18a25cd50c20e1.tar.gz
gcc-e1cca88019ab1208f8389606dd18a25cd50c20e1.tar.bz2
[OMP] Tighten 'is_gimple_omp_oacc'
No overall change in behavior. gcc/ * gimple.h (is_gimple_omp_oacc): Tighten. * omp-low.c (check_omp_nesting_restrictions): Adjust.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple.h8
-rw-r--r--gcc/omp-low.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 3ec86f5..91b92b4 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -6501,6 +6501,14 @@ is_gimple_omp_oacc (const gimple *stmt)
gcc_assert (is_gimple_omp (stmt));
switch (gimple_code (stmt))
{
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ case GIMPLE_OMP_ATOMIC_STORE:
+ case GIMPLE_OMP_CONTINUE:
+ case GIMPLE_OMP_RETURN:
+ /* Codes shared between OpenACC and OpenMP cannot be used to disambiguate
+ the two. */
+ gcc_unreachable ();
+
case GIMPLE_OMP_FOR:
switch (gimple_omp_for_kind (stmt))
{
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index cadca7e..d1136d1 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3016,11 +3016,12 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
/* No nesting of non-OpenACC STMT (that is, an OpenMP one, or a GOMP builtin)
inside an OpenACC CTX. */
- if (!(is_gimple_omp (stmt)
- && is_gimple_omp_oacc (stmt))
- /* Except for atomic codes that we share with OpenMP. */
- && !(gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD
- || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE))
+ if (gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD
+ || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE)
+ /* ..., except for the atomic codes that OpenACC shares with OpenMP. */
+ ;
+ else if (!(is_gimple_omp (stmt)
+ && is_gimple_omp_oacc (stmt)))
{
if (oacc_get_fn_attrib (cfun->decl) != NULL)
{