This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran] PR18918 - UCOBOUND coarray draft patch
- From: Daniel Kraft <d at domob dot eu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 04 Apr 2011 11:46:53 +0200
- Subject: Re: [Patch, Fortran] PR18918 - UCOBOUND coarray draft patch
- References: <4D94F762.1020300@net-b.de> <4D988C43.506@net-b.de>
Hi Tobias,
On 04/03/11 17:03, Tobias Burnus wrote:
For the support, the scalarizer had to be modified and the cobounds had
to be saved in the descriptor (and in TYPE_LANG_SPECIFIC(node)).
I'm all but an expert on this area (maybe you could ask Mikael for his
opinion on the scalarizer changes), but isn't this TYPE_LANG_SPECIFIC
stuff only for compile-time known things?
Build and regtested on x86-64-linux.
OK for the trunk?
Ok, but please consider the (minor) comments below.
@@ -4129,7 +4129,12 @@ gfc_is_coindexed (gfc_expr *e)
for (ref = e->ref; ref; ref = ref->next)
if (ref->type == REF_ARRAY && ref->u.ar.codimen > 0)
- return true;
+ {
+ int n;
+ for (n = ref->u.ar.dimen; n < ref->u.ar.dimen + ref->u.ar.codimen; n++)
+ if (ref->u.ar.dimen_type[n] != DIMEN_THIS_IMAGE)
+ return true;
+ }
It seems to me there's some tab-vs-space issue here (for the int and for
lines).
@@ -3152,6 +3173,14 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
case GFC_ISYM_LBOUND:
case GFC_ISYM_UBOUND:
loop->dimen = ss->data.info.dimen;
+ loop->codimen = 0;
+ break;
+
+ case GFC_ISYM_LCOBOUND:
+ case GFC_ISYM_UCOBOUND:
+ case GFC_ISYM_THIS_IMAGE:
+ loop->dimen = ss->data.info.dimen;
+ loop->codimen = ss->data.info.codimen;
default:
break;
That doesn't change anything, but I'd rather have a "break" for the new
cases (even though there was none before and fall-through just has the
same effect). It seems clearer to me as you don't do anything "special"
via fall-through.
@@ -3739,7 +3780,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop, locus *
where)
info = &ss->data.info;
dim = info->dim[n];
- if (loopspec[n] != NULL)
+ if (loopspec[n] != NULL /*|| n >= loop->dimen*/)
{
specinfo = &loopspec[n]->data.info;
spec_dim = specinfo->dim[n];
Could you clarify (via a comment or the like) why you add this
commented-out code? Or rather remove it and add later seems also like a
good possibility to me.
@@ -7386,8 +7484,9 @@ gfc_walk_variable_expr (gfc_ss * ss, gfc_expr * expr)
indexss->next = gfc_ss_terminator;
indexss->loop_chain = gfc_ss_terminator;
newss->data.info.subscript[n] = indexss;
- newss->data.info.dim[newss->data.info.dimen] = n;
- newss->data.info.dimen++;
+
newss->data.info.dim[newss->data.info.dimen+newss->data.info.codimen] = n;
+ if (n < ar->dimen)
+ newss->data.info.dimen++;
break;
Nit: Please add appropriate spacing around the "+" in the "long line".
(As it is in the hunk above.)
Yours,
Daniel