2020-01-01 12:51:42 +01:00
|
|
|
! Copyright (C) 2002-2020 Free Software Foundation, Inc.
|
2005-05-11 00:06:55 +02:00
|
|
|
! Contributed by Tobias Schl"uter
|
|
|
|
!
|
|
|
|
!This file is part of the GNU Fortran 95 runtime library (libgfortran).
|
|
|
|
!
|
|
|
|
!GNU libgfortran is free software; you can redistribute it and/or
|
|
|
|
!modify it under the terms of the GNU General Public
|
|
|
|
!License as published by the Free Software Foundation; either
|
2009-04-09 17:00:19 +02:00
|
|
|
!version 3 of the License, or (at your option) any later version.
|
2005-05-11 00:06:55 +02:00
|
|
|
!
|
|
|
|
!GNU libgfortran is distributed in the hope that it will be useful,
|
|
|
|
!but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
!MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
!GNU General Public License for more details.
|
|
|
|
!
|
2009-04-09 17:00:19 +02:00
|
|
|
!Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
!permissions described in the GCC Runtime Library Exception, version
|
|
|
|
!3.1, as published by the Free Software Foundation.
|
2005-05-11 00:06:55 +02:00
|
|
|
!
|
2009-04-09 17:00:19 +02:00
|
|
|
!You should have received a copy of the GNU General Public License and
|
|
|
|
!a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
!see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
!<http://www.gnu.org/licenses/>.
|
|
|
|
|
2005-05-11 00:06:55 +02:00
|
|
|
! Specifics for the intrinsics whose calling conventions change if
|
|
|
|
! -ff2c is used.
|
|
|
|
!
|
|
|
|
! There are two annoyances WRT the preprocessor:
|
|
|
|
! - we're using -traditional-cpp, so we can't use the ## operator.
|
|
|
|
! - macros expand to a single line, and Fortran lines can't be wider
|
|
|
|
! than 132 characters, therefore we use two macros to split the lines
|
|
|
|
!
|
|
|
|
! The cases we need to implement are functions returning default REAL
|
|
|
|
! or COMPLEX. The former need to return DOUBLE PRECISION instead of REAL,
|
|
|
|
! the latter become subroutines returning via a hidden first argument.
|
|
|
|
|
|
|
|
! one argument functions
|
|
|
|
#define REAL_HEAD(NAME) \
|
2007-01-20 19:33:20 +01:00
|
|
|
elemental function _gfortran_f2c_specific__/**/NAME/**/_r4 (parm) result(res);
|
2005-05-11 00:06:55 +02:00
|
|
|
|
|
|
|
#define REAL_BODY(NAME) \
|
|
|
|
REAL, intent (in) :: parm; \
|
|
|
|
DOUBLE PRECISION :: res; \
|
|
|
|
res = NAME (parm); \
|
|
|
|
end function
|
|
|
|
|
|
|
|
#define COMPLEX_HEAD(NAME) \
|
2007-01-20 19:33:20 +01:00
|
|
|
subroutine _gfortran_f2c_specific__/**/NAME/**/_c4 (res, parm);
|
2005-05-11 00:06:55 +02:00
|
|
|
|
|
|
|
#define COMPLEX_BODY(NAME) \
|
|
|
|
COMPLEX, intent (in) :: parm; \
|
|
|
|
COMPLEX, intent (out) :: res; \
|
|
|
|
res = NAME (parm); \
|
|
|
|
end subroutine
|
|
|
|
|
|
|
|
#define DCOMPLEX_HEAD(NAME) \
|
2007-01-20 19:33:20 +01:00
|
|
|
subroutine _gfortran_f2c_specific__/**/NAME/**/_c8 (res, parm);
|
2005-05-11 00:06:55 +02:00
|
|
|
|
|
|
|
#define DCOMPLEX_BODY(NAME) \
|
|
|
|
DOUBLE COMPLEX, intent (in) :: parm; \
|
|
|
|
DOUBLE COMPLEX, intent (out) :: res; \
|
|
|
|
res = NAME (parm); \
|
|
|
|
end subroutine
|
|
|
|
|
|
|
|
REAL_HEAD(abs)
|
|
|
|
REAL_BODY(abs)
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
|
2005-05-11 00:06:55 +02:00
|
|
|
! abs is special in that the result is real
|
2007-01-20 19:33:20 +01:00
|
|
|
elemental function _gfortran_f2c_specific__abs_c4 (parm) result (res)
|
2005-05-11 00:06:55 +02:00
|
|
|
COMPLEX, intent(in) :: parm
|
|
|
|
DOUBLE PRECISION :: res
|
|
|
|
res = abs(parm)
|
|
|
|
end function
|
|
|
|
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
|
|
|
|
! aimag is special in that the result is real
|
2007-01-20 19:33:20 +01:00
|
|
|
elemental function _gfortran_f2c_specific__aimag_c4 (parm)
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
complex(kind=4), intent(in) :: parm
|
2007-01-20 19:33:20 +01:00
|
|
|
double precision :: _gfortran_f2c_specific__aimag_c4
|
|
|
|
_gfortran_f2c_specific__aimag_c4 = aimag(parm)
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
end function
|
|
|
|
|
2007-01-20 19:33:20 +01:00
|
|
|
elemental function _gfortran_f2c_specific__aimag_c8 (parm)
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
complex(kind=8), intent(in) :: parm
|
2007-01-20 19:33:20 +01:00
|
|
|
double precision :: _gfortran_f2c_specific__aimag_c8
|
|
|
|
_gfortran_f2c_specific__aimag_c8 = aimag(parm)
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
end function
|
|
|
|
|
|
|
|
|
2005-05-11 00:06:55 +02:00
|
|
|
REAL_HEAD(exp)
|
|
|
|
REAL_BODY(exp)
|
|
|
|
COMPLEX_HEAD(exp)
|
|
|
|
COMPLEX_BODY(exp)
|
|
|
|
DCOMPLEX_HEAD(exp)
|
|
|
|
DCOMPLEX_BODY(exp)
|
|
|
|
|
|
|
|
REAL_HEAD(log)
|
|
|
|
REAL_BODY(log)
|
|
|
|
COMPLEX_HEAD(log)
|
|
|
|
COMPLEX_BODY(log)
|
|
|
|
DCOMPLEX_HEAD(log)
|
|
|
|
DCOMPLEX_BODY(log)
|
|
|
|
|
|
|
|
REAL_HEAD(log10)
|
|
|
|
REAL_BODY(log10)
|
|
|
|
|
|
|
|
REAL_HEAD(sqrt)
|
|
|
|
REAL_BODY(sqrt)
|
|
|
|
COMPLEX_HEAD(sqrt)
|
|
|
|
COMPLEX_BODY(sqrt)
|
|
|
|
DCOMPLEX_HEAD(sqrt)
|
|
|
|
DCOMPLEX_BODY(sqrt)
|
|
|
|
|
|
|
|
REAL_HEAD(asin)
|
|
|
|
REAL_BODY(asin)
|
|
|
|
|
|
|
|
REAL_HEAD(acos)
|
|
|
|
REAL_BODY(acos)
|
|
|
|
|
|
|
|
REAL_HEAD(atan)
|
|
|
|
REAL_BODY(atan)
|
|
|
|
|
re PR fortran/16580 ([4.1 only] gfortran ICE on test g77.f-torture/execute/intrinsic77.f)
PR fortran/16580
PR fortran/29288
* gcc/fortran/intrinsic.c (add_sym): Define the actual_ok when a
gfc_intrinsic_sym structure is filled.
(gfc_intrinsic_actual_ok): New function.
(add_sym_0s, add_sym_1s, add_sym_2s, add_sym_3s, add_sym_4s,
add_sym_5s): Intrinsic subroutines are not allowed as actual
arguments, so we remove argument actual_ok.
(add_functions): Correct the values for actual_ok of all intrinsics.
(add_subroutines): Remove the actual_ok argument, which was never used.
* gcc/fortran/intrinsic.h (gfc_intrinsic_actual_ok): New prototype.
* gcc/fortran/gfortran.h (gfc_resolve_index_func): New prototype.
* gcc/fortran/resolve.c (resolve_actual_arglist): Check whether
an intrinsic used as an argument list is allowed there.
* gcc/fortran/iresolve.c (gfc_resolve_index_func): New function.
(gfc_resolve_len): Change intrinsic function name to agree with
libgfortran.
* gcc/fortran/trans-decl.c (gfc_get_extern_function_decl): Add
new case, because some specific intrinsics take 3 arguments.
* gcc/fortran/intrinsic.texi: DIMAG is a GNU extension.
* libgfortran/Makefile.am: Add the new files to the build
process, and rules to build them.
* libgfortran/Makefile.in: Regenerate.
* libgfortran/m4/misc_specifics.m4: New file.
* libgfortran/m4/specific.m4: Add new special cases for function
with complex argument and real result, like abs_c* and aimag_c*.
* libgfortran/intrinsics/f2c_specifics.F90: Add specifics for
AIMAG, ASINH, ACOSH and ATANH.
* libgfortran/generated/_aimag_c4.F90: New file.
* libgfortran/generated/_aimag_c8.F90: New file.
* libgfortran/generated/_asinh_r10.F90: New file.
* libgfortran/generated/_acosh_r16.F90: New file.
* libgfortran/generated/_aimag_c10.F90: New file.
* libgfortran/generated/_atanh_r16.F90: New file.
* libgfortran/generated/_acosh_r4.F90: New file.
* libgfortran/generated/_acosh_r8.F90: New file.
* libgfortran/generated/_asinh_r4.F90: New file.
* libgfortran/generated/_asinh_r8.F90: New file.
* libgfortran/generated/_asinh_r16.F90: New file.
* libgfortran/generated/_atanh_r4.F90: New file.
* libgfortran/generated/_atanh_r8.F90: New file.
* libgfortran/generated/_acosh_r10.F90: New file.
* libgfortran/generated/misc_specifics.F90: New file.
* libgfortran/generated/_aimag_c16.F90: New file.
* libgfortran/generated/_atanh_r10.F90: New file.
* gcc/testsuite/gfortran.fortran-torture/execute/specifics.f90:
Add tests for using all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_1.f90: Add tests for using
all possible intrinsics as actual arguments.
* gcc/testsuite/gfortran.dg/specifics_2.f90: New file.
* gcc/testsuite/gfortran.dg/specifics_3.f90: New file.
From-SVN: r117534
2006-10-07 15:34:16 +02:00
|
|
|
REAL_HEAD(asinh)
|
|
|
|
REAL_BODY(asinh)
|
|
|
|
|
|
|
|
REAL_HEAD(acosh)
|
|
|
|
REAL_BODY(acosh)
|
|
|
|
|
|
|
|
REAL_HEAD(atanh)
|
|
|
|
REAL_BODY(atanh)
|
|
|
|
|
2005-05-11 00:06:55 +02:00
|
|
|
REAL_HEAD(sin)
|
|
|
|
REAL_BODY(sin)
|
|
|
|
COMPLEX_HEAD(sin)
|
|
|
|
COMPLEX_BODY(sin)
|
|
|
|
DCOMPLEX_HEAD(sin)
|
|
|
|
DCOMPLEX_BODY(sin)
|
|
|
|
|
|
|
|
REAL_HEAD(cos)
|
|
|
|
REAL_BODY(cos)
|
|
|
|
COMPLEX_HEAD(cos)
|
|
|
|
COMPLEX_BODY(cos)
|
|
|
|
DCOMPLEX_HEAD(cos)
|
|
|
|
DCOMPLEX_BODY(cos)
|
|
|
|
|
|
|
|
REAL_HEAD(tan)
|
|
|
|
REAL_BODY(tan)
|
|
|
|
|
|
|
|
REAL_HEAD(sinh)
|
|
|
|
REAL_BODY(sinh)
|
|
|
|
|
|
|
|
REAL_HEAD(cosh)
|
|
|
|
REAL_BODY(cosh)
|
|
|
|
|
|
|
|
REAL_HEAD(tanh)
|
|
|
|
REAL_BODY(tanh)
|
|
|
|
|
|
|
|
REAL_HEAD(aint)
|
|
|
|
REAL_BODY(aint)
|
|
|
|
|
|
|
|
REAL_HEAD(anint)
|
|
|
|
REAL_BODY(anint)
|
|
|
|
|
|
|
|
! two argument functions
|
|
|
|
#define REAL2_HEAD(NAME) \
|
2007-01-20 19:33:20 +01:00
|
|
|
elemental function _gfortran_f2c_specific__/**/NAME/**/_r4 (p1, p2) result(res);
|
2005-05-11 00:06:55 +02:00
|
|
|
|
|
|
|
#define REAL2_BODY(NAME) \
|
|
|
|
REAL, intent (in) :: p1, p2; \
|
|
|
|
DOUBLE PRECISION :: res; \
|
|
|
|
res = NAME (p1, p2); \
|
|
|
|
end function
|
|
|
|
|
|
|
|
REAL2_HEAD(sign)
|
|
|
|
REAL2_BODY(sign)
|
|
|
|
|
|
|
|
REAL2_HEAD(dim)
|
|
|
|
REAL2_BODY(dim)
|
|
|
|
|
|
|
|
REAL2_HEAD(atan2)
|
|
|
|
REAL2_BODY(atan2)
|
|
|
|
|
|
|
|
REAL2_HEAD(mod)
|
|
|
|
REAL2_BODY(mod)
|
2006-10-01 00:32:41 +02:00
|
|
|
|
|
|
|
! conjg is special-cased because it is not suffixed _c4 but _4
|
2007-01-20 19:33:20 +01:00
|
|
|
subroutine _gfortran_f2c_specific__conjg_4 (res, parm)
|
2006-10-01 00:32:41 +02:00
|
|
|
COMPLEX, intent (in) :: parm
|
|
|
|
COMPLEX, intent (out) :: res
|
|
|
|
res = conjg (parm)
|
|
|
|
end subroutine
|
2007-01-20 19:33:20 +01:00
|
|
|
subroutine _gfortran_f2c_specific__conjg_8 (res, parm)
|
2006-10-01 00:32:41 +02:00
|
|
|
DOUBLE COMPLEX, intent (in) :: parm
|
|
|
|
DOUBLE COMPLEX, intent (out) :: res
|
|
|
|
res = conjg (parm)
|
|
|
|
end subroutine
|
|
|
|
|