]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/48976 (INQUIRE with STREAM= not supported)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 27 Dec 2012 18:09:13 +0000 (18:09 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 27 Dec 2012 18:09:13 +0000 (18:09 +0000)
2012-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/48976
* gfortran.h (gfc_inquire struct): Add pointer for inquire stream.
* io.c (io_tag): Add tag for inquire stream. (match_inquire_element):
Add matcher for new tag. (gfc_resolve_inquire): Resolve new tag.
* ioparm.def: Add new parameter for inquire stream.
* trans-io.c (gfc_trans_inquire): Add tranlste code for inquire
stream.

From-SVN: r194734

gcc/fortran/ChangeLog
gcc/fortran/gfortran.h
gcc/fortran/io.c
gcc/fortran/ioparm.def
gcc/fortran/trans-io.c

index b3dab05db1303e846a9c7c91c813c2a33a070ab4..a8d6a21c8ab0d84852f93343cb58a75fcd83b970 100644 (file)
@@ -1,3 +1,13 @@
+2012-12-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/48976
+       * gfortran.h (gfc_inquire struct): Add pointer for inquire stream.
+       * io.c (io_tag): Add tag for inquire stream. (match_inquire_element):
+       Add matcher for new tag. (gfc_resolve_inquire): Resolve new tag.
+       * ioparm.def: Add new parameter for inquire stream.
+       * trans-io.c (gfc_trans_inquire): Add tranlste code for inquire
+       stream.
+
 2012-12-23  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/54884
index f12099228a01e99baf216c81f9c1842f6571cf18..a419af3ad403c68d9b756c1bdc7143803e73b94a 100644 (file)
@@ -2008,7 +2008,8 @@ typedef struct
     *name, *access, *sequential, *direct, *form, *formatted,
     *unformatted, *recl, *nextrec, *blank, *position, *action, *read,
     *write, *readwrite, *delim, *pad, *iolength, *iomsg, *convert, *strm_pos,
-    *asynchronous, *decimal, *encoding, *pending, *round, *sign, *size, *id;
+    *asynchronous, *decimal, *encoding, *pending, *round, *sign, *size, *id,
+    *iqstream;
 
   gfc_st_label *err;
 
index bd84f1fc48ad11b543bc609ea3be6b39b60961fe..7eb52a974d7c38e917ef014cc5cacb1b8d53d5e6 100644 (file)
@@ -97,7 +97,8 @@ static const io_tag
        tag_eor         = {"EOR", " eor =", " %l", BT_UNKNOWN},
        tag_id          = {"ID", " id =", " %v", BT_INTEGER},
        tag_pending     = {"PENDING", " pending =", " %v", BT_LOGICAL},
-       tag_newunit     = {"NEWUNIT", " newunit =", " %v", BT_INTEGER};
+       tag_newunit     = {"NEWUNIT", " newunit =", " %v", BT_INTEGER},
+       tag_s_iqstream  = {"STREAM", " stream =", " %v", BT_CHARACTER};
 
 static gfc_dt *current_dt;
 
@@ -3912,6 +3913,7 @@ match_inquire_element (gfc_inquire *inquire)
   RETM m = match_out_tag (&tag_strm_out, &inquire->strm_pos);
   RETM m = match_vtag (&tag_pending, &inquire->pending);
   RETM m = match_vtag (&tag_id, &inquire->id);
+  RETM m = match_vtag (&tag_s_iqstream, &inquire->iqstream);
   RETM return MATCH_NO;
 }
 
@@ -4101,6 +4103,7 @@ gfc_resolve_inquire (gfc_inquire *inquire)
   INQUIRE_RESOLVE_TAG (&tag_pending, inquire->pending);
   INQUIRE_RESOLVE_TAG (&tag_size, inquire->size);
   INQUIRE_RESOLVE_TAG (&tag_s_decimal, inquire->decimal);
+  INQUIRE_RESOLVE_TAG (&tag_s_iqstream, inquire->iqstream);
 #undef INQUIRE_RESOLVE_TAG
 
   if (gfc_reference_st_label (inquire->err, ST_LABEL_TARGET) == FAILURE)
index 5ccd869732fc9e46dee18a022d9f7740bb360cd2..c9c271d886d67fca8ba6f606c4b8799428a12014 100644 (file)
@@ -88,6 +88,7 @@ IOPARM (inquire, sign,                1 << 4,  char1)
 IOPARM (inquire, pending,      1 << 5,  pint4)
 IOPARM (inquire, size,         1 << 6,  pintio)
 IOPARM (inquire, id,           1 << 7,  pint4)
+IOPARM (inquire, iqstream,     1 << 8,  char1)
 IOPARM (wait,    common,       0,       common)
 IOPARM (wait,    id,           1 << 7,  pint4)
 #ifndef IOPARM_dt_list_format
index 940129eb05f09cfb4e19d5db685d8a18655b32a8..921edd042eae0b1e7cbc0faf587b233839d2c210 100644 (file)
@@ -1364,6 +1364,9 @@ gfc_trans_inquire (gfc_code * code)
   if (p->id)
     mask2 |= set_parameter_ref (&block, &post_block,var, IOPARM_inquire_id,
                                p->id);
+  if (p->iqstream)
+    mask2 |= set_string (&block, &post_block, var, IOPARM_inquire_iqstream,
+                        p->iqstream);
 
   if (mask2)
     mask |= set_parameter_const (&block, var, IOPARM_inquire_flags2, mask2);