]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/fortran/parse.c
OpenMP: Fixes for omp critical + hint
[thirdparty/gcc.git] / gcc / fortran / parse.c
index d30208febb15356ced57453efa01fa32ec438d17..96fd4aaee5ede6a5790dc63f3957f45093ad2cd3 100644 (file)
@@ -5384,7 +5384,8 @@ parse_omp_structured_block (gfc_statement omp_st, bool workshare_stmts_only)
       cp->ext.omp_clauses->nowait |= new_st.ext.omp_bool;
       break;
     case EXEC_OMP_END_CRITICAL:
-      if (((cp->ext.omp_clauses == NULL) ^ (new_st.ext.omp_name == NULL))
+      if (((cp->ext.omp_clauses->critical_name == NULL)
+           ^ (new_st.ext.omp_name == NULL))
          || (new_st.ext.omp_name != NULL
              && strcmp (cp->ext.omp_clauses->critical_name,
                         new_st.ext.omp_name) != 0))