Commit 9de8e7af by Tobias Burnus Committed by Tobias Burnus

resolve.c (resolve_critical): Fix name mangling.

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.

From-SVN: r214029
parent 86d2cad9
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> 2014-08-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054 PR fortran/44054
......
...@@ -8485,13 +8485,14 @@ resolve_critical (gfc_code *code) ...@@ -8485,13 +8485,14 @@ resolve_critical (gfc_code *code)
if (gfc_option.coarray != GFC_FCOARRAY_LIB) if (gfc_option.coarray != GFC_FCOARRAY_LIB)
return; 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) if (symtree)
lock_type = symtree->n.sym; lock_type = symtree->n.sym;
else else
{ {
if (gfc_get_sym_tree ("__lock_type@0", gfc_current_ns, &symtree, if (gfc_get_sym_tree (GFC_PREFIX ("lock_type"), gfc_current_ns, &symtree,
false) != 0) false) != 0)
gcc_unreachable (); gcc_unreachable ();
lock_type = symtree->n.sym; lock_type = symtree->n.sym;
lock_type->attr.flavor = FL_DERIVED; lock_type->attr.flavor = FL_DERIVED;
...@@ -8500,7 +8501,7 @@ resolve_critical (gfc_code *code) ...@@ -8500,7 +8501,7 @@ resolve_critical (gfc_code *code)
lock_type->intmod_sym_id = ISOFORTRAN_LOCK_TYPE; 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) if (gfc_get_sym_tree (name, gfc_current_ns, &symtree, false) != 0)
gcc_unreachable (); gcc_unreachable ();
......
...@@ -1121,7 +1121,7 @@ gfc_trans_critical (gfc_code *code) ...@@ -1121,7 +1121,7 @@ gfc_trans_critical (gfc_code *code)
token = GFC_TYPE_ARRAY_CAF_TOKEN (TREE_TYPE (token)); token = GFC_TYPE_ARRAY_CAF_TOKEN (TREE_TYPE (token));
tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_lock, 7, tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_lock, 7,
token, integer_zero_node, integer_one_node, 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); null_pointer_node, integer_zero_node);
gfc_add_expr_to_block (&block, tmp); gfc_add_expr_to_block (&block, tmp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment