aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-03-03 23:46:20 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2008-03-03 23:46:20 +0000
commitf489fba12819abd5c1b8fe1a1bbff71fe67e81f0 (patch)
treeafdccf794dd7e07d887dd608052f12f5ea83ec70 /gcc
parenta1b25e49f867208ec896a7f273441d2972dd591c (diff)
downloadgcc-f489fba12819abd5c1b8fe1a1bbff71fe67e81f0.zip
gcc-f489fba12819abd5c1b8fe1a1bbff71fe67e81f0.tar.gz
gcc-f489fba12819abd5c1b8fe1a1bbff71fe67e81f0.tar.bz2
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')
-rw-r--r--gcc/fortran/ChangeLog28
-rw-r--r--gcc/fortran/check.c12
-rw-r--r--gcc/fortran/gfortran.h2
-rw-r--r--gcc/fortran/gfortran.texi86
-rw-r--r--gcc/fortran/intrinsic.c88
-rw-r--r--gcc/fortran/intrinsic.h3
-rw-r--r--gcc/fortran/intrinsic.texi301
-rw-r--r--gcc/fortran/invoke.texi41
-rw-r--r--gcc/fortran/iresolve.c8
-rw-r--r--gcc/fortran/lang-specs.h2
-rw-r--r--gcc/fortran/lang.opt4
-rw-r--r--gcc/fortran/libgfortran.h1
-rw-r--r--gcc/fortran/mathbuiltins.def7
-rw-r--r--gcc/fortran/options.c18
-rw-r--r--gcc/fortran/parse.c3
-rw-r--r--gcc/fortran/simplify.c15
-rw-r--r--gcc/fortran/trans-intrinsic.c16
-rw-r--r--gcc/testsuite/ChangeLog26
-rw-r--r--gcc/testsuite/gfortran.dg/bessel_1.f9037
-rw-r--r--gcc/testsuite/gfortran.dg/besxy.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_usage_9.f0310
-rw-r--r--gcc/testsuite/gfortran.dg/contains_empty_1.f0311
-rw-r--r--gcc/testsuite/gfortran.dg/contains_empty_2.f0314
-rw-r--r--gcc/testsuite/gfortran.dg/derived_function_interface_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/dg.exp2
-rw-r--r--gcc/testsuite/gfortran.dg/erfc_scaled_1.f9028
-rw-r--r--gcc/testsuite/gfortran.dg/gamma_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/gamma_2.f908
-rw-r--r--gcc/testsuite/gfortran.dg/gamma_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/gamma_4.f908
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/gomp.exp2
-rw-r--r--gcc/testsuite/gfortran.dg/hypot_1.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/invalid_contains_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/invalid_contains_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/recursive_check_3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/vect/vect.exp10
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/compile/compile.exp35
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/execute.exp35
38 files changed, 706 insertions, 223 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 9f51302..38686ee 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,31 @@
+2008-03-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/33197
+ * 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.
+
2008-03-02 Jakub Jelinek <jakub@redhat.com>
* gfortranspec.c (lang_specific_driver): Update copyright notice
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 5c7353d..c02656c 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -1111,6 +1111,18 @@ gfc_check_huge (gfc_expr *x)
}
+try
+gfc_check_hypot (gfc_expr *x, gfc_expr *y)
+{
+ if (type_check (x, 0, BT_REAL) == FAILURE)
+ return FAILURE;
+ if (same_type_check (x, 0, y, 1) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
/* Check that the single argument is an integer. */
try
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index cc74979..07518ee 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -347,6 +347,7 @@ enum gfc_isym_id
GFC_ISYM_EPSILON,
GFC_ISYM_ERF,
GFC_ISYM_ERFC,
+ GFC_ISYM_ERFC_SCALED,
GFC_ISYM_ETIME,
GFC_ISYM_EXIT,
GFC_ISYM_EXP,
@@ -379,6 +380,7 @@ enum gfc_isym_id
GFC_ISYM_GMTIME,
GFC_ISYM_HOSTNM,
GFC_ISYM_HUGE,
+ GFC_ISYM_HYPOT,
GFC_ISYM_IACHAR,
GFC_ISYM_IAND,
GFC_ISYM_IARGC,
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 098f1f0..afbfe03 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::
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 96bf62b..e2f3517 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -964,15 +964,15 @@ add_functions (void)
make_generic ("acos", GFC_ISYM_ACOS, GFC_STD_F77);
- add_sym_1 ("acosh", GFC_ISYM_ACOSH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_fn_r, gfc_simplify_acosh, gfc_resolve_acosh,
- x, BT_REAL, dr, REQUIRED);
+ add_sym_1 ("acosh", GFC_ISYM_ACOSH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr,
+ GFC_STD_F2008, gfc_check_fn_r, gfc_simplify_acosh,
+ gfc_resolve_acosh, x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dacosh", GFC_ISYM_ACOSH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, gfc_simplify_acosh, gfc_resolve_acosh,
x, BT_REAL, dd, REQUIRED);
- make_generic ("acosh", GFC_ISYM_ACOSH, GFC_STD_GNU);
+ make_generic ("acosh", GFC_ISYM_ACOSH, GFC_STD_F2008);
add_sym_1 ("adjustl", GFC_ISYM_ADJUSTL, CLASS_ELEMENTAL, ACTUAL_NO, BT_CHARACTER, dc, GFC_STD_F95,
NULL, gfc_simplify_adjustl, NULL,
@@ -1047,15 +1047,15 @@ add_functions (void)
make_generic ("asin", GFC_ISYM_ASIN, GFC_STD_F77);
- add_sym_1 ("asinh", GFC_ISYM_ASINH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_fn_r, gfc_simplify_asinh, gfc_resolve_asinh,
- x, BT_REAL, dr, REQUIRED);
+ add_sym_1 ("asinh", GFC_ISYM_ASINH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr,
+ GFC_STD_F2008, gfc_check_fn_r, gfc_simplify_asinh,
+ gfc_resolve_asinh, x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dasinh", GFC_ISYM_ASINH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, gfc_simplify_asinh, gfc_resolve_asinh,
x, BT_REAL, dd, REQUIRED);
- make_generic ("asinh", GFC_ISYM_ASINH, GFC_STD_GNU);
+ make_generic ("asinh", GFC_ISYM_ASINH, GFC_STD_F2008);
add_sym_2 ("associated", GFC_ISYM_ASSOCIATED, CLASS_INQUIRY, ACTUAL_NO, BT_LOGICAL, dl,
GFC_STD_F95, gfc_check_associated, NULL, NULL,
@@ -1073,15 +1073,15 @@ add_functions (void)
make_generic ("atan", GFC_ISYM_ATAN, GFC_STD_F77);
- add_sym_1 ("atanh", GFC_ISYM_ATANH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_fn_r, gfc_simplify_atanh, gfc_resolve_atanh,
- x, BT_REAL, dr, REQUIRED);
+ add_sym_1 ("atanh", GFC_ISYM_ATANH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr,
+ GFC_STD_F2008, gfc_check_fn_r, gfc_simplify_atanh,
+ gfc_resolve_atanh, x, BT_REAL, dr, REQUIRED);
add_sym_1 ("datanh", GFC_ISYM_ATANH, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, gfc_simplify_atanh, gfc_resolve_atanh,
x, BT_REAL, dd, REQUIRED);
- make_generic ("atanh", GFC_ISYM_ATANH, GFC_STD_GNU);
+ make_generic ("atanh", GFC_ISYM_ATANH, GFC_STD_F2008);
add_sym_2 ("atan2", GFC_ISYM_ATAN2, CLASS_ELEMENTAL, ACTUAL_YES, BT_REAL, dr, GFC_STD_F77,
gfc_check_atan2, gfc_simplify_atan2, gfc_resolve_atan2,
@@ -1098,61 +1098,73 @@ add_functions (void)
gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
+ make_alias ("bessel_j0", GFC_STD_F2008);
+
add_sym_1 ("dbesj0", GFC_ISYM_J0, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
- make_generic ("besj0", GFC_ISYM_J0, GFC_STD_GNU);
+ make_generic ("bessel_j0", GFC_ISYM_J0, GFC_STD_F2008);
add_sym_1 ("besj1", GFC_ISYM_J1, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
+ make_alias ("bessel_j1", GFC_STD_F2008);
+
add_sym_1 ("dbesj1", GFC_ISYM_J1, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
- make_generic ("besj1", GFC_ISYM_J1, GFC_STD_GNU);
+ make_generic ("bessel_j1", GFC_ISYM_J1, GFC_STD_F2008);
add_sym_2 ("besjn", GFC_ISYM_JN, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_besn, NULL, gfc_resolve_besn,
n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dr, REQUIRED);
+ make_alias ("bessel_jn", GFC_STD_F2008);
+
add_sym_2 ("dbesjn", GFC_ISYM_JN, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_besn, NULL, gfc_resolve_besn,
n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
- make_generic ("besjn", GFC_ISYM_JN, GFC_STD_GNU);
+ make_generic ("bessel_jn", GFC_ISYM_JN, GFC_STD_F2008);
add_sym_1 ("besy0", GFC_ISYM_Y0, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
+ make_alias ("bessel_y0", GFC_STD_F2008);
+
add_sym_1 ("dbesy0", GFC_ISYM_Y0, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
- make_generic ("besy0", GFC_ISYM_Y0, GFC_STD_GNU);
+ make_generic ("bessel_y0", GFC_ISYM_Y0, GFC_STD_F2008);
add_sym_1 ("besy1", GFC_ISYM_Y1, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
+ make_alias ("bessel_y1", GFC_STD_F2008);
+
add_sym_1 ("dbesy1", GFC_ISYM_Y1, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
- make_generic ("besy1", GFC_ISYM_Y1, GFC_STD_GNU);
+ make_generic ("bessel_y1", GFC_ISYM_Y1, GFC_STD_F2008);
add_sym_2 ("besyn", GFC_ISYM_YN, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_besn, NULL, gfc_resolve_besn,
n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dr, REQUIRED);
+ make_alias ("bessel_yn", GFC_STD_F2008);
+
add_sym_2 ("dbesyn", GFC_ISYM_YN, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_besn, NULL, gfc_resolve_besn,
n, BT_INTEGER, di, REQUIRED, x, BT_REAL, dd, REQUIRED);
- make_generic ("besyn", GFC_ISYM_YN, GFC_STD_GNU);
+ make_generic ("bessel_yn", GFC_ISYM_YN, GFC_STD_F2008);
add_sym_1 ("bit_size", GFC_ISYM_BIT_SIZE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
gfc_check_i, gfc_simplify_bit_size, NULL,
@@ -1339,25 +1351,31 @@ add_functions (void)
make_generic ("epsilon", GFC_ISYM_EPSILON, GFC_STD_F95);
/* G77 compatibility for the ERF() and ERFC() functions. */
- add_sym_1 ("erf", GFC_ISYM_ERF, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
+ add_sym_1 ("erf", GFC_ISYM_ERF, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr,
+ GFC_STD_F2008, gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("derf", GFC_ISYM_ERF, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
- make_generic ("erf", GFC_ISYM_ERF, GFC_STD_GNU);
+ make_generic ("erf", GFC_ISYM_ERF, GFC_STD_F2008);
- add_sym_1 ("erfc", GFC_ISYM_ERFC, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
+ add_sym_1 ("erfc", GFC_ISYM_ERFC, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr,
+ GFC_STD_F2008, gfc_check_fn_r, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dr, REQUIRED);
add_sym_1 ("derfc", GFC_ISYM_ERFC, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dd, GFC_STD_GNU,
gfc_check_fn_d, NULL, gfc_resolve_g77_math1,
x, BT_REAL, dd, REQUIRED);
- make_generic ("erfc", GFC_ISYM_ERFC, GFC_STD_GNU);
+ make_generic ("erfc", GFC_ISYM_ERFC, GFC_STD_F2008);
+
+ add_sym_1 ("erfc_scaled", GFC_ISYM_ERFC_SCALED, CLASS_ELEMENTAL, ACTUAL_NO,
+ BT_REAL, dr, GFC_STD_F2008, gfc_check_fn_r, NULL,
+ gfc_resolve_g77_math1, x, BT_REAL, dr, REQUIRED);
+
+ make_generic ("erfc_scaled", GFC_ISYM_ERFC_SCALED, GFC_STD_F2008);
/* G77 compatibility */
add_sym_1 ("dtime", GFC_ISYM_DTIME, NO_CLASS, ACTUAL_NO, BT_REAL, 4, GFC_STD_GNU,
@@ -1458,15 +1476,15 @@ add_functions (void)
make_generic ("fput", GFC_ISYM_FPUT, GFC_STD_GNU);
- add_sym_1 ("gamma", GFC_ISYM_GAMMA, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
- gfc_check_fn_r, gfc_simplify_gamma, gfc_resolve_gamma,
- x, BT_REAL, dr, REQUIRED);
+ add_sym_1 ("gamma", GFC_ISYM_GAMMA, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr,
+ GFC_STD_F2008, gfc_check_fn_r, gfc_simplify_gamma,
+ gfc_resolve_gamma, x, BT_REAL, dr, REQUIRED);
add_sym_1 ("dgamma", GFC_ISYM_GAMMA, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_fn_d, gfc_simplify_gamma, gfc_resolve_gamma,
x, BT_REAL, dr, REQUIRED);
- make_generic ("gamma", GFC_ISYM_GAMMA, GFC_STD_GNU);
+ make_generic ("gamma", GFC_ISYM_GAMMA, GFC_STD_F2008);
/* Unix IDs (g77 compatibility) */
add_sym_1 ("getcwd", GFC_ISYM_GETCWD, NO_CLASS, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
@@ -1502,6 +1520,13 @@ add_functions (void)
make_generic ("huge", GFC_ISYM_HUGE, GFC_STD_F95);
+ add_sym_2 ("hypot", GFC_ISYM_HYPOT, CLASS_ELEMENTAL, ACTUAL_NO,
+ BT_REAL, dr, GFC_STD_F2008,
+ gfc_check_hypot, gfc_simplify_hypot, gfc_resolve_hypot,
+ x, BT_REAL, dr, REQUIRED, y, BT_REAL, dr, REQUIRED);
+
+ make_generic ("hypot", GFC_ISYM_HYPOT, GFC_STD_F2008);
+
add_sym_2 ("iachar", GFC_ISYM_IACHAR, CLASS_ELEMENTAL, ACTUAL_NO,
BT_INTEGER, di, GFC_STD_F95,
gfc_check_ichar_iachar, gfc_simplify_iachar, gfc_resolve_iachar,
@@ -1717,10 +1742,13 @@ add_functions (void)
make_generic ("len_trim", GFC_ISYM_LEN_TRIM, GFC_STD_F95);
- add_sym_1 ("lgamma", GFC_ISYM_LGAMMA, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
+ add_sym_1 ("lgamma", GFC_ISYM_LGAMMA, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL,
+ dr, GFC_STD_GNU,
gfc_check_fn_r, gfc_simplify_lgamma, gfc_resolve_lgamma,
x, BT_REAL, dr, REQUIRED);
+ make_alias ("log_gamma", GFC_STD_F2008);
+
add_sym_1 ("algama", GFC_ISYM_LGAMMA, CLASS_ELEMENTAL, ACTUAL_NO, BT_REAL, dr, GFC_STD_GNU,
gfc_check_fn_r, gfc_simplify_lgamma, gfc_resolve_lgamma,
x, BT_REAL, dr, REQUIRED);
@@ -1729,7 +1757,7 @@ add_functions (void)
gfc_check_fn_d, gfc_simplify_lgamma, gfc_resolve_lgamma,
x, BT_REAL, dr, REQUIRED);
- make_generic ("lgamma", GFC_ISYM_LGAMMA, GFC_STD_GNU);
+ make_generic ("log_gamma", GFC_ISYM_LGAMMA, GFC_STD_F2008);
add_sym_2 ("lge", GFC_ISYM_LGE, CLASS_ELEMENTAL, ACTUAL_NO, BT_LOGICAL, dl, GFC_STD_F77,
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 55fe645..3ae4145 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -67,6 +67,7 @@ try gfc_check_fn_rc (gfc_expr *);
try gfc_check_fnum (gfc_expr *);
try gfc_check_hostnm (gfc_expr *);
try gfc_check_huge (gfc_expr *);
+try gfc_check_hypot (gfc_expr *, gfc_expr *);
try gfc_check_i (gfc_expr *);
try gfc_check_iand (gfc_expr *, gfc_expr *);
try gfc_check_and (gfc_expr *, gfc_expr *);
@@ -228,6 +229,7 @@ gfc_expr *gfc_simplify_floor (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_fraction (gfc_expr *);
gfc_expr *gfc_simplify_gamma (gfc_expr *);
gfc_expr *gfc_simplify_huge (gfc_expr *);
+gfc_expr *gfc_simplify_hypot (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_iachar (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_iand (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_ibclr (gfc_expr *, gfc_expr *);
@@ -368,6 +370,7 @@ void gfc_resolve_getgid (gfc_expr *);
void gfc_resolve_getpid (gfc_expr *);
void gfc_resolve_getuid (gfc_expr *);
void gfc_resolve_hostnm (gfc_expr *, gfc_expr *);
+void gfc_resolve_hypot (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_iand (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibclr (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_ibits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 0b5e65f..c2630b2 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -62,12 +62,12 @@ Some basic guidelines for editing this document:
* @code{ATAN}: ATAN, Arctangent function
* @code{ATAN2}: ATAN2, Arctangent function
* @code{ATANH}: ATANH, Hyperbolic arctangent function
-* @code{BESJ0}: BESJ0, Bessel function of the first kind of order 0
-* @code{BESJ1}: BESJ1, Bessel function of the first kind of order 1
-* @code{BESJN}: BESJN, Bessel function of the first kind
-* @code{BESY0}: BESY0, Bessel function of the second kind of order 0
-* @code{BESY1}: BESY1, Bessel function of the second kind of order 1
-* @code{BESYN}: BESYN, Bessel function of the second kind
+* @code{BESSEL_J0}: BESSEL_J0, Bessel function of the first kind of order 0
+* @code{BESSEL_J1}: BESSEL_J1, Bessel function of the first kind of order 1
+* @code{BESSEL_JN}: BESSEL_JN, Bessel function of the first kind
+* @code{BESSEL_Y0}: BESSEL_Y0, Bessel function of the second kind of order 0
+* @code{BESSEL_Y1}: BESSEL_Y1, Bessel function of the second kind of order 1
+* @code{BESSEL_YN}: BESSEL_YN, Bessel function of the second kind
* @code{BIT_SIZE}: BIT_SIZE, Bit size inquiry function
* @code{BTEST}: BTEST, Bit test function
* @code{C_ASSOCIATED}: C_ASSOCIATED, Status of a C pointer
@@ -103,6 +103,7 @@ Some basic guidelines for editing this document:
* @code{EPSILON}: EPSILON, Epsilon function
* @code{ERF}: ERF, Error function
* @code{ERFC}: ERFC, Complementary error function
+* @code{ERFC_SCALED}: ERFC_SCALED, Exponentially-scaled complementary error function
* @code{ETIME}: ETIME, Execution time subroutine (or function)
* @code{EXIT}: EXIT, Exit the program with status.
* @code{EXP}: EXP, Exponential function
@@ -136,6 +137,7 @@ Some basic guidelines for editing this document:
* @code{GMTIME}: GMTIME, Convert time to GMT info
* @code{HOSTNM}: HOSTNM, Get system host name
* @code{HUGE}: HUGE, Largest number of a kind
+* @code{HYPOT}: HYPOT, Euclidian distance function
* @code{IACHAR}: IACHAR, Code in @acronym{ASCII} collating sequence
* @code{IAND}: IAND, Bitwise logical and
* @code{IARGC}: IARGC, Get the number of command line arguments
@@ -164,7 +166,7 @@ Some basic guidelines for editing this document:
* @code{LBOUND}: LBOUND, Lower dimension bounds of an array
* @code{LEN}: LEN, Length of a character entity
* @code{LEN_TRIM}: LEN_TRIM, Length of a character entity without trailing blank characters
-* @code{LGAMMA}: LGAMMA, Logarithm of the Gamma function
+* @code{LOG_GAMMA}: LOG_GAMMA, Logarithm of the Gamma function
* @code{LGE}: LGE, Lexical greater than or equal
* @code{LGT}: LGT, Lexical greater than
* @code{LINK}: LINK, Create a hard link
@@ -266,11 +268,12 @@ Some basic guidelines for editing this document:
The intrinsic procedures provided by GNU Fortran include all of the
intrinsic procedures required by the Fortran 95 standard, a set of
-intrinsic procedures for backwards compatibility with G77, and a small
-selection of intrinsic procedures from the Fortran 2003 standard. Any
-conflict between a description here and a description in either the
-Fortran 95 standard or the Fortran 2003 standard is unintentional, and
-the standard(s) should be considered authoritative.
+intrinsic procedures for backwards compatibility with G77, and a
+selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
+standards. Any conflict between a description here and a description in
+either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
+2008 standard is unintentional, and the standard(s) should be considered
+authoritative.
The enumeration of the @code{KIND} type parameter is processor defined in
the Fortran 95 standard. GNU Fortran defines the default integer type and
@@ -574,7 +577,7 @@ Inverse function: @ref{COS}
@code{COSH(X)}).
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@@ -584,13 +587,11 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
-greater or equal to one.
+@item @var{X} @tab The type shall be @code{REAL} or @code{COMPLEX}.
@end multitable
@item @emph{Return value}:
-The return value is of type @code{REAL(*)} and it lies in the
-range @math{0 \leq \acosh (x) \leq \infty}.
+The return value has the same type and kind as @var{X}
@item @emph{Example}:
@smallexample
@@ -1213,7 +1214,7 @@ Inverse function: @ref{SIN}
@code{ASINH(X)} computes the hyperbolic arcsine of @var{X} (inverse of @code{SINH(X)}).
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@@ -1223,12 +1224,11 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{X} @tab The type shall be @code{REAL(*)}, with @var{X} a real number.
+@item @var{X} @tab The type shall be @code{REAL} or @code{COMPLEX}.
@end multitable
@item @emph{Return value}:
-The return value is of type @code{REAL(*)} and it lies in the
-range @math{-\infty \leq \asinh (x) \leq \infty}.
+The return value is of the same type and kind as @var{X}.
@item @emph{Example}:
@smallexample
@@ -1445,7 +1445,7 @@ end program test_atan2
of @code{TANH(X)}).
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@@ -1455,13 +1455,11 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude
-that is less than or equal to one.
+@item @var{X} @tab The type shall be @code{REAL} or @code{COMPLEX}.
@end multitable
@item @emph{Return value}:
-The return value is of type @code{REAL(*)} and it lies in the
-range @math{-\infty \leq \atanh(x) \leq \infty}.
+The return value has same type and kind as @var{X}.
@item @emph{Example}:
@smallexample
@@ -1483,25 +1481,27 @@ Inverse function: @ref{TANH}
-@node BESJ0
-@section @code{BESJ0} --- Bessel function of the first kind of order 0
+@node BESSEL_J0
+@section @code{BESSEL_J0} --- Bessel function of the first kind of order 0
+@fnindex BESSEL_J0
@fnindex BESJ0
@fnindex DBESJ0
@cindex Bessel function, first kind
@table @asis
@item @emph{Description}:
-@code{BESJ0(X)} computes the Bessel function of the first kind of order 0
-of @var{X}.
+@code{BESSEL_J0(X)} computes the Bessel function of the first kind of
+order 0 of @var{X}. This function is available under the name
+@code{BESJ0} as a GNU extension.
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{RESULT = BESJ0(X)}
+@code{RESULT = BESSEL_J0(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1516,7 +1516,7 @@ range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
@smallexample
program test_besj0
real(8) :: x = 0.0_8
- x = besj0(x)
+ x = bessel_j0(x)
end program test_besj0
@end smallexample
@@ -1529,25 +1529,27 @@ end program test_besj0
-@node BESJ1
-@section @code{BESJ1} --- Bessel function of the first kind of order 1
+@node BESSEL_J1
+@section @code{BESEL_J1} --- Bessel function of the first kind of order 1
+@fnindex BESSEL_J1
@fnindex BESJ1
@fnindex DBESJ1
@cindex Bessel function, first kind
@table @asis
@item @emph{Description}:
-@code{BESJ1(X)} computes the Bessel function of the first kind of order 1
-of @var{X}.
+@code{BESSEL_J1(X)} computes the Bessel function of the first kind of
+order 1 of @var{X}. This function is available under the name
+@code{BESJ1} as a GNU extension.
@item @emph{Standard}:
-GNU extension
+Fortran 2008
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{RESULT = BESJ1(X)}
+@code{RESULT = BESSEL_J1(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1562,7 +1564,7 @@ range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
@smallexample
program test_besj1
real(8) :: x = 1.0_8
- x = besj1(x)
+ x = bessel_j1(x)
end program test_besj1
@end smallexample
@@ -1575,27 +1577,29 @@ end program test_besj1
-@node BESJN
-@section @code{BESJN} --- Bessel function of the first kind
+@node BESSEL_JN
+@section @code{BESSEL_JN} --- Bessel function of the first kind
+@fnindex BESSEL_JN
@fnindex BESJN
@fnindex DBESJN
@cindex Bessel function, first kind
@table @asis
@item @emph{Description}:
-@code{BESJN(N, X)} computes the Bessel function of the first kind of order
-@var{N} of @var{X}.
+@code{BESSEL_JN(N, X)} computes the Bessel function of the first kind of
+order @var{N} of @var{X}. This function is available under the name
+@code{BESJN} as a GNU extension.
If both arguments are arrays, their ranks and shapes shall conform.
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{RESULT = BESJN(N, X)}
+@code{RESULT = BESSEL_JN(N, X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1610,7 +1614,7 @@ The return value is a scalar of type @code{REAL(*)}.
@smallexample
program test_besjn
real(8) :: x = 1.0_8
- x = besjn(5,x)
+ x = bessel_jn(5,x)
end program test_besjn
@end smallexample
@@ -1624,25 +1628,27 @@ end program test_besjn
-@node BESY0
-@section @code{BESY0} --- Bessel function of the second kind of order 0
+@node BESSEL_Y0
+@section @code{BESSEL_Y0} --- Bessel function of the second kind of order 0
+@fnindex BESSEL_Y0
@fnindex BESY0
@fnindex DBESY0
@cindex Bessel function, second kind
@table @asis
@item @emph{Description}:
-@code{BESY0(X)} computes the Bessel function of the second kind of order 0
-of @var{X}.
+@code{BESSEL_Y0(X)} computes the Bessel function of the second kind of
+order 0 of @var{X}. This function is available under the name
+@code{BESY0} as a GNU extension.
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{RESULT = BESY0(X)}
+@code{RESULT = BESSEL_Y0(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1656,7 +1662,7 @@ The return value is a scalar of type @code{REAL(*)}.
@smallexample
program test_besy0
real(8) :: x = 0.0_8
- x = besy0(x)
+ x = bessel_y0(x)
end program test_besy0
@end smallexample
@@ -1669,25 +1675,27 @@ end program test_besy0
-@node BESY1
-@section @code{BESY1} --- Bessel function of the second kind of order 1
+@node BESSEL_Y1
+@section @code{BESSEL_Y1} --- Bessel function of the second kind of order 1
+@fnindex BESSEL_Y1
@fnindex BESY1
@fnindex DBESY1
@cindex Bessel function, second kind
@table @asis
@item @emph{Description}:
-@code{BESY1(X)} computes the Bessel function of the second kind of order 1
-of @var{X}.
+@code{BESSEL_Y1(X)} computes the Bessel function of the second kind of
+order 1 of @var{X}. This function is available under the name
+@code{BESY1} as a GNU extension.
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{RESULT = BESY1(X)}
+@code{RESULT = BESSEL_Y1(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1701,7 +1709,7 @@ The return value is a scalar of type @code{REAL(*)}.
@smallexample
program test_besy1
real(8) :: x = 1.0_8
- x = besy1(x)
+ x = bessel_y1(x)
end program test_besy1
@end smallexample
@@ -1714,27 +1722,29 @@ end program test_besy1
-@node BESYN
-@section @code{BESYN} --- Bessel function of the second kind
+@node BESSEL_YN
+@section @code{BESSEL_YN} --- Bessel function of the second kind
+@fnindex BESSEL_YN
@fnindex BESYN
@fnindex DBESYN
@cindex Bessel function, second kind
@table @asis
@item @emph{Description}:
-@code{BESYN(N, X)} computes the Bessel function of the second kind of order
-@var{N} of @var{X}.
+@code{BESSEL_YN(N, X)} computes the Bessel function of the second kind of
+order @var{N} of @var{X}. This function is available under the name
+@code{BESYN} as a GNU extension.
If both arguments are arrays, their ranks and shapes shall conform.
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{RESULT = BESYN(N, X)}
+@code{RESULT = BESSEL_YN(N, X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1749,7 +1759,7 @@ The return value is a scalar of type @code{REAL(*)}.
@smallexample
program test_besyn
real(8) :: x = 1.0_8
- x = besyn(5,x)
+ x = bessel_yn(5,x)
end program test_besyn
@end smallexample
@@ -1859,7 +1869,7 @@ end program test_btest
or if @var{c_ptr1} is associated with the target @var{c_ptr2}.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@@ -1905,7 +1915,7 @@ end subroutine association_test
@code{C_FUNLOC(x)} determines the C address of the argument.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@@ -1966,7 +1976,7 @@ Note: Due to the currently lacking support of procedure pointers in GNU Fortran
this function is not fully operable.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Subroutine
@@ -2024,7 +2034,7 @@ end program main
shape.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Subroutine
@@ -2077,7 +2087,7 @@ end program main
@code{C_LOC(x)} determines the C address of the argument.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@@ -2399,7 +2409,7 @@ end program test_cmplx
command line when the containing program was invoked.
@item @emph{Standard}:
-F2003
+Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@@ -3511,7 +3521,7 @@ end program test_epsilon
@code{ERF(X)} computes the error function of @var{X}.
@item @emph{Standard}:
-GNU Extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@@ -3521,12 +3531,12 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
+@item @var{X} @tab The type shall be @code{REAL}.
@end multitable
@item @emph{Return value}:
-The return value is a scalar of type @code{REAL(*)} and it is positive
-(@math{ - 1 \leq erf (x) \leq 1 }.
+The return value is of type @code{REAL}, of the same kind as
+@var{X} and lies in the range @math{-1 \leq erf (x) \leq 1 }.
@item @emph{Example}:
@smallexample
@@ -3555,7 +3565,7 @@ end program test_erf
@code{ERFC(X)} computes the complementary error function of @var{X}.
@item @emph{Standard}:
-GNU extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@@ -3565,12 +3575,12 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
+@item @var{X} @tab The type shall be @code{REAL}.
@end multitable
@item @emph{Return value}:
-The return value is a scalar of type @code{REAL(*)} and it is positive
-(@math{ 0 \leq erfc (x) \leq 2 }.
+The return value is of type @code{REAL} and of the same kind as @var{X}.
+It lies in the range @math{ 0 \leq erfc (x) \leq 2 }.
@item @emph{Example}:
@smallexample
@@ -3589,6 +3599,44 @@ end program test_erfc
+@node ERFC_SCALED
+@section @code{ERFC_SCALED} --- Error function
+@fnindex ERFC_SCALED
+@cindex error function, complementary, exponentially-scaled
+
+@table @asis
+@item @emph{Description}:
+@code{ERFC_SCALED(X)} computes the exponentially-scaled complementary
+error function of @var{X}.
+
+@item @emph{Standard}:
+Fortran 2008 and later
+
+@item @emph{Class}:
+Elemental function
+
+@item @emph{Syntax}:
+@code{RESULT = ERFC_SCALED(X)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{X} @tab The type shall be @code{REAL}.
+@end multitable
+
+@item @emph{Return value}:
+The return value is of type @code{REAL} and of the same kind as @var{X}.
+
+@item @emph{Example}:
+@smallexample
+program test_erfc_scaled
+ real(8) :: x = 0.17_8
+ x = erfc_scaled(x)
+end program test_erfc_scaled
+@end smallexample
+@end table
+
+
+
@node ETIME
@section @code{ETIME} --- Execution time subroutine (or function)
@fnindex ETIME
@@ -4529,7 +4577,7 @@ $$
@end tex
@item @emph{Standard}:
-GNU Extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@@ -4562,7 +4610,7 @@ end program test_gamma
@end multitable
@item @emph{See also}:
-Logarithm of the Gamma function: @ref{LGAMMA}
+Logarithm of the Gamma function: @ref{LOG_GAMMA}
@end table
@@ -4663,8 +4711,8 @@ END PROGRAM
@item @emph{See also}:
GNU Fortran 77 compatibility function: @ref{IARGC}
-F2003 functions and subroutines: @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT},
-@ref{COMMAND_ARGUMENT_COUNT}
+Fortran 2003 functions and subroutines: @ref{GET_COMMAND},
+@ref{GET_COMMAND_ARGUMENT}, @ref{COMMAND_ARGUMENT_COUNT}
@end table
@@ -4680,7 +4728,7 @@ F2003 functions and subroutines: @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT},
Retrieve the entire command line that was used to invoke the program.
@item @emph{Standard}:
-F2003
+Fortran 2003 and later
@item @emph{Class}:
Subroutine
@@ -4724,7 +4772,7 @@ Retrieve the @var{N}th argument that was passed on the
command line when the containing program was invoked.
@item @emph{Standard}:
-F2003
+Fortran 2003 and later
@item @emph{Class}:
Subroutine
@@ -4871,7 +4919,7 @@ END PROGRAM
Get the @var{VALUE} of the environmental variable @var{ENVVAR}.
@item @emph{Standard}:
-F2003
+Fortran 2003 and later
@item @emph{Class}:
Subroutine
@@ -5184,6 +5232,46 @@ end program test_huge_tiny
+@node HYPOT
+@section @code{HYPOT} --- Euclidean distance function
+@fnindex HYPOT
+@cindex Euclidean distance
+
+@table @asis
+@item @emph{Description}:
+@code{HYPOT(X,Y)} is the Euclidean distance function. It is equal to
+@math{\sqrt{X^2 + Y^2}}, without undue underflow or overflow.
+
+@item @emph{Standard}:
+Fortran 2008 and later
+
+@item @emph{Class}:
+Elemental function
+
+@item @emph{Syntax}:
+@code{RESULT = HYPOT(X,Y)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{X} @tab The type shall be @code{REAL}.
+@item @var{Y} @tab The type and kind type parameter shall be the same as
+@var{X}.
+@end multitable
+
+@item @emph{Return value}:
+The return value has the same type and kind type parameter as @var{X}.
+
+@item @emph{Example}:
+@smallexample
+program test_hypot
+ real(4) :: x = 1.e0_4, y = 0.5e0_4
+ x = hypot(x,y)
+end program test_hypot
+@end smallexample
+@end table
+
+
+
@node IACHAR
@section @code{IACHAR} --- Code in @acronym{ASCII} collating sequence
@fnindex IACHAR
@@ -5322,8 +5410,8 @@ See @ref{GETARG}
@item @emph{See also}:
GNU Fortran 77 compatibility subroutine: @ref{GETARG}
-F2003 functions and subroutines: @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT},
-@ref{COMMAND_ARGUMENT_COUNT}
+Fortran 2003 functions and subroutines: @ref{GET_COMMAND},
+@ref{GET_COMMAND_ARGUMENT}, @ref{COMMAND_ARGUMENT_COUNT}
@end table
@@ -5915,7 +6003,7 @@ with the @code{IOSTAT_END} parameter of the intrinsic module
@code{ISO_FORTRAN_ENV}.
@item @emph{Standard}:
-Fortran 2003.
+Fortran 2003 and later
@item @emph{Class}:
Elemental function
@@ -5960,7 +6048,7 @@ variable with the @code{IOSTAT_EOR} parameter of the intrinsic module
@code{ISO_FORTRAN_ENV}.
@item @emph{Standard}:
-Fortran 2003.
+Fortran 2003 and later
@item @emph{Class}:
Elemental function
@@ -6405,26 +6493,27 @@ The return value is of type @code{INTEGER} and of kind @var{KIND}. If
-@node LGAMMA
-@section @code{LGAMMA} --- Logarithm of the Gamma function
-@fnindex GAMMA
+@node LOG_GAMMA
+@section @code{LOG_GAMMA} --- Logarithm of the Gamma function
+@fnindex LOG_GAMMA
+@fnindex LGAMMA
@fnindex ALGAMA
@fnindex DLGAMA
@cindex Gamma function, logarithm of
@table @asis
@item @emph{Description}:
-@code{GAMMA(X)} computes the natural logarithm of the absolute value of the
-Gamma (@math{\Gamma}) function.
+@code{LOG_GAMMA(X)} computes the natural logarithm of the absolute value
+of the Gamma (@math{\Gamma}) function.
@item @emph{Standard}:
-GNU Extension
+Fortran 2008 and later
@item @emph{Class}:
Elemental function
@item @emph{Syntax}:
-@code{X = LGAMMA(X)}
+@code{X = LOG_GAMMA(X)}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -7840,7 +7929,7 @@ end program
@var{DEST}. @var{SRC} will become deallocated in the process.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Subroutine
@@ -7972,7 +8061,7 @@ end program test_nearest
@code{NEW_LINE(C)} returns the new-line character.
@item @emph{Standard}:
-F2003 and later
+Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@@ -8103,8 +8192,8 @@ Returns a disassociated pointer.
If @var{MOLD} is present, a dissassociated pointer of the same type is
returned, otherwise the type is determined by context.
-In Fortran 95, @var{MOLD} is optional. Please note that F2003 includes
-cases where it is required.
+In Fortran 95, @var{MOLD} is optional. Please note that Fortran 2003
+includes cases where it is required.
@item @emph{Standard}:
F95 and later
@@ -10892,7 +10981,7 @@ F95 elemental function: @ref{IEOR}
@section @code{ISO_FORTRAN_ENV}
@table @asis
@item @emph{Standard}:
-Fortran 2003
+Fortran 2003 and later
@end table
The @code{ISO_FORTRAN_ENV} module provides the following scalar default-integer
@@ -10932,7 +11021,7 @@ Identifies the preconnected unit identified by the asterisk
@section @code{ISO_C_BINDING}
@table @asis
@item @emph{Standard}:
-Fortran 2003
+Fortran 2003 and later
@end table
The following intrinsic procedures are provided by the module; their
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 06d36b9..64e5070 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -281,7 +281,7 @@ lines in the source file. The default value is 132.
@item -fmax-identifier-length=@var{n}
@opindex @code{fmax-identifier-length=}@var{n}
Specify the maximum allowed identifier length. Typical values are
-31 (Fortran 95) and 63 (Fortran 2003).
+31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
@item -fimplicit-none
@opindex @code{fimplicit-none}
@@ -322,18 +322,18 @@ on most systems, but with @option{-fno-range-check} the value will
@item -std=@var{std}
@opindex @code{std=}@var{std} option
Specify the standard to which the program is expected to conform, which
-may be one of @samp{f95}, @samp{f2003}, @samp{gnu}, or @samp{legacy}.
-The default value for @var{std} is @samp{gnu}, which specifies a
-superset of the Fortran 95 standard that includes all of the extensions
-supported by GNU Fortran, although warnings will be given for obsolete
-extensions not recommended for use in new code. The @samp{legacy} value
-is equivalent but without the warnings for obsolete extensions, and may
-be useful for old non-standard programs. The @samp{f95} and
-@samp{f2003} values specify strict conformance to the Fortran 95 and
-Fortran 2003 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.
+may be one of @samp{f95}, @samp{f2003}, @samp{f2008}, @samp{gnu}, or
+@samp{legacy}. The default value for @var{std} is @samp{gnu}, which
+specifies a superset of the Fortran 95 standard that includes all of the
+extensions supported by GNU Fortran, although warnings will be given for
+obsolete extensions not recommended for use in new code. The
+@samp{legacy} value is equivalent but without the warnings for obsolete
+extensions, and may be useful for old non-standard programs. The
+@samp{f95}, @samp{f2003} and @samp{f2008} values specify strict
+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.
@end table
@@ -400,8 +400,8 @@ They soon find that it does not do quite what they want---it finds some
nonstandard practices, but not all.
However, improvements to GNU Fortran in this area are welcome.
-This should be used in conjunction with @option{-std=f95} or
-@option{-std=f2003}.
+This should be used in conjunction with @option{-std=f95},
+@option{-std=f2003} or @option{-std=f2008}.
@item -pedantic-errors
@opindex @code{pedantic-errors}
@@ -445,10 +445,11 @@ The following example will trigger the warning.
@cindex warnings, ampersand
@cindex &
Warn about missing ampersand in continued character constants. The warning is
-given with @option{-Wampersand}, @option{-pedantic}, @option{-std=f95}, and
-@option{-std=f2003}. Note: With no ampersand given in a continued character
-constant, GNU Fortran assumes continuation at the first non-comment,
-non-whitespace character after the ampersand that initiated the continuation.
+given with @option{-Wampersand}, @option{-pedantic}, @option{-std=f95},
+@option{-std=f2003} and @option{-std=f2008}. Note: With no ampersand
+given in a continued character constant, GNU Fortran assumes continuation
+at the first non-comment, non-whitespace character after the ampersand
+that initiated the continuation.
@item -Wcharacter-truncation
@opindex @code{Wcharacter-truncation}
@@ -503,7 +504,7 @@ of the Fortran Character Set. For continuation lines, a tab followed
by a digit between 1 and 9 is supported. @option{-Wno-tabs} will cause
a warning to be issued if a tab is encountered. Note, @option{-Wno-tabs}
is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
-and @option{-Wall}.
+@option{-std=f2008} and @option{-Wall}.
@item -Wunderflow
@opindex @code{Wunderflow}
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 27a0022..bdb6928 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -880,6 +880,14 @@ gfc_resolve_hostnm (gfc_expr *f, gfc_expr *n ATTRIBUTE_UNUSED)
void
+gfc_resolve_hypot (gfc_expr *f, gfc_expr *x, gfc_expr *y ATTRIBUTE_UNUSED)
+{
+ f->ts = x->ts;
+ f->value.function.name = gfc_get_string ("__hypot_r%d", x->ts.kind);
+}
+
+
+void
gfc_resolve_iand (gfc_expr *f, gfc_expr *i, gfc_expr *j)
{
/* If the kind of i and j are different, then g77 cross-promoted the
diff --git a/gcc/fortran/lang-specs.h b/gcc/fortran/lang-specs.h
index e49b073..e5c54ae 100644
--- a/gcc/fortran/lang-specs.h
+++ b/gcc/fortran/lang-specs.h
@@ -34,6 +34,7 @@
{".F90", "@f95-cpp-input", 0, 0, 0},
{".F95", "@f95-cpp-input", 0, 0, 0},
{".F03", "@f95-cpp-input", 0, 0, 0},
+{".F08", "@f95-cpp-input", 0, 0, 0},
{"@f95-cpp-input",
"cc1 -E -lang-fortran -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \
%{E|M|MM:%(cpp_debug_options)}\
@@ -43,6 +44,7 @@
{".f90", "@f95", 0, 0, 0},
{".f95", "@f95", 0, 0, 0},
{".f03", "@f95", 0, 0, 0},
+{".f08", "@f95", 0, 0, 0},
{"@f95", "%{!E:f951 %i %(cc1_options) %{J*} %{I*}\
%{!nostdinc:-fintrinsic-modules-path finclude%s} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
{".f", "@f77", 0, 0, 0},
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 16db192..a376192 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -297,6 +297,10 @@ std=f2003
Fortran
Conform to the ISO Fortran 2003 standard
+std=f2008
+Fortran
+Conform to the ISO Fortran 2008 standard
+
std=f95
Fortran
Conform to the ISO Fortran 95 standard
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index be9716e..513dbd2 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -20,6 +20,7 @@ along with GCC; see the file COPYING3. If not see
/* Flags to specify which standard/extension contains a feature.
Note that no features were obsoleted nor deleted in F2003. */
+#define GFC_STD_F2008 (1<<7) /* New in F2008. */
#define GFC_STD_LEGACY (1<<6) /* Backward compatibility. */
#define GFC_STD_GNU (1<<5) /* GNU Fortran extension. */
#define GFC_STD_F2003 (1<<4) /* New in F2003. */
diff --git a/gcc/fortran/mathbuiltins.def b/gcc/fortran/mathbuiltins.def
index 37758e1a..6db416e 100644
--- a/gcc/fortran/mathbuiltins.def
+++ b/gcc/fortran/mathbuiltins.def
@@ -6,11 +6,11 @@
Use DEFINE_MATH_BUILTIN_C if the complex versions of the builtin are
also available. */
DEFINE_MATH_BUILTIN_C (ACOS, "acos", 0)
-DEFINE_MATH_BUILTIN (ACOSH, "acosh", 0)
+DEFINE_MATH_BUILTIN_C (ACOSH, "acosh", 0)
DEFINE_MATH_BUILTIN_C (ASIN, "asin", 0)
-DEFINE_MATH_BUILTIN (ASINH, "asinh", 0)
+DEFINE_MATH_BUILTIN_C (ASINH, "asinh", 0)
DEFINE_MATH_BUILTIN_C (ATAN, "atan", 0)
-DEFINE_MATH_BUILTIN (ATANH, "atanh", 0)
+DEFINE_MATH_BUILTIN_C (ATANH, "atanh", 0)
DEFINE_MATH_BUILTIN (ATAN2, "atan2", 1)
DEFINE_MATH_BUILTIN_C (COS, "cos", 0)
DEFINE_MATH_BUILTIN_C (COSH, "cosh", 0)
@@ -32,3 +32,4 @@ DEFINE_MATH_BUILTIN (ERF, "erf", 0)
DEFINE_MATH_BUILTIN (ERFC, "erfc", 0)
DEFINE_MATH_BUILTIN (GAMMA, "tgamma", 0)
DEFINE_MATH_BUILTIN (LGAMMA,"lgamma", 0)
+DEFINE_MATH_BUILTIN (HYPOT, "hypot", 1)
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index ecab0c5..61481b3 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -42,8 +42,8 @@ static void
set_default_std_flags (void)
{
gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
- | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F77 | GFC_STD_GNU
- | GFC_STD_LEGACY;
+ | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
+ | GFC_STD_GNU | GFC_STD_LEGACY;
gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
}
@@ -155,6 +155,9 @@ form_from_filename (const char *filename)
".f03", FORM_FREE}
,
{
+ ".f08", FORM_FREE}
+ ,
+ {
".f", FORM_FIXED}
,
{
@@ -752,6 +755,17 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_tabs = 0;
break;
+ case OPT_std_f2008:
+ gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F77
+ | GFC_STD_F2003 | GFC_STD_F95 | GFC_STD_F2008;
+ gfc_option.warn_std = GFC_STD_F95_OBS;
+ gfc_option.max_continue_fixed = 255;
+ gfc_option.max_continue_free = 255;
+ gfc_option.max_identifier_length = 63;
+ gfc_option.warn_ampersand = 1;
+ gfc_option.warn_tabs = 0;
+ break;
+
case OPT_std_gnu:
set_default_std_flags ();
break;
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 67f4cc7..ff1d565 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -3197,8 +3197,7 @@ parse_contained (int module)
pop_state ();
if (!contains_statements)
- /* This is valid in Fortran 2008. */
- gfc_notify_std (GFC_STD_GNU, "Extension: CONTAINS statement without "
+ gfc_notify_std (GFC_STD_F2008, "Fortran 2008: CONTAINS statement without "
"FUNCTION or SUBROUTINE statement at %C");
}
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 264f689..a8277ac 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -1280,6 +1280,21 @@ gfc_simplify_huge (gfc_expr *e)
return result;
}
+
+gfc_expr *
+gfc_simplify_hypot (gfc_expr *x, gfc_expr *y)
+{
+ gfc_expr *result;
+
+ if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT)
+ return NULL;
+
+ result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
+ mpfr_hypot (result->value.real, x->value.real, y->value.real, GFC_RND_MODE);
+ return range_check (result, "HYPOT");
+}
+
+
/* We use the processor's collating sequence, because all
systems that gfortran currently works on are ASCII. */
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 49f2094..066b18e 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -104,17 +104,25 @@ gfc_intrinsic_map_t;
true, true, NAME, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, \
NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE},
+#define LIB_FUNCTION(ID, NAME, HAVE_COMPLEX) \
+ { GFC_ISYM_ ## ID, END_BUILTINS, END_BUILTINS, END_BUILTINS, END_BUILTINS, \
+ END_BUILTINS, END_BUILTINS, END_BUILTINS, END_BUILTINS, \
+ false, HAVE_COMPLEX, true, NAME, NULL_TREE, NULL_TREE, NULL_TREE, \
+ NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }
+
static GTY(()) gfc_intrinsic_map_t gfc_intrinsic_map[] =
{
/* Functions built into gcc itself. */
#include "mathbuiltins.def"
+ /* Functions in libgfortran. */
+ LIB_FUNCTION (ERFC_SCALED, "erfc_scaled", false),
+
/* End the list. */
- { GFC_ISYM_NONE, END_BUILTINS, END_BUILTINS, END_BUILTINS, END_BUILTINS,
- END_BUILTINS, END_BUILTINS, END_BUILTINS, END_BUILTINS,
- true, false, true, NULL, NULL_TREE, NULL_TREE, NULL_TREE,
- NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE }
+ LIB_FUNCTION (NONE, NULL, false)
+
};
+#undef LIB_FUNCTION
#undef DEFINE_MATH_BUILTIN
#undef DEFINE_MATH_BUILTIN_C
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8d21111..1bd3d91 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,29 @@
+2008-03-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/33197
+ * 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.
+
2007-03-03 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/builtin-apply-mmx.c: Do not XFAIL on Darwin.
diff --git a/gcc/testsuite/gfortran.dg/bessel_1.f90 b/gcc/testsuite/gfortran.dg/bessel_1.f90
new file mode 100644
index 0000000..728c5ce
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bessel_1.f90
@@ -0,0 +1,37 @@
+! { dg-do run }
+
+program test
+ implicit none
+
+ interface check
+ procedure check_r4
+ procedure check_r8
+ end interface check
+
+ real(kind=4) :: x4
+ real(kind=8) :: x8
+
+ x8 = 1.9_8 ; x4 = 1.9_4
+ call check(bessel_j0 (x8), bessel_j0 (1.9_8))
+ call check(bessel_j0 (x4), bessel_j0 (1.9_4))
+ call check(bessel_j1 (x8), bessel_j1 (1.9_8))
+ call check(bessel_j1 (x4), bessel_j1 (1.9_4))
+ call check(bessel_jn (3,x8), bessel_jn (3,1.9_8))
+ call check(bessel_jn (3,x4), bessel_jn (3,1.9_4))
+ call check(bessel_y0 (x8), bessel_y0 (1.9_8))
+ call check(bessel_y0 (x4), bessel_y0 (1.9_4))
+ call check(bessel_y1 (x8), bessel_y1 (1.9_8))
+ call check(bessel_y1 (x4), bessel_y1 (1.9_4))
+ call check(bessel_yn (3,x8), bessel_yn (3,1.9_8))
+ call check(bessel_yn (3,x4), bessel_yn (3,1.9_4))
+
+contains
+ subroutine check_r4 (a, b)
+ real(kind=4), intent(in) :: a, b
+ if (abs(a - b) > 1.e-5 * abs(b)) call abort
+ end subroutine
+ subroutine check_r8 (a, b)
+ real(kind=8), intent(in) :: a, b
+ if (abs(a - b) > 1.e-7 * abs(b)) call abort
+ end subroutine
+end program test
diff --git a/gcc/testsuite/gfortran.dg/besxy.f90 b/gcc/testsuite/gfortran.dg/besxy.f90
index 5b4cbba..5cd5c8a 100644
--- a/gcc/testsuite/gfortran.dg/besxy.f90
+++ b/gcc/testsuite/gfortran.dg/besxy.f90
@@ -21,4 +21,21 @@ PROGRAM test_erf
ra = BESY0(ra)
ra = BESY1(ra)
ra = BESYN(0, ra)
-END PROGRAM \ No newline at end of file
+
+ r = BESSEL_J0(r)
+ r = BESSEL_J1(r)
+ r = BESSEL_JN(0, r)
+
+ r = BESSEL_Y0(r)
+ r = BESSEL_Y1(r)
+ r = BESSEL_YN(0, r)
+
+ ra = BESSEL_J0(ra)
+ ra = BESSEL_J1(ra)
+ ra = BESSEL_JN(0, ra)
+
+ ra = BESSEL_Y0(ra)
+ ra = BESSEL_Y1(ra)
+ ra = BESSEL_YN(0, ra)
+
+END PROGRAM
diff --git a/gcc/testsuite/gfortran.dg/bind_c_usage_9.f03 b/gcc/testsuite/gfortran.dg/bind_c_usage_9.f03
index 0ab782e..086a116 100644
--- a/gcc/testsuite/gfortran.dg/bind_c_usage_9.f03
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_9.f03
@@ -9,14 +9,14 @@ subroutine foo() bind(c)
contains
subroutine bar() bind (c) ! { dg-error "may not be specified for an internal" }
end subroutine bar ! { dg-error "Expected label" }
-end subroutine foo ! { dg-warning "Extension: CONTAINS statement" }
+end subroutine foo ! { dg-error "Fortran 2008: CONTAINS statement" }
subroutine foo2() bind(c)
use iso_c_binding
contains
integer(c_int) function barbar() bind (c) ! { dg-error "may not be specified for an internal" }
end function barbar ! { dg-error "Expecting END SUBROUTINE" }
-end subroutine foo2 ! { dg-warning "Extension: CONTAINS statement" }
+end subroutine foo2 ! { dg-error "Fortran 2008: CONTAINS statement" }
function one() bind(c)
use iso_c_binding
@@ -25,7 +25,7 @@ function one() bind(c)
contains
integer(c_int) function two() bind (c) ! { dg-error "may not be specified for an internal" }
end function two ! { dg-error "Expected label" }
-end function one ! { dg-warning "Extension: CONTAINS statement" }
+end function one ! { dg-error "Fortran 2008: CONTAINS statement" }
function one2() bind(c)
use iso_c_binding
@@ -34,7 +34,7 @@ function one2() bind(c)
contains
subroutine three() bind (c) ! { dg-error "may not be specified for an internal" }
end subroutine three ! { dg-error "Expecting END FUNCTION statement" }
-end function one2 ! { dg-warning "Extension: CONTAINS statement" }
+end function one2 ! { dg-error "Fortran 2008: CONTAINS statement" }
program main
use iso_c_binding
@@ -44,4 +44,4 @@ contains
end subroutine test ! { dg-error "Expecting END PROGRAM" }
integer(c_int) function test2() bind (c) ! { dg-error "may not be specified for an internal" }
end function test2 ! { dg-error "Expecting END PROGRAM" }
-end program main ! { dg-warning "Extension: CONTAINS statement" }
+end program main ! { dg-error "Fortran 2008: CONTAINS statement" }
diff --git a/gcc/testsuite/gfortran.dg/contains_empty_1.f03 b/gcc/testsuite/gfortran.dg/contains_empty_1.f03
new file mode 100644
index 0000000..51b5dd9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/contains_empty_1.f03
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-std=f2003 -pedantic" }
+program test
+ print *, 'hello there'
+contains
+end program test ! { dg-error "Fortran 2008: CONTAINS statement without" }
+
+module truc
+ integer, parameter :: answer = 42
+contains
+end module truc ! { dg-error "Fortran 2008: CONTAINS statement without" }
diff --git a/gcc/testsuite/gfortran.dg/contains_empty_2.f03 b/gcc/testsuite/gfortran.dg/contains_empty_2.f03
new file mode 100644
index 0000000..62e18f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/contains_empty_2.f03
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! { dg-options "-std=f2008 -pedantic" }
+
+program test
+ print *, 'hello there'
+contains
+end program test
+
+module truc
+ integer, parameter :: answer = 42
+contains
+end module truc
+
+! { dg-final { cleanup-modules "truc" } }
diff --git a/gcc/testsuite/gfortran.dg/derived_function_interface_1.f90 b/gcc/testsuite/gfortran.dg/derived_function_interface_1.f90
index a9e4041..b7ee4df 100644
--- a/gcc/testsuite/gfortran.dg/derived_function_interface_1.f90
+++ b/gcc/testsuite/gfortran.dg/derived_function_interface_1.f90
@@ -41,5 +41,5 @@ contains
type(foo) function fun() ! { dg-error "already has an explicit interface" }
end function fun ! { dg-error "Expecting END PROGRAM" }
-end ! { dg-warning "CONTAINS statement without FUNCTION or SUBROUTINE statement" }
+end
! { dg-final { cleanup-modules "kinds" } }
diff --git a/gcc/testsuite/gfortran.dg/dg.exp b/gcc/testsuite/gfortran.dg/dg.exp
index a80f6bf..2ccdfd0 100644
--- a/gcc/testsuite/gfortran.dg/dg.exp
+++ b/gcc/testsuite/gfortran.dg/dg.exp
@@ -30,7 +30,7 @@ dg-init
# Main loop.
gfortran-dg-runtest [lsort \
- [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03} ] ] $DEFAULT_FFLAGS
+ [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] $DEFAULT_FFLAGS
gfortran-dg-runtest [lsort \
[glob -nocomplain $srcdir/$subdir/g77/*.\[fF\] ] ] $DEFAULT_FFLAGS
diff --git a/gcc/testsuite/gfortran.dg/erfc_scaled_1.f90 b/gcc/testsuite/gfortran.dg/erfc_scaled_1.f90
new file mode 100644
index 0000000..8a114e6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/erfc_scaled_1.f90
@@ -0,0 +1,28 @@
+! { dg-do run }
+
+program test
+ implicit none
+
+ interface check
+ procedure check_r4
+ procedure check_r8
+ end interface check
+
+ real(kind=4) :: x4
+ real(kind=8) :: x8
+
+ x8 = 1.9_8 ; x4 = 1.9_4
+
+ call check(erfc_scaled(x8), erfc_scaled(1.9_8))
+ call check(erfc_scaled(x4), erfc_scaled(1.9_4))
+
+contains
+ subroutine check_r4 (a, b)
+ real(kind=4), intent(in) :: a, b
+ if (abs(a - b) > 1.e-5 * abs(b)) call abort
+ end subroutine
+ subroutine check_r8 (a, b)
+ real(kind=8), intent(in) :: a, b
+ if (abs(a - b) > 1.e-7 * abs(b)) call abort
+ end subroutine
+end program test
diff --git a/gcc/testsuite/gfortran.dg/gamma_1.f90 b/gcc/testsuite/gfortran.dg/gamma_1.f90
index c2bbdb6..9946166 100644
--- a/gcc/testsuite/gfortran.dg/gamma_1.f90
+++ b/gcc/testsuite/gfortran.dg/gamma_1.f90
@@ -8,7 +8,7 @@
!
program gamma_test
implicit none
-intrinsic :: gamma, lgamma
+intrinsic :: gamma, lgamma, log_gamma
integer, parameter :: sp = kind(1.0)
integer, parameter :: dp = kind(1.0d0)
@@ -21,6 +21,8 @@ if (abs(dgamma(1.0_dp) - 1.0_dp) > tiny(1.0_dp)) call abort()
if (abs(lgamma(1.0_sp)) > tiny(1.0_sp)) call abort()
if (abs(lgamma(1.0_dp)) > tiny(1.0_dp)) call abort()
+if (abs(log_gamma(1.0_sp)) > tiny(1.0_sp)) call abort()
+if (abs(log_gamma(1.0_dp)) > tiny(1.0_dp)) call abort()
if (abs(algama(1.0_sp)) > tiny(1.0_sp)) call abort()
if (abs(dlgama(1.0_dp)) > tiny(1.0_dp)) call abort()
end program gamma_test
diff --git a/gcc/testsuite/gfortran.dg/gamma_2.f90 b/gcc/testsuite/gfortran.dg/gamma_2.f90
index ca7432b..6e8cefa 100644
--- a/gcc/testsuite/gfortran.dg/gamma_2.f90
+++ b/gcc/testsuite/gfortran.dg/gamma_2.f90
@@ -20,12 +20,12 @@ integer, parameter :: dp = kind(1.0d0)
real(sp) :: rsp = 1.0_sp
real(dp) :: rdp = 1.0_dp
-rsp = gamma(rsp) ! FIXME: "is not included in the selected standard"
-rdp = gamma(rdp) ! FIXME: "is not included in the selected standard"
+rsp = gamma(rsp) ! FIXME "is not included in the selected standard"
+rdp = gamma(rdp) ! FIXME "is not included in the selected standard"
rdp = dgamma(rdp) ! { dg-error "is not included in the selected standard" }
-rsp = lgamma(rsp) ! FIXME: "is not included in the selected standard"
-rdp = lgamma(rdp) ! FIXME: "is not included in the selected standard"
+rsp = lgamma(rsp) ! { dg-error "is not included in the selected standard" }
+rdp = lgamma(rdp) ! { dg-error "is not included in the selected standard" }
rsp = algama(rsp) ! { dg-error "is not included in the selected standard" }
rdp = dlgama(rdp) ! { dg-error "is not included in the selected standard" }
end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/gamma_3.f90 b/gcc/testsuite/gfortran.dg/gamma_3.f90
index b35596f..ca3d30d 100644
--- a/gcc/testsuite/gfortran.dg/gamma_3.f90
+++ b/gcc/testsuite/gfortran.dg/gamma_3.f90
@@ -16,11 +16,11 @@ x = dgamma(cmplx(1.0,0.0,kind(0d0))) ! { dg-error "must be REAL" }
x = gamma(int(1)) ! { dg-error "is not consistent with a specific intrinsic interface" }
x = dgamma(int(1)) ! { dg-error "must be REAL" }
-x = lgamma(cmplx(1.0,0.0)) ! { dg-error "is not consistent with a specific intrinsic interface" }
+x = lgamma(cmplx(1.0,0.0)) ! { dg-error "must be REAL" }
x = algama(cmplx(1.0,0.0)) ! { dg-error "must be REAL" }
x = dlgama(cmplx(1.0,0.0,kind(0d0))) ! { dg-error "must be REAL" }
-x = lgamma(int(1)) ! { dg-error "is not consistent with a specific intrinsic interface" }
+x = lgamma(int(1)) ! { dg-error "must be REAL" }
x = algama(int(1)) ! { dg-error "must be REAL" }
x = dlgama(int(1)) ! { dg-error "must be REAL" }
end program gamma_test
diff --git a/gcc/testsuite/gfortran.dg/gamma_4.f90 b/gcc/testsuite/gfortran.dg/gamma_4.f90
index a351f77..67e9e23 100644
--- a/gcc/testsuite/gfortran.dg/gamma_4.f90
+++ b/gcc/testsuite/gfortran.dg/gamma_4.f90
@@ -1,20 +1,18 @@
! { dg-do run }
! { dg-require-effective-target fortran_large_real }
!
-! Test the vendor intrinsic (d)gamma, lgamma and algama/dlgama
-! gamma is also part of the Fortran 2008 draft; lgamma is called
-! log_gamma in the Fortran 2008 draft.
+! Test the Fortran 2008 intrinsics gamma and log_gamma
!
! PR fortran/32980
!
program gamma_test
implicit none
-intrinsic :: gamma, lgamma
+intrinsic :: gamma, log_gamma
integer, parameter :: qp = selected_real_kind(precision (0.0_8) + 1)
real(qp) :: rqp
if (abs(gamma(1.0_qp) - 1.0_qp) > tiny(1.0_qp)) call abort()
-if (abs(lgamma(1.0_qp)) > tiny(1.0_qp)) call abort()
+if (abs(log_gamma(1.0_qp)) > tiny(1.0_qp)) call abort()
end program gamma_test
diff --git a/gcc/testsuite/gfortran.dg/gomp/gomp.exp b/gcc/testsuite/gfortran.dg/gomp/gomp.exp
index 185bc3d..34ae146 100644
--- a/gcc/testsuite/gfortran.dg/gomp/gomp.exp
+++ b/gcc/testsuite/gfortran.dg/gomp/gomp.exp
@@ -12,7 +12,7 @@ dg-init
# Main loop.
gfortran-dg-runtest [lsort \
- [find $srcdir/$subdir *.\[fF\]{,90,95,03} ] ] " -fopenmp"
+ [find $srcdir/$subdir *.\[fF\]{,90,95,03,08} ] ] " -fopenmp"
# All done.
dg-finish
diff --git a/gcc/testsuite/gfortran.dg/hypot_1.f90 b/gcc/testsuite/gfortran.dg/hypot_1.f90
new file mode 100644
index 0000000..59022fa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/hypot_1.f90
@@ -0,0 +1,29 @@
+! { dg-do run }
+
+program test
+ implicit none
+
+ interface check
+ procedure check_r4
+ procedure check_r8
+ end interface check
+
+ real(kind=4) :: x4, y4
+ real(kind=8) :: x8, y8
+
+ x8 = 1.9_8 ; x4 = 1.9_4
+ y8 = -2.1_8 ; y4 = -2.1_4
+
+ call check(hypot(x8,y8), hypot(1.9_8,-2.1_8))
+ call check(hypot(x4,y4), hypot(1.9_4,-2.1_4))
+
+contains
+ subroutine check_r4 (a, b)
+ real(kind=4), intent(in) :: a, b
+ if (abs(a - b) > 1.e-5 * abs(b)) call abort
+ end subroutine
+ subroutine check_r8 (a, b)
+ real(kind=8), intent(in) :: a, b
+ if (abs(a - b) > 1.e-7 * abs(b)) call abort
+ end subroutine
+end program test
diff --git a/gcc/testsuite/gfortran.dg/invalid_contains_1.f90 b/gcc/testsuite/gfortran.dg/invalid_contains_1.f90
index 757751d..df4bb3f 100644
--- a/gcc/testsuite/gfortran.dg/invalid_contains_1.f90
+++ b/gcc/testsuite/gfortran.dg/invalid_contains_1.f90
@@ -5,4 +5,4 @@ contains
subroutine FOO ! { dg-error "conflicts with PROCEDURE" }
character(len=selected_int_kind(0)) :: C ! { dg-error "data declaration statement" }
end subroutine ! { dg-error "Expecting END MODULE statement" }
-end ! { dg-warning "CONTAINS statement without FUNCTION" } \ No newline at end of file
+end
diff --git a/gcc/testsuite/gfortran.dg/invalid_contains_2.f90 b/gcc/testsuite/gfortran.dg/invalid_contains_2.f90
index 90be10f..72c1e21 100644
--- a/gcc/testsuite/gfortran.dg/invalid_contains_2.f90
+++ b/gcc/testsuite/gfortran.dg/invalid_contains_2.f90
@@ -6,4 +6,4 @@ contains
integer :: i ! { dg-error "data declaration statement" }
character(len=selected_int_kind(i)) :: c ! { dg-error "data declaration statement" }
end subroutine ! { dg-error "Expecting END PROGRAM statement" }
-end program foo ! { dg-warning "CONTAINS statement without FUNCTION" }
+end program foo
diff --git a/gcc/testsuite/gfortran.dg/recursive_check_3.f90 b/gcc/testsuite/gfortran.dg/recursive_check_3.f90
index 23904a8..ec358cb 100644
--- a/gcc/testsuite/gfortran.dg/recursive_check_3.f90
+++ b/gcc/testsuite/gfortran.dg/recursive_check_3.f90
@@ -5,18 +5,18 @@ contains
pure pure subroutine a1(b) ! { dg-error "Duplicate PURE attribute specified" }
real, intent(in) :: b ! { dg-error "Unexpected data declaration statement" }
end subroutine a1 ! { dg-error "Expecting END MODULE" }
-end module m1 ! { dg-warning "CONTAINS statement without FUNCTION" }
+end module m1
module m2
contains
elemental elemental subroutine a2(b) ! { dg-error "Duplicate ELEMENTAL attribute" }
real, intent(in) :: b ! { dg-error "Unexpected data declaration statement" }
end subroutine a2 ! { dg-error "Expecting END MODULE" }
-end module m2 ! { dg-warning "CONTAINS statement without FUNCTION" }
+end module m2
module m3
contains
recursive recursive subroutine a3(b) ! { dg-error "Duplicate RECURSIVE attribute" }
real, intent(in) :: b ! { dg-error "Unexpected data declaration statement" }
end subroutine a3 ! { dg-error "Expecting END MODULE" }
-end module m3 ! { dg-warning "CONTAINS statement without FUNCTION" }
+end module m3
diff --git a/gcc/testsuite/gfortran.dg/vect/vect.exp b/gcc/testsuite/gfortran.dg/vect/vect.exp
index a1b9498..9f91434 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect.exp
+++ b/gcc/testsuite/gfortran.dg/vect/vect.exp
@@ -90,8 +90,8 @@ proc check_effective_target_lp64_or_vect_no_align { } {
dg-init
# Main loop.
-gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[fF\]{,90,95,03} ]] $DEFAULT_VECTCFLAGS
-gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[fF\]{,90,95,03} ]] $DEFAULT_VECTCFLAGS
+gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vect-*.\[fF\]{,90,95,03,08} ]] $DEFAULT_VECTCFLAGS
+gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/pr*.\[fF\]{,90,95,03,08} ]] $DEFAULT_VECTCFLAGS
#### Tests with special options
global SAVED_DEFAULT_VECTCFLAGS
@@ -100,19 +100,19 @@ set SAVED_DEFAULT_VECTCFLAGS $DEFAULT_VECTCFLAGS
# -ffast-math tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-ffast-math"
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03} ]] \
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/fast-math-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# -fvect-cost-model tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-fvect-cost-model"
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/cost-model-*.\[fF\]{,90,95,03} ]] \
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/cost-model-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# --param vect-max-version-for-alias-checks=0 tests
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "--param" "vect-max-version-for-alias-checks=0"
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[fF\]{,90,95,03} ]] \
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-vfa-*.\[fF\]{,90,95,03,08} ]] \
"" $DEFAULT_VECTCFLAGS
# Clean up.
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/compile.exp b/gcc/testsuite/gfortran.fortran-torture/compile/compile.exp
index 37ac092..d52b730 100644
--- a/gcc/testsuite/gfortran.fortran-torture/compile/compile.exp
+++ b/gcc/testsuite/gfortran.fortran-torture/compile/compile.exp
@@ -46,6 +46,13 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f90]] {
fortran-torture $testcase
}
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F90]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture $testcase
+}
+
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f95]] {
if ![runtest_file_p $runtests $testcase] then {
continue
@@ -53,9 +60,37 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f95]] {
fortran-torture $testcase
}
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F95]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture $testcase
+}
+
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f03]] {
if ![runtest_file_p $runtests $testcase] then {
continue
}
fortran-torture $testcase
}
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F03]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture $testcase
+}
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f08]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture $testcase
+}
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F08]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture $testcase
+}
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/execute.exp b/gcc/testsuite/gfortran.fortran-torture/execute/execute.exp
index fcf9f1f..d22372a 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/execute.exp
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/execute.exp
@@ -50,6 +50,13 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f90]] {
fortran-torture-execute $testcase
}
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F90]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture-execute $testcase
+}
+
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f95]] {
if ![runtest_file_p $runtests $testcase] then {
continue
@@ -57,9 +64,37 @@ foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f95]] {
fortran-torture-execute $testcase
}
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F95]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture-execute $testcase
+}
+
foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f03]] {
if ![runtest_file_p $runtests $testcase] then {
continue
}
fortran-torture-execute $testcase
}
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F03]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture-execute $testcase
+}
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.f08]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture-execute $testcase
+}
+
+foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.F08]] {
+ if ![runtest_file_p $runtests $testcase] then {
+ continue
+ }
+ fortran-torture-execute $testcase
+}