public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-871] [OMP] Tighten 'is_gimple_omp_oacc'
@ 2021-05-18 9:46 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2021-05-18 9:46 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:e1cca88019ab1208f8389606dd18a25cd50c20e1
commit r12-871-ge1cca88019ab1208f8389606dd18a25cd50c20e1
Author: Thomas Schwinge <thomas@codesourcery.com>
Date: Fri May 7 10:13:49 2021 +0200
[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.
Diff:
---
gcc/gimple.h | 8 ++++++++
gcc/omp-low.c | 11 ++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 3ec86f5f082..91b92b4a4d1 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 cadca7e201f..d1136d181b3 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)
{
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-18 9:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 9:46 [gcc r12-871] [OMP] Tighten 'is_gimple_omp_oacc' Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).