Hello all,
this patch does two things:
a) It updates the Fortran 2003 and TR/TS 29113 status in the GNU Fortran
manual.
b) It changes all references to Technical Report 29113 to Technical
Specification 29113
c) It changes -std=f2008tr to -std=f2008ts
(a) is obvious.
Regarding (b): For some reason, ISO's SC22 thinks that one should not
use Technical Reports (TR) but a Technical Specification (TS) for the
Further //Interoperability of Fortran with C document - and later also
for the coarray extensions. Glancing at the documentation, I think they
are right that a TS is better; there are procedural differences, but for
us the main difference is the name. As the final word is TS, I think
gfortran should use TS and not TR throughout for the post-F2008
technical documents.
Cf. ftp://ftp.nag.co.uk/sc22wg5/N1851-N1900/N1879.txt : "JTC 1/SC 22
instructs the JTC 1/SC 22/WG 5 Convenor to submit future drafts of TR
29113, Further Interoperability of Fortran with C as Technical
Specifications"
For the difference between TS and TR, see also
http://www.iso.org/iso/standards_development/processes_and_procedures/deliverables.htm;
for the different approval scheme also the following flow chart
(clickable):
http://www.iso.org/iso/standards_development/it_tools/flowchart_main.htm
Regarding (c): If we switch to TS everywhere, I think it makes sense to
also call the flag -std=f2008ts; the flag stands for: Follow the
standard according to Fortran 2008 with the extensions defined in the
post-F2008 (pre-F2013) standard. Namely, TS 29113 on further
interoperability of Fortran with C and the coarray TS, which is in a
rather early stage. (TS 29113 is already past a PDTS voting and a DTS
should be submitted until June 2012.
Given that -std=f2008tr was never included in a released GCC version and
given that it currently only allows very few features, I think no one
actually uses it. Hence, I decided that one can simply change it without
taking care of still accepting the f2008tr version.
(Currently supported TS 29113 features: OPTIONAL with BIND(C) - absent
arguments are indicated as NULL pointer, matching the internal
implementation. RANK() intrinsic - which is boring without assumed-rank
arrays. ASYNCHRONOUS - well, only the semantic has changed a bit since
F2003/GCC 4.6; however, GCC's middle end uses by default ASYNCHRONOUS
semantic; turning it off is a missed-optimization bug.)
The patch was build and regtested on x86-64-linux.
OK for the trunk?
Tobias
PS: I will also update the release notes after the patch has been committed.
2011-10-12 Tobias Burnus <bur...@net-b.de>
* gfortran.texi (Fortran 2008 status, TS 29113 status,
Further Interoperability of Fortran with C): Update implementation
status, change references from TR 29113 to TS 29113.
* intrinsic.texi (RANK): Change TR 29113 to TS 29113.
* invoke.text (-std=): Ditto, change -std=f2008tr to -std=f2008ts.
* lang.opt (std=): Ditto.
* options.c (gfc_handle_option, set_default_std_flags): Ditto and
change GFC_STD_F2008_TR to GFC_STD_F2008_TS.
* libgfortran.h: Ditto.
* intrinsic.c (add_functions, gfc_check_intrinsic_standard): Ditto.
* decl.c (verify_c_interop_param): Ditto.
2011-10-12 Tobias Burnus <bur...@net-b.de>
* gfortran.dg/bind_c_usage_23.f90: Change TR 29113 to TS 29113 in
the comments.
* gfortran.dg/bind_c_usage_24.f90: Ditto.
* gfortran.dg/rank_3.f90: Ditto.
* gfortran.dg/bind_c_usage_22.f90: Ditto, change -std=f2008tr to
-std=f2008ts in dg-options.
* gfortran.dg/rank_4.f90: Ditto.
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 0ee2575..9f3a39e 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1069,7 +1069,7 @@ verify_c_interop_param (gfc_symbol *sym)
retval = FAILURE;
}
else if (sym->attr.optional == 1
- && gfc_notify_std (GFC_STD_F2008_TR, "TR29113: Variable '%s' "
+ && gfc_notify_std (GFC_STD_F2008_TS, "TS29113: Variable '%s' "
"at %L with OPTIONAL attribute in "
"procedure '%s' which is BIND(C)",
sym->name, &(sym->declared_at),
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 389c05b..f847df3 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -772,7 +772,7 @@ compile option was used.
@menu
* Fortran 2003 status::
* Fortran 2008 status::
-* TR 29113 status::
+* TS 29113 status::
@end menu
@node Fortran 2003 status
@@ -1003,8 +1003,11 @@ the intrinsic module @code{ISO_FORTRAN_ENV}.
@code{ISO_C_BINDINGS} and @code{COMPILER_VERSION} and @code{COMPILER_OPTIONS}
of @code{ISO_FORTRAN_ENV}.
-@item Experimental coarray, use the @option{-fcoarray=single} or
-@option{-fcoarray=lib} flag to enable it.
+@item Coarray support for serial programs with @option{-fcoarray=single} flag
+and experimental support for multiple images with the @option{-fcoarray=lib}
+flag.
+
+@item The @code{DO CONCURRENT} construct is supported.
@item The @code{BLOCK} construct is supported.
@@ -1049,19 +1052,25 @@ arrays are supported for named constants (@code{PARAMETER}).
-@node TR 29113 status
-@section Fortran 29113 status
+@node TS 29113 status
+@section Technical Specification 29113 Status
-GNU Fortran supports some of the new features of the technical report (TR)
-29113 on Further Interoperability of Fortran with C.
-@uref{http://gcc.gnu.org/wiki/Fortran2008Status, wiki} has some information
-about the current TR 29113 implementation status. In particular, the
+GNU Fortran supports some of the new features of the Technical
+Specification (TS) 29113 on Further Interoperability of Fortran with C.
+The @uref{http://gcc.gnu.org/wiki/TS29113Status, wiki} has some information
+about the current TS 29113 implementation status. In particular, the
following is implemented.
@itemize
-@item The @option{-std=f2008} option.
-@item The OPTIONAL attribute is now allowed for dummy arguments of
-BIND(C) procedures.
+@item The @option{-std=f2008ts} option.
+
+@item The @code{OPTIONAL} attribute is allowed for dummy arguments
+of @code{BIND(C) procedures.}
+
+@item The RANK intrinsic is supported.
+
+@item GNU Fortran's implementation for variables with @code{ASYNCHRONOUS}
+attribute is compatible with TS 29113.
@end itemize
@@ -2446,15 +2455,13 @@ END MODULE m
Assumed-shape and allocatable arrays are passed using an array descriptor
(dope vector). The internal structure of the array descriptor used
by GNU Fortran is not yet documented and will change. There will also be
-a Technical Report (TR 29113) which standardizes an interoperable
+a Technical Specification (TS 29113) which standardizes an interoperable
array descriptor. Until then, you can use the Chasm Language
Interoperability Tools, @url{http://chasm-interop.sourceforge.net/},
which provide an interface to GNU Fortran's array descriptor.
-The technical report 29113 will presumably also include support for
-C-interoperable @code{OPTIONAL} and for assumed-rank and assumed-type
-dummy arguments. However, the TR has neither been approved nor implemented
-in GNU Fortran; therefore, these features are not yet available.
+GNU Fortran already supports the C-interoperable @code{OPTIONAL}
+attribute; for absent arguments, a @code{NULL} pointer is passed.
@@ -2620,9 +2627,9 @@ Possible values are (bitwise or-ed) @code{GFC_STD_F77} (1),
@code{GFC_STD_F95_OBS} (2), @code{GFC_STD_F95_DEL} (4), @code{GFC_STD_F95}
(8), @code{GFC_STD_F2003} (16), @code{GFC_STD_GNU} (32),
@code{GFC_STD_LEGACY} (64), @code{GFC_STD_F2008} (128),
-@code{GFC_STD_F2008_OBS} (256) and GFC_STD_F2008_TR (512). Default:
+@code{GFC_STD_F2008_OBS} (256) and GFC_STD_F2008_TS (512). Default:
@code{GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95 | GFC_STD_F2003
-| GFC_STD_F2008 | GFC_STD_F2008_TR | GFC_STD_F2008_OBS | GFC_STD_F77
+| GFC_STD_F2008 | GFC_STD_F2008_TS | GFC_STD_F2008_OBS | GFC_STD_F77
| GFC_STD_GNU | GFC_STD_LEGACY}.
@item @var{option}[1] @tab Standard-warning flag; prints a warning to
standard error. Default: @code{GFC_STD_F95_DEL | GFC_STD_LEGACY}.
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 5946ddd..8f437cc 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -2434,9 +2434,9 @@ add_functions (void)
make_generic ("range", GFC_ISYM_RANGE, GFC_STD_F95);
add_sym_1 ("rank", GFC_ISYM_RANK, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di,
- GFC_STD_F2008_TR, gfc_check_rank, gfc_simplify_rank, NULL,
+ GFC_STD_F2008_TS, gfc_check_rank, gfc_simplify_rank, NULL,
a, BT_REAL, dr, REQUIRED);
- make_generic ("rank", GFC_ISYM_RANK, GFC_STD_F2008_TR);
+ make_generic ("rank", GFC_ISYM_RANK, GFC_STD_F2008_TS);
add_sym_2 ("real", GFC_ISYM_REAL, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_F77,
gfc_check_real, gfc_simplify_real, gfc_resolve_real,
@@ -3989,8 +3989,8 @@ gfc_check_intrinsic_standard (const gfc_intrinsic_sym* isym,
symstd_msg = "new in Fortran 2008";
break;
- case GFC_STD_F2008_TR:
- symstd_msg = "new in TR 29113";
+ case GFC_STD_F2008_TS:
+ symstd_msg = "new in TS 29113";
break;
case GFC_STD_GNU:
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index a093bec..11f87a5 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -10222,7 +10222,7 @@ See @code{PRECISION} for an example.
@code{RANK(A)} returns the rank of a scalar or array data object.
@item @emph{Standard}:
-Technical Report (TR) 29113
+Technical Specification (TS) 29113
@item @emph{Class}:
Inquiry function
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 41fee67..d939269 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -368,9 +368,10 @@ extensions, and may be useful for old non-standard programs. The
conformance to the Fortran 95, Fortran 2003 and Fortran 2008 standards,
respectively; errors are given for all extensions beyond the relevant
language standard, and warnings are given for the Fortran 77 features
-that are permitted but obsolescent in later standards. @samp{-std=f2008tr}
+that are permitted but obsolescent in later standards. @samp{-std=f2008ts}
allows the Fortran 2008 standard including the additions of the
-technical report (TR) 29113.
+Technical Specification (TS) 29113 on Further Interoperability of Fortran
+with C.
@end table
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 1a3d073..081041b 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -590,9 +590,9 @@ std=f2008
Fortran
Conform to the ISO Fortran 2008 standard
-std=f2008tr
+std=f2008ts
Fortran
-Conform to the ISO Fortran 2008 standard including TR 29113
+Conform to the ISO Fortran 2008 standard including TS 29113
std=f95
Fortran
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index b2137bb..874cd95 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
Note that no features were obsoleted nor deleted in F2003.
Please remember to keep those definitions in sync with
gfortran.texi. */
-#define GFC_STD_F2008_TR (1<<9) /* POST-F2008 technical reports. */
+#define GFC_STD_F2008_TS (1<<9) /* POST-F2008 technical reports. */
#define GFC_STD_F2008_OBS (1<<8) /* Obsolescent in F2008. */
#define GFC_STD_F2008 (1<<7) /* New in F2008. */
#define GFC_STD_LEGACY (1<<6) /* Backward compatibility. */
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 4c59bd5..dcb11e8 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -49,7 +49,7 @@ set_default_std_flags (void)
{
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
| GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
- | GFC_STD_F2008_OBS | GFC_STD_F2008_TR | GFC_STD_GNU | GFC_STD_LEGACY;
+ | GFC_STD_F2008_OBS | GFC_STD_F2008_TS | GFC_STD_GNU | GFC_STD_LEGACY;
gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
}
@@ -945,10 +945,10 @@ gfc_handle_option (size_t scode, const char *arg, int value,
gfc_option.warn_tabs = 0;
break;
- case OPT_std_f2008tr:
+ case OPT_std_f2008ts:
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77
| GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008 | GFC_STD_F2008_OBS
- | GFC_STD_F2008_TR;
+ | GFC_STD_F2008_TS;
gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS;
gfc_option.max_identifier_length = 63;
gfc_option.warn_ampersand = 1;
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_22.f90 b/gcc/testsuite/gfortran.dg/bind_c_usage_22.f90
index 861f8c7..5a5771c 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_usage_22.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_22.f90
@@ -1,10 +1,10 @@
! { dg-do compile }
-! { dg-options "-std=f2008tr" }
+! { dg-options "-std=f2008ts" }
!
! PR fortran/48858
! PR fortran/48820
!
-! OPTIONAL + BIND(C) is allowed since TR 29113
+! OPTIONAL + BIND(C) is allowed since TS 29113
!
! VALID
@@ -13,20 +13,20 @@ subroutine sub(z) bind(C)
integer(c_int), value :: z
end subroutine sub
-! VALID since TR29113
+! VALID since TS29113
subroutine sub2(z) bind(C)
use iso_c_binding
integer(c_int), optional :: z
end subroutine sub2
-! VALID since TR29113
+! VALID since TS29113
subroutine sub2a(z) bind(C)
use iso_c_binding
integer(c_int) :: z
optional :: z
end subroutine sub2a
-! VALID since TR29113
+! VALID since TS29113
subroutine sub2b(z) bind(C)
use iso_c_binding
optional :: z
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_23.f90 b/gcc/testsuite/gfortran.dg/bind_c_usage_23.f90
index 374f812..3917b9d 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_usage_23.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_23.f90
@@ -4,7 +4,7 @@
! PR fortran/48858
! PR fortran/48820
!
-! OPTIONAL + BIND(C) is allowed since TR 29113
+! OPTIONAL + BIND(C) is allowed since TS 29113
!
! VALID
@@ -13,20 +13,20 @@ subroutine sub(z) bind(C)
integer(c_int), value :: z
end subroutine sub
-! VALID since TR29113
+! VALID since TS29113
subroutine sub2(z) bind(C) ! { dg-error "with OPTIONAL attribute in procedure" }
use iso_c_binding
integer(c_int), optional :: z
end subroutine sub2
-! VALID since TR29113
+! VALID since TS29113
subroutine sub2a(z) bind(C) ! { dg-error "with OPTIONAL attribute in procedure" }
use iso_c_binding
integer(c_int) :: z
optional :: z
end subroutine sub2a
-! VALID since TR29113
+! VALID since TS29113
subroutine sub2b(z) bind(C) ! { dg-error "with OPTIONAL attribute in procedure" }
use iso_c_binding
optional :: z
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_24.f90 b/gcc/testsuite/gfortran.dg/bind_c_usage_24.f90
index 703ab5f..a6ebd58 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_usage_24.f90
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_24.f90
@@ -4,7 +4,7 @@
! PR fortran/48858
! PR fortran/48820
!
-! TR 29113: BIND(C) with OPTIONAL
+! TS 29113: BIND(C) with OPTIONAL
!
module m
use iso_c_binding
diff --git a/gcc/testsuite/gfortran.dg/rank_3.f90 b/gcc/testsuite/gfortran.dg/rank_3.f90
index fac2185..c8f8fa7 100644
--- a/gcc/testsuite/gfortran.dg/rank_3.f90
+++ b/gcc/testsuite/gfortran.dg/rank_3.f90
@@ -3,5 +3,5 @@
!
! PR fortran/48820
!
-intrinsic :: rank ! { dg-error "new in TR 29113" }
+intrinsic :: rank ! { dg-error "new in TS 29113" }
end
diff --git a/gcc/testsuite/gfortran.dg/rank_4.f90 b/gcc/testsuite/gfortran.dg/rank_4.f90
index 40b0209..a370df0 100644
--- a/gcc/testsuite/gfortran.dg/rank_4.f90
+++ b/gcc/testsuite/gfortran.dg/rank_4.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-std=f2008tr -fdump-tree-original" }
+! { dg-options "-std=f2008ts -fdump-tree-original" }
!
! PR fortran/48820
!