diff options
author | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2008-03-03 23:46:20 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2008-03-03 23:46:20 +0000 |
commit | f489fba12819abd5c1b8fe1a1bbff71fe67e81f0 (patch) | |
tree | afdccf794dd7e07d887dd608052f12f5ea83ec70 /gcc/fortran/gfortran.texi | |
parent | a1b25e49f867208ec896a7f273441d2972dd591c (diff) | |
download | gcc-f489fba12819abd5c1b8fe1a1bbff71fe67e81f0.tar.gz |
re PR fortran/33197 (Fortran 2008: math functions)
PR fortran/33197
gcc/fortran/
* intrinsic.c (add_functions): Modify intrinsics ACOSH, ASINH,
ATANH, ERF, ERFC and GAMMA. Add intrinsics BESSEL_{J,Y}{0,1,N},
ERFC_SCALED, LOG_GAMMA and HYPOT.
* intrinsic.h (gfc_check_hypot, gfc_simplify_hypot,
gfc_resolve_hypot): New prototypes.
* mathbuiltins.def: Add HYPOT builtin. Make complex versions of
ACOSH, ASINH and ATANH available.
* gfortran.h (GFC_ISYM_ERFC_SCALED, GFC_ISYM_HYPOT): New values.
* lang.opt: Add -std=f2008 option.
* libgfortran.h: Define GFC_STD_F2008.
* lang-specs.h: Add .f08 and .F08 file suffixes.
* iresolve.c (gfc_resolve_hypot): New function.
* parse.c (parse_contained): Allow empty CONTAINS for Fortran 2008.
* check.c (gfc_check_hypot): New function.
* trans-intrinsic.c (gfc_intrinsic_map): Define ERFC_SCALE builtin.
* options.c (set_default_std_flags): Allow Fortran 2008 by default.
(form_from_filename): Add .f08 suffix.
(gfc_handle_option): Handle -std=f2008 option.
* simplify.c (gfc_simplify_hypot): New function.
* gfortran.texi: Document Fortran 2008 status and file extensions.
* intrinsic.texi: Document new BESSEL_{J,Y}{0,1,N} intrinsics,
as well as HYPOT and ERFC_SCALED. Update documentation of ERF,
ERFC, GAMMA, LGAMMA, ASINH, ACOSH and ATANH.
* invoke.texi: Document the new -std=f2008 option.
libgomp/
* testsuite/libgomp.fortran/fortran.exp: Add .f08 and
.F08 file suffixes.
gcc/testsuite/
* gfortran.dg/gomp/gomp.exp: Add .f08 and .F08 file suffixes.
* gfortran.dg/dg.exp: Likewise.
* gfortran.dg/vect/vect.exp: Likewise.
* gfortran.fortran-torture/execute/execute.exp: Likewise.
* gfortran.fortran-torture/compile/compile.exp: Likewise.
* gfortran.dg/gamma_1.f90: Also check log_gamma.
* gfortran.dg/invalid_contains_1.f90: Remove warning about
empty CONTAINS.
* gfortran.dg/gamma_2.f90: Add a few error messages.
* gfortran.dg/invalid_contains_2.f90: Remove warning about
empty CONTAINS.
* gfortran.dg/gamma_3.f90: Adjust error message.
* gfortran.dg/gamma_4.f90: Test for log_gamma instead of lgamma.
* gfortran.dg/bind_c_usage_9.f03: Adjust error messages.
* gfortran.dg/bessel_1.f90: New test.
* gfortran.dg/recursive_check_3.f90: Remove warnings.
* gfortran.dg/besxy.f90: Also check for new F2008 intrinsics.
* gfortran.dg/derived_function_interface_1.f90: Remove warning.
* gfortran.dg/contains_empty_1.f03: New test.
* gfortran.dg/erfc_scaled_1.f90: New test.
* gfortran.dg/hypot_1.f90: New test.
* gfortran.dg/contains_empty_2.f03: New test.
libgfortran/
* intrinsics/erfc_scaled_inc.c: New file.
* intrinsics/erfc_scaled.c: New file.
* gfortran.map (GFORTRAN_1.0): Add _gfortran_erfc_scaled_r*.
* Makefile.am: Add intrinsics/erfc_scaled.c.
* config.h.in: Regenerate.
* configure: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r132846
Diffstat (limited to 'gcc/fortran/gfortran.texi')
-rw-r--r-- | gcc/fortran/gfortran.texi | 86 |
1 files changed, 61 insertions, 25 deletions
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 098f1f05bd9..afbfe03317f 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -181,7 +181,7 @@ Part I: Invoking GNU Fortran * Runtime:: Influencing runtime behavior with environment variables. Part II: Language Reference -* Fortran 2003 status:: Fortran 2003 features supported by GNU Fortran. +* Fortran 2003 and 2008 status:: Fortran 2003 and 2008 features supported by GNU Fortran. * Extensions:: Language extensions implemented by GNU Fortran. * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran. * Intrinsic Modules:: Intrinsic modules supported by GNU Fortran. @@ -251,7 +251,7 @@ it will do everything you expect from any decent compiler: @item Read a user's program, stored in a file and containing instructions written -in Fortran 77, Fortran 90, Fortran 95 or Fortran 2003. +in Fortran 77, Fortran 90, Fortran 95, Fortran 2003 or Fortran 2008. This file contains @dfn{source code}. @item @@ -369,17 +369,19 @@ Fortran) for each file in the source code, and then calls the assembler and linker as appropriate to produce the compiled output. In a copy of GCC which has been compiled with Fortran language support enabled, @command{gcc} will recognize files with @file{.f}, @file{.for}, @file{.ftn}, -@file{.f90}, @file{.f95}, and @file{.f03} extensions as Fortran source code, -and compile it accordingly. A @command{gfortran} driver program is also -provided, which is identical to @command{gcc} except that it automatically -links the Fortran runtime libraries into the compiled program. +@file{.f90}, @file{.f95}, @file{.f03} and @file{.f08} extensions as +Fortran source code, and compile it accordingly. A @command{gfortran} +driver program is also provided, which is identical to @command{gcc} +except that it automatically links the Fortran runtime libraries into the +compiled program. Source files with @file{.f}, @file{.for}, @file{.fpp}, @file{.ftn}, @file{.F}, @file{.FOR}, @file{.FPP}, and @file{.FTN} extensions are treated as fixed form. -Source files with @file{.f90}, @file{.f95}, @file{.f03}, @file{.F90}, -@file{.F95}, and @file{.F03} extensions are treated as free form. The -capitalized versions of either form are run through preprocessing. Source files -with the lower case @file{.fpp} extension are also run through preprocessing. +Source files with @file{.f90}, @file{.f95}, @file{.f03}, @file{.f08}, +@file{.F90}, @file{.F95}, @file{.F03} and @file{.F08} extensions are +treated as free form. The capitalized versions of either form are run +through preprocessing. Source files with the lower case @file{.fpp} +extension are also run through preprocessing. This manual specifically documents the Fortran front end, which handles the programming language's syntax and semantics. The aspects of GCC @@ -407,10 +409,10 @@ FPP) to allow for conditional compilation. In the case of GNU Fortran, this is the GNU C Preprocessor in the traditional mode. On systems with case-preserving file names, the preprocessor is automatically invoked if the file extension is @code{.F}, @code{.FOR}, @code{.FTN}, @code{.F90}, -@code{.F95} or @code{.F03}; otherwise use for fixed-format code the option -@code{-x f77-cpp-input} and for free-format code @code{-x f95-cpp-input}. -Invocation of the preprocessor can be suppressed using @code{-x f77} or -@code{-x f95}. +@code{.F95}, @code{.F03} or @code{.F08}; otherwise use for fixed-format +code the option @code{-x f77-cpp-input} and for free-format code @code{-x +f95-cpp-input}. Invocation of the preprocessor can be suppressed using +@code{-x f77} or @code{-x f95}. If the GNU Fortran invoked the preprocessor, @code{__GFORTRAN__} is defined and @code{__GNUC__}, @code{__GNUC_MINOR__} and @@ -468,10 +470,10 @@ The GNU Fortran compiler is able to compile nearly all standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs, including a number of standard and non-standard extensions, and can be used on real-world programs. In particular, the supported extensions -include OpenMP, Cray-style pointers, and several Fortran 2003 features -such as enumeration, stream I/O, and some of the enhancements to -allocatable array support from TR 15581. However, it is still under -development and has a few remaining rough edges. +include OpenMP, Cray-style pointers, and several Fortran 2003 and Fortran +2008 features such as enumeration, stream I/O, and some of the +enhancements to allocatable array support from TR 15581. However, it is +still under development and has a few remaining rough edges. At present, the GNU Fortran compiler passes the @uref{http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html, @@ -516,9 +518,18 @@ the ISO/IEC TR-15581 enhancements to allocatable arrays, and the @uref{http://www.openmp.org/drupal/mp-documents/spec25.pdf, OpenMP Application Program Interface v2.5} specification. -In the future, the GNU Fortran compiler may also support other standard -variants of and extensions to the Fortran language. These include -ISO/IEC 1539-1:2004 (Fortran 2003). +In the future, the GNU Fortran compiler will also support ISO/IEC +1539-1:2004 (Fortran 2003) and future Fortran standards. Partial support +of that standard is already provided; the current status of Fortran 2003 +support is reported in the @ref{Fortran 2003 status} section of the +documentation. + +The next version of the Fortran standard after Fortran 2003 is currently +being developped and the GNU Fortran compiler supports some of its new +features. This support is based on the latest draft of the standard +(available from @url{http://www.nag.co.uk/sc22wg5/}) and no guarantee of +future compatibility is made, as the final standard might differ from the +draft. For more information, see the @ref{Fortran 2008 status} section. @c ===================================================================== @@ -758,11 +769,19 @@ was used. @end tex @c --------------------------------------------------------------------- -@c Fortran 2003 Status +@c Fortran 2003 and 2008 Status @c --------------------------------------------------------------------- +@node Fortran 2003 and 2008 status +@chapter Fortran 2003 and 2008 Status + +@menu +* Fortran 2003 status:: +* Fortran 2008 status:: +@end menu + @node Fortran 2003 status -@chapter Fortran 2003 Status +@section Fortran 2003 status Although GNU Fortran focuses on implementing the Fortran 95 standard for the time being, a few Fortran 2003 features are currently @@ -867,6 +886,22 @@ BOZ as argument of INT, REAL, DBLE and CMPLX. @end itemize +@node Fortran 2008 status +@section Fortran 2008 status + +The next version of the Fortran standard after Fortran 2003 is currently +being worked on by the Working Group 5 of Sub-Committee 22 of the Joint +Technical Committee 1 of the International Organization for +Standardization (ISO) and the International Electrotechnical Commission +(IEC). This group is known at @uref{http://www.nag.co.uk/sc22wg5/, WG5}. +The next revision of the Fortran standard is informally referred to as +Fortran 2008, reflecting its planned release year. The GNU Fortran +compiler has support for some of the new features in Fortran 2008. This +support is based on the latest draft, available from +@url{http://www.nag.co.uk/sc22wg5/}. However, as the final standard may +differ from the drafts, no guarantee of backward compatibility can be +made and you should only use it for experimental purposes. + @c --------------------------------------------------------------------- @c Extensions @c --------------------------------------------------------------------- @@ -903,8 +938,9 @@ by any standard, and those that are supported by GNU Fortran purely for backward compatibility with legacy compilers. By default, @option{-std=gnu} allows the compiler to accept both types of extensions, but to warn about the use of the latter. Specifying -either @option{-std=f95} or @option{-std=f2003} disables both types -of extensions, and @option{-std=legacy} allows both without warning. +either @option{-std=f95}, @option{-std=f2003} or @option{-std=f2008} +disables both types of extensions, and @option{-std=legacy} allows both +without warning. @menu * Old-style kind specifications:: |