aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r--gcc/fortran/parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index d30208f..96fd4aa 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -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))