===================================================================
@@ -1,3 +1,8 @@
+2014-08-15 Tobias Burnus <burnus@net-b.de>
+
+ * resolve.c (resolve_critical): Fix name mangling.
+ * trans-stmt.c (gfc_trans_critical): Fix lock call.
+
2014-08-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
===================================================================
@@ -8485,13 +8485,14 @@ resolve_critical (gfc_code *code)
if (gfc_option.coarray != GFC_FCOARRAY_LIB)
return;
- symtree = gfc_find_symtree (gfc_current_ns->sym_root, "__lock_type@0");
+ symtree = gfc_find_symtree (gfc_current_ns->sym_root,
+ GFC_PREFIX ("lock_type"));
if (symtree)
lock_type = symtree->n.sym;
else
{
- if (gfc_get_sym_tree ("__lock_type@0", gfc_current_ns, &symtree,
- false) != 0)
+ if (gfc_get_sym_tree (GFC_PREFIX ("lock_type"), gfc_current_ns, &symtree,
+ false) != 0)
gcc_unreachable ();
lock_type = symtree->n.sym;
lock_type->attr.flavor = FL_DERIVED;
@@ -8500,7 +8501,7 @@ resolve_critical (gfc_code *code)
lock_type->intmod_sym_id = ISOFORTRAN_LOCK_TYPE;
}
- sprintf(name, "__lock_var@%d",serial++);
+ sprintf(name, GFC_PREFIX ("lock_var") "%d",serial++);
if (gfc_get_sym_tree (name, gfc_current_ns, &symtree, false) != 0)
gcc_unreachable ();
===================================================================
@@ -1121,7 +1121,7 @@ gfc_trans_critical (gfc_code *code)
token = GFC_TYPE_ARRAY_CAF_TOKEN (TREE_TYPE (token));
tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_lock, 7,
token, integer_zero_node, integer_one_node,
- boolean_true_node, null_pointer_node,
+ null_pointer_node, null_pointer_node,
null_pointer_node, integer_zero_node);
gfc_add_expr_to_block (&block, tmp);
}