This one is more controversial and I need input from a coarray-fluent guy, for
example Tobias.

As I introduced the want_coarray flag (see previous patch), it made sense to me
to also set want_coarray for coarray dummies. After some more thought,
I decided to restrict further want_coarray to assumed shape coarray
dummies. The patch does that.

However, what comes up from testing is that neither is needed.
I'm not submiting this patch for approval, I'm submitting it to understand why
it is not necessary.
How are cobounds passed to a coarray dummy?

2011-09-14  Mikael Morin  <mikael.mo...@sfr.fr>

        * trans-expr.c (gfc_conv_procedure_call): Set want_coarray flag if the
        dummy argument is an assumed-shape coarray.

diff --git a/trans-expr.c b/trans-expr.c
index 131927c..80447fa 100644
--- a/trans-expr.c
+++ b/trans-expr.c
@@ -2990,8 +2990,12 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
 	{
 	  /* A scalar or transformational function.  */
 	  gfc_init_se (&parmse, NULL);
-	  argss = gfc_walk_expr (e);
+	  if (fsym && fsym->attr.codimension
+	      && (fsym->as->cotype == AS_ASSUMED_SHAPE
+		  || fsym->as->cotype == AS_DEFERRED))
+	    parmse.want_coarray = 1;
 
+	  argss = gfc_walk_expr (e);
 	  if (argss == gfc_ss_terminator)
 	    {
 	      if (e->expr_type == EXPR_VARIABLE

Reply via email to