]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix ICE when optional arguments are used in OpenACC directives
authorKwok Cheung Yeung <kcy@codesourcery.com>
Fri, 3 May 2019 13:14:35 +0000 (06:14 -0700)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 3 Mar 2020 11:17:23 +0000 (12:17 +0100)
2019-05-03  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/
* gimplify.c (gomp_oacc_needs_data_present): Return NULL if decl is a
Fortran optional argument.

(cherry picked from openacc-gcc-9-branch commit
9f8245e675d2907ae7b76a50557452361e979c59)

gcc/ChangeLog.omp
gcc/gimplify.c

index 6ec668e2ebe45472e4d002d89e41b52299ea1b1e..1bf6dbcb8c71d63622561966843d49265dfa3583 100644 (file)
@@ -1,3 +1,8 @@
+2019-05-03  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       * gimplify.c (gomp_oacc_needs_data_present): Return NULL if decl is a
+       Fortran optional argument.
+
 2019-02-01  Thomas Schwinge  <thomas@codesourcery.com>
 
        * omp-oacc-kernels.c (struct adjust_nested_loop_clauses_wi_info): New.
index f7cfa0eb4e1e399e901d7f2951b988dff1656f84..dfd31735863161ec785998763285c58c82e66a08 100644 (file)
@@ -9707,6 +9707,9 @@ gomp_oacc_needs_data_present (tree decl)
          || TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) != ARRAY_TYPE))
     return NULL;
 
+  if (omp_is_optional_argument (decl))
+    return NULL;
+
   decl = get_base_address (decl);
 
   for (ctx = gimplify_omp_ctxp->outer_context; ctx; ctx = ctx->outer_context)