public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran, committed] Handle EXEC_WAIT in Fortran tree dump
@ 2017-10-03 13:53 Thomas Koenig
  0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 2017-10-03 13:53 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

Hello world,

I noticed that EXEC_WAIT wasn't handled in the Fortran tree dump.
This patch does that.  While preparing this, I also noticed that
the values for the END and EOR tags were interchanged and fixed
this as well.

Committed as obvious and simple.

Just a cleanup for the time when WAIT actually does anything :-)

Regards

	Thomas

2017-10-03  Thomas Koenig  <tkoenig@gcc.gnu.org>

         * io.c (match_wait_element): Correctly match END and EOR tags.
         * dump-parse-tree.c (show_code_node): Handle EXEC_WAIT.

[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 1791 bytes --]

Index: io.c
===================================================================
--- io.c	(Revision 253377)
+++ io.c	(Arbeitskopie)
@@ -4641,8 +4641,8 @@ match_wait_element (gfc_wait *wait)
 
   m = match_etag (&tag_unit, &wait->unit);
   RETM m = match_ltag (&tag_err, &wait->err);
-  RETM m = match_ltag (&tag_end, &wait->eor);
-  RETM m = match_ltag (&tag_eor, &wait->end);
+  RETM m = match_ltag (&tag_end, &wait->end);
+  RETM m = match_ltag (&tag_eor, &wait->eor);
   RETM m = match_etag (&tag_iomsg, &wait->iomsg);
   if (m == MATCH_YES && !check_char_variable (wait->iomsg))
     return MATCH_ERROR;
Index: dump-parse-tree.c
===================================================================
--- dump-parse-tree.c	(Revision 253377)
+++ dump-parse-tree.c	(Arbeitskopie)
@@ -2727,6 +2727,41 @@ show_code_node (int level, gfc_code *c)
 	fprintf (dumpfile, " EOR=%d", dt->eor->value);
       break;
 
+    case EXEC_WAIT:
+      fputs ("WAIT", dumpfile);
+
+      if (c->ext.wait != NULL)
+	{
+	  gfc_wait *wait = c->ext.wait;
+	  if (wait->unit)
+	    {
+	      fputs (" UNIT=", dumpfile);
+	      show_expr (wait->unit);
+	    }
+	  if (wait->iostat)
+	    {
+	      fputs (" IOSTAT=", dumpfile);
+	      show_expr (wait->iostat);
+	    }
+	  if (wait->iomsg)
+	    {
+	      fputs (" IOMSG=", dumpfile);
+	      show_expr (wait->iomsg);
+	    }
+	  if (wait->id)
+	    {
+	      fputs (" ID=", dumpfile);
+	      show_expr (wait->id);
+	    }
+	  if (wait->err)
+	    fprintf (dumpfile, " ERR=%d", wait->err->value);
+	  if (wait->end)
+	    fprintf (dumpfile, " END=%d", wait->end->value);
+	  if (wait->eor)
+	    fprintf (dumpfile, " EOR=%d", wait->eor->value);
+	}
+      break;
+
     case EXEC_OACC_PARALLEL_LOOP:
     case EXEC_OACC_PARALLEL:
     case EXEC_OACC_KERNELS_LOOP:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-03 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-03 13:53 [patch, fortran, committed] Handle EXEC_WAIT in Fortran tree dump Thomas Koenig

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).