|| !positive_check (0, image))
return false;
- return !team || (scalar_check (team, 0) && team_type_check (team, 0));
+ return !team || (scalar_check (team, 1) && team_type_check (team, 1));
}
GFC_STAT_STOPPED_IMAGE));
}
else if (flag_coarray == GFC_FCOARRAY_LIB)
+ /* The team is optional and therefore needs to be a pointer to the opaque
+ pointer. */
tmp = build_call_expr_loc (input_location, gfor_fndecl_caf_image_status, 2,
args[0],
- num_args < 2 ? null_pointer_node : args[1]);
+ num_args < 2
+ ? null_pointer_node
+ : gfc_build_addr_expr (NULL_TREE, args[1]));
else
gcc_unreachable ();
{
gfc_init_se (&argse, NULL);
gfc_conv_expr_val (&argse, code->expr1);
- images = argse.expr;
+ images = gfc_trans_force_lval (&argse.pre, argse.expr);
+ gfc_add_block_to_block (&se.pre, &argse.pre);
}
if (code->expr2)
gfc_init_se (&argse, NULL);
gfc_conv_expr_val (&argse, code->expr2);
stat = argse.expr;
+ gfc_add_block_to_block (&se.pre, &argse.pre);
}
else
stat = null_pointer_node;
argse.want_pointer = 1;
gfc_conv_expr (&argse, code->expr3);
gfc_conv_string_parameter (&argse);
- errmsg = gfc_build_addr_expr (NULL, argse.expr);
+ errmsg = argse.expr;
errmsglen = fold_convert (size_type_node, argse.string_length);
+ gfc_add_block_to_block (&se.pre, &argse.pre);
}
else if (flag_coarray == GFC_FCOARRAY_LIB)
{
! { dg-final { scan-tree-dump-times "_gfortran_caf_sync_memory \\(0B, 0B, 0\\);" 1 "original" } }
! { dg-final { scan-tree-dump-times "_gfortran_caf_sync_memory \\(&stat, 0B, 0\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_sync_memory \\(0B, &&msg, 42\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "_gfortran_caf_sync_memory \\(&stat, &&msg, 42\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_sync_memory \\(0B, &msg, 42\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "_gfortran_caf_sync_memory \\(&stat, &msg, 42\\);" 1 "original" } }