public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-983] [OpenACC privatization] Don't let unhandled 'IFN_UNIQUE_OACC_PRIVATE' linger [PR90115]
@ 2021-05-21 18:54 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2021-05-21 18:54 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ff451ea723deb3fe8471eb96ac9381c063ec6533

commit r12-983-gff451ea723deb3fe8471eb96ac9381c063ec6533
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Thu May 20 15:37:07 2021 +0200

    [OpenACC privatization] Don't let unhandled 'IFN_UNIQUE_OACC_PRIVATE' linger [PR90115]
    
    Make sure they're all handled in 'execute_oacc_device_lower'.  Why we at all
    can have 'level == -1' cases is a separate bug to be fixed.
    
            gcc/
            PR middle-end/90115
            * omp-offload.c (execute_oacc_device_lower)
            <IFN_UNIQUE_OACC_PRIVATE>: Diagnose and handle for 'level == -1'
            case, too.
            * internal-fn.c (expand_UNIQUE): Don't expect
            'IFN_UNIQUE_OACC_PRIVATE'.

Diff:
---
 gcc/internal-fn.c |  2 --
 gcc/omp-offload.c | 10 ++++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index d92080c8077..d209a52f823 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -2969,8 +2969,6 @@ expand_UNIQUE (internal_fn, gcall *stmt)
       else
 	gcc_unreachable ();
       break;
-    case IFN_UNIQUE_OACC_PRIVATE:
-      break;
     }
 
   if (pattern)
diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
index 080bdddfe88..36bd2e44d81 100644
--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -2139,8 +2139,9 @@ execute_oacc_device_lower ()
 		  {
 		    HOST_WIDE_INT level
 		      = TREE_INT_CST_LOW (gimple_call_arg (call, 2));
-		    if (level == -1)
-		      break;
+		    gcc_checking_assert (level == -1
+					 || (level >= 0
+					     && level < GOMP_DIM_MAX));
 		    for (unsigned i = 3;
 			 i < gimple_call_num_args (call);
 			 i++)
@@ -2156,11 +2157,12 @@ execute_oacc_device_lower ()
 			      { "gang", "worker", "vector" };
 			    fprintf (dump_file, "Decl UID %u has %s "
 				     "partitioning:", DECL_UID (decl),
-				     axes[level]);
+				     (level == -1 ? "UNKNOWN" : axes[level]));
 			    print_generic_decl (dump_file, decl, TDF_SLIM);
 			    fputc ('\n', dump_file);
 			  }
-			if (targetm.goacc.adjust_private_decl)
+			if (level != -1
+			    && targetm.goacc.adjust_private_decl)
 			  {
 			    tree oldtype = TREE_TYPE (decl);
 			    tree newdecl


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-21 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 18:54 [gcc r12-983] [OpenACC privatization] Don't let unhandled 'IFN_UNIQUE_OACC_PRIVATE' linger [PR90115] 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).