re PR fortran/93162 (gcc/fortran/trans-openmp.c:2469:50: runtime error: load of value...
authorJakub Jelinek <jakub@redhat.com>
Tue, 7 Jan 2020 07:14:41 +0000 (08:14 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 7 Jan 2020 07:14:41 +0000 (08:14 +0100)
PR fortran/93162
* trans-openmp.c (gfc_trans_omp_clauses): Check for REF_ARRAY type
before testing u.ar.type == AR_FULL.

From-SVN: r279944

gcc/fortran/ChangeLog
gcc/fortran/trans-openmp.c

index a09d370f0bd744a8f4a1fc7ce0f16950feed58ff..22f804789885d4fceb3eccf67faf8b16fba23e0b 100644 (file)
@@ -1,3 +1,9 @@
+2020-01-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR fortran/93162
+       * trans-openmp.c (gfc_trans_omp_clauses): Check for REF_ARRAY type
+       before testing u.ar.type == AR_FULL.
+
 2020-01-04  Tobias Burnus  <tobias@codesourcery.com>
 
        PR fortran/91640
index 918af74bbf69dfbf33a9cd9e8fd4dfb2c7ce794b..9835d2aae3c1743c72e8421c84888c0b71e7e434 100644 (file)
@@ -2495,7 +2495,9 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
              tree decl = gfc_trans_omp_variable (n->sym, false);
              if (DECL_P (decl))
                TREE_ADDRESSABLE (decl) = 1;
-             if (n->expr == NULL || n->expr->ref->u.ar.type == AR_FULL)
+             if (n->expr == NULL
+                 || (n->expr->ref->type == REF_ARRAY
+                     && n->expr->ref->u.ar.type == AR_FULL))
                {
                  tree present = gfc_omp_check_optional_argument (decl, true);
                  if (n->sym->ts.type == BT_CLASS)