Commit d7baf647 by Mikael Morin Committed by Mikael Morin

trans-array.c (gfc_walk_variable_expr): Remove scalar coarray handling.

	* trans-array.c (gfc_walk_variable_expr): Remove scalar coarray
	handling.  Don't reset array ref's corank and codimensions' types
	in the full array ref case.  Update loop upper limit.
	Remove DIMEN_THIS_IMAGE case.  Remove unnecessary conditions.

From-SVN: r179691
parent 677e2dae
2011-10-07 Mikael Morin <mikael.morin@sfr.fr> 2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_walk_variable_expr): Remove scalar coarray
handling. Don't reset array ref's corank and codimensions' types
in the full array ref case. Update loop upper limit.
Remove DIMEN_THIS_IMAGE case. Remove unnecessary conditions.
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans.h (gfc_ss_info): Remove codimen field. * trans.h (gfc_ss_info): Remove codimen field.
* trans-array.c (gfc_get_array_ss): Don't set codimen field. * trans-array.c (gfc_get_array_ss): Don't set codimen field.
(gfc_trans_create_temp_array): Don't set descriptor's cobounds. (gfc_trans_create_temp_array): Don't set descriptor's cobounds.
......
...@@ -7612,12 +7612,6 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -7612,12 +7612,6 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
ar = &ref->u.ar; ar = &ref->u.ar;
if (ar->as->rank == 0 && ref->next != NULL)
{
/* Scalar coarray. */
continue;
}
switch (ar->type) switch (ar->type)
{ {
case AR_ELEMENT: case AR_ELEMENT:
...@@ -7632,7 +7626,6 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -7632,7 +7626,6 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
/* Make sure array is the same as array(:,:), this way /* Make sure array is the same as array(:,:), this way
we don't need to special case all the time. */ we don't need to special case all the time. */
ar->dimen = ar->as->rank; ar->dimen = ar->as->rank;
ar->codimen = 0;
for (n = 0; n < ar->dimen; n++) for (n = 0; n < ar->dimen; n++)
{ {
ar->dimen_type[n] = DIMEN_RANGE; ar->dimen_type[n] = DIMEN_RANGE;
...@@ -7641,14 +7634,6 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -7641,14 +7634,6 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
gcc_assert (ar->end[n] == NULL); gcc_assert (ar->end[n] == NULL);
gcc_assert (ar->stride[n] == NULL); gcc_assert (ar->stride[n] == NULL);
} }
for (n = ar->dimen; n < ar->dimen + ar->as->corank; n++)
{
newss->data.info.dim[n] = n;
ar->dimen_type[n] = DIMEN_RANGE;
gcc_assert (ar->start[n] == NULL);
gcc_assert (ar->end[n] == NULL);
}
ss = newss; ss = newss;
break; break;
...@@ -7657,14 +7642,12 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -7657,14 +7642,12 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
newss->data.info.ref = ref; newss->data.info.ref = ref;
/* We add SS chains for all the subscripts in the section. */ /* We add SS chains for all the subscripts in the section. */
for (n = 0; n < ar->dimen + ar->codimen; n++) for (n = 0; n < ar->dimen; n++)
{ {
gfc_ss *indexss; gfc_ss *indexss;
switch (ar->dimen_type[n]) switch (ar->dimen_type[n])
{ {
case DIMEN_THIS_IMAGE:
continue;
case DIMEN_ELEMENT: case DIMEN_ELEMENT:
/* Add SS for elemental (scalar) subscripts. */ /* Add SS for elemental (scalar) subscripts. */
gcc_assert (ar->start[n]); gcc_assert (ar->start[n]);
...@@ -7677,8 +7660,7 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -7677,8 +7660,7 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
/* We don't add anything for sections, just remember this /* We don't add anything for sections, just remember this
dimension for later. */ dimension for later. */
newss->data.info.dim[newss->data.info.dimen] = n; newss->data.info.dim[newss->data.info.dimen] = n;
if (n < ar->dimen) newss->data.info.dimen++;
newss->data.info.dimen++;
break; break;
case DIMEN_VECTOR: case DIMEN_VECTOR:
...@@ -7689,8 +7671,7 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr) ...@@ -7689,8 +7671,7 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
indexss->loop_chain = gfc_ss_terminator; indexss->loop_chain = gfc_ss_terminator;
newss->data.info.subscript[n] = indexss; newss->data.info.subscript[n] = indexss;
newss->data.info.dim[newss->data.info.dimen] = n; newss->data.info.dim[newss->data.info.dimen] = n;
if (n < ar->dimen) newss->data.info.dimen++;
newss->data.info.dimen++;
break; break;
default: default:
......
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