io.c (match_wait_element): Correctly match END and EOR tags.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 3 Oct 2017 13:49:39 +0000 (13:49 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 3 Oct 2017 13:49:39 +0000 (13:49 +0000)
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.

From-SVN: r253381

gcc/fortran/ChangeLog
gcc/fortran/dump-parse-tree.c
gcc/fortran/io.c

index 0e7c7a8..6f904b1 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2017-10-02  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/82312
index a9107c1..a0098d7 100644 (file)
@@ -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:
index 2c3d761..af465dc 100644 (file)
@@ -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;