Fortran manual: Combine standard conformance docs in one place.

Discussion of conformance with various revisions of the
Fortran standard was split between two separate parts of the
manual.  This patch moves it all to the introductory chapter.

2021-11-01  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/fortran/
	* gfortran.texi (Standards): Move discussion of specific
	standard versions here....
	(Fortran standards status): ...from here, and delete this node.
This commit is contained in:
Sandra Loosemore 2021-10-29 17:16:40 -07:00
parent d3f7a2fa64
commit 2b1c757d83

View File

@ -180,7 +180,6 @@ Part I: Invoking GNU Fortran
* Runtime:: Influencing runtime behavior with environment variables.
Part II: Language Reference
* Fortran standards status:: Fortran 2003, 2008 and 2018 features supported by GNU Fortran.
* Compiler Characteristics:: User-visible implementation details.
* Extensions:: Language extensions implemented by GNU Fortran.
* Mixed-Language Programming:: Interoperability with C
@ -524,7 +523,10 @@ Fortran 2008 and Fortran 2018.
@cindex Standards
@menu
* Varying Length Character Strings::
* Fortran 95 status::
* Fortran 2003 status::
* Fortran 2008 status::
* Fortran 2018 status::
@end menu
The GNU Fortran compiler implements
@ -547,8 +549,8 @@ There also is support for the OpenACC specification (targeting
version 2.6, @uref{http://www.openacc.org/}). See
@uref{https://gcc.gnu.org/wiki/OpenACC} for more information.
@node Varying Length Character Strings
@subsection Varying Length Character Strings
@node Fortran 95 status
@subsection Fortran 95 status
@cindex Varying length character strings
@cindex Varying length strings
@cindex strings, varying length
@ -565,6 +567,376 @@ the features of @code{ISO_VARYING_STRING} and should be considered as
replacement. (Namely, allocatable or pointers of the type
@code{character(len=:)}.)
@node Fortran 2003 status
@subsection Fortran 2003 status
GNU Fortran supports several Fortran 2003 features; an incomplete
list can be found below. See also the
@uref{https://gcc.gnu.org/wiki/Fortran2003, wiki page} about Fortran 2003.
@itemize
@item Procedure pointers including procedure-pointer components with
@code{PASS} attribute.
@item Procedures which are bound to a derived type (type-bound procedures)
including @code{PASS}, @code{PROCEDURE} and @code{GENERIC}, and
operators bound to a type.
@item Abstract interfaces and type extension with the possibility to
override type-bound procedures or to have deferred binding.
@item Polymorphic entities (``@code{CLASS}'') for derived types and unlimited
polymorphism (``@code{CLASS(*)}'') -- including @code{SAME_TYPE_AS},
@code{EXTENDS_TYPE_OF} and @code{SELECT TYPE} for scalars and arrays and
finalization.
@item Generic interface names, which have the same name as derived types,
are now supported. This allows one to write constructor functions. Note
that Fortran does not support static constructor functions. For static
variables, only default initialization or structure-constructor
initialization are available.
@item The @code{ASSOCIATE} construct.
@item Interoperability with C including enumerations,
@item In structure constructors the components with default values may be
omitted.
@item Extensions to the @code{ALLOCATE} statement, allowing for a
type-specification with type parameter and for allocation and initialization
from a @code{SOURCE=} expression; @code{ALLOCATE} and @code{DEALLOCATE}
optionally return an error message string via @code{ERRMSG=}.
@item Reallocation on assignment: If an intrinsic assignment is
used, an allocatable variable on the left-hand side is automatically allocated
(if unallocated) or reallocated (if the shape is different). Currently, scalar
deferred character length left-hand sides are correctly handled but arrays
are not yet fully implemented.
@item Deferred-length character variables and scalar deferred-length character
components of derived types are supported. (Note that array-valued components
are not yet implemented.)
@item Transferring of allocations via @code{MOVE_ALLOC}.
@item The @code{PRIVATE} and @code{PUBLIC} attributes may be given individually
to derived-type components.
@item In pointer assignments, the lower bound may be specified and
the remapping of elements is supported.
@item For pointers an @code{INTENT} may be specified which affect the
association status not the value of the pointer target.
@item Intrinsics @code{command_argument_count}, @code{get_command},
@code{get_command_argument}, and @code{get_environment_variable}.
@item Support for Unicode characters (ISO 10646) and UTF-8, including
the @code{SELECTED_CHAR_KIND} and @code{NEW_LINE} intrinsic functions.
@item Support for binary, octal and hexadecimal (BOZ) constants in the
intrinsic functions @code{INT}, @code{REAL}, @code{CMPLX} and @code{DBLE}.
@item Support for namelist variables with allocatable and pointer
attribute and nonconstant length type parameter.
@item
@cindex array, constructors
@cindex @code{[...]}
Array constructors using square brackets. That is, @code{[...]} rather
than @code{(/.../)}. Type-specification for array constructors like
@code{(/ some-type :: ... /)}.
@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
@cindex @code{FLUSH} statement
@cindex statement, @code{FLUSH}
@code{FLUSH} statement.
@item
@cindex @code{IOMSG=} specifier
@code{IOMSG=} specifier for I/O statements.
@item
@cindex @code{ENUM} statement
@cindex @code{ENUMERATOR} statement
@cindex statement, @code{ENUM}
@cindex statement, @code{ENUMERATOR}
@opindex @code{fshort-enums}
Support for the declaration of enumeration constants via the
@code{ENUM} and @code{ENUMERATOR} statements. Interoperability with
@command{gcc} is guaranteed also for the case where the
@command{-fshort-enums} command line option is given.
@item
@cindex TR 15581
TR 15581:
@itemize
@item
@cindex @code{ALLOCATABLE} dummy arguments
@code{ALLOCATABLE} dummy arguments.
@item
@cindex @code{ALLOCATABLE} function results
@code{ALLOCATABLE} function results
@item
@cindex @code{ALLOCATABLE} components of derived types
@code{ALLOCATABLE} components of derived types
@end itemize
@item
@cindex @code{STREAM} I/O
@cindex @code{ACCESS='STREAM'} I/O
The @code{OPEN} statement supports the @code{ACCESS='STREAM'} specifier,
allowing I/O without any record structure.
@item
Namelist input/output for internal files.
@item Minor I/O features: Rounding during formatted output, using of
a decimal comma instead of a decimal point, setting whether a plus sign
should appear for positive numbers. On systems where @code{strtod} honours
the rounding mode, the rounding mode is also supported for input.
@item
@cindex @code{PROTECTED} statement
@cindex statement, @code{PROTECTED}
The @code{PROTECTED} statement and attribute.
@item
@cindex @code{VALUE} statement
@cindex statement, @code{VALUE}
The @code{VALUE} statement and attribute.
@item
@cindex @code{VOLATILE} statement
@cindex statement, @code{VOLATILE}
The @code{VOLATILE} statement and attribute.
@item
@cindex @code{IMPORT} statement
@cindex statement, @code{IMPORT}
The @code{IMPORT} statement, allowing to import
host-associated derived types.
@item The intrinsic modules @code{ISO_FORTRAN_ENVIRONMENT} is supported,
which contains parameters of the I/O units, storage sizes. Additionally,
procedures for C interoperability are available in the @code{ISO_C_BINDING}
module.
@item
@cindex @code{USE, INTRINSIC} statement
@cindex statement, @code{USE, INTRINSIC}
@cindex @code{ISO_FORTRAN_ENV} statement
@cindex statement, @code{ISO_FORTRAN_ENV}
@code{USE} statement with @code{INTRINSIC} and @code{NON_INTRINSIC}
attribute; supported intrinsic modules: @code{ISO_FORTRAN_ENV},
@code{ISO_C_BINDING}, @code{OMP_LIB} and @code{OMP_LIB_KINDS},
and @code{OPENACC}.
@item
Renaming of operators in the @code{USE} statement.
@end itemize
@node Fortran 2008 status
@subsection Fortran 2008 status
The latest version of the Fortran standard is ISO/IEC 1539-1:2010, informally
known as Fortran 2008. The official version is available from International
Organization for Standardization (ISO) or its national member organizations.
The the final draft (FDIS) can be downloaded free of charge from
@url{http://www.nag.co.uk/@/sc22wg5/@/links.html}. Fortran is developed by the
Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1 of the
International Organization for Standardization and the International
Electrotechnical Commission (IEC). This group is known as
@uref{http://www.nag.co.uk/sc22wg5/, WG5}.
The GNU Fortran compiler supports several of the new features of Fortran 2008;
the @uref{https://gcc.gnu.org/wiki/Fortran2008Status, wiki} has some information
about the current Fortran 2008 implementation status. In particular, the
following is implemented.
@itemize
@item The @option{-std=f2008} option and support for the file extensions
@file{.f08} and @file{.F08}.
@item The @code{OPEN} statement now supports the @code{NEWUNIT=} option,
which returns a unique file unit, thus preventing inadvertent use of the
same unit in different parts of the program.
@item The @code{g0} format descriptor and unlimited format items.
@item The mathematical intrinsics @code{ASINH}, @code{ACOSH}, @code{ATANH},
@code{ERF}, @code{ERFC}, @code{GAMMA}, @code{LOG_GAMMA}, @code{BESSEL_J0},
@code{BESSEL_J1}, @code{BESSEL_JN}, @code{BESSEL_Y0}, @code{BESSEL_Y1},
@code{BESSEL_YN}, @code{HYPOT}, @code{NORM2}, and @code{ERFC_SCALED}.
@item Using complex arguments with @code{TAN}, @code{SINH}, @code{COSH},
@code{TANH}, @code{ASIN}, @code{ACOS}, and @code{ATAN} is now possible;
@code{ATAN}(@var{Y},@var{X}) is now an alias for @code{ATAN2}(@var{Y},@var{X}).
@item Support of the @code{PARITY} intrinsic functions.
@item The following bit intrinsics: @code{LEADZ} and @code{TRAILZ} for
counting the number of leading and trailing zero bits, @code{POPCNT} and
@code{POPPAR} for counting the number of one bits and returning the parity;
@code{BGE}, @code{BGT}, @code{BLE}, and @code{BLT} for bitwise comparisons;
@code{DSHIFTL} and @code{DSHIFTR} for combined left and right shifts,
@code{MASKL} and @code{MASKR} for simple left and right justified masks,
@code{MERGE_BITS} for a bitwise merge using a mask, @code{SHIFTA},
@code{SHIFTL} and @code{SHIFTR} for shift operations, and the
transformational bit intrinsics @code{IALL}, @code{IANY} and @code{IPARITY}.
@item Support of the @code{EXECUTE_COMMAND_LINE} intrinsic subroutine.
@item Support for the @code{STORAGE_SIZE} intrinsic inquiry function.
@item The @code{INT@{8,16,32@}} and @code{REAL@{32,64,128@}} kind type
parameters and the array-valued named constants @code{INTEGER_KINDS},
@code{LOGICAL_KINDS}, @code{REAL_KINDS} and @code{CHARACTER_KINDS} of
the intrinsic module @code{ISO_FORTRAN_ENV}.
@item The module procedures @code{C_SIZEOF} of the intrinsic module
@code{ISO_C_BINDINGS} and @code{COMPILER_VERSION} and @code{COMPILER_OPTIONS}
of @code{ISO_FORTRAN_ENV}.
@item Coarray support for serial programs with @option{-fcoarray=single} flag
and experimental support for multiple images with the @option{-fcoarray=lib}
flag.
@item Submodules are supported. It should noted that @code{MODULEs} do not
produce the smod file needed by the descendent @code{SUBMODULEs} unless they
contain at least one @code{MODULE PROCEDURE} interface. The reason for this is
that @code{SUBMODULEs} are useless without @code{MODULE PROCEDUREs}. See
http://j3-fortran.org/doc/meeting/207/15-209.txt for a discussion and a draft
interpretation. Adopting this interpretation has the advantage that code that
does not use submodules does not generate smod files.
@item The @code{DO CONCURRENT} construct is supported.
@item The @code{BLOCK} construct is supported.
@item The @code{STOP} and the new @code{ERROR STOP} statements now
support all constant expressions. Both show the signals which were signaling
at termination.
@item Support for the @code{CONTIGUOUS} attribute.
@item Support for @code{ALLOCATE} with @code{MOLD}.
@item Support for the @code{IMPURE} attribute for procedures, which
allows for @code{ELEMENTAL} procedures without the restrictions of
@code{PURE}.
@item Null pointers (including @code{NULL()}) and not-allocated variables
can be used as actual argument to optional non-pointer, non-allocatable
dummy arguments, denoting an absent argument.
@item Non-pointer variables with @code{TARGET} attribute can be used as
actual argument to @code{POINTER} dummies with @code{INTENT(IN)}.
@item Pointers including procedure pointers and those in a derived
type (pointer components) can now be initialized by a target instead
of only by @code{NULL}.
@item The @code{EXIT} statement (with construct-name) can be now be
used to leave not only the @code{DO} but also the @code{ASSOCIATE},
@code{BLOCK}, @code{IF}, @code{SELECT CASE} and @code{SELECT TYPE}
constructs.
@item Internal procedures can now be used as actual argument.
@item Minor features: obsolesce diagnostics for @code{ENTRY} with
@option{-std=f2008}; a line may start with a semicolon; for internal
and module procedures @code{END} can be used instead of
@code{END SUBROUTINE} and @code{END FUNCTION}; @code{SELECTED_REAL_KIND}
now also takes a @code{RADIX} argument; intrinsic types are supported
for @code{TYPE}(@var{intrinsic-type-spec}); multiple type-bound procedures
can be declared in a single @code{PROCEDURE} statement; implied-shape
arrays are supported for named constants (@code{PARAMETER}).
@end itemize
@node Fortran 2018 status
@subsection Status of Fortran 2018 support
@itemize
@item ERROR STOP in a PURE procedure
An @code{ERROR STOP} statement is permitted in a @code{PURE}
procedure.
@item IMPLICIT NONE with a spec-list
Support the @code{IMPLICIT NONE} statement with an
@code{implicit-none-spec-list}.
@item Behavior of INQUIRE with the RECL= specifier
The behavior of the @code{INQUIRE} statement with the @code{RECL=}
specifier now conforms to Fortran 2018.
@end itemize
@subsubsection TS 29113 Status (Further Interoperability with C)
GNU Fortran supports some of the new features of the Technical
Specification (TS) 29113 on Further Interoperability of Fortran with C.
The @uref{https://gcc.gnu.org/wiki/TS29113Status, wiki} has some information
about the current TS 29113 implementation status. In particular, the
following is implemented.
See also @ref{Further Interoperability of Fortran with C}.
@itemize
@item The @code{OPTIONAL} attribute is allowed for dummy arguments
of @code{BIND(C) procedures.}
@item The @code{RANK} intrinsic is supported.
@item GNU Fortran's implementation for variables with @code{ASYNCHRONOUS}
attribute is compatible with TS 29113.
@item Assumed types (@code{TYPE(*)}).
@item Assumed-rank (@code{DIMENSION(..)}).
@item ISO_Fortran_binding (now in Fortran 2018 18.4) is implemented such that
conversion of the array descriptor for assumed type or assumed rank arrays is
done in the library. The include file ISO_Fortran_binding.h is can be found in
@code{~prefix/lib/gcc/$target/$version}.
@end itemize
@subsubsection TS 18508 Status (Additional Parallel Features)
GNU Fortran supports the following new features of the Technical
Specification 18508 on Additional Parallel Features in Fortran:
@itemize
@item The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR intrinsics.
@item The @code{CO_MIN} and @code{CO_MAX} and @code{SUM} reduction intrinsics.
And the @code{CO_BROADCAST} and @code{CO_REDUCE} intrinsic, except that those
do not support polymorphic types or types with allocatable, pointer or
polymorphic components.
@item Events (@code{EVENT POST}, @code{EVENT WAIT}, @code{EVENT_QUERY})
@item Failed images (@code{FAIL IMAGE}, @code{IMAGE_STATUS},
@code{FAILED_IMAGES}, @code{STOPPED_IMAGES})
@end itemize
@c =====================================================================
@c PART I: INVOCATION REFERENCE
@ -801,386 +1173,6 @@ The default value is 131072.
\part{II}{Language Reference}
@end tex
@c ---------------------------------------------------------------------
@c Fortran standards status
@c ---------------------------------------------------------------------
@node Fortran standards status
@chapter Fortran standards status
@menu
* Fortran 2003 status::
* Fortran 2008 status::
* Fortran 2018 status::
@end menu
@node Fortran 2003 status
@section Fortran 2003 status
GNU Fortran supports several Fortran 2003 features; an incomplete
list can be found below. See also the
@uref{https://gcc.gnu.org/wiki/Fortran2003, wiki page} about Fortran 2003.
@itemize
@item Procedure pointers including procedure-pointer components with
@code{PASS} attribute.
@item Procedures which are bound to a derived type (type-bound procedures)
including @code{PASS}, @code{PROCEDURE} and @code{GENERIC}, and
operators bound to a type.
@item Abstract interfaces and type extension with the possibility to
override type-bound procedures or to have deferred binding.
@item Polymorphic entities (``@code{CLASS}'') for derived types and unlimited
polymorphism (``@code{CLASS(*)}'') -- including @code{SAME_TYPE_AS},
@code{EXTENDS_TYPE_OF} and @code{SELECT TYPE} for scalars and arrays and
finalization.
@item Generic interface names, which have the same name as derived types,
are now supported. This allows one to write constructor functions. Note
that Fortran does not support static constructor functions. For static
variables, only default initialization or structure-constructor
initialization are available.
@item The @code{ASSOCIATE} construct.
@item Interoperability with C including enumerations,
@item In structure constructors the components with default values may be
omitted.
@item Extensions to the @code{ALLOCATE} statement, allowing for a
type-specification with type parameter and for allocation and initialization
from a @code{SOURCE=} expression; @code{ALLOCATE} and @code{DEALLOCATE}
optionally return an error message string via @code{ERRMSG=}.
@item Reallocation on assignment: If an intrinsic assignment is
used, an allocatable variable on the left-hand side is automatically allocated
(if unallocated) or reallocated (if the shape is different). Currently, scalar
deferred character length left-hand sides are correctly handled but arrays
are not yet fully implemented.
@item Deferred-length character variables and scalar deferred-length character
components of derived types are supported. (Note that array-valued components
are not yet implemented.)
@item Transferring of allocations via @code{MOVE_ALLOC}.
@item The @code{PRIVATE} and @code{PUBLIC} attributes may be given individually
to derived-type components.
@item In pointer assignments, the lower bound may be specified and
the remapping of elements is supported.
@item For pointers an @code{INTENT} may be specified which affect the
association status not the value of the pointer target.
@item Intrinsics @code{command_argument_count}, @code{get_command},
@code{get_command_argument}, and @code{get_environment_variable}.
@item Support for Unicode characters (ISO 10646) and UTF-8, including
the @code{SELECTED_CHAR_KIND} and @code{NEW_LINE} intrinsic functions.
@item Support for binary, octal and hexadecimal (BOZ) constants in the
intrinsic functions @code{INT}, @code{REAL}, @code{CMPLX} and @code{DBLE}.
@item Support for namelist variables with allocatable and pointer
attribute and nonconstant length type parameter.
@item
@cindex array, constructors
@cindex @code{[...]}
Array constructors using square brackets. That is, @code{[...]} rather
than @code{(/.../)}. Type-specification for array constructors like
@code{(/ some-type :: ... /)}.
@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
@cindex @code{FLUSH} statement
@cindex statement, @code{FLUSH}
@code{FLUSH} statement.
@item
@cindex @code{IOMSG=} specifier
@code{IOMSG=} specifier for I/O statements.
@item
@cindex @code{ENUM} statement
@cindex @code{ENUMERATOR} statement
@cindex statement, @code{ENUM}
@cindex statement, @code{ENUMERATOR}
@opindex @code{fshort-enums}
Support for the declaration of enumeration constants via the
@code{ENUM} and @code{ENUMERATOR} statements. Interoperability with
@command{gcc} is guaranteed also for the case where the
@command{-fshort-enums} command line option is given.
@item
@cindex TR 15581
TR 15581:
@itemize
@item
@cindex @code{ALLOCATABLE} dummy arguments
@code{ALLOCATABLE} dummy arguments.
@item
@cindex @code{ALLOCATABLE} function results
@code{ALLOCATABLE} function results
@item
@cindex @code{ALLOCATABLE} components of derived types
@code{ALLOCATABLE} components of derived types
@end itemize
@item
@cindex @code{STREAM} I/O
@cindex @code{ACCESS='STREAM'} I/O
The @code{OPEN} statement supports the @code{ACCESS='STREAM'} specifier,
allowing I/O without any record structure.
@item
Namelist input/output for internal files.
@item Minor I/O features: Rounding during formatted output, using of
a decimal comma instead of a decimal point, setting whether a plus sign
should appear for positive numbers. On systems where @code{strtod} honours
the rounding mode, the rounding mode is also supported for input.
@item
@cindex @code{PROTECTED} statement
@cindex statement, @code{PROTECTED}
The @code{PROTECTED} statement and attribute.
@item
@cindex @code{VALUE} statement
@cindex statement, @code{VALUE}
The @code{VALUE} statement and attribute.
@item
@cindex @code{VOLATILE} statement
@cindex statement, @code{VOLATILE}
The @code{VOLATILE} statement and attribute.
@item
@cindex @code{IMPORT} statement
@cindex statement, @code{IMPORT}
The @code{IMPORT} statement, allowing to import
host-associated derived types.
@item The intrinsic modules @code{ISO_FORTRAN_ENVIRONMENT} is supported,
which contains parameters of the I/O units, storage sizes. Additionally,
procedures for C interoperability are available in the @code{ISO_C_BINDING}
module.
@item
@cindex @code{USE, INTRINSIC} statement
@cindex statement, @code{USE, INTRINSIC}
@cindex @code{ISO_FORTRAN_ENV} statement
@cindex statement, @code{ISO_FORTRAN_ENV}
@code{USE} statement with @code{INTRINSIC} and @code{NON_INTRINSIC}
attribute; supported intrinsic modules: @code{ISO_FORTRAN_ENV},
@code{ISO_C_BINDING}, @code{OMP_LIB} and @code{OMP_LIB_KINDS},
and @code{OPENACC}.
@item
Renaming of operators in the @code{USE} statement.
@end itemize
@node Fortran 2008 status
@section Fortran 2008 status
The latest version of the Fortran standard is ISO/IEC 1539-1:2010, informally
known as Fortran 2008. The official version is available from International
Organization for Standardization (ISO) or its national member organizations.
The the final draft (FDIS) can be downloaded free of charge from
@url{http://www.nag.co.uk/@/sc22wg5/@/links.html}. Fortran is developed by the
Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1 of the
International Organization for Standardization and the International
Electrotechnical Commission (IEC). This group is known as
@uref{http://www.nag.co.uk/sc22wg5/, WG5}.
The GNU Fortran compiler supports several of the new features of Fortran 2008;
the @uref{https://gcc.gnu.org/wiki/Fortran2008Status, wiki} has some information
about the current Fortran 2008 implementation status. In particular, the
following is implemented.
@itemize
@item The @option{-std=f2008} option and support for the file extensions
@file{.f08} and @file{.F08}.
@item The @code{OPEN} statement now supports the @code{NEWUNIT=} option,
which returns a unique file unit, thus preventing inadvertent use of the
same unit in different parts of the program.
@item The @code{g0} format descriptor and unlimited format items.
@item The mathematical intrinsics @code{ASINH}, @code{ACOSH}, @code{ATANH},
@code{ERF}, @code{ERFC}, @code{GAMMA}, @code{LOG_GAMMA}, @code{BESSEL_J0},
@code{BESSEL_J1}, @code{BESSEL_JN}, @code{BESSEL_Y0}, @code{BESSEL_Y1},
@code{BESSEL_YN}, @code{HYPOT}, @code{NORM2}, and @code{ERFC_SCALED}.
@item Using complex arguments with @code{TAN}, @code{SINH}, @code{COSH},
@code{TANH}, @code{ASIN}, @code{ACOS}, and @code{ATAN} is now possible;
@code{ATAN}(@var{Y},@var{X}) is now an alias for @code{ATAN2}(@var{Y},@var{X}).
@item Support of the @code{PARITY} intrinsic functions.
@item The following bit intrinsics: @code{LEADZ} and @code{TRAILZ} for
counting the number of leading and trailing zero bits, @code{POPCNT} and
@code{POPPAR} for counting the number of one bits and returning the parity;
@code{BGE}, @code{BGT}, @code{BLE}, and @code{BLT} for bitwise comparisons;
@code{DSHIFTL} and @code{DSHIFTR} for combined left and right shifts,
@code{MASKL} and @code{MASKR} for simple left and right justified masks,
@code{MERGE_BITS} for a bitwise merge using a mask, @code{SHIFTA},
@code{SHIFTL} and @code{SHIFTR} for shift operations, and the
transformational bit intrinsics @code{IALL}, @code{IANY} and @code{IPARITY}.
@item Support of the @code{EXECUTE_COMMAND_LINE} intrinsic subroutine.
@item Support for the @code{STORAGE_SIZE} intrinsic inquiry function.
@item The @code{INT@{8,16,32@}} and @code{REAL@{32,64,128@}} kind type
parameters and the array-valued named constants @code{INTEGER_KINDS},
@code{LOGICAL_KINDS}, @code{REAL_KINDS} and @code{CHARACTER_KINDS} of
the intrinsic module @code{ISO_FORTRAN_ENV}.
@item The module procedures @code{C_SIZEOF} of the intrinsic module
@code{ISO_C_BINDINGS} and @code{COMPILER_VERSION} and @code{COMPILER_OPTIONS}
of @code{ISO_FORTRAN_ENV}.
@item Coarray support for serial programs with @option{-fcoarray=single} flag
and experimental support for multiple images with the @option{-fcoarray=lib}
flag.
@item Submodules are supported. It should noted that @code{MODULEs} do not
produce the smod file needed by the descendent @code{SUBMODULEs} unless they
contain at least one @code{MODULE PROCEDURE} interface. The reason for this is
that @code{SUBMODULEs} are useless without @code{MODULE PROCEDUREs}. See
http://j3-fortran.org/doc/meeting/207/15-209.txt for a discussion and a draft
interpretation. Adopting this interpretation has the advantage that code that
does not use submodules does not generate smod files.
@item The @code{DO CONCURRENT} construct is supported.
@item The @code{BLOCK} construct is supported.
@item The @code{STOP} and the new @code{ERROR STOP} statements now
support all constant expressions. Both show the signals which were signaling
at termination.
@item Support for the @code{CONTIGUOUS} attribute.
@item Support for @code{ALLOCATE} with @code{MOLD}.
@item Support for the @code{IMPURE} attribute for procedures, which
allows for @code{ELEMENTAL} procedures without the restrictions of
@code{PURE}.
@item Null pointers (including @code{NULL()}) and not-allocated variables
can be used as actual argument to optional non-pointer, non-allocatable
dummy arguments, denoting an absent argument.
@item Non-pointer variables with @code{TARGET} attribute can be used as
actual argument to @code{POINTER} dummies with @code{INTENT(IN)}.
@item Pointers including procedure pointers and those in a derived
type (pointer components) can now be initialized by a target instead
of only by @code{NULL}.
@item The @code{EXIT} statement (with construct-name) can be now be
used to leave not only the @code{DO} but also the @code{ASSOCIATE},
@code{BLOCK}, @code{IF}, @code{SELECT CASE} and @code{SELECT TYPE}
constructs.
@item Internal procedures can now be used as actual argument.
@item Minor features: obsolesce diagnostics for @code{ENTRY} with
@option{-std=f2008}; a line may start with a semicolon; for internal
and module procedures @code{END} can be used instead of
@code{END SUBROUTINE} and @code{END FUNCTION}; @code{SELECTED_REAL_KIND}
now also takes a @code{RADIX} argument; intrinsic types are supported
for @code{TYPE}(@var{intrinsic-type-spec}); multiple type-bound procedures
can be declared in a single @code{PROCEDURE} statement; implied-shape
arrays are supported for named constants (@code{PARAMETER}).
@end itemize
@node Fortran 2018 status
@section Status of Fortran 2018 support
@itemize
@item ERROR STOP in a PURE procedure
An @code{ERROR STOP} statement is permitted in a @code{PURE}
procedure.
@item IMPLICIT NONE with a spec-list
Support the @code{IMPLICIT NONE} statement with an
@code{implicit-none-spec-list}.
@item Behavior of INQUIRE with the RECL= specifier
The behavior of the @code{INQUIRE} statement with the @code{RECL=}
specifier now conforms to Fortran 2018.
@end itemize
@subsection TS 29113 Status (Further Interoperability with C)
GNU Fortran supports some of the new features of the Technical
Specification (TS) 29113 on Further Interoperability of Fortran with C.
The @uref{https://gcc.gnu.org/wiki/TS29113Status, wiki} has some information
about the current TS 29113 implementation status. In particular, the
following is implemented.
See also @ref{Further Interoperability of Fortran with C}.
@itemize
@item The @code{OPTIONAL} attribute is allowed for dummy arguments
of @code{BIND(C) procedures.}
@item The @code{RANK} intrinsic is supported.
@item GNU Fortran's implementation for variables with @code{ASYNCHRONOUS}
attribute is compatible with TS 29113.
@item Assumed types (@code{TYPE(*)}).
@item Assumed-rank (@code{DIMENSION(..)}).
@item ISO_Fortran_binding (now in Fortran 2018 18.4) is implemented such that
conversion of the array descriptor for assumed type or assumed rank arrays is
done in the library. The include file ISO_Fortran_binding.h is can be found in
@code{~prefix/lib/gcc/$target/$version}.
@end itemize
@subsection TS 18508 Status (Additional Parallel Features)
GNU Fortran supports the following new features of the Technical
Specification 18508 on Additional Parallel Features in Fortran:
@itemize
@item The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR intrinsics.
@item The @code{CO_MIN} and @code{CO_MAX} and @code{SUM} reduction intrinsics.
And the @code{CO_BROADCAST} and @code{CO_REDUCE} intrinsic, except that those
do not support polymorphic types or types with allocatable, pointer or
polymorphic components.
@item Events (@code{EVENT POST}, @code{EVENT WAIT}, @code{EVENT_QUERY})
@item Failed images (@code{FAIL IMAGE}, @code{IMAGE_STATUS},
@code{FAILED_IMAGES}, @code{STOPPED_IMAGES})
@end itemize
@c ---------------------------------------------------------------------