trans-array.h (struct gfc_se): New flag want_coarray.

* trans-array.h (struct gfc_se): New flag want_coarray.
	* trans-intrinsic.c (trans_this_image, trans_image_index,
	conv_intrinsic_cobound): Set want_coarray.
	* trans_array.c (gfc_conv_expr_descriptor): Evaluate codimension
	earlier and without relying on the scalarizer.

From-SVN: r179676
This commit is contained in:
Mikael Morin 2011-10-07 21:24:07 +02:00 committed by Mikael Morin
parent 89010691e4
commit 23c3d0f972
4 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.h (struct gfc_se): New flag want_coarray.
* trans-intrinsic.c (trans_this_image, trans_image_index,
conv_intrinsic_cobound): Set want_coarray.
* trans_array.c (gfc_conv_expr_descriptor): Evaluate codimension
earlier and without relying on the scalarizer.
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* expr.c (gfc_get_corank): Return 0 if input expression is not a

View File

@ -5988,6 +5988,11 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
tree to;
tree base;
if (se->want_coarray)
codim = gfc_get_corank (expr);
else
codim = 0;
/* Set the string_length for a character array. */
if (expr->ts.type == BT_CHARACTER)
se->string_length = gfc_get_expr_charlen (expr);
@ -6036,7 +6041,6 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
base = NULL_TREE;
ndim = info->ref ? info->ref->u.ar.dimen : info->dimen;
codim = info->codimen;
for (n = 0; n < ndim; n++)
{
stride = gfc_conv_array_stride (desc, n);

View File

@ -974,6 +974,7 @@ trans_this_image (gfc_se * se, gfc_expr *expr)
ss = gfc_walk_expr (expr->value.function.actual->expr);
gcc_assert (ss != gfc_ss_terminator);
ss->data.info.codimen = corank;
argse.want_coarray = 1;
gfc_conv_expr_descriptor (&argse, expr->value.function.actual->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre);
gfc_add_block_to_block (&se->post, &argse.post);
@ -1161,6 +1162,7 @@ trans_image_index (gfc_se * se, gfc_expr *expr)
ss = gfc_walk_expr (expr->value.function.actual->expr);
gcc_assert (ss != gfc_ss_terminator);
ss->data.info.codimen = corank;
argse.want_coarray = 1;
gfc_conv_expr_descriptor (&argse, expr->value.function.actual->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre);
gfc_add_block_to_block (&se->post, &argse.post);
@ -1488,6 +1490,7 @@ conv_intrinsic_cobound (gfc_se * se, gfc_expr * expr)
gcc_assert (ss != gfc_ss_terminator);
ss->data.info.codimen = corank;
gfc_init_se (&argse, NULL);
argse.want_coarray = 1;
gfc_conv_expr_descriptor (&argse, arg->expr, ss);
gfc_add_block_to_block (&se->pre, &argse.pre);

View File

@ -86,6 +86,8 @@ typedef struct gfc_se
args alias. */
unsigned force_tmp:1;
unsigned want_coarray:1;
/* Scalarization parameters. */
struct gfc_se *parent;
struct gfc_ss *ss;