aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog14
-rw-r--r--gcc/fortran/gfortran.texi18
-rw-r--r--gcc/fortran/trans-decl.c3
-rw-r--r--gcc/fortran/trans-io.c5
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/gfortran.dg/f2003_inquire_1.f034
-rw-r--r--gcc/testsuite/gfortran.dg/f2003_io_1.f032
7 files changed, 31 insertions, 25 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 94b63b7..9454102 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,17 @@
+2018-07-31 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ Revert 'AsyncI/O patch committed'
+ 2018-07-25 Nicolas Koenig <koenigni@gcc.gnu.org>
+ Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/25829
+ * gfortran.texi: Add description of asynchronous I/O.
+ * trans-decl.c (gfc_finish_var_decl): Treat asynchronous variables
+ as volatile.
+ * trans-io.c (gfc_build_io_library_fndecls): Rename st_wait to
+ st_wait_async and change argument spec from ".X" to ".w".
+ (gfc_trans_wait): Pass ID argument via reference.
+
2018-07-25 Nicolas Koenig <koenigni@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 3920002..d6bb7aa 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -879,7 +879,8 @@ than @code{(/.../)}. Type-specification for array constructors like
@item Extensions to the specification and initialization expressions,
including the support for intrinsics with real and complex arguments.
-@item Support for the asynchronous input/output.
+@item Support for the asynchronous input/output syntax; however, the
+data transfer is currently always synchronously performed.
@item
@cindex @code{FLUSH} statement
@@ -1182,7 +1183,6 @@ might in some way or another become visible to the programmer.
* Files opened without an explicit ACTION= specifier::
* File operations on symbolic links::
* File format of unformatted sequential files::
-* Asynchronous I/O::
@end menu
@@ -1486,20 +1486,6 @@ program main
end program main
@end smallexample
-@node Asynchronous I/O
-@section Asynchronous I/O
-@cindex input/output, asynchronous
-@cindex asynchronous I/O
-
-Asynchronous I/O is supported if the program is linked against the
-POSIX thread library. If that is not the case, all I/O is performed
-as synchronous.
-
-On some systems, such as Darwin or Solaris, the POSIX thread library
-is always linked in, so asynchronous I/O is always performed. On other
-sytems, such as Linux, it is necessary to specify @option{-pthread},
-@option{-lpthread} or @option{-fopenmp} during the linking step.
-
@c ---------------------------------------------------------------------
@c Extensions
@c ---------------------------------------------------------------------
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index eea6b81..08c1ebd 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -698,8 +698,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
&& CLASS_DATA (sym)->ts.u.derived->attr.has_dtio_procs)))
TREE_STATIC (decl) = 1;
- /* Treat asynchronous variables the same as volatile, for now. */
- if (sym->attr.volatile_ || sym->attr.asynchronous)
+ if (sym->attr.volatile_)
{
TREE_THIS_VOLATILE (decl) = 1;
TREE_SIDE_EFFECTS (decl) = 1;
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 88dbcb8..2626c46 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -438,9 +438,10 @@ gfc_build_io_library_fndecls (void)
get_identifier (PREFIX("st_iolength")), ".w",
void_type_node, 1, dt_parm_type);
+ /* TODO: Change when asynchronous I/O is implemented. */
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_wait].type);
iocall[IOCALL_WAIT] = gfc_build_library_function_decl_with_spec (
- get_identifier (PREFIX("st_wait_async")), ".w",
+ get_identifier (PREFIX("st_wait")), ".X",
void_type_node, 1, parm_type);
parm_type = build_pointer_type (st_parameter[IOPARM_ptype_filepos].type);
@@ -1526,7 +1527,7 @@ gfc_trans_wait (gfc_code * code)
mask |= IOPARM_common_err;
if (p->id)
- mask |= set_parameter_ref (&block, &post_block, var, IOPARM_wait_id, p->id);
+ mask |= set_parameter_value (&block, var, IOPARM_wait_id, p->id);
set_parameter_const (&block, var, IOPARM_common_flags, mask);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0731143..eb64742 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2018-07-31 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ Revert 'AsyncI/O patch committed'
+ 2018-07-25 Nicolas Koenig <koenigni@gcc.gnu.org>
+ Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/25829
+ * gfortran.dg/f2003_inquire_1.f03: Add write statement.
+ * gfortran.dg/f2003_io_1.f03: Add wait statement.
+
2018-07-30 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/85160
diff --git a/gcc/testsuite/gfortran.dg/f2003_inquire_1.f03 b/gcc/testsuite/gfortran.dg/f2003_inquire_1.f03
index 957cdae..e51f619 100644
--- a/gcc/testsuite/gfortran.dg/f2003_inquire_1.f03
+++ b/gcc/testsuite/gfortran.dg/f2003_inquire_1.f03
@@ -7,12 +7,10 @@ logical :: vpending
open(10, file='mydata_f2003_inquire_1', asynchronous="yes", blank="null", &
& decimal="comma", encoding="utf-8", sign="plus")
-write (10,*, asynchronous="yes", id=vid) 'asdf'
-wait (10)
-
inquire(unit=10, round=sround, sign=ssign, size=vsize, id=vid, &
& pending=vpending, asynchronous=sasynchronous, decimal=sdecimal, &
& encoding=sencoding)
+
if (ssign.ne."PLUS") STOP 1
if (sasynchronous.ne."YES") STOP 2
if (sdecimal.ne."COMMA") STOP 3
diff --git a/gcc/testsuite/gfortran.dg/f2003_io_1.f03 b/gcc/testsuite/gfortran.dg/f2003_io_1.f03
index 8c7fb4b..8021d79 100644
--- a/gcc/testsuite/gfortran.dg/f2003_io_1.f03
+++ b/gcc/testsuite/gfortran.dg/f2003_io_1.f03
@@ -13,7 +13,6 @@ open(10, file='mydata_f2003_io_1', asynchronous="yes", blank="null")
write(10,'(10f8.3)', asynchronous="yes", decimal="comma", id=j) a
rewind(10)
read(10,'(10f8.3)', asynchronous="yes", decimal="comma", blank="zero") b
-wait(10)
if (any(b.ne.23.45)) STOP 1
c = 3.14
@@ -25,7 +24,6 @@ rewind(10)
write(10,'(10f8.3)', asynchronous="yes", decimal="point") a
rewind(10)
read(10,'(10f8.3)', asynchronous="yes", decimal="point") b
-wait (10)
if (any(b.ne.23.45)) STOP 3
wait(unit=10, err=25, iostat=istat, iomsg=msg, end=35, id=j)