public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Kraft <d@domob.eu>
To: gcc-patches@gcc.gnu.org
Cc: fortran@gcc.gnu.org
Subject: Re: [Patch, Fortran] PR18918 - UCOBOUND coarray draft patch
Date: Mon, 04 Apr 2011 09:44:00 -0000	[thread overview]
Message-ID: <4D99938D.6040007@domob.eu> (raw)
In-Reply-To: <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

  reply	other threads:[~2011-04-04  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 22:20 Tobias Burnus
2011-04-03 15:03 ` Tobias Burnus
2011-04-04  9:44   ` Daniel Kraft [this message]
2011-04-04 18:35     ` Tobias Burnus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D99938D.6040007@domob.eu \
    --to=d@domob.eu \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).