2004-05-13 08:41:07 +02:00
|
|
|
/* Check functions
|
2015-01-05 13:33:28 +01:00
|
|
|
Copyright (C) 2002-2015 Free Software Foundation, Inc.
|
2004-05-13 08:41:07 +02:00
|
|
|
Contributed by Andy Vaught & Katherine Holcomb
|
|
|
|
|
Make-lang.in, [...]: Update copyright years and boilerplate.
* Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c,
decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c,
expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c,
intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h,
matchexp.c, misc.c, module.c, options.c, parse.c, parse.h,
primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c,
trans-array.c, trans-array.h, trans-common.c, trans-const.c,
trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c,
trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c,
trans-types.h, trans.c, trans.h: Update copyright years and
boilerplate.
* data.c: Likewise, also removed two whitespace-only lines.
* gfortranspec.c, lang.opt: Update copyright years.
From-SVN: r81839
2004-05-14 15:00:04 +02:00
|
|
|
This file is part of GCC.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
Make-lang.in, [...]: Update copyright years and boilerplate.
* Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c,
decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c,
expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c,
intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h,
matchexp.c, misc.c, module.c, options.c, parse.c, parse.h,
primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c,
trans-array.c, trans-array.h, trans-common.c, trans-const.c,
trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c,
trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c,
trans-types.h, trans.c, trans.h: Update copyright years and
boilerplate.
* data.c: Likewise, also removed two whitespace-only lines.
* gfortranspec.c, lang.opt: Update copyright years.
From-SVN: r81839
2004-05-14 15:00:04 +02:00
|
|
|
GCC 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
|
arith.c: Change copyright header to refer to version 3 of the GNU General Public...
* arith.c: Change copyright header to refer to version 3 of the GNU General
Public License and to point readers at the COPYING3 file and the FSF's
license web page.
* openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c,
iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c,
dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c,
gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c,
trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c,
scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h,
lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c,
trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c,
arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h,
primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise.
From-SVN: r127129
2007-08-01 18:29:36 +02:00
|
|
|
Software Foundation; either version 3, or (at your option) any later
|
Make-lang.in, [...]: Update copyright years and boilerplate.
* Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c,
decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c,
expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c,
intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h,
matchexp.c, misc.c, module.c, options.c, parse.c, parse.h,
primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c,
trans-array.c, trans-array.h, trans-common.c, trans-const.c,
trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c,
trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c,
trans-types.h, trans.c, trans.h: Update copyright years and
boilerplate.
* data.c: Likewise, also removed two whitespace-only lines.
* gfortranspec.c, lang.opt: Update copyright years.
From-SVN: r81839
2004-05-14 15:00:04 +02:00
|
|
|
version.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
Make-lang.in, [...]: Update copyright years and boilerplate.
* Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c,
decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c,
expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c,
intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h,
matchexp.c, misc.c, module.c, options.c, parse.c, parse.h,
primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c,
trans-array.c, trans-array.h, trans-common.c, trans-const.c,
trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c,
trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c,
trans-types.h, trans.c, trans.h: Update copyright years and
boilerplate.
* data.c: Likewise, also removed two whitespace-only lines.
* gfortranspec.c, lang.opt: Update copyright years.
From-SVN: r81839
2004-05-14 15:00:04 +02:00
|
|
|
GCC 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.
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
arith.c: Change copyright header to refer to version 3 of the GNU General Public...
* arith.c: Change copyright header to refer to version 3 of the GNU General
Public License and to point readers at the COPYING3 file and the FSF's
license web page.
* openmp.c, interface.c, intrinsic.c, trans-array.c, trans-expr.c, symbol.c,
iso-fortran-env.def, intrinsic.h, decl.c, trans-array.h, matchexp.c,
dump-parse-tree.c, trans-common.c, array.c, Make-lang.in, trans-openmp.c,
gfortran.h, error.c, iso-c-binding.def, lang.opt, data.c, trans-const.c,
trans-stmt.c, expr.c, trans-const.h, trans-stmt.h, module.c, trans.c,
scanner.c, trans-types.c, trans.h, gfortranspec.c, trans-types.h,
lang-specs.h, io.c, bbt.c, resolve.c, f95-lang.c, st.c, iresolve.c, match.c,
trans-decl.c, trans-io.c, target-memory.c, match.h, target-memory.h, parse.c,
arith.h, check.c, dependency.c, parse.h, types.def, convert.c, dependency.h,
primary.c, trans-intrinsic.c, options.c, misc.c, simplify.c: Likewise.
From-SVN: r127129
2007-08-01 18:29:36 +02:00
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* These functions check to see if an argument list is compatible with
|
|
|
|
a particular intrinsic function or subroutine. Presence of
|
|
|
|
required arguments has already been established, the argument list
|
|
|
|
has been sorted into the right order and has NULL arguments in the
|
|
|
|
correct places for missing optional arguments. */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
2012-07-08 11:55:02 +02:00
|
|
|
#include "coretypes.h"
|
2015-07-09 13:27:35 +02:00
|
|
|
#include "options.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
#include "gfortran.h"
|
|
|
|
#include "intrinsic.h"
|
2010-04-13 03:59:35 +02:00
|
|
|
#include "constructor.h"
|
2011-08-05 23:51:59 +02:00
|
|
|
#include "target-memory.h"
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
|
2007-09-12 12:30:22 +02:00
|
|
|
/* Make sure an expression is a scalar. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-09-12 12:30:22 +02:00
|
|
|
scalar_check (gfc_expr *e, int n)
|
|
|
|
{
|
|
|
|
if (e->rank == 0)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-09-12 12:30:22 +02:00
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a scalar",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
|
|
|
&e->where);
|
2007-09-12 12:30:22 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2007-09-12 12:30:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Check the type of an expression. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
type_check (gfc_expr *e, int n, bt type)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (e->ts.type == type)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be %s",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
|
|
|
&e->where, gfc_basic_typename (type));
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Check that the expression is a numeric type. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
numeric_check (gfc_expr *e, int n)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (gfc_numeric_ts (&e->ts))
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-04-07 22:20:49 +02:00
|
|
|
/* If the expression has not got a type, check if its namespace can
|
|
|
|
offer a default type. */
|
2012-09-15 17:44:22 +02:00
|
|
|
if ((e->expr_type == EXPR_VARIABLE || e->expr_type == EXPR_FUNCTION)
|
2007-04-07 22:20:49 +02:00
|
|
|
&& e->symtree->n.sym->ts.type == BT_UNKNOWN
|
2013-04-10 23:36:58 +02:00
|
|
|
&& gfc_set_default_type (e->symtree->n.sym, 0, e->symtree->n.sym->ns)
|
2007-04-07 22:20:49 +02:00
|
|
|
&& gfc_numeric_ts (&e->symtree->n.sym->ts))
|
|
|
|
{
|
|
|
|
e->ts = e->symtree->n.sym->ts;
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-04-07 22:20:49 +02:00
|
|
|
}
|
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a numeric type",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
|
|
|
&e->where);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Check that an expression is integer or real. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
int_or_real_check (gfc_expr *e, int n)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (e->ts.type != BT_INTEGER && e->ts.type != BT_REAL)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be INTEGER "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or REAL", gfc_current_intrinsic_arg[n]->name,
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_current_intrinsic, &e->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-01-29 18:46:34 +01:00
|
|
|
/* Check that an expression is real or complex. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
real_or_complex_check (gfc_expr *e, int n)
|
2005-01-29 18:46:34 +01:00
|
|
|
{
|
|
|
|
if (e->ts.type != BT_REAL && e->ts.type != BT_COMPLEX)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be REAL "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or COMPLEX", gfc_current_intrinsic_arg[n]->name,
|
|
|
|
gfc_current_intrinsic, &e->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Check that an expression is INTEGER or PROCEDURE. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
int_or_proc_check (gfc_expr *e, int n)
|
|
|
|
{
|
|
|
|
if (e->ts.type != BT_INTEGER && e->ts.type != BT_PROCEDURE)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be INTEGER "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or PROCEDURE", gfc_current_intrinsic_arg[n]->name,
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_current_intrinsic, &e->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2005-01-29 18:46:34 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-01-29 18:46:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Check that the expression is an optional constant integer
|
|
|
|
and that it specifies a valid kind for that type. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
kind_check (gfc_expr *k, int n, bt type)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
int kind;
|
|
|
|
|
|
|
|
if (k == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (k, n, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (k, n))
|
|
|
|
return false;
|
2007-09-12 12:30:22 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_check_init_expr (k))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a constant",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
2007-01-07 01:28:29 +01:00
|
|
|
&k->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gfc_extract_int (k, &kind) != NULL
|
arith.c (gfc_validate_kind): Add may_fail argument; abort if false and we don't validate the kind.
* arith.c (gfc_validate_kind): Add may_fail argument; abort if
false and we don't validate the kind.
(gfc_check_integer_range, gfc_check_real_range): Update to match.
* check.c (kind_check): Likewise.
* decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Likewise.
(match_char_spec, match_logical_spec): Likewise.
* gfortran.h (gfc_validate_kind): Likewise.
* options.c (gfc_handle_option): Likewise.
* primary.c (match_integer_constant, match_real_constant,
match_string_constant, match_logical_constant,
match_const_complex_part): Likewise.
* simplify.c (get_kind, gfc_simplify_bit_size, gfc_simplify_digits,
gfc_simplify_epsilon, gfc_simplify_huge, gfc_simplify_ibclr,
gfc_simplify_ibset, gfc_simplify_ishft, gfc_simplify_ishftc,
gfc_simplify_maxexponent, gfc_simplify_minexponent,
gfc_simplify_nearest, gfc_simplify_not, gfc_simplify_precision,
gfc_simplify_radix, gfc_simplify_range, gfc_simplify_rrspacing,
gfc_simplify_scale, gfc_simplify_spacing, gfc_simplify_tan,
gfc_simplify_tiny): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_aint, gfc_conv_intrinsic_mod,
gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval,
prepare_arg_info): Likewise.
From-SVN: r86608
2004-08-26 08:07:52 +02:00
|
|
|
|| gfc_validate_kind (type, kind, true) < 0)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
gfc_error ("Invalid kind for %s at %L", gfc_basic_typename (type),
|
|
|
|
&k->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure the expression is a double precision real. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
double_check (gfc_expr *d, int n)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (d, n, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
gfortran.h (gfc_default_*_kind): Remove prototypes, add extern variable declaration of same name.
* gfortran.h (gfc_default_*_kind): Remove prototypes, add extern
variable declaration of same name.
* arith.c, check.c, decl.c, dump_parse_tree.c, expr.c,
intrinsic.c, io.c, iresolve.c, match.c, options.c, primary.c,
resolve.c, simplify.c, symbol.c, trans-const.c, trans-io.c:
Replace all calls to gfc_default_*_kind with variable accesses.
* trans-types.c: Same as above.
(gfc_default_*_kind_1): Rename to gfc_default_*_kind, remove
static qualifier. Replace all occurences.
(gfc_default_*_kind): Remove functions.
From-SVN: r86662
2004-08-27 16:49:35 +02:00
|
|
|
if (d->ts.kind != gfc_default_double_kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be double "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"precision", gfc_current_intrinsic_arg[n]->name,
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_current_intrinsic, &d->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
coarray_check (gfc_expr *e, int n)
|
|
|
|
{
|
2011-12-19 09:15:47 +01:00
|
|
|
if (e->ts.type == BT_CLASS && gfc_expr_attr (e).class_ok
|
|
|
|
&& CLASS_DATA (e)->attr.codimension
|
|
|
|
&& CLASS_DATA (e)->as->corank)
|
|
|
|
{
|
|
|
|
gfc_add_class_array_ref (e);
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2011-12-19 09:15:47 +01:00
|
|
|
}
|
|
|
|
|
2011-10-07 21:02:36 +02:00
|
|
|
if (!gfc_is_coarray (e))
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Expected coarray variable as %qs argument to the %s "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"intrinsic at %L", gfc_current_intrinsic_arg[n]->name,
|
|
|
|
gfc_current_intrinsic, &e->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2012-12-20 01:15:00 +01:00
|
|
|
}
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Make sure the expression is a logical array. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
logical_array_check (gfc_expr *array, int n)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (array->ts.type != BT_LOGICAL || array->rank == 0)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a logical "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"array", gfc_current_intrinsic_arg[n]->name,
|
|
|
|
gfc_current_intrinsic, &array->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure an expression is an array. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
array_check (gfc_expr *e, int n)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2011-12-19 09:15:47 +01:00
|
|
|
if (e->ts.type == BT_CLASS && gfc_expr_attr (e).class_ok
|
re PR fortran/41539 ([OOP] Calling function which takes CLASS: Rank comparison does not work)
2011-12-11 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/41539
PR fortran/43214
PR fortran/43969
PR fortran/44568
PR fortran/46356
PR fortran/46990
PR fortran/49074
* interface.c(symbol_rank): Return the rank of the _data
component of class objects.
(compare_parameter): Also compare the derived type of the class
_data component for type mismatch. Similarly, return 1 if the
formal and _data ranks match.
(compare_actual_formal): Do not compare storage sizes for class
expressions. It is an error if an actual class array, passed to
a formal class array is not full.
* trans-expr.c (gfc_class_data_get, gfc_class_vptr_get,
gfc_vtable_field_get, gfc_vtable_hash_get, gfc_vtable_size_get,
gfc_vtable_extends_get, gfc_vtable_def_init_get,
gfc_vtable_copy_get): New functions for class API.
(gfc_conv_derived_to_class): For an array reference in an
elemental procedure call retain the ss to provide the
scalarized array reference. Moved in file.
(gfc_conv_class_to_class): New function.
(gfc_conv_subref_array_arg): Use the type of the
class _data component as a basetype.
(gfc_conv_procedure_call): Ensure that class array expressions
have both the _data reference and an array reference. Use
gfc_conv_class_to_class to handle class arrays for elemental
functions in scalarized loops, class array elements and full
class arrays. Use a call to gfc_conv_subref_array_arg in order
that the copy-in/copy-out for passing class arrays to derived
type arrays occurs correctly.
(gfc_conv_expr): If it is missing, add the _data component
between a class object or component and an array reference.
(gfc_trans_class_array_init_assign): New function.
(gfc_trans_class_init_assign): Call it for array expressions.
* trans-array.c (gfc_add_loop_ss_code): Do not use a temp for
class scalars since their size will depend on the dynamic type.
(build_class_array_ref): New function.
(gfc_conv_scalarized_array_ref): Call build_class_array_ref.
(gfc_array_init_size): Add extra argument, expr3, that represents
the SOURCE argument. If present,use this for the element size.
(gfc_array_allocate): Also add argument expr3 and use it when
calling gfc_array_init_size.
(structure_alloc_comps): Enable class arrays.
* class.c (gfc_add_component_ref): Carry over the derived type
of the _data component.
(gfc_add_class_array_ref): New function.
(class_array_ref_detected): New static function.
(gfc_is_class_array_ref): New function that calls previous.
(gfc_is_class_scalar_expr): New function.
(gfc_build_class_symbol): Throw not implemented error for
assumed size class arrays. Remove error that prevents
CLASS arrays.
(gfc_build_class_symbol): Prevent pointer/allocatable conflict.
Also unset codimension.
(gfc_find_derived_vtab): Make 'copy' elemental and set the
intent of the arguments accordingly.:
* trans-array.h : Update prototype for gfc_array_allocate.
* array.c (gfc_array_dimen_size): Return failure if class expr.
(gfc_array_size): Likewise.
* gfortran.h : New prototypes for gfc_add_class_array_ref,
gfc_is_class_array_ref and gfc_is_class_scalar_expr.
* trans-stmt.c (trans_associate_var): Exclude class targets
from test. Move the allocation of the _vptr to an earlier time
for class objects.
(trans_associate_var): Assign the descriptor directly for class
arrays.
(gfc_trans_allocate): Add expr3 to gfc_array_allocate arguments.
Convert array element references into sections. Do not invoke
gfc_conv_procedure_call, use gfc_trans_call instead.
* expr.c (gfc_get_corank): Fix for BT_CLASS.
(gfc_is_simply_contiguous): Exclude class from test.
* trans.c (gfc_build_array_ref): Include class array refs.
* trans.h : Include prototypes for class API functions that are
new in trans-expr. Define GFC_DECL_CLASS(node).
* resolve.c (check_typebound_baseobject ): Remove error for
non-scalar base object.
(resolve_allocate_expr): Ensure that class _data component is
present. If array, call gfc_expr_to_intialize.
(resolve_select): Remove scalar error for SELECT statement as a
temporary measure.
(resolve_assoc_var): Update 'target' (aka 'selector') as
needed. Ensure that the target expression has the right rank.
(resolve_select_type): Ensure that target expressions have a
valid locus.
(resolve_allocate_expr, resolve_fl_derived0): Fix for BT_CLASS.
* trans-decl.c (gfc_get_symbol_decl): Set GFC_DECL_CLASS, where
appropriate.
(gfc_trans_deferred_vars): Get class arrays right.
* match.c(select_type_set_tmp): Add array spec to temporary.
(gfc_match_select_type): Allow class arrays.
* check.c (array_check): Ensure that class arrays have refs.
(dim_corank_check, dim_rank_check): Retrun success if class.
* primary.c (gfc_match_varspec): Fix for class arrays and
co-arrays. Make sure that class _data is present.
(gfc_match_rvalue): Handle class arrays.
*trans-intrinsic.c (gfc_conv_intrinsic_size): Add class array
reference.
(gfc_conv_allocated): Add _data component to class expressions.
(gfc_add_intrinsic_ss_code): ditto.
* simplify.c (simplify_cobound): Fix for BT_CLASS.
(simplify_bound): Return NULL for class arrays.
(simplify_cobound): Obtain correct array_spec. Use cotype as
appropriate. Use arrayspec for bounds.
2011-12-11 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/41539
PR fortran/43214
PR fortran/43969
PR fortran/44568
PR fortran/46356
PR fortran/46990
PR fortran/49074
* gfortran.dg/class_array_1.f03: New.
* gfortran.dg/class_array_2.f03: New.
* gfortran.dg/class_array_3.f03: New.
* gfortran.dg/class_array_4.f03: New.
* gfortran.dg/class_array_5.f03: New.
* gfortran.dg/class_array_6.f03: New.
* gfortran.dg/class_array_7.f03: New.
* gfortran.dg/class_array_8.f03: New.
* gfortran.dg/coarray_poly_1.f90: New.
* gfortran.dg/coarray_poly_2.f90: New.
* gfortran.dg/coarray/poly_run_1.f90: New.
* gfortran.dg/coarray/poly_run_2.f90: New.
* gfortran.dg/class_to_type_1.f03: New.
* gfortran.dg/type_to_class_1.f03: New.
* gfortran.dg/typebound_assignment_3.f03: Remove the error.
* gfortran.dg/auto_dealloc_2.f90: Occurences of __builtin_free
now 2.
* gfortran.dg/class_19.f03: Occurences of __builtin_free now 8.
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r182210
2011-12-11 21:42:23 +01:00
|
|
|
&& CLASS_DATA (e)->attr.dimension
|
|
|
|
&& CLASS_DATA (e)->as->rank)
|
|
|
|
{
|
|
|
|
gfc_add_class_array_ref (e);
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/41539 ([OOP] Calling function which takes CLASS: Rank comparison does not work)
2011-12-11 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/41539
PR fortran/43214
PR fortran/43969
PR fortran/44568
PR fortran/46356
PR fortran/46990
PR fortran/49074
* interface.c(symbol_rank): Return the rank of the _data
component of class objects.
(compare_parameter): Also compare the derived type of the class
_data component for type mismatch. Similarly, return 1 if the
formal and _data ranks match.
(compare_actual_formal): Do not compare storage sizes for class
expressions. It is an error if an actual class array, passed to
a formal class array is not full.
* trans-expr.c (gfc_class_data_get, gfc_class_vptr_get,
gfc_vtable_field_get, gfc_vtable_hash_get, gfc_vtable_size_get,
gfc_vtable_extends_get, gfc_vtable_def_init_get,
gfc_vtable_copy_get): New functions for class API.
(gfc_conv_derived_to_class): For an array reference in an
elemental procedure call retain the ss to provide the
scalarized array reference. Moved in file.
(gfc_conv_class_to_class): New function.
(gfc_conv_subref_array_arg): Use the type of the
class _data component as a basetype.
(gfc_conv_procedure_call): Ensure that class array expressions
have both the _data reference and an array reference. Use
gfc_conv_class_to_class to handle class arrays for elemental
functions in scalarized loops, class array elements and full
class arrays. Use a call to gfc_conv_subref_array_arg in order
that the copy-in/copy-out for passing class arrays to derived
type arrays occurs correctly.
(gfc_conv_expr): If it is missing, add the _data component
between a class object or component and an array reference.
(gfc_trans_class_array_init_assign): New function.
(gfc_trans_class_init_assign): Call it for array expressions.
* trans-array.c (gfc_add_loop_ss_code): Do not use a temp for
class scalars since their size will depend on the dynamic type.
(build_class_array_ref): New function.
(gfc_conv_scalarized_array_ref): Call build_class_array_ref.
(gfc_array_init_size): Add extra argument, expr3, that represents
the SOURCE argument. If present,use this for the element size.
(gfc_array_allocate): Also add argument expr3 and use it when
calling gfc_array_init_size.
(structure_alloc_comps): Enable class arrays.
* class.c (gfc_add_component_ref): Carry over the derived type
of the _data component.
(gfc_add_class_array_ref): New function.
(class_array_ref_detected): New static function.
(gfc_is_class_array_ref): New function that calls previous.
(gfc_is_class_scalar_expr): New function.
(gfc_build_class_symbol): Throw not implemented error for
assumed size class arrays. Remove error that prevents
CLASS arrays.
(gfc_build_class_symbol): Prevent pointer/allocatable conflict.
Also unset codimension.
(gfc_find_derived_vtab): Make 'copy' elemental and set the
intent of the arguments accordingly.:
* trans-array.h : Update prototype for gfc_array_allocate.
* array.c (gfc_array_dimen_size): Return failure if class expr.
(gfc_array_size): Likewise.
* gfortran.h : New prototypes for gfc_add_class_array_ref,
gfc_is_class_array_ref and gfc_is_class_scalar_expr.
* trans-stmt.c (trans_associate_var): Exclude class targets
from test. Move the allocation of the _vptr to an earlier time
for class objects.
(trans_associate_var): Assign the descriptor directly for class
arrays.
(gfc_trans_allocate): Add expr3 to gfc_array_allocate arguments.
Convert array element references into sections. Do not invoke
gfc_conv_procedure_call, use gfc_trans_call instead.
* expr.c (gfc_get_corank): Fix for BT_CLASS.
(gfc_is_simply_contiguous): Exclude class from test.
* trans.c (gfc_build_array_ref): Include class array refs.
* trans.h : Include prototypes for class API functions that are
new in trans-expr. Define GFC_DECL_CLASS(node).
* resolve.c (check_typebound_baseobject ): Remove error for
non-scalar base object.
(resolve_allocate_expr): Ensure that class _data component is
present. If array, call gfc_expr_to_intialize.
(resolve_select): Remove scalar error for SELECT statement as a
temporary measure.
(resolve_assoc_var): Update 'target' (aka 'selector') as
needed. Ensure that the target expression has the right rank.
(resolve_select_type): Ensure that target expressions have a
valid locus.
(resolve_allocate_expr, resolve_fl_derived0): Fix for BT_CLASS.
* trans-decl.c (gfc_get_symbol_decl): Set GFC_DECL_CLASS, where
appropriate.
(gfc_trans_deferred_vars): Get class arrays right.
* match.c(select_type_set_tmp): Add array spec to temporary.
(gfc_match_select_type): Allow class arrays.
* check.c (array_check): Ensure that class arrays have refs.
(dim_corank_check, dim_rank_check): Retrun success if class.
* primary.c (gfc_match_varspec): Fix for class arrays and
co-arrays. Make sure that class _data is present.
(gfc_match_rvalue): Handle class arrays.
*trans-intrinsic.c (gfc_conv_intrinsic_size): Add class array
reference.
(gfc_conv_allocated): Add _data component to class expressions.
(gfc_add_intrinsic_ss_code): ditto.
* simplify.c (simplify_cobound): Fix for BT_CLASS.
(simplify_bound): Return NULL for class arrays.
(simplify_cobound): Obtain correct array_spec. Use cotype as
appropriate. Use arrayspec for bounds.
2011-12-11 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/41539
PR fortran/43214
PR fortran/43969
PR fortran/44568
PR fortran/46356
PR fortran/46990
PR fortran/49074
* gfortran.dg/class_array_1.f03: New.
* gfortran.dg/class_array_2.f03: New.
* gfortran.dg/class_array_3.f03: New.
* gfortran.dg/class_array_4.f03: New.
* gfortran.dg/class_array_5.f03: New.
* gfortran.dg/class_array_6.f03: New.
* gfortran.dg/class_array_7.f03: New.
* gfortran.dg/class_array_8.f03: New.
* gfortran.dg/coarray_poly_1.f90: New.
* gfortran.dg/coarray_poly_2.f90: New.
* gfortran.dg/coarray/poly_run_1.f90: New.
* gfortran.dg/coarray/poly_run_2.f90: New.
* gfortran.dg/class_to_type_1.f03: New.
* gfortran.dg/type_to_class_1.f03: New.
* gfortran.dg/typebound_assignment_3.f03: Remove the error.
* gfortran.dg/auto_dealloc_2.f90: Occurences of __builtin_free
now 2.
* gfortran.dg/class_19.f03: Occurences of __builtin_free now 8.
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r182210
2011-12-11 21:42:23 +01:00
|
|
|
}
|
|
|
|
|
2013-02-09 10:49:49 +01:00
|
|
|
if (e->rank != 0 && e->ts.type != BT_PROCEDURE)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be an array",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
|
|
|
&e->where);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-09 18:24:59 +02:00
|
|
|
/* If expr is a constant, then check to ensure that it is greater than
|
|
|
|
of equal to zero. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2010-06-09 18:24:59 +02:00
|
|
|
nonnegative_check (const char *arg, gfc_expr *expr)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (expr->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
gfc_extract_int (expr, &i);
|
|
|
|
if (i < 0)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs at %L must be nonnegative", arg, &expr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-06-09 18:24:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* If expr2 is constant, then check that the value is less than
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
(less than or equal to, if 'or_equal' is true) bit_size(expr1). */
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2010-06-09 18:24:59 +02:00
|
|
|
less_than_bitsize1 (const char *arg1, gfc_expr *expr1, const char *arg2,
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
gfc_expr *expr2, bool or_equal)
|
2010-06-09 18:24:59 +02:00
|
|
|
{
|
|
|
|
int i2, i3;
|
|
|
|
|
|
|
|
if (expr2->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
gfc_extract_int (expr2, &i2);
|
|
|
|
i3 = gfc_validate_kind (BT_INTEGER, expr1->ts.kind, false);
|
2012-12-20 01:15:00 +01:00
|
|
|
|
2011-10-20 20:07:10 +02:00
|
|
|
/* For ISHFT[C], check that |shift| <= bit_size(i). */
|
|
|
|
if (arg2 == NULL)
|
|
|
|
{
|
|
|
|
if (i2 < 0)
|
|
|
|
i2 = -i2;
|
|
|
|
|
|
|
|
if (i2 > gfc_integer_kinds[i3].bit_size)
|
|
|
|
{
|
|
|
|
gfc_error ("The absolute value of SHIFT at %L must be less "
|
2014-12-11 16:13:33 +01:00
|
|
|
"than or equal to BIT_SIZE(%qs)",
|
2011-10-20 20:07:10 +02:00
|
|
|
&expr2->where, arg1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-10-20 20:07:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
if (or_equal)
|
2010-06-09 18:24:59 +02:00
|
|
|
{
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
if (i2 > gfc_integer_kinds[i3].bit_size)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs at %L must be less than "
|
|
|
|
"or equal to BIT_SIZE(%qs)",
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
arg2, &expr2->where, arg1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (i2 >= gfc_integer_kinds[i3].bit_size)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs at %L must be less than BIT_SIZE(%qs)",
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
arg2, &expr2->where, arg1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
2010-06-09 18:24:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-06-09 18:24:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
/* If expr is constant, then check that the value is less than or equal
|
|
|
|
to the bit_size of the kind k. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
less_than_bitsizekind (const char *arg, gfc_expr *expr, int k)
|
|
|
|
{
|
|
|
|
int i, val;
|
|
|
|
|
|
|
|
if (expr->expr_type != EXPR_CONSTANT)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2012-12-20 01:15:00 +01:00
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
i = gfc_validate_kind (BT_INTEGER, k, false);
|
|
|
|
gfc_extract_int (expr, &val);
|
|
|
|
|
|
|
|
if (val > gfc_integer_kinds[i].bit_size)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs at %L must be less than or equal to the BIT_SIZE of "
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
"INTEGER(KIND=%d)", arg, &expr->where, k);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-06-09 18:24:59 +02:00
|
|
|
/* If expr2 and expr3 are constants, then check that the value is less than
|
|
|
|
or equal to bit_size(expr1). */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2010-06-09 18:24:59 +02:00
|
|
|
less_than_bitsize2 (const char *arg1, gfc_expr *expr1, const char *arg2,
|
|
|
|
gfc_expr *expr2, const char *arg3, gfc_expr *expr3)
|
|
|
|
{
|
|
|
|
int i2, i3;
|
|
|
|
|
|
|
|
if (expr2->expr_type == EXPR_CONSTANT && expr3->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
gfc_extract_int (expr2, &i2);
|
|
|
|
gfc_extract_int (expr3, &i3);
|
|
|
|
i2 += i3;
|
|
|
|
i3 = gfc_validate_kind (BT_INTEGER, expr1->ts.kind, false);
|
|
|
|
if (i2 > gfc_integer_kinds[i3].bit_size)
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<%s + %s%> at %L must be less than or equal "
|
2014-12-11 16:13:33 +01:00
|
|
|
"to BIT_SIZE(%qs)",
|
2010-06-09 18:24:59 +02:00
|
|
|
arg2, arg3, &expr2->where, arg1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-06-09 18:24:59 +02:00
|
|
|
}
|
|
|
|
|
2006-11-10 04:38:43 +01:00
|
|
|
/* Make sure two expressions have the same type. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
same_type_check (gfc_expr *e, int n, gfc_expr *f, int m)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2015-11-08 17:47:58 +01:00
|
|
|
gfc_typespec *ets = &e->ts;
|
|
|
|
gfc_typespec *fts = &f->ts;
|
|
|
|
|
|
|
|
if (e->ts.type == BT_PROCEDURE && e->symtree->n.sym)
|
|
|
|
ets = &e->symtree->n.sym->ts;
|
|
|
|
if (f->ts.type == BT_PROCEDURE && f->symtree->n.sym)
|
|
|
|
fts = &f->symtree->n.sym->ts;
|
|
|
|
|
|
|
|
if (gfc_compare_types (ets, fts))
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be the same type "
|
|
|
|
"and kind as %qs", gfc_current_intrinsic_arg[m]->name,
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic, &f->where,
|
|
|
|
gfc_current_intrinsic_arg[n]->name);
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure that an expression has a certain (nonzero) rank. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
rank_check (gfc_expr *e, int n, int rank)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (e->rank == rank)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of rank %d",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
&e->where, rank);
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure a variable expression is not an optional dummy argument. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
nonoptional_check (gfc_expr *e, int n)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.optional)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must not be OPTIONAL",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
2004-05-13 08:41:07 +02:00
|
|
|
&e->where);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Recursive check on nonoptional variables? */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
/* Check for ALLOCATABLE attribute. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
allocatable_check (gfc_expr *e, int n)
|
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
|
|
|
|
|
|
|
attr = gfc_variable_attr (e, NULL);
|
2013-01-27 08:09:06 +01:00
|
|
|
if (!attr.allocatable || attr.associate_var)
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be ALLOCATABLE",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
|
|
|
&e->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Check that an expression has a particular kind. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
kind_value_check (gfc_expr *e, int n, int k)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (e->ts.kind == k)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of kind %d",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
&e->where, k);
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Make sure an expression is a variable. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
re PR fortran/46484 (Should reject ALLOCATED(non-variable expression ))
2010-11-15 Tobias Burnus <burnus@net.b.de>
PR fortran/46484
* check.c (variable_check): Don't treat functions calls as
* variables;
optionally accept function themselves.
(gfc_check_all_any, gfc_check_loc, gfc_check_move_alloc,
gfc_check_null, gfc_check_present, gfc_check_cpu_time,
gfc_check_date_and_time, gfc_check_mvbits, gfc_check_random_number,
gfc_check_random_seed, gfc_check_system_clock,
gfc_check_dtime_etime, gfc_check_dtime_etime_sub,
gfc_check_itime_idate,gfc_check_ltime_gmtime): Update call.
2010-11-15 Tobias Burnus <burnus@net.b.de>
PR fortran/46484
* gfortran.dg/allocatable_scalar_11.f90: New.
* gfortran.dg/allocatable_scalar_5.f90: Make test case standard
* conform.
From-SVN: r166769
2010-11-15 21:44:26 +01:00
|
|
|
variable_check (gfc_expr *e, int n, bool allow_proc)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (e->expr_type == EXPR_VARIABLE
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
&& e->symtree->n.sym->attr.intent == INTENT_IN
|
|
|
|
&& (gfc_current_intrinsic_arg[n]->intent == INTENT_OUT
|
|
|
|
|| gfc_current_intrinsic_arg[n]->intent == INTENT_INOUT))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2011-12-03 12:30:18 +01:00
|
|
|
gfc_ref *ref;
|
|
|
|
bool pointer = e->symtree->n.sym->ts.type == BT_CLASS
|
|
|
|
&& CLASS_DATA (e->symtree->n.sym)
|
|
|
|
? CLASS_DATA (e->symtree->n.sym)->attr.class_pointer
|
|
|
|
: e->symtree->n.sym->attr.pointer;
|
|
|
|
|
|
|
|
for (ref = e->ref; ref; ref = ref->next)
|
|
|
|
{
|
|
|
|
if (pointer && ref->type == REF_COMPONENT)
|
|
|
|
break;
|
|
|
|
if (ref->type == REF_COMPONENT
|
|
|
|
&& ((ref->u.c.component->ts.type == BT_CLASS
|
|
|
|
&& CLASS_DATA (ref->u.c.component)->attr.class_pointer)
|
|
|
|
|| (ref->u.c.component->ts.type != BT_CLASS
|
|
|
|
&& ref->u.c.component->attr.pointer)))
|
|
|
|
break;
|
2012-12-20 01:15:00 +01:00
|
|
|
}
|
2011-12-03 12:30:18 +01:00
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L cannot be "
|
2011-12-03 12:30:18 +01:00
|
|
|
"INTENT(IN)", gfc_current_intrinsic_arg[n]->name,
|
|
|
|
gfc_current_intrinsic, &e->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-12-03 12:30:18 +01:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
re PR fortran/46484 (Should reject ALLOCATED(non-variable expression ))
2010-11-15 Tobias Burnus <burnus@net.b.de>
PR fortran/46484
* check.c (variable_check): Don't treat functions calls as
* variables;
optionally accept function themselves.
(gfc_check_all_any, gfc_check_loc, gfc_check_move_alloc,
gfc_check_null, gfc_check_present, gfc_check_cpu_time,
gfc_check_date_and_time, gfc_check_mvbits, gfc_check_random_number,
gfc_check_random_seed, gfc_check_system_clock,
gfc_check_dtime_etime, gfc_check_dtime_etime_sub,
gfc_check_itime_idate,gfc_check_ltime_gmtime): Update call.
2010-11-15 Tobias Burnus <burnus@net.b.de>
PR fortran/46484
* gfortran.dg/allocatable_scalar_11.f90: New.
* gfortran.dg/allocatable_scalar_5.f90: Make test case standard
* conform.
From-SVN: r166769
2010-11-15 21:44:26 +01:00
|
|
|
if (e->expr_type == EXPR_VARIABLE
|
|
|
|
&& e->symtree->n.sym->attr.flavor != FL_PARAMETER
|
2012-01-23 21:38:23 +01:00
|
|
|
&& (allow_proc || !e->symtree->n.sym->attr.function))
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
|
2012-01-23 21:38:23 +01:00
|
|
|
if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.function
|
|
|
|
&& e->symtree->n.sym == e->symtree->n.sym->result)
|
|
|
|
{
|
|
|
|
gfc_namespace *ns;
|
|
|
|
for (ns = gfc_current_ns; ns; ns = ns->parent)
|
|
|
|
if (ns->proc_name == e->symtree->n.sym)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2012-01-23 21:38:23 +01:00
|
|
|
}
|
|
|
|
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a variable",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, &e->where);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Check the common DIM parameter for correctness. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-09-12 12:30:22 +02:00
|
|
|
dim_check (gfc_expr *dim, int n, bool optional)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2007-09-12 12:30:22 +02:00
|
|
|
if (dim == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (dim, n, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (dim, n))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!optional && !nonoptional_check (dim, n))
|
|
|
|
return false;
|
2006-02-14 20:25:36 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
/* If a coarray DIM parameter is a constant, make sure that it is greater than
|
|
|
|
zero and less than or equal to the corank of the given array. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
dim_corank_check (gfc_expr *dim, gfc_expr *array)
|
|
|
|
{
|
|
|
|
int corank;
|
|
|
|
|
|
|
|
gcc_assert (array->expr_type == EXPR_VARIABLE);
|
|
|
|
|
|
|
|
if (dim->expr_type != EXPR_CONSTANT)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2012-12-20 01:15:00 +01:00
|
|
|
|
re PR fortran/41539 ([OOP] Calling function which takes CLASS: Rank comparison does not work)
2011-12-11 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/41539
PR fortran/43214
PR fortran/43969
PR fortran/44568
PR fortran/46356
PR fortran/46990
PR fortran/49074
* interface.c(symbol_rank): Return the rank of the _data
component of class objects.
(compare_parameter): Also compare the derived type of the class
_data component for type mismatch. Similarly, return 1 if the
formal and _data ranks match.
(compare_actual_formal): Do not compare storage sizes for class
expressions. It is an error if an actual class array, passed to
a formal class array is not full.
* trans-expr.c (gfc_class_data_get, gfc_class_vptr_get,
gfc_vtable_field_get, gfc_vtable_hash_get, gfc_vtable_size_get,
gfc_vtable_extends_get, gfc_vtable_def_init_get,
gfc_vtable_copy_get): New functions for class API.
(gfc_conv_derived_to_class): For an array reference in an
elemental procedure call retain the ss to provide the
scalarized array reference. Moved in file.
(gfc_conv_class_to_class): New function.
(gfc_conv_subref_array_arg): Use the type of the
class _data component as a basetype.
(gfc_conv_procedure_call): Ensure that class array expressions
have both the _data reference and an array reference. Use
gfc_conv_class_to_class to handle class arrays for elemental
functions in scalarized loops, class array elements and full
class arrays. Use a call to gfc_conv_subref_array_arg in order
that the copy-in/copy-out for passing class arrays to derived
type arrays occurs correctly.
(gfc_conv_expr): If it is missing, add the _data component
between a class object or component and an array reference.
(gfc_trans_class_array_init_assign): New function.
(gfc_trans_class_init_assign): Call it for array expressions.
* trans-array.c (gfc_add_loop_ss_code): Do not use a temp for
class scalars since their size will depend on the dynamic type.
(build_class_array_ref): New function.
(gfc_conv_scalarized_array_ref): Call build_class_array_ref.
(gfc_array_init_size): Add extra argument, expr3, that represents
the SOURCE argument. If present,use this for the element size.
(gfc_array_allocate): Also add argument expr3 and use it when
calling gfc_array_init_size.
(structure_alloc_comps): Enable class arrays.
* class.c (gfc_add_component_ref): Carry over the derived type
of the _data component.
(gfc_add_class_array_ref): New function.
(class_array_ref_detected): New static function.
(gfc_is_class_array_ref): New function that calls previous.
(gfc_is_class_scalar_expr): New function.
(gfc_build_class_symbol): Throw not implemented error for
assumed size class arrays. Remove error that prevents
CLASS arrays.
(gfc_build_class_symbol): Prevent pointer/allocatable conflict.
Also unset codimension.
(gfc_find_derived_vtab): Make 'copy' elemental and set the
intent of the arguments accordingly.:
* trans-array.h : Update prototype for gfc_array_allocate.
* array.c (gfc_array_dimen_size): Return failure if class expr.
(gfc_array_size): Likewise.
* gfortran.h : New prototypes for gfc_add_class_array_ref,
gfc_is_class_array_ref and gfc_is_class_scalar_expr.
* trans-stmt.c (trans_associate_var): Exclude class targets
from test. Move the allocation of the _vptr to an earlier time
for class objects.
(trans_associate_var): Assign the descriptor directly for class
arrays.
(gfc_trans_allocate): Add expr3 to gfc_array_allocate arguments.
Convert array element references into sections. Do not invoke
gfc_conv_procedure_call, use gfc_trans_call instead.
* expr.c (gfc_get_corank): Fix for BT_CLASS.
(gfc_is_simply_contiguous): Exclude class from test.
* trans.c (gfc_build_array_ref): Include class array refs.
* trans.h : Include prototypes for class API functions that are
new in trans-expr. Define GFC_DECL_CLASS(node).
* resolve.c (check_typebound_baseobject ): Remove error for
non-scalar base object.
(resolve_allocate_expr): Ensure that class _data component is
present. If array, call gfc_expr_to_intialize.
(resolve_select): Remove scalar error for SELECT statement as a
temporary measure.
(resolve_assoc_var): Update 'target' (aka 'selector') as
needed. Ensure that the target expression has the right rank.
(resolve_select_type): Ensure that target expressions have a
valid locus.
(resolve_allocate_expr, resolve_fl_derived0): Fix for BT_CLASS.
* trans-decl.c (gfc_get_symbol_decl): Set GFC_DECL_CLASS, where
appropriate.
(gfc_trans_deferred_vars): Get class arrays right.
* match.c(select_type_set_tmp): Add array spec to temporary.
(gfc_match_select_type): Allow class arrays.
* check.c (array_check): Ensure that class arrays have refs.
(dim_corank_check, dim_rank_check): Retrun success if class.
* primary.c (gfc_match_varspec): Fix for class arrays and
co-arrays. Make sure that class _data is present.
(gfc_match_rvalue): Handle class arrays.
*trans-intrinsic.c (gfc_conv_intrinsic_size): Add class array
reference.
(gfc_conv_allocated): Add _data component to class expressions.
(gfc_add_intrinsic_ss_code): ditto.
* simplify.c (simplify_cobound): Fix for BT_CLASS.
(simplify_bound): Return NULL for class arrays.
(simplify_cobound): Obtain correct array_spec. Use cotype as
appropriate. Use arrayspec for bounds.
2011-12-11 Paul Thomas <pault@gcc.gnu.org>
Tobias Burnus <burnus@gcc.gnu.org>
PR fortran/41539
PR fortran/43214
PR fortran/43969
PR fortran/44568
PR fortran/46356
PR fortran/46990
PR fortran/49074
* gfortran.dg/class_array_1.f03: New.
* gfortran.dg/class_array_2.f03: New.
* gfortran.dg/class_array_3.f03: New.
* gfortran.dg/class_array_4.f03: New.
* gfortran.dg/class_array_5.f03: New.
* gfortran.dg/class_array_6.f03: New.
* gfortran.dg/class_array_7.f03: New.
* gfortran.dg/class_array_8.f03: New.
* gfortran.dg/coarray_poly_1.f90: New.
* gfortran.dg/coarray_poly_2.f90: New.
* gfortran.dg/coarray/poly_run_1.f90: New.
* gfortran.dg/coarray/poly_run_2.f90: New.
* gfortran.dg/class_to_type_1.f03: New.
* gfortran.dg/type_to_class_1.f03: New.
* gfortran.dg/typebound_assignment_3.f03: Remove the error.
* gfortran.dg/auto_dealloc_2.f90: Occurences of __builtin_free
now 2.
* gfortran.dg/class_19.f03: Occurences of __builtin_free now 8.
Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r182210
2011-12-11 21:42:23 +01:00
|
|
|
if (array->ts.type == BT_CLASS)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2011-10-18 17:05:30 +02:00
|
|
|
corank = gfc_get_corank (array);
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
|
|
|
if (mpz_cmp_ui (dim->value.integer, 1) < 0
|
|
|
|
|| mpz_cmp_ui (dim->value.integer, corank) > 0)
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<dim%> argument of %qs intrinsic at %L is not a valid "
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
"codimension index", gfc_current_intrinsic, &dim->where);
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* If a DIM parameter is a constant, make sure that it is greater than
|
|
|
|
zero and less than or equal to the rank of the given array. If
|
|
|
|
allow_assumed is zero then dim must be less than the rank of the array
|
|
|
|
for assumed size arrays. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
gfc_array_ref *ar;
|
|
|
|
int rank;
|
|
|
|
|
2009-06-07 15:45:47 +02:00
|
|
|
if (dim == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2009-06-07 15:45:47 +02:00
|
|
|
|
2010-07-06 21:48:58 +02:00
|
|
|
if (dim->expr_type != EXPR_CONSTANT)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2010-07-06 21:48:58 +02:00
|
|
|
if (array->expr_type == EXPR_FUNCTION && array->value.function.isym
|
|
|
|
&& array->value.function.isym->id == GFC_ISYM_SPREAD)
|
|
|
|
rank = array->rank + 1;
|
|
|
|
else
|
|
|
|
rank = array->rank;
|
|
|
|
|
re PR fortran/48820 (TR 29113: Implement parts needed for MPI 3)
2012-07-20 Tobias Burnus <burnus@net-b.de>
PR fortran/48820
* array.c (match_array_element_spec, gfc_match_array_spec,
spec_size, gfc_array_dimen_size): Add support for
assumed-rank arrays.
* check.c (dim_rank_check): Ditto.
* class.c (gfc_add_component_ref): Ditto.
(gfc_build_class_symbol): Regard assumed-rank arrays
as having GFC_MAX_DIMENSIONS. And build extra class
container for a scalar pointer class.
* decl.c (merge_array_spec): Add assert.
* dump-parse-tree.c (show_array_spec): Add support for
assumed-rank arrays.
* expr.c (gfc_is_simply_contiguous): Ditto.
* gfortran.h (array_type): Ditto.
(gfc_array_spec, gfc_expr): Add comment to "rank" field.
* interface.c (compare_type_rank, argument_rank_mismatch,
compare_parameter, gfc_procedure_use): Ditto.
(compare_actual_formal): Fix NULL() to optional-dummy
handling for polymorphic dummies.
* module.c (mio_typespec): Add support for
assumed-rank arrays.
* resolve.c (resolve_formal_arglist, resolve_actual_arglist,
resolve_elemental_actual, resolve_global_procedure,
expression_shape, resolve_variable, update_ppc_arglist,
check_typebound_baseobject, gfc_resolve_expr,
resolve_fl_var_and_proc, gfc_resolve_finalizers,
resolve_typebound_procedure, resolve_symbol): Ditto.
(assumed_type_expr_allowed): Remove static variable.
(actual_arg, first_actual_arg): New static variables.
* simplify.c (simplify_bound, gfc_simplify_range): Add
support for assumed-rank arrays.
* trans-array.c (gfc_conv_array_parameter): Ditto.
(gfc_get_descriptor_dimension): New function, which returns
the descriptor.
(gfc_conv_descriptor_dimension): Use it.
(gfc_conv_descriptor_stride_get, gfc_conv_array_parameter):
Handle GFC_ARRAY_ASSUMED_RANK_CONT and AS_ASSUMED_RANK.
* trans-array.h (gfc_get_descriptor_dimension): New prototype.
* trans-decl. (gfc_build_dummy_array_decl,
gfc_trans_deferred_vars, add_argument_checking): Add
support for assumed-rank arrays.
* trans-expr.c (gfc_conv_expr_present, gfc_conv_variable,
gfc_conv_procedure_call): Ditto.
(get_scalar_to_descriptor_type, class_array_data_assign,
conv_scalar_to_descriptor): New static functions.
(gfc_conv_derived_to_class, gfc_conv_class_to_class): Use
them.
* trans-intrinsic.c (get_rank_from_desc): New function.
(gfc_conv_intrinsic_rank, gfc_conv_associated): Use it.
* trans-types.c (gfc_array_descriptor_base_caf,
gfc_array_descriptor_base): Make space for scalar array.
(gfc_is_nodesc_array, gfc_is_nodesc_array,
gfc_build_array_type, gfc_get_array_descriptor_base): Add
support for assumed-rank arrays.
* trans.h (gfc_array_kind): Add GFC_ARRAY_ASSUMED_RANK and
GFC_ARRAY_ASSUMED_RANK_CONT.
2012-07-20 Tobias Burnus <burnus@net-b.de>
PR fortran/48820
* gfortran.dg/assumed_type_3.f90: Update dg-error.
* gfortran.dg/assumed_rank_1.f90: New.
* gfortran.dg/assumed_rank_1_c.c: New.
* gfortran.dg/assumed_rank_2.f90: New.
* gfortran.dg/assumed_rank_4.f90: New.
* gfortran.dg/assumed_rank_5.f90: New.
* gfortran.dg/assumed_rank_6.f90: New.
* gfortran.dg/assumed_rank_7.f90: New.
* gfortran.dg/assumed_rank_8.f90: New.
* gfortran.dg/assumed_rank_8_c.c: New.
* gfortran.dg/assumed_rank_9.f90: New.
* gfortran.dg/assumed_rank_10.f90: New.
* gfortran.dg/assumed_rank_12.f90: New.
From-SVN: r189700
2012-07-20 07:56:37 +02:00
|
|
|
/* Assumed-rank array. */
|
|
|
|
if (rank == -1)
|
|
|
|
rank = GFC_MAX_DIMENSIONS;
|
|
|
|
|
2008-12-31 15:21:44 +01:00
|
|
|
if (array->expr_type == EXPR_VARIABLE)
|
|
|
|
{
|
|
|
|
ar = gfc_find_array_ref (array);
|
|
|
|
if (ar->as->type == AS_ASSUMED_SIZE
|
|
|
|
&& !allow_assumed
|
|
|
|
&& ar->type != AR_ELEMENT
|
|
|
|
&& ar->type != AR_SECTION)
|
|
|
|
rank--;
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (mpz_cmp_ui (dim->value.integer, 1) < 0
|
|
|
|
|| mpz_cmp_ui (dim->value.integer, rank) > 0)
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<dim%> argument of %qs intrinsic at %L is not a valid "
|
2004-05-13 08:41:07 +02:00
|
|
|
"dimension index", gfc_current_intrinsic, &dim->where);
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2006-02-04 23:11:57 +01:00
|
|
|
/* Compare the size of a along dimension ai with the size of b along
|
|
|
|
dimension bi, returning 0 if they are known not to be identical,
|
|
|
|
and 1 if they are identical, or if this cannot be determined. */
|
|
|
|
|
|
|
|
static int
|
|
|
|
identical_dimen_shape (gfc_expr *a, int ai, gfc_expr *b, int bi)
|
|
|
|
{
|
|
|
|
mpz_t a_size, b_size;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
gcc_assert (a->rank > ai);
|
|
|
|
gcc_assert (b->rank > bi);
|
|
|
|
|
|
|
|
ret = 1;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (gfc_array_dimen_size (a, ai, &a_size))
|
2006-02-04 23:11:57 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (gfc_array_dimen_size (b, bi, &b_size))
|
2006-02-04 23:11:57 +01:00
|
|
|
{
|
|
|
|
if (mpz_cmp (a_size, b_size) != 0)
|
|
|
|
ret = 0;
|
2012-12-20 01:15:00 +01:00
|
|
|
|
2006-02-04 23:11:57 +01:00
|
|
|
mpz_clear (b_size);
|
|
|
|
}
|
|
|
|
mpz_clear (a_size);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2010-12-24 09:42:04 +01:00
|
|
|
/* Calculate the length of a character variable, including substrings.
|
|
|
|
Strip away parentheses if necessary. Return -1 if no length could
|
|
|
|
be determined. */
|
|
|
|
|
|
|
|
static long
|
|
|
|
gfc_var_strlen (const gfc_expr *a)
|
|
|
|
{
|
|
|
|
gfc_ref *ra;
|
|
|
|
|
|
|
|
while (a->expr_type == EXPR_OP && a->value.op.op == INTRINSIC_PARENTHESES)
|
|
|
|
a = a->value.op.op1;
|
|
|
|
|
|
|
|
for (ra = a->ref; ra != NULL && ra->type != REF_SUBSTRING; ra = ra->next)
|
|
|
|
;
|
|
|
|
|
|
|
|
if (ra)
|
|
|
|
{
|
|
|
|
long start_a, end_a;
|
|
|
|
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
if (!ra->u.ss.end)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
if ((!ra->u.ss.start || ra->u.ss.start->expr_type == EXPR_CONSTANT)
|
2010-12-24 09:42:04 +01:00
|
|
|
&& ra->u.ss.end->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
start_a = ra->u.ss.start ? mpz_get_si (ra->u.ss.start->value.integer)
|
|
|
|
: 1;
|
2010-12-24 09:42:04 +01:00
|
|
|
end_a = mpz_get_si (ra->u.ss.end->value.integer);
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
return (end_a < start_a) ? 0 : end_a - start_a + 1;
|
2010-12-24 09:42:04 +01:00
|
|
|
}
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
else if (ra->u.ss.start
|
|
|
|
&& gfc_dep_compare_expr (ra->u.ss.start, ra->u.ss.end) == 0)
|
2010-12-24 09:42:04 +01:00
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (a->ts.u.cl && a->ts.u.cl->length
|
|
|
|
&& a->ts.u.cl->length->expr_type == EXPR_CONSTANT)
|
|
|
|
return mpz_get_si (a->ts.u.cl->length->value.integer);
|
|
|
|
else if (a->expr_type == EXPR_CONSTANT
|
|
|
|
&& (a->ts.u.cl == NULL || a->ts.u.cl->length == NULL))
|
|
|
|
return a->value.character.length;
|
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2007-09-21 12:44:20 +02:00
|
|
|
/* Check whether two character expressions have the same length;
|
2013-04-10 23:36:58 +02:00
|
|
|
returns true if they have or if the length cannot be determined,
|
|
|
|
otherwise return false and raise a gfc_error. */
|
2007-09-21 12:44:20 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2008-12-18 11:05:54 +01:00
|
|
|
gfc_check_same_strlen (const gfc_expr *a, const gfc_expr *b, const char *name)
|
2007-09-21 12:44:20 +02:00
|
|
|
{
|
|
|
|
long len_a, len_b;
|
|
|
|
|
2010-12-24 09:42:04 +01:00
|
|
|
len_a = gfc_var_strlen(a);
|
|
|
|
len_b = gfc_var_strlen(b);
|
2007-09-21 12:44:20 +02:00
|
|
|
|
2010-12-24 09:42:04 +01:00
|
|
|
if (len_a == -1 || len_b == -1 || len_a == len_b)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-12-24 09:42:04 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
gfc_error ("Unequal character lengths (%ld/%ld) in %s at %L",
|
|
|
|
len_a, len_b, name, &a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2010-12-24 09:42:04 +01:00
|
|
|
}
|
2007-09-21 12:44:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/***** Check functions *****/
|
|
|
|
|
|
|
|
/* Check subroutine suitable for intrinsics taking a real argument and
|
|
|
|
a kind argument for the result. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
check_a_kind (gfc_expr *a, gfc_expr *kind, bt type)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_REAL))
|
|
|
|
return false;
|
|
|
|
if (!kind_check (kind, 1, type))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Check subroutine suitable for ceiling, floor and nint. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_a_ikind (gfc_expr *a, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
return check_a_kind (a, kind, BT_INTEGER);
|
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Check subroutine suitable for aint, anint. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_a_xkind (gfc_expr *a, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
return check_a_kind (a, kind, BT_REAL);
|
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_abs (gfc_expr *a)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-08-12 23:21:08 +02:00
|
|
|
gfc_check_achar (gfc_expr *a, gfc_expr *kind)
|
2005-02-19 20:16:09 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!kind_check (kind, 1, BT_CHARACTER))
|
|
|
|
return false;
|
2005-02-19 20:16:09 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-02-19 20:16:09 +01:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_access_func (gfc_expr *name, gfc_expr *mode)
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER)
|
|
|
|
|| !scalar_check (name, 0))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mode, 1, BT_CHARACTER)
|
|
|
|
|| !scalar_check (mode, 1))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (mode, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_all_any (gfc_expr *mask, gfc_expr *dim)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!logical_array_check (mask, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, mask, 0))
|
|
|
|
return false;
|
2009-06-07 18:35:06 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_allocated (gfc_expr *array)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (array, 0, false))
|
|
|
|
return false;
|
|
|
|
if (!allocatable_check (array, 0))
|
|
|
|
return false;
|
2012-12-20 01:15:00 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Common check function where the first argument must be real or
|
|
|
|
integer and the second argument must be the same as the first. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_a_p (gfc_expr *a, gfc_expr *p)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2005-11-27 15:01:36 +01:00
|
|
|
if (a->ts.type != p->ts.type)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs and %qs arguments of %qs intrinsic at %L must "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"have the same type", gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
2007-01-07 01:28:29 +01:00
|
|
|
&p->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2005-11-27 15:01:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (a->ts.kind != p->ts.kind)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
|
|
|
|
&p->where))
|
|
|
|
return false;
|
2005-11-27 15:01:36 +01:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
gfc_check_x_yd (gfc_expr *x, gfc_expr *y)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!double_check (x, 0) || !double_check (y, 1))
|
|
|
|
return false;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
re PR fortran/32580 (iso_c_binding c_f_procpointer / procedure pointers)
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/32580
* gfortran.h (struct gfc_symbol): New member "proc_pointer".
* check.c (gfc_check_associated,gfc_check_null): Implement
procedure pointers.
* decl.c (match_procedure_decl): Ditto.
* expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto.
* interface.c (compare_actual_formal): Ditto.
* match.h: Ditto.
* match.c (gfc_match_pointer_assignment): Ditto.
* parse.c (parse_interface): Ditto.
* primary.c (gfc_match_rvalue,match_variable): Ditto.
* resolve.c (resolve_fl_procedure): Ditto.
* symbol.c (check_conflict,gfc_add_external,gfc_add_pointer,
gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto.
* trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl,
create_function_arglist): Ditto.
* trans-expr.c (gfc_conv_variable,gfc_conv_function_val,
gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto.
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32580
* gfortran.dg/c_f_pointer_tests_3.f90: Updated.
* gfortran.dg/proc_decl_1.f90: Updated.
* gfortran.dg/proc_ptr_1.f90: New.
* gfortran.dg/proc_ptr_2.f90: New.
* gfortran.dg/proc_ptr_3.f90: New.
* gfortran.dg/proc_ptr_4.f90: New.
* gfortran.dg/proc_ptr_5.f90: New.
* gfortran.dg/proc_ptr_6.f90: New.
* gfortran.dg/proc_ptr_7.f90: New.
* gfortran.dg/proc_ptr_8.f90: New.
Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
From-SVN: r137386
2008-07-02 21:53:37 +02:00
|
|
|
symbol_attribute attr1, attr2;
|
2004-05-13 08:41:07 +02:00
|
|
|
int i;
|
2013-04-10 23:36:58 +02:00
|
|
|
bool t;
|
2006-06-05 09:45:03 +02:00
|
|
|
locus *where;
|
|
|
|
|
|
|
|
where = &pointer->where;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2012-12-28 16:14:45 +01:00
|
|
|
if (pointer->expr_type == EXPR_NULL)
|
2006-06-05 09:45:03 +02:00
|
|
|
goto null_arg;
|
2012-12-28 16:14:45 +01:00
|
|
|
|
|
|
|
attr1 = gfc_expr_attr (pointer);
|
2004-05-13 08:41:07 +02:00
|
|
|
|
re PR fortran/32580 (iso_c_binding c_f_procpointer / procedure pointers)
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/32580
* gfortran.h (struct gfc_symbol): New member "proc_pointer".
* check.c (gfc_check_associated,gfc_check_null): Implement
procedure pointers.
* decl.c (match_procedure_decl): Ditto.
* expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto.
* interface.c (compare_actual_formal): Ditto.
* match.h: Ditto.
* match.c (gfc_match_pointer_assignment): Ditto.
* parse.c (parse_interface): Ditto.
* primary.c (gfc_match_rvalue,match_variable): Ditto.
* resolve.c (resolve_fl_procedure): Ditto.
* symbol.c (check_conflict,gfc_add_external,gfc_add_pointer,
gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto.
* trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl,
create_function_arglist): Ditto.
* trans-expr.c (gfc_conv_variable,gfc_conv_function_val,
gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto.
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32580
* gfortran.dg/c_f_pointer_tests_3.f90: Updated.
* gfortran.dg/proc_decl_1.f90: Updated.
* gfortran.dg/proc_ptr_1.f90: New.
* gfortran.dg/proc_ptr_2.f90: New.
* gfortran.dg/proc_ptr_3.f90: New.
* gfortran.dg/proc_ptr_4.f90: New.
* gfortran.dg/proc_ptr_5.f90: New.
* gfortran.dg/proc_ptr_6.f90: New.
* gfortran.dg/proc_ptr_7.f90: New.
* gfortran.dg/proc_ptr_8.f90: New.
Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
From-SVN: r137386
2008-07-02 21:53:37 +02:00
|
|
|
if (!attr1.pointer && !attr1.proc_pointer)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a POINTER",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
&pointer->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2011-05-27 23:29:19 +02:00
|
|
|
/* F2008, C1242. */
|
|
|
|
if (attr1.pointer && gfc_is_coindexed (pointer))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be "
|
2012-02-17 11:51:10 +01:00
|
|
|
"coindexed", gfc_current_intrinsic_arg[0]->name,
|
2011-05-27 23:29:19 +02:00
|
|
|
gfc_current_intrinsic, &pointer->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-05-27 23:29:19 +02:00
|
|
|
}
|
|
|
|
|
2005-12-08 17:56:10 +01:00
|
|
|
/* Target argument is optional. */
|
2004-05-13 08:41:07 +02:00
|
|
|
if (target == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2006-06-05 09:45:03 +02:00
|
|
|
where = &target->where;
|
2004-05-13 08:41:07 +02:00
|
|
|
if (target->expr_type == EXPR_NULL)
|
2006-06-05 09:45:03 +02:00
|
|
|
goto null_arg;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-10-29 16:24:38 +01:00
|
|
|
if (target->expr_type == EXPR_VARIABLE || target->expr_type == EXPR_FUNCTION)
|
|
|
|
attr2 = gfc_expr_attr (target);
|
2005-12-08 17:56:10 +01:00
|
|
|
else
|
re PR fortran/25746 (Elemental assignment gives wrong result)
2006-05-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25746
* interface.c (gfc_extend_assign): Use new code EXEC_ASSIGN_CALL.
* gfortran.h : Put EXEC_ASSIGN_CALL in enum.
* trans-stmt.c (gfc_conv_elemental_dependencies): New function.
(gfc_trans_call): Call it. Add new boolian argument to flag
need for dependency checking. Assert intent OUT and IN for arg1
and arg2.
(gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL.
trans-stmt.h : Modify prototype of gfc_trans_call.
trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL.
st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL.
* dependency.c (gfc_check_fncall_dependency): Don't check other
against itself.
PR fortran/25090
* resolve.c : Remove resolving_index_expr.
(entry_parameter): Remove.
(gfc_resolve_expr, resolve_charlen, resolve_fl_variable): Remove
calls to entry_parameter and references to resolving_index_expr.
PR fortran/27584
* check.c (gfc_check_associated): Replace NULL assert with an
error message, since it is possible to generate bad code that
has us fall through to here..
PR fortran/19015
* iresolve.c (maxloc, minloc): If DIM is not present, pass the
rank of ARRAY as the shape of the result. Otherwise, pass the
shape of ARRAY, less the dimension DIM.
(maxval, minval): The same, when DIM is present, otherwise no
change.
2006-05-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25746
* gfortran.dg/elemental_subroutine_3.f90: New test.
PR fortran/25090
* gfortran.dg/entry_dummy_ref_1.f90: Remove.
PR fortran/27584
* gfortran.dg/associated_target_1.f90: New test.
PR fortran/19015
* gfortran.dg/maxloc_shape_1.f90: New test.
From-SVN: r113949
2006-05-21 09:35:05 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a pointer "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or target VARIABLE or FUNCTION",
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&target->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/25746 (Elemental assignment gives wrong result)
2006-05-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25746
* interface.c (gfc_extend_assign): Use new code EXEC_ASSIGN_CALL.
* gfortran.h : Put EXEC_ASSIGN_CALL in enum.
* trans-stmt.c (gfc_conv_elemental_dependencies): New function.
(gfc_trans_call): Call it. Add new boolian argument to flag
need for dependency checking. Assert intent OUT and IN for arg1
and arg2.
(gfc_trans_forall_1): Use new code EXEC_ASSIGN_CALL.
trans-stmt.h : Modify prototype of gfc_trans_call.
trans.c (gfc_trans_code): Add call for EXEC_ASSIGN_CALL.
st.c (gfc_free_statement): Free actual for EXEC_ASSIGN_CALL.
* dependency.c (gfc_check_fncall_dependency): Don't check other
against itself.
PR fortran/25090
* resolve.c : Remove resolving_index_expr.
(entry_parameter): Remove.
(gfc_resolve_expr, resolve_charlen, resolve_fl_variable): Remove
calls to entry_parameter and references to resolving_index_expr.
PR fortran/27584
* check.c (gfc_check_associated): Replace NULL assert with an
error message, since it is possible to generate bad code that
has us fall through to here..
PR fortran/19015
* iresolve.c (maxloc, minloc): If DIM is not present, pass the
rank of ARRAY as the shape of the result. Otherwise, pass the
shape of ARRAY, less the dimension DIM.
(maxval, minval): The same, when DIM is present, otherwise no
change.
2006-05-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/25746
* gfortran.dg/elemental_subroutine_3.f90: New test.
PR fortran/25090
* gfortran.dg/entry_dummy_ref_1.f90: Remove.
PR fortran/27584
* gfortran.dg/associated_target_1.f90: New test.
PR fortran/19015
* gfortran.dg/maxloc_shape_1.f90: New test.
From-SVN: r113949
2006-05-21 09:35:05 +02:00
|
|
|
}
|
2005-12-08 17:56:10 +01:00
|
|
|
|
re PR fortran/32580 (iso_c_binding c_f_procpointer / procedure pointers)
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/32580
* gfortran.h (struct gfc_symbol): New member "proc_pointer".
* check.c (gfc_check_associated,gfc_check_null): Implement
procedure pointers.
* decl.c (match_procedure_decl): Ditto.
* expr.c (gfc_check_pointer_assign,gfc_check_assign_symbol): Ditto.
* interface.c (compare_actual_formal): Ditto.
* match.h: Ditto.
* match.c (gfc_match_pointer_assignment): Ditto.
* parse.c (parse_interface): Ditto.
* primary.c (gfc_match_rvalue,match_variable): Ditto.
* resolve.c (resolve_fl_procedure): Ditto.
* symbol.c (check_conflict,gfc_add_external,gfc_add_pointer,
gfc_copy_attr,gen_fptr_param,build_formal_args): Ditto.
* trans-decl.c (get_proc_pointer_decl,gfc_get_extern_function_decl,
create_function_arglist): Ditto.
* trans-expr.c (gfc_conv_variable,gfc_conv_function_val,
gfc_conv_function_call,gfc_trans_pointer_assignment): Ditto.
2008-07-02 Janus Weil <janus@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
PR fortran/32580
* gfortran.dg/c_f_pointer_tests_3.f90: Updated.
* gfortran.dg/proc_decl_1.f90: Updated.
* gfortran.dg/proc_ptr_1.f90: New.
* gfortran.dg/proc_ptr_2.f90: New.
* gfortran.dg/proc_ptr_3.f90: New.
* gfortran.dg/proc_ptr_4.f90: New.
* gfortran.dg/proc_ptr_5.f90: New.
* gfortran.dg/proc_ptr_6.f90: New.
* gfortran.dg/proc_ptr_7.f90: New.
* gfortran.dg/proc_ptr_8.f90: New.
Co-Authored-By: Paul Thomas <pault@gcc.gnu.org>
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
From-SVN: r137386
2008-07-02 21:53:37 +02:00
|
|
|
if (attr1.pointer && !attr2.pointer && !attr2.target)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a POINTER "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or a TARGET", gfc_current_intrinsic_arg[1]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &target->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2011-05-27 23:29:19 +02:00
|
|
|
/* F2008, C1242. */
|
|
|
|
if (attr1.pointer && gfc_is_coindexed (target))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be "
|
2012-02-17 11:51:10 +01:00
|
|
|
"coindexed", gfc_current_intrinsic_arg[1]->name,
|
2011-05-27 23:29:19 +02:00
|
|
|
gfc_current_intrinsic, &target->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-05-27 23:29:19 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
t = true;
|
|
|
|
if (!same_type_check (pointer, 0, target, 1))
|
|
|
|
t = false;
|
|
|
|
if (!rank_check (target, 0, pointer->rank))
|
|
|
|
t = false;
|
2004-05-13 08:41:07 +02:00
|
|
|
if (target->rank > 0)
|
|
|
|
{
|
|
|
|
for (i = 0; i < target->rank; i++)
|
2007-01-07 01:28:29 +01:00
|
|
|
if (target->ref->u.ar.dimen_type[i] == DIMEN_VECTOR)
|
|
|
|
{
|
|
|
|
gfc_error ("Array section with a vector subscript at %L shall not "
|
2005-09-17 20:58:01 +02:00
|
|
|
"be the target of a pointer",
|
2007-01-07 01:28:29 +01:00
|
|
|
&target->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
t = false;
|
2007-01-07 01:28:29 +01:00
|
|
|
break;
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
return t;
|
2006-06-05 09:45:03 +02:00
|
|
|
|
|
|
|
null_arg:
|
|
|
|
|
|
|
|
gfc_error ("NULL pointer at %L is not permitted as actual argument "
|
2014-12-11 16:13:33 +01:00
|
|
|
"of %qs intrinsic function", where, gfc_current_intrinsic);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2006-06-05 09:45:03 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2009-07-26 19:25:56 +02:00
|
|
|
gfc_check_atan_2 (gfc_expr *y, gfc_expr *x)
|
|
|
|
{
|
2011-10-28 17:15:25 +02:00
|
|
|
/* gfc_notify_std would be a waste of time as the return value
|
2009-07-26 19:25:56 +02:00
|
|
|
is seemingly used only for the generic resolution. The error
|
|
|
|
will be: Too many arguments. */
|
|
|
|
if ((gfc_option.allow_std & GFC_STD_F2008) == 0)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-07-26 19:25:56 +02:00
|
|
|
|
|
|
|
return gfc_check_atan2 (y, x);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_atan2 (gfc_expr *y, gfc_expr *x)
|
2004-08-26 19:11:27 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (y, 0, BT_REAL))
|
|
|
|
return false;
|
|
|
|
if (!same_type_check (y, 0, x, 1))
|
|
|
|
return false;
|
2004-08-26 19:11:27 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-08-26 19:11:27 +02:00
|
|
|
}
|
|
|
|
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
gfc_check_atomic (gfc_expr *atom, int atom_no, gfc_expr *value, int val_no,
|
|
|
|
gfc_expr *stat, int stat_no)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
{
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
if (!scalar_check (atom, atom_no) || !scalar_check (value, val_no))
|
|
|
|
return false;
|
check.c (gfc_check_atomic, [...]): Use argument for GFC_ISYM_CAF_GET.
gcc/fortran/
2014-06-17 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic, gfc_check_atomic_def):
Use argument for GFC_ISYM_CAF_GET.
* resolve.c (resolve_variable): Enable CAF_GET insertion.
(resolve_lock_unlock): Remove GFC_ISYM_CAF_GET.
(resolve_ordinary_assign): Enable CAF_SEND insertion.
* trans-const.c (gfc_build_string_const,
gfc_build_wide_string_const): Set TYPE_STRING_FLAG.
* trans-decl.c (gfor_fndecl_caf_get, gfor_fndecl_caf_send,
gfor_fndecl_caf_sendget): New global variables.
(gfc_build_builtin_function_decls): Initialize them;
update co_min/max/sum initialization.
* trans-expr.c (gfc_get_tree_for_caf_expr): Renamed from
get_tree_for_caf_expr and removed static.
(gfc_conv_procedure_call): Update call.
* trans-intrinsic.c (caf_get_image_index,
conv_caf_vector_subscript_elem, conv_caf_vector_subscript,
get_caf_token_offset, gfc_conv_intrinsic_caf_get,
conv_caf_send): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine,
gfc_walk_intrinsic_function): Handle CAF_GET and CAF_SEND.
(conv_co_minmaxsum): Update call for remove unused vector
subscript.
(conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref):
Skip a CAF_GET of the argument.
* trans-types.c (gfc_get_caf_vector_type): New.
* trans-types.h (gfc_get_caf_vector_type): New.
* trans.h (gfor_fndecl_caf_get, gfor_fndecl_caf_send,
gfor_fndecl_caf_sendget): New global variables.
(gfc_get_tree_for_caf_expr): New prototypes.
libgfortran/
2014-06-17 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (gfc_descriptor_t): New typedef.
(caf_vector_t): Update.
(_gfortran_caf_co_sum, _gfortran_caf_co_max, _gfortran_caf_co_min):
Remove vector-subscript argument.
(_gfortran_caf_co_send, _gfortran_caf_co_get,
_gfortran_caf_co_sendget): New.
* caf/single.c (_gfortran_caf_co_sum, _gfortran_caf_co_max,
_gfortran_caf_co_min): Remove vector-subscript argument.
(_gfortran_caf_co_send, _gfortran_caf_co_get,
_gfortran_caf_co_sendget): New.
gcc/testsuite/
2014-06-17 Tobias Burnus <burnus@net-b.de>
Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>
* gfortran.dg/coarray/send_array.f90: New.
* gfortran.dg/coarray/get_array.f90: New.
* gfortran.dg/coarray/sendget_array.f90: New.
* gfortran.dg/coarray/collectives_1.f90: Correct subroutine
names.
* gfortran.dg/coarray/collectives_2.f90: New.
Co-Authored-By: Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>
From-SVN: r211748
2014-06-17 22:54:14 +02:00
|
|
|
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
if (!(atom->ts.type == BT_INTEGER && atom->ts.kind == gfc_atomic_int_kind)
|
|
|
|
&& !(atom->ts.type == BT_LOGICAL
|
|
|
|
&& atom->ts.kind == gfc_atomic_logical_kind))
|
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument at %L to intrinsic function %s shall be an "
|
|
|
|
"integer of ATOMIC_INT_KIND or a logical of "
|
|
|
|
"ATOMIC_LOGICAL_KIND", &atom->where, gfc_current_intrinsic);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
2015-03-02 19:56:51 +01:00
|
|
|
if (!gfc_is_coarray (atom) && !gfc_is_coindexed (atom))
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument at %L of the %s intrinsic function shall be a "
|
|
|
|
"coarray or coindexed", &atom->where, gfc_current_intrinsic);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (atom->ts.type != value->ts.type)
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall have the same "
|
|
|
|
"type as %qs at %L", gfc_current_intrinsic_arg[val_no]->name,
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
gfc_current_intrinsic, &value->where,
|
|
|
|
gfc_current_intrinsic_arg[atom_no]->name, &atom->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
if (stat != NULL)
|
|
|
|
{
|
|
|
|
if (!type_check (stat, stat_no, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (stat, stat_no))
|
|
|
|
return false;
|
|
|
|
if (!variable_check (stat, stat_no, false))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (stat, stat_no, gfc_default_integer_kind))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_notify_std (GFC_STD_F2008_TS, "STAT= argument to %s at %L",
|
|
|
|
gfc_current_intrinsic, &stat->where))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
gfc_check_atomic_def (gfc_expr *atom, gfc_expr *value, gfc_expr *stat)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
{
|
check.c (gfc_check_atomic, [...]): Use argument for GFC_ISYM_CAF_GET.
gcc/fortran/
2014-06-17 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic, gfc_check_atomic_def):
Use argument for GFC_ISYM_CAF_GET.
* resolve.c (resolve_variable): Enable CAF_GET insertion.
(resolve_lock_unlock): Remove GFC_ISYM_CAF_GET.
(resolve_ordinary_assign): Enable CAF_SEND insertion.
* trans-const.c (gfc_build_string_const,
gfc_build_wide_string_const): Set TYPE_STRING_FLAG.
* trans-decl.c (gfor_fndecl_caf_get, gfor_fndecl_caf_send,
gfor_fndecl_caf_sendget): New global variables.
(gfc_build_builtin_function_decls): Initialize them;
update co_min/max/sum initialization.
* trans-expr.c (gfc_get_tree_for_caf_expr): Renamed from
get_tree_for_caf_expr and removed static.
(gfc_conv_procedure_call): Update call.
* trans-intrinsic.c (caf_get_image_index,
conv_caf_vector_subscript_elem, conv_caf_vector_subscript,
get_caf_token_offset, gfc_conv_intrinsic_caf_get,
conv_caf_send): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine,
gfc_walk_intrinsic_function): Handle CAF_GET and CAF_SEND.
(conv_co_minmaxsum): Update call for remove unused vector
subscript.
(conv_intrinsic_atomic_def, conv_intrinsic_atomic_ref):
Skip a CAF_GET of the argument.
* trans-types.c (gfc_get_caf_vector_type): New.
* trans-types.h (gfc_get_caf_vector_type): New.
* trans.h (gfor_fndecl_caf_get, gfor_fndecl_caf_send,
gfor_fndecl_caf_sendget): New global variables.
(gfc_get_tree_for_caf_expr): New prototypes.
libgfortran/
2014-06-17 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (gfc_descriptor_t): New typedef.
(caf_vector_t): Update.
(_gfortran_caf_co_sum, _gfortran_caf_co_max, _gfortran_caf_co_min):
Remove vector-subscript argument.
(_gfortran_caf_co_send, _gfortran_caf_co_get,
_gfortran_caf_co_sendget): New.
* caf/single.c (_gfortran_caf_co_sum, _gfortran_caf_co_max,
_gfortran_caf_co_min): Remove vector-subscript argument.
(_gfortran_caf_co_send, _gfortran_caf_co_get,
_gfortran_caf_co_sendget): New.
gcc/testsuite/
2014-06-17 Tobias Burnus <burnus@net-b.de>
Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>
* gfortran.dg/coarray/send_array.f90: New.
* gfortran.dg/coarray/get_array.f90: New.
* gfortran.dg/coarray/sendget_array.f90: New.
* gfortran.dg/coarray/collectives_1.f90: Correct subroutine
names.
* gfortran.dg/coarray/collectives_2.f90: New.
Co-Authored-By: Alessandro Fanfarillo <alessandro.fanfarillo@gmail.com>
From-SVN: r211748
2014-06-17 22:54:14 +02:00
|
|
|
if (atom->expr_type == EXPR_FUNCTION
|
|
|
|
&& atom->value.function.isym
|
|
|
|
&& atom->value.function.isym->id == GFC_ISYM_CAF_GET)
|
|
|
|
atom = atom->value.function.actual->expr;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_check_vardef_context (atom, false, false, false, NULL))
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument of the %s intrinsic function at %L shall be "
|
|
|
|
"definable", gfc_current_intrinsic, &atom->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
return gfc_check_atomic (atom, 0, value, 1, stat, 2);
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
gfc_check_atomic_op (gfc_expr *atom, gfc_expr *value, gfc_expr *stat)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
{
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
if (atom->ts.type != BT_INTEGER || atom->ts.kind != gfc_atomic_int_kind)
|
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument at %L to intrinsic function %s shall be an "
|
|
|
|
"integer of ATOMIC_INT_KIND", &atom->where,
|
|
|
|
gfc_current_intrinsic);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gfc_check_atomic_def (atom, value, stat);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
gfc_check_atomic_ref (gfc_expr *value, gfc_expr *atom, gfc_expr *stat)
|
|
|
|
{
|
|
|
|
if (atom->expr_type == EXPR_FUNCTION
|
|
|
|
&& atom->value.function.isym
|
|
|
|
&& atom->value.function.isym->id == GFC_ISYM_CAF_GET)
|
|
|
|
atom = atom->value.function.actual->expr;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_check_vardef_context (value, false, false, false, NULL))
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
{
|
|
|
|
gfc_error ("VALUE argument of the %s intrinsic function at %L shall be "
|
|
|
|
"definable", gfc_current_intrinsic, &value->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
return gfc_check_atomic (atom, 1, value, 0, stat, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
gfc_check_atomic_cas (gfc_expr *atom, gfc_expr *old, gfc_expr *compare,
|
|
|
|
gfc_expr *new_val, gfc_expr *stat)
|
|
|
|
{
|
|
|
|
if (atom->expr_type == EXPR_FUNCTION
|
|
|
|
&& atom->value.function.isym
|
|
|
|
&& atom->value.function.isym->id == GFC_ISYM_CAF_GET)
|
|
|
|
atom = atom->value.function.actual->expr;
|
|
|
|
|
|
|
|
if (!gfc_check_atomic (atom, 0, new_val, 3, stat, 4))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!scalar_check (old, 1) || !scalar_check (compare, 2))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!same_type_check (atom, 0, old, 1))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!same_type_check (atom, 0, compare, 2))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_check_vardef_context (atom, false, false, false, NULL))
|
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument of the %s intrinsic function at %L shall be "
|
|
|
|
"definable", gfc_current_intrinsic, &atom->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gfc_check_vardef_context (old, false, false, false, NULL))
|
|
|
|
{
|
|
|
|
gfc_error ("OLD argument of the %s intrinsic function at %L shall be "
|
|
|
|
"definable", gfc_current_intrinsic, &old->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
check.c (gfc_check_event_query): New function.
2015-12-02 Tobias Burnus <burnus@net-b.de>
Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
* check.c (gfc_check_event_query): New function.
* dump-parse-tree.c (show_code_node): Handle EXEC_EVENT_POST,
EXEC_EVENT_WAIT.
* expr.c (gfc_check_vardef_context): New check for event variables
definition.
* gfortran.h (gfc_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
(gfc_isym_id): GFC_ISYM_EVENT_QUERY.
(struct symbol_attribute): New field.
(gfc_exec_op): Add EXEC_EVENT_POST and EXEC_EVENT_WAIT.
* gfortran.texi: Document about new events functions and minor
changes.
* interface.c (compare_parameter): New check.
(gfc_procedure_use): New check for explicit procedure interface.
(add_subroutines): Add event_query.
* intrinsic.h (gfc_check_event_query,gfc_resolve_event_query):
New prototypes.
* iresolve.c (gfc_resolve_event_query): New function.
* iso-fortran-env.def (event_type): New type.
* match.c (event_statement,gfc_match_event_post,gfc_match_event_wait):
New functions.
(gfc_match_name): New event post and event wait.
* match.h (gfc_match_event_post,gfc_match_event_wait):
New prototypes.
* module.c (ab_attribute): Add AB_EVENT_COMP.
(attr_bits): Likewise.
(mio_symbol_attribute): Handle event_comp attribute.
* parse.c (decode_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
(next_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
(gfc_ascii_statement): Add ST_EVENT_POST, ST_EVENT_WAIT.
(parse_derived): Check for event_type components.
* resolve.c (resolve_allocate_expr): Check for event variable def.
(resolve_lock_unlock): Renamed to resolve_lock_unlock_event. It
includes logic for locks and events.
(gfc_resolve_code): Call it.
(gfc_resolve_symbol): New check for event variable to be a corray.
* st.c (gfc_free_statement): Handle new EXEC_EVENT_POST and
EXEC_EVENT_WAIT.
* trans-decl.c (gfor_fndecl_caf_event_post,gfor_fndecl_caf_event_wait,
gfor_fndecl_caf_event_query): New global variables.
(generate_coarray_sym_init): Checking for event_type.
(gfc_conv_procedure_call): Check for C bind attribute.
* trans-intrinsic.c (conv_intrinsic_event_query): New function.
(conv_intrinsic_move_alloc): Call it.
* trans-stmt.c (gfc_trans_lock_unlock): Passing address
of actual argument.
(gfc_trans_sync): Likewise.
(gfc_trans_event_post_wait): New function.
* trans-stmt.h (gfc_trans_event_post_wait): New prototype.
* trans-types.c (gfc_get_derived_type): Integer_kind as event_type.
* trans.c (gfc_allocate_using_lib): New argument and logic for events.
(gfc_allocate_allocatable): Passing new argument.
(trans_code): Handle EXEC_EVENT_POST, EXEC_EVENT_WAIT.
* trans.h (gfc_coarray_type): New elements.
(gfor_fndecl_caf_event_post,gfor_fndecl_caf_event_wait,
gfor_fndecl_caf_event_query): Declare them.
2015-12-02 Tobias Burnus <burnus@net-b.de>
Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
* gfortran.dg/coarray/event_1.f90: New.
* gfortran.dg/coarray/event_2.f90: New.
Co-Authored-By: Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
From-SVN: r231208
2015-12-02 22:59:05 +01:00
|
|
|
bool
|
|
|
|
gfc_check_event_query (gfc_expr *event, gfc_expr *count, gfc_expr *stat)
|
|
|
|
{
|
|
|
|
if (event->ts.type != BT_DERIVED
|
|
|
|
|| event->ts.u.derived->from_intmod != INTMOD_ISO_FORTRAN_ENV
|
|
|
|
|| event->ts.u.derived->intmod_sym_id != ISOFORTRAN_EVENT_TYPE)
|
|
|
|
{
|
|
|
|
gfc_error ("EVENT argument at %L to the intrinsic EVENT_QUERY "
|
|
|
|
"shall be of type EVENT_TYPE", &event->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!scalar_check (event, 0))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_check_vardef_context (count, false, false, false, NULL))
|
|
|
|
{
|
|
|
|
gfc_error ("COUNT argument of the EVENT_QUERY intrinsic function at %L "
|
|
|
|
"shall be definable", &count->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!type_check (count, 1, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
int i = gfc_validate_kind (BT_INTEGER, count->ts.kind, false);
|
|
|
|
int j = gfc_validate_kind (BT_INTEGER, gfc_default_integer_kind, false);
|
|
|
|
|
|
|
|
if (gfc_integer_kinds[i].range < gfc_integer_kinds[j].range)
|
|
|
|
{
|
|
|
|
gfc_error ("COUNT argument of the EVENT_QUERY intrinsic function at %L "
|
|
|
|
"shall have at least the range of the default integer",
|
|
|
|
&count->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (stat != NULL)
|
|
|
|
{
|
|
|
|
if (!type_check (stat, 2, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (stat, 2))
|
|
|
|
return false;
|
|
|
|
if (!variable_check (stat, 2, false))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_notify_std (GFC_STD_F2008_TS, "STAT= argument to %s at %L",
|
|
|
|
gfc_current_intrinsic, &stat->where))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
check.c (gfc_check_atomic): Update for STAT=.
gcc/fortran/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* check.c (gfc_check_atomic): Update for STAT=.
(gfc_check_atomic_def, gfc_check_atomic_ref): Update call.
(gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New.
* gfortran.h (gfc_isym_id): GFC_ISYM_ATOMIC_CAS,
* GFC_ISYM_ATOMIC_ADD,
GFC_ISYM_ATOMIC_AND, GFC_ISYM_ATOMIC_OR, GFC_ISYM_ATOMIC_XOR,
GFC_ISYM_ATOMIC_FETCH_ADD, GFC_ISYM_ATOMIC_FETCH_AND,
GFC_ISYM_ATOMIC_FETCH_OR and GFC_ISYM_ATOMIC_FETCH_XOR.
* intrinsic.c (add_subroutines): Handle them.
* intrinsic.texi: Add documentation for them.
(ATOMIC_REF, ATOMIC_DEFINE): Add STAT=.
(ISO_FORTRAN_ENV): Add STAT_FAILED_IMAGE.
* intrinsic.h (gfc_check_atomic_op, gfc_check_atomic_cas,
gfc_check_atomic_fetch_op): New
prototypes.
* libgfortran.h (libgfortran_stat_codes): Add
* GFC_STAT_FAILED_IMAGE.
* iso-fortran-env.def: Add it.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Renamed from
conv_intrinsic_atomic_ref; handle more atomics.
(conv_intrinsic_atomic_def): Handle STAT=.
(conv_intrinsic_atomic_cas): New.
(gfc_conv_intrinsic_subroutine): Handle new atomics.
gcc/testsuite/
2014-07-12 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_atomic_1.f90: Update dg-error.
* gfortran.dg/coarray_atomic_2.f90: New.
* gfortran.dg/coarray_atomic_3.f90: New.
* gfortran.dg/coarray_atomic_4.f90: New.
* gfortran.dg/coarray/atomic_2.f90: New.
From-SVN: r212483
2014-07-12 21:00:47 +02:00
|
|
|
|
|
|
|
bool
|
|
|
|
gfc_check_atomic_fetch_op (gfc_expr *atom, gfc_expr *value, gfc_expr *old,
|
|
|
|
gfc_expr *stat)
|
|
|
|
{
|
|
|
|
if (atom->expr_type == EXPR_FUNCTION
|
|
|
|
&& atom->value.function.isym
|
|
|
|
&& atom->value.function.isym->id == GFC_ISYM_CAF_GET)
|
|
|
|
atom = atom->value.function.actual->expr;
|
|
|
|
|
|
|
|
if (atom->ts.type != BT_INTEGER || atom->ts.kind != gfc_atomic_int_kind)
|
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument at %L to intrinsic function %s shall be an "
|
|
|
|
"integer of ATOMIC_INT_KIND", &atom->where,
|
|
|
|
gfc_current_intrinsic);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gfc_check_atomic (atom, 0, value, 1, stat, 3))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!scalar_check (old, 2))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!same_type_check (atom, 0, old, 2))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_check_vardef_context (atom, false, false, false, NULL))
|
|
|
|
{
|
|
|
|
gfc_error ("ATOM argument of the %s intrinsic function at %L shall be "
|
|
|
|
"definable", gfc_current_intrinsic, &atom->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!gfc_check_vardef_context (old, false, false, false, NULL))
|
|
|
|
{
|
|
|
|
gfc_error ("OLD argument of the %s intrinsic function at %L shall be "
|
|
|
|
"definable", gfc_current_intrinsic, &old->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2011-05-31 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* intrinsic.c (klass): Add CLASS_ATOMIC.
(add_subroutines): Add atomic_ref/atomic_define.
* intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
* intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
and GFC_ISYM_ATOMIC_REF.
(gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
* iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref):
* New
functions.
* check.c (gfc_check_atomic, gfc_check_atomic_def,
gfc_check_atomic_ref): New functions.
* iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
* trans-intrinsic.c (conv_intrinsic_atomic_def,
conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
functions.
(conv_intrinsic_move_alloc) Renamed from
gfc_conv_intrinsic_move_alloc - and made static.
* trans.h (gfc_conv_intrinsic_move_alloc): Remove.
(gfc_conv_intrinsic_subroutine) Add prototype.
* trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
From-SVN: r174510
2011-05-31 22:04:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 17:58:16 +02:00
|
|
|
/* BESJN and BESYN functions. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_besn (gfc_expr *n, gfc_expr *x)
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 17:58:16 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (n, 0, BT_INTEGER))
|
|
|
|
return false;
|
2010-08-19 09:28:17 +02:00
|
|
|
if (n->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
gfc_extract_int (n, &i);
|
2013-04-10 23:36:58 +02:00
|
|
|
if (i < 0 && !gfc_notify_std (GFC_STD_GNU, "Negative argument "
|
|
|
|
"N at %L", &n->where))
|
|
|
|
return false;
|
2010-08-19 09:28:17 +02:00
|
|
|
}
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 17:58:16 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 1, BT_REAL))
|
|
|
|
return false;
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 17:58:16 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_besn, [...]): New functions.
2004-08-29 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_besn, gfc_check_g77_math1): New functions.
* f95-lang.c (DO_DEFINE_MATH_BUILTIN): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
(build_builtin_fntypes): New function.
(gfc_init_builtin_functions): Use it.
* gfortran.h (enum gfc_generic_isym_id): Add GFC_ISYM_{J,Y}{0,1,N}
and GFC_ISYM_ERF{,C}.
(gfc_c_int_kind): Declare.
* intrinsic.c (add_functions): Add [d]bes* and [d]erf*.
* intrinsic.h (gfc_check_besn, gfc_check_g77_math1, gfc_resolve_besn,
gfc_resolve_g77_math1): Add prototypes.
* resolve.c (gfc_resolve_besn, gfc_resolve_g77_math1): New functions.
* mathbuiltins.def: Add comment. Change third argument. Use
DEFINE_MATH_BUILTIN_C. Add bessel and error functions.
* trans-intrinsic.c (BUILT_IN_FUNCTION): Define.
(DEFINE_MATH_BUILTIN, DEFINE_MATH_BUILTIN_C): Use it.
* trans-types.c (gfc_c_int_kind): Declare.
(gfc_init_kinds): Set it.
testsuite/
* gfortran.dg/g77/README: Update.
* gfortran.dg/g77/erfc.f: Copy from g77.f-torture.
* gfortran.dg/g77/intrinsic-unix-bessel.f: Ditto.
* gfortran.dg/g77/intrinsic-unix-erf.f: Ditto.
libgfortran/
* intrinsics/bessel.c: New file.
* intrinsics/erf.c: New file.
* Makefie.am: Add intrinsics/bessel.c and intrinsics/erf.c.
* configure.ac: Test for C99 Bessel and Error functions.
* Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r86727
2004-08-29 17:58:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-19 09:28:17 +02:00
|
|
|
/* Transformational version of the Bessel JN and YN functions. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2010-08-19 09:28:17 +02:00
|
|
|
gfc_check_bessel_n2 (gfc_expr *n1, gfc_expr *n2, gfc_expr *x)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (n1, 0, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (n1, 0))
|
|
|
|
return false;
|
|
|
|
if (!nonnegative_check ("N1", n1))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!type_check (n2, 1, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (n2, 1))
|
|
|
|
return false;
|
|
|
|
if (!nonnegative_check ("N2", n2))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!type_check (x, 2, BT_REAL))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (x, 2))
|
|
|
|
return false;
|
2010-08-19 09:28:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-08-19 09:28:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
gfc_check_bge_bgt_ble_blt (gfc_expr *i, gfc_expr *j)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (j, 1, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2010-06-09 18:24:59 +02:00
|
|
|
gfc_check_bitfcn (gfc_expr *i, gfc_expr *pos)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (pos, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("pos", pos))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize1 ("i", i, "pos", pos, false))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_char (gfc_expr *i, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!kind_check (kind, 1, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_chdir (gfc_expr *dir)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (dir, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (dir, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_chdir_sub (gfc_expr *dir, gfc_expr *status)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (dir, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (dir, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 1, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (status, 1))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_chmod (gfc_expr *name, gfc_expr *mode)
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mode, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (mode, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_chmod_sub (gfc_expr *name, gfc_expr *mode, gfc_expr *status)
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mode, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (mode, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (y != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (y, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (x->ts.type == BT_COMPLEX)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must not be "
|
2014-12-13 00:12:06 +01:00
|
|
|
"present if %<x%> is COMPLEX",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&y->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2009-07-19 17:37:50 +02:00
|
|
|
|
|
|
|
if (y->ts.type == BT_COMPLEX)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must have a type "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"of either REAL or INTEGER",
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&y->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-07-19 17:37:50 +02:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 2, BT_COMPLEX))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
2014-11-25 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
(gfc_error_now_1): Renamed from gfc_error_now.
(gfc_error_now): Renamed from gfc_error_now_2.
(gfc_warning_now_1): Renamed from gfc_warning_now.
(gfc_warning_now): Renamed from gfc_warning_now_2.
* error.c (gfc_error_now_1): Renamed from gfc_error_now.
(gfc_error_now): Renamed from gfc_error_now_2.
(gfc_warning_now_1): Renamed from gfc_warning_now.
(gfc_warning_now): Renamed from gfc_warning_now_2.
(gfc_get_errors): Include common diagnostic in count.
* lang.opt (Wc-binding-type, Wconversion, Wconversion-extra,
Wintrinsics-std): Create a Var for those warnings.
* check.c (gfc_check_cmplx): Pass warning flag to
diagnostic function.
* decl.c (get_proc_name, gfc_verify_c_interop_param, build_sym
gfc_set_constant_character_len, verify_bind_c_sym): Ditto; use
_1 for old diagnostic, remove _2 for new diagnostic.
* expr.c (gfc_check_assign, gfc_check_vardef_context): Ditto.
* frontend-passes.c (doloop_code, do_function): Ditto.
* intrinsic.c (gfc_is_intrinsic, gfc_convert_type_warn): Ditto.
* match.c (gfc_match_common): Ditto.
* module.c (use_iso_fortran_env_module, gfc_use_module): Ditto.
* parse.c (decode_statement, decode_gcc_attribute, next_free,
next_fixed, gfc_check_do_variable): Ditto.
* resolve.c (resolve_common_vars, resolve_ordinary_assign):
Ditto.
* scanner.c (add_path_to_list, skip_free_comments,
gfc_next_char_literal, gfc_gobble_whitespace, load_line,
preprocessor_line, load_file): Ditto.
* symbol.c (gfc_set_default_type, verify_bind_c_derived_type):
Ditto.
* options.c (gfc_post_options): Ditto.
(gfc_init_options, set_Wall, gfc_handle_option): Ditto; remove
flags which now have a Var.
* invoke.texi (Wconversion-extra): Make clear that the flag
does not imply -Wconversion.
gcc/testsuite/
* gfortran.dg/empty_label.f: Change test to continue testing
for -fmax-errors=1.
* gfortran.dg/empty_label.f90: Ditto.
* gfortran.dg/warnings_are_errors_1.f90: Update dg-*.
From-SVN: r218067
2014-11-25 23:33:32 +01:00
|
|
|
if (!kind && warn_conversion
|
2012-08-14 12:22:06 +02:00
|
|
|
&& x->ts.type == BT_REAL && x->ts.kind > gfc_default_real_kind)
|
gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
2014-11-25 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
(gfc_error_now_1): Renamed from gfc_error_now.
(gfc_error_now): Renamed from gfc_error_now_2.
(gfc_warning_now_1): Renamed from gfc_warning_now.
(gfc_warning_now): Renamed from gfc_warning_now_2.
* error.c (gfc_error_now_1): Renamed from gfc_error_now.
(gfc_error_now): Renamed from gfc_error_now_2.
(gfc_warning_now_1): Renamed from gfc_warning_now.
(gfc_warning_now): Renamed from gfc_warning_now_2.
(gfc_get_errors): Include common diagnostic in count.
* lang.opt (Wc-binding-type, Wconversion, Wconversion-extra,
Wintrinsics-std): Create a Var for those warnings.
* check.c (gfc_check_cmplx): Pass warning flag to
diagnostic function.
* decl.c (get_proc_name, gfc_verify_c_interop_param, build_sym
gfc_set_constant_character_len, verify_bind_c_sym): Ditto; use
_1 for old diagnostic, remove _2 for new diagnostic.
* expr.c (gfc_check_assign, gfc_check_vardef_context): Ditto.
* frontend-passes.c (doloop_code, do_function): Ditto.
* intrinsic.c (gfc_is_intrinsic, gfc_convert_type_warn): Ditto.
* match.c (gfc_match_common): Ditto.
* module.c (use_iso_fortran_env_module, gfc_use_module): Ditto.
* parse.c (decode_statement, decode_gcc_attribute, next_free,
next_fixed, gfc_check_do_variable): Ditto.
* resolve.c (resolve_common_vars, resolve_ordinary_assign):
Ditto.
* scanner.c (add_path_to_list, skip_free_comments,
gfc_next_char_literal, gfc_gobble_whitespace, load_line,
preprocessor_line, load_file): Ditto.
* symbol.c (gfc_set_default_type, verify_bind_c_derived_type):
Ditto.
* options.c (gfc_post_options): Ditto.
(gfc_init_options, set_Wall, gfc_handle_option): Ditto; remove
flags which now have a Var.
* invoke.texi (Wconversion-extra): Make clear that the flag
does not imply -Wconversion.
gcc/testsuite/
* gfortran.dg/empty_label.f: Change test to continue testing
for -fmax-errors=1.
* gfortran.dg/empty_label.f90: Ditto.
* gfortran.dg/warnings_are_errors_1.f90: Update dg-*.
From-SVN: r218067
2014-11-25 23:33:32 +01:00
|
|
|
gfc_warning_now (OPT_Wconversion, "Conversion from %s to default-kind "
|
|
|
|
"COMPLEX(%d) at %L might lose precision, consider using "
|
|
|
|
"the KIND argument", gfc_typename (&x->ts),
|
|
|
|
gfc_default_real_kind, &x->where);
|
|
|
|
else if (y && !kind && warn_conversion
|
2012-08-14 12:22:06 +02:00
|
|
|
&& y->ts.type == BT_REAL && y->ts.kind > gfc_default_real_kind)
|
gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
2014-11-25 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* gfortran.h (gfc_option_t): Remove flags moved as Var to .opt.
(gfc_error_now_1): Renamed from gfc_error_now.
(gfc_error_now): Renamed from gfc_error_now_2.
(gfc_warning_now_1): Renamed from gfc_warning_now.
(gfc_warning_now): Renamed from gfc_warning_now_2.
* error.c (gfc_error_now_1): Renamed from gfc_error_now.
(gfc_error_now): Renamed from gfc_error_now_2.
(gfc_warning_now_1): Renamed from gfc_warning_now.
(gfc_warning_now): Renamed from gfc_warning_now_2.
(gfc_get_errors): Include common diagnostic in count.
* lang.opt (Wc-binding-type, Wconversion, Wconversion-extra,
Wintrinsics-std): Create a Var for those warnings.
* check.c (gfc_check_cmplx): Pass warning flag to
diagnostic function.
* decl.c (get_proc_name, gfc_verify_c_interop_param, build_sym
gfc_set_constant_character_len, verify_bind_c_sym): Ditto; use
_1 for old diagnostic, remove _2 for new diagnostic.
* expr.c (gfc_check_assign, gfc_check_vardef_context): Ditto.
* frontend-passes.c (doloop_code, do_function): Ditto.
* intrinsic.c (gfc_is_intrinsic, gfc_convert_type_warn): Ditto.
* match.c (gfc_match_common): Ditto.
* module.c (use_iso_fortran_env_module, gfc_use_module): Ditto.
* parse.c (decode_statement, decode_gcc_attribute, next_free,
next_fixed, gfc_check_do_variable): Ditto.
* resolve.c (resolve_common_vars, resolve_ordinary_assign):
Ditto.
* scanner.c (add_path_to_list, skip_free_comments,
gfc_next_char_literal, gfc_gobble_whitespace, load_line,
preprocessor_line, load_file): Ditto.
* symbol.c (gfc_set_default_type, verify_bind_c_derived_type):
Ditto.
* options.c (gfc_post_options): Ditto.
(gfc_init_options, set_Wall, gfc_handle_option): Ditto; remove
flags which now have a Var.
* invoke.texi (Wconversion-extra): Make clear that the flag
does not imply -Wconversion.
gcc/testsuite/
* gfortran.dg/empty_label.f: Change test to continue testing
for -fmax-errors=1.
* gfortran.dg/empty_label.f90: Ditto.
* gfortran.dg/warnings_are_errors_1.f90: Update dg-*.
From-SVN: r218067
2014-11-25 23:33:32 +01:00
|
|
|
gfc_warning_now (OPT_Wconversion, "Conversion from %s to default-kind "
|
|
|
|
"COMPLEX(%d) at %L might lose precision, consider using "
|
|
|
|
"the KIND argument", gfc_typename (&y->ts),
|
|
|
|
gfc_default_real_kind, &y->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
static bool
|
2014-09-25 08:07:15 +02:00
|
|
|
check_co_collective (gfc_expr *a, gfc_expr *image_idx, gfc_expr *stat,
|
|
|
|
gfc_expr *errmsg, bool co_reduce)
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
{
|
|
|
|
if (!variable_check (a, 0, false))
|
|
|
|
return false;
|
|
|
|
|
2014-06-25 22:26:42 +02:00
|
|
|
if (!gfc_check_vardef_context (a, false, false, false, "argument 'A' with "
|
|
|
|
"INTENT(INOUT)"))
|
|
|
|
return false;
|
|
|
|
|
2014-09-25 08:07:15 +02:00
|
|
|
/* Fortran 2008, 12.5.2.4, paragraph 18. */
|
2014-06-25 22:26:42 +02:00
|
|
|
if (gfc_has_vector_subscript (a))
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("Argument %<A%> with INTENT(INOUT) at %L of the intrinsic "
|
2014-06-25 22:26:42 +02:00
|
|
|
"subroutine %s shall not have a vector subscript",
|
|
|
|
&a->where, gfc_current_intrinsic);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-10-24 22:52:41 +02:00
|
|
|
if (gfc_is_coindexed (a))
|
|
|
|
{
|
|
|
|
gfc_error ("The A argument at %L to the intrinsic %s shall not be "
|
|
|
|
"coindexed", &a->where, gfc_current_intrinsic);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2014-09-25 08:07:15 +02:00
|
|
|
if (image_idx != NULL)
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
{
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!type_check (image_idx, co_reduce ? 2 : 1, BT_INTEGER))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!scalar_check (image_idx, co_reduce ? 2 : 1))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (stat != NULL)
|
|
|
|
{
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!type_check (stat, co_reduce ? 3 : 2, BT_INTEGER))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!scalar_check (stat, co_reduce ? 3 : 2))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!variable_check (stat, co_reduce ? 3 : 2, false))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
|
|
|
if (stat->ts.kind != 4)
|
|
|
|
{
|
|
|
|
gfc_error ("The stat= argument at %L must be a kind=4 integer "
|
|
|
|
"variable", &stat->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (errmsg != NULL)
|
|
|
|
{
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!type_check (errmsg, co_reduce ? 4 : 3, BT_CHARACTER))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!scalar_check (errmsg, co_reduce ? 4 : 3))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
if (!variable_check (errmsg, co_reduce ? 4 : 3, false))
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
|
|
|
if (errmsg->ts.kind != 1)
|
|
|
|
{
|
|
|
|
gfc_error ("The errmsg= argument at %L must be a default-kind "
|
|
|
|
"character variable", &errmsg->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-17 07:29:30 +01:00
|
|
|
if (flag_coarray == GFC_FCOARRAY_NONE)
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
{
|
2014-11-24 08:47:46 +01:00
|
|
|
gfc_fatal_error ("Coarrays disabled at %L, use %<-fcoarray=%> to enable",
|
|
|
|
&a->where);
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-09-25 08:07:15 +02:00
|
|
|
bool
|
|
|
|
gfc_check_co_broadcast (gfc_expr *a, gfc_expr *source_image, gfc_expr *stat,
|
|
|
|
gfc_expr *errmsg)
|
|
|
|
{
|
|
|
|
if (a->ts.type == BT_CLASS || gfc_expr_attr (a).alloc_comp)
|
|
|
|
{
|
2014-10-24 22:52:41 +02:00
|
|
|
gfc_error ("Support for the A argument at %L which is polymorphic A "
|
|
|
|
"argument or has allocatable components is not yet "
|
|
|
|
"implemented", &a->where);
|
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
}
|
|
|
|
return check_co_collective (a, source_image, stat, errmsg, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
gfc_check_co_reduce (gfc_expr *a, gfc_expr *op, gfc_expr *result_image,
|
|
|
|
gfc_expr *stat, gfc_expr *errmsg)
|
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
2014-10-24 22:52:41 +02:00
|
|
|
gfc_formal_arglist *formal;
|
|
|
|
gfc_symbol *sym;
|
2014-09-25 08:07:15 +02:00
|
|
|
|
|
|
|
if (a->ts.type == BT_CLASS)
|
|
|
|
{
|
2014-10-24 22:52:41 +02:00
|
|
|
gfc_error ("The A argument at %L of CO_REDUCE shall not be polymorphic",
|
|
|
|
&a->where);
|
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gfc_expr_attr (a).alloc_comp)
|
|
|
|
{
|
2014-10-24 22:52:41 +02:00
|
|
|
gfc_error ("Support for the A argument at %L with allocatable components"
|
|
|
|
" is not yet implemented", &a->where);
|
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
}
|
|
|
|
|
2014-10-24 22:52:41 +02:00
|
|
|
if (!check_co_collective (a, result_image, stat, errmsg, true))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_resolve_expr (op))
|
|
|
|
return false;
|
|
|
|
|
2014-09-25 08:07:15 +02:00
|
|
|
attr = gfc_expr_attr (op);
|
|
|
|
if (!attr.pure || !attr.function)
|
|
|
|
{
|
2014-10-24 22:52:41 +02:00
|
|
|
gfc_error ("OPERATOR argument at %L must be a PURE function",
|
|
|
|
&op->where);
|
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
}
|
|
|
|
|
2014-10-24 22:52:41 +02:00
|
|
|
if (attr.intrinsic)
|
|
|
|
{
|
|
|
|
/* None of the intrinsics fulfills the criteria of taking two arguments,
|
|
|
|
returning the same type and kind as the arguments and being permitted
|
|
|
|
as actual argument. */
|
|
|
|
gfc_error ("Intrinsic function %s at %L is not permitted for CO_REDUCE",
|
|
|
|
op->symtree->n.sym->name, &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
2014-09-25 08:07:15 +02:00
|
|
|
|
2014-10-24 22:52:41 +02:00
|
|
|
if (gfc_is_proc_ptr_comp (op))
|
|
|
|
{
|
|
|
|
gfc_component *comp = gfc_get_proc_ptr_comp (op);
|
|
|
|
sym = comp->ts.interface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sym = op->symtree->n.sym;
|
2014-09-25 08:07:15 +02:00
|
|
|
|
2014-10-24 22:52:41 +02:00
|
|
|
formal = sym->formal;
|
|
|
|
|
|
|
|
if (!formal || !formal->next || formal->next->next)
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L shall have two "
|
|
|
|
"arguments", &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (sym->result->ts.type == BT_UNKNOWN)
|
|
|
|
gfc_set_default_type (sym->result, 0, NULL);
|
|
|
|
|
|
|
|
if (!gfc_compare_types (&a->ts, &sym->result->ts))
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("A argument at %L has type %s but the function passed as "
|
2014-10-24 22:52:41 +02:00
|
|
|
"OPERATOR at %L returns %s",
|
|
|
|
&a->where, gfc_typename (&a->ts), &op->where,
|
|
|
|
gfc_typename (&sym->result->ts));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (!gfc_compare_types (&a->ts, &formal->sym->ts)
|
|
|
|
|| !gfc_compare_types (&a->ts, &formal->next->sym->ts))
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L has arguments of type "
|
|
|
|
"%s and %s but shall have type %s", &op->where,
|
|
|
|
gfc_typename (&formal->sym->ts),
|
|
|
|
gfc_typename (&formal->next->sym->ts), gfc_typename (&a->ts));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (op->rank || attr.allocatable || attr.pointer || formal->sym->as
|
|
|
|
|| formal->next->sym->as || formal->sym->attr.allocatable
|
|
|
|
|| formal->next->sym->attr.allocatable || formal->sym->attr.pointer
|
|
|
|
|| formal->next->sym->attr.pointer)
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L shall have scalar "
|
|
|
|
"nonallocatable nonpointer arguments and return a "
|
|
|
|
"nonallocatable nonpointer scalar", &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (formal->sym->attr.value != formal->next->sym->attr.value)
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L shall have the VALUE "
|
|
|
|
"attribute either for none or both arguments", &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (formal->sym->attr.target != formal->next->sym->attr.target)
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L shall have the TARGET "
|
|
|
|
"attribute either for none or both arguments", &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (formal->sym->attr.asynchronous != formal->next->sym->attr.asynchronous)
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L shall have the "
|
|
|
|
"ASYNCHRONOUS attribute either for none or both arguments",
|
|
|
|
&op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (formal->sym->attr.optional || formal->next->sym->attr.optional)
|
|
|
|
{
|
|
|
|
gfc_error ("The function passed as OPERATOR at %L shall not have the "
|
|
|
|
"OPTIONAL attribute for either of the arguments", &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (a->ts.type == BT_CHARACTER)
|
|
|
|
{
|
|
|
|
gfc_charlen *cl;
|
|
|
|
unsigned long actual_size, formal_size1, formal_size2, result_size;
|
|
|
|
|
|
|
|
cl = a->ts.u.cl;
|
|
|
|
actual_size = cl && cl->length && cl->length->expr_type == EXPR_CONSTANT
|
|
|
|
? mpz_get_ui (cl->length->value.integer) : 0;
|
|
|
|
|
|
|
|
cl = formal->sym->ts.u.cl;
|
|
|
|
formal_size1 = cl && cl->length && cl->length->expr_type == EXPR_CONSTANT
|
|
|
|
? mpz_get_ui (cl->length->value.integer) : 0;
|
|
|
|
|
|
|
|
cl = formal->next->sym->ts.u.cl;
|
|
|
|
formal_size2 = cl && cl->length && cl->length->expr_type == EXPR_CONSTANT
|
|
|
|
? mpz_get_ui (cl->length->value.integer) : 0;
|
|
|
|
|
|
|
|
cl = sym->ts.u.cl;
|
|
|
|
result_size = cl && cl->length && cl->length->expr_type == EXPR_CONSTANT
|
|
|
|
? mpz_get_ui (cl->length->value.integer) : 0;
|
|
|
|
|
|
|
|
if (actual_size
|
|
|
|
&& ((formal_size1 && actual_size != formal_size1)
|
|
|
|
|| (formal_size2 && actual_size != formal_size2)))
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("The character length of the A argument at %L and of the "
|
|
|
|
"arguments of the OPERATOR at %L shall be the same",
|
2014-10-24 22:52:41 +02:00
|
|
|
&a->where, &op->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (actual_size && result_size && actual_size != result_size)
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("The character length of the A argument at %L and of the "
|
|
|
|
"function result of the OPERATOR at %L shall be the same",
|
|
|
|
&a->where, &op->where);
|
2014-10-24 22:52:41 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2014-09-25 08:07:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
bool
|
|
|
|
gfc_check_co_minmax (gfc_expr *a, gfc_expr *result_image, gfc_expr *stat,
|
|
|
|
gfc_expr *errmsg)
|
|
|
|
{
|
|
|
|
if (a->ts.type != BT_INTEGER && a->ts.type != BT_REAL
|
|
|
|
&& a->ts.type != BT_CHARACTER)
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall be of type "
|
|
|
|
"integer, real or character",
|
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&a->where);
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
return false;
|
|
|
|
}
|
2014-09-25 08:07:15 +02:00
|
|
|
return check_co_collective (a, result_image, stat, errmsg, false);
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
gfc_check_co_sum (gfc_expr *a, gfc_expr *result_image, gfc_expr *stat,
|
|
|
|
gfc_expr *errmsg)
|
|
|
|
{
|
|
|
|
if (!numeric_check (a, 0))
|
|
|
|
return false;
|
2014-09-25 08:07:15 +02:00
|
|
|
return check_co_collective (a, result_image, stat, errmsg, false);
|
check.c (check_co_minmaxsum, [...]): New.
gcc/fortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* check.c (check_co_minmaxsum, gfc_check_co_minmax,
gfc_check_co_sum): New.
* error.c (gfc_notify_std): Update -std=f2008ts.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_CO_MAX,
GFC_ISYM_CO_MIN, GFC_ISYM_CO_SUM.
* intrinsic.h (gfc_check_co_minmax,
gfc_check_co_sum): Declare.
* intrinsic.c (add_subroutines): Add co_min, co_max
and co_sum.
(gfc_check_intrinsic_standard): Update text for
-std=f2008ts.
* intrinsic.texi (CO_MIN, CO_MAX, CO_SUM): Document
them.
* invoke.texi (-std=f2008ts): Update wording.
* trans.h (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
* trans-decl.c (gfor_fndecl_co_max,
gfor_fndecl_co_min, gfor_fndecl_co_sum): Define.
(gfc_build_builtin_function_decls): Assign to it.
* trans-intrinsic.c (conv_co_minmaxsum): New.
(gfc_conv_intrinsic_subroutine): Call it.
libgfortran/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* caf/libcaf.h (caf_vector_t, _gfortran_caf_co_sum,
_gfortran_caf_co_min, _gfortran_caf_co_max): Declare
* caf/single.c
gcc/testsuite/
2014-05-08 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_collectives_1.f90: New.
* gfortran.dg/coarray_collectives_2.f90: New.
* gfortran.dg/coarray_collectives_3.f90: New.
* gfortran.dg/coarray_collectives_4.f90: New.
* gfortran.dg/coarray_collectives_5.f90: New.
* gfortran.dg/coarray_collectives_6.f90: New.
* gfortran.dg/coarray/collectives_1.f90: New.
* gfortran.dg/assumed_rank_5.f90: Update dg-error.
* gfortran.dg/assumed_type_4.f90: Update dg-error.
* gfortran.dg/bind_c_array_params.f03: Update dg-error.
* gfortran.dg/bind_c_usage_28.f90: Update dg-error.
* gfortran.dg/c_funloc_tests_5.f03: Update dg-error.
* gfortran.dg/c_funloc_tests_6.f90: Update dg-error.
* gfortran.dg/c_loc_tests_11.f03: Update dg-error.
From-SVN: r210223
2014-05-08 18:55:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_complex (gfc_expr *x, gfc_expr *y)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (x, 0))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (x, 0))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (y, 1))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (y, 1))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!logical_array_check (mask, 0))
|
|
|
|
return false;
|
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
|
|
|
if (!dim_rank_check (dim, mask, 0))
|
|
|
|
return false;
|
|
|
|
if (!kind_check (kind, 2, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (shift, 1, BT_INTEGER))
|
|
|
|
return false;
|
2007-12-22 18:43:54 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 2, true))
|
|
|
|
return false;
|
2009-06-07 15:45:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, array, false))
|
|
|
|
return false;
|
2009-06-07 15:45:47 +02:00
|
|
|
|
|
|
|
if (array->rank == 1 || shift->rank == 0)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (shift, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2009-06-07 15:45:47 +02:00
|
|
|
else if (shift->rank == array->rank - 1)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2009-06-07 15:45:47 +02:00
|
|
|
int d;
|
|
|
|
if (!dim)
|
|
|
|
d = 1;
|
|
|
|
else if (dim->expr_type == EXPR_CONSTANT)
|
|
|
|
gfc_extract_int (dim, &d);
|
|
|
|
else
|
|
|
|
d = -1;
|
|
|
|
|
|
|
|
if (d > 0)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
for (i = 0, j = 0; i < array->rank; i++)
|
|
|
|
if (i != d - 1)
|
|
|
|
{
|
|
|
|
if (!identical_dimen_shape (array, i, shift, j))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L has "
|
2009-06-07 15:45:47 +02:00
|
|
|
"invalid shape in dimension %d (%ld/%ld)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name,
|
2009-06-07 15:45:47 +02:00
|
|
|
gfc_current_intrinsic, &shift->where, i + 1,
|
|
|
|
mpz_get_si (array->shape[i]),
|
|
|
|
mpz_get_si (shift->shape[j]));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-07 15:45:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
j += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of intrinsic %qs at %L of must have rank "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"%d or be a scalar", gfc_current_intrinsic_arg[1]->name,
|
2009-06-07 15:45:47 +02:00
|
|
|
gfc_current_intrinsic, &shift->where, array->rank - 1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ctime (gfc_expr *time)
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (time, 0))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (time, 0, BT_INTEGER))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool gfc_check_datan2 (gfc_expr *y, gfc_expr *x)
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!double_check (y, 0) || !double_check (x, 1))
|
|
|
|
return false;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (y != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (y, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (x->ts.type == BT_COMPLEX)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must not be "
|
2014-12-13 00:12:06 +01:00
|
|
|
"present if %<x%> is COMPLEX",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&y->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2009-07-19 17:37:50 +02:00
|
|
|
|
|
|
|
if (y->ts.type == BT_COMPLEX)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must have a type "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"of either REAL or INTEGER",
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&y->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-07-19 17:37:50 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_dble (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_digits (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
switch (vector_a->ts.type)
|
|
|
|
{
|
|
|
|
case BT_LOGICAL:
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (vector_b, 1, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BT_INTEGER:
|
|
|
|
case BT_REAL:
|
|
|
|
case BT_COMPLEX:
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (vector_b, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be numeric "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or LOGICAL", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &vector_a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (vector_a, 0, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (vector_b, 1, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2006-02-04 23:11:57 +01:00
|
|
|
if (! identical_dimen_shape (vector_a, 0, vector_b, 0))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Different shape for arguments %qs and %qs at %L for "
|
2014-12-13 00:12:06 +01:00
|
|
|
"intrinsic %<dot_product%>",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, &vector_a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2006-02-04 23:11:57 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
gfc_check_dprod (gfc_expr *x, gfc_expr *y)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL)
|
|
|
|
|| !type_check (y, 1, BT_REAL))
|
|
|
|
return false;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
|
|
|
|
if (x->ts.kind != gfc_default_real_kind)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be default "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"real", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
gfc_current_intrinsic, &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (y->ts.kind != gfc_default_real_kind)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be default "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"real", gfc_current_intrinsic_arg[1]->name,
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
gfc_current_intrinsic, &y->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
gfc_check_dshift (gfc_expr *i, gfc_expr *j, gfc_expr *shift)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (j, 1, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2011-10-30 22:59:24 +01:00
|
|
|
if (i->is_boz && j->is_boz)
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("%<I%> at %L and %<J%>' at %L cannot both be BOZ literal "
|
2014-12-11 16:13:33 +01:00
|
|
|
"constants", &i->where, &j->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-10-30 22:59:24 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!i->is_boz && !j->is_boz && !same_type_check (i, 0, j, 1))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (shift, 2, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("SHIFT", shift))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2011-10-30 22:59:24 +01:00
|
|
|
if (i->is_boz)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize1 ("J", j, "SHIFT", shift, true))
|
|
|
|
return false;
|
2011-10-30 22:59:24 +01:00
|
|
|
i->ts.kind = j->ts.kind;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize1 ("I", i, "SHIFT", shift, true))
|
|
|
|
return false;
|
2011-10-30 22:59:24 +01:00
|
|
|
j->ts.kind = i->ts.kind;
|
|
|
|
}
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
|
|
|
|
gfc_expr *dim)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (shift, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 3, true))
|
|
|
|
return false;
|
2009-06-07 15:45:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, array, false))
|
|
|
|
return false;
|
2009-06-07 15:45:47 +02:00
|
|
|
|
|
|
|
if (array->rank == 1 || shift->rank == 0)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (shift, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2009-06-07 15:45:47 +02:00
|
|
|
else if (shift->rank == array->rank - 1)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2009-06-07 15:45:47 +02:00
|
|
|
int d;
|
|
|
|
if (!dim)
|
|
|
|
d = 1;
|
|
|
|
else if (dim->expr_type == EXPR_CONSTANT)
|
|
|
|
gfc_extract_int (dim, &d);
|
|
|
|
else
|
|
|
|
d = -1;
|
|
|
|
|
|
|
|
if (d > 0)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
for (i = 0, j = 0; i < array->rank; i++)
|
|
|
|
if (i != d - 1)
|
|
|
|
{
|
|
|
|
if (!identical_dimen_shape (array, i, shift, j))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L has "
|
2009-06-07 15:45:47 +02:00
|
|
|
"invalid shape in dimension %d (%ld/%ld)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name,
|
2009-06-07 15:45:47 +02:00
|
|
|
gfc_current_intrinsic, &shift->where, i + 1,
|
|
|
|
mpz_get_si (array->shape[i]),
|
|
|
|
mpz_get_si (shift->shape[j]));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-07 15:45:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
j += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of intrinsic %qs at %L of must have rank "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"%d or be a scalar", gfc_current_intrinsic_arg[1]->name,
|
2009-06-07 15:45:47 +02:00
|
|
|
gfc_current_intrinsic, &shift->where, array->rank - 1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (boundary != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (array, 0, boundary, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-06-07 15:45:47 +02:00
|
|
|
if (array->rank == 1 || boundary->rank == 0)
|
2008-07-19 19:20:26 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (boundary, 2))
|
|
|
|
return false;
|
2008-07-19 19:20:26 +02:00
|
|
|
}
|
2009-06-07 15:45:47 +02:00
|
|
|
else if (boundary->rank == array->rank - 1)
|
2008-07-19 19:20:26 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_check_conformance (shift, boundary,
|
|
|
|
"arguments '%s' and '%s' for "
|
|
|
|
"intrinsic %s",
|
|
|
|
gfc_current_intrinsic_arg[1]->name,
|
|
|
|
gfc_current_intrinsic_arg[2]->name,
|
|
|
|
gfc_current_intrinsic))
|
|
|
|
return false;
|
2008-07-19 19:20:26 +02:00
|
|
|
}
|
2009-06-07 15:45:47 +02:00
|
|
|
else
|
2008-07-19 19:20:26 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of intrinsic %qs at %L of must have "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"rank %d or be a scalar",
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&shift->where, array->rank - 1);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2008-07-19 19:20:26 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2010-05-19 13:43:53 +02:00
|
|
|
gfc_check_float (gfc_expr *a)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_INTEGER))
|
|
|
|
return false;
|
2010-05-19 13:43:53 +02:00
|
|
|
|
|
|
|
if ((a->ts.kind != gfc_default_integer_kind)
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_GNU, "non-default INTEGER "
|
|
|
|
"kind argument to %s intrinsic at %L",
|
|
|
|
gfc_current_intrinsic, &a->where))
|
|
|
|
return false;
|
2010-05-19 13:43:53 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-05-19 13:43:53 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2005-01-29 18:46:34 +01:00
|
|
|
/* A single complex argument. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fn_c (gfc_expr *a)
|
2005-01-29 18:46:34 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_COMPLEX))
|
|
|
|
return false;
|
2005-01-29 18:46:34 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-01-29 18:46:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* A single real argument. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fn_r (gfc_expr *a)
|
2005-01-29 18:46:34 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_REAL))
|
|
|
|
return false;
|
2005-01-29 18:46:34 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-01-29 18:46:34 +01:00
|
|
|
}
|
|
|
|
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
/* A single double argument. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
gfc_check_fn_d (gfc_expr *a)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!double_check (a, 0))
|
|
|
|
return false;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33162
* intrinsic.h: Add prototypes for four new functions, gfc_check_datan2,
gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd.
* intrinsic.c (add_functions): Add double precision checks for dabs,
dacos, dacosh, dasin, dasinh, datan, datanh, datan2, dbesj0, dbesj1,
dbesy0, dbesy1, dcos, dcosh, ddim, derf, derfc, dexp, dgamma,
dlgama, dlog, dlog10, dmod, dsign, dsin, dsinh, dsqrt, dtan, and dtanh.
Add real check dprod.
* check.c (gfc_check_datan2): New function to check for double precision
argumants. (gfc_check_dprod, gfc_check_fn_d, and gfc_check_x_yd): Ditto.
From-SVN: r129673
2007-10-27 02:54:20 +02:00
|
|
|
}
|
2005-01-29 18:46:34 +01:00
|
|
|
|
|
|
|
/* A single real or complex argument. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fn_rc (gfc_expr *a)
|
2005-01-29 18:46:34 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!real_or_complex_check (a, 0))
|
|
|
|
return false;
|
2005-01-29 18:46:34 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-01-29 18:46:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2009-07-11 02:03:07 +02:00
|
|
|
gfc_check_fn_rc2008 (gfc_expr *a)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!real_or_complex_check (a, 0))
|
|
|
|
return false;
|
2009-07-11 02:03:07 +02:00
|
|
|
|
|
|
|
if (a->ts.type == BT_COMPLEX
|
2014-12-13 00:12:06 +01:00
|
|
|
&& !gfc_notify_std (GFC_STD_F2008, "COMPLEX argument %qs "
|
|
|
|
"of %qs intrinsic at %L",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
2013-04-10 23:36:58 +02:00
|
|
|
gfc_current_intrinsic, &a->where))
|
|
|
|
return false;
|
2009-07-11 02:03:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2009-07-11 02:03:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fnum (gfc_expr *unit)
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_huge (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
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
2008-03-04 00:46:20 +01:00
|
|
|
gfc_check_hypot (gfc_expr *x, gfc_expr *y)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
|
|
|
if (!same_type_check (x, 0, y, 1))
|
|
|
|
return false;
|
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
2008-03-04 00:46:20 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
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
2008-03-04 00:46:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Check that the single argument is an integer. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_i (gfc_expr *i)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_iand (gfc_expr *i, gfc_expr *j)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (j, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-12-12 22:09:09 +01:00
|
|
|
if (i->ts.kind != j->ts.kind)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
|
|
|
|
&i->where))
|
|
|
|
return false;
|
2004-12-12 22:09:09 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ibits (gfc_expr *i, gfc_expr *pos, gfc_expr *len)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-12-12 22:09:09 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (pos, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-12-12 22:09:09 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (len, 2, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("pos", pos))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("len", len))
|
|
|
|
return false;
|
2004-12-12 22:09:09 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize2 ("i", i, "pos", pos, "len", len))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
|
2005-04-25 02:09:11 +02:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (c, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2005-04-25 02:09:11 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 1, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2005-10-24 00:16:38 +02:00
|
|
|
if (c->expr_type == EXPR_VARIABLE || c->expr_type == EXPR_SUBSTRING)
|
2005-04-25 02:09:11 +02:00
|
|
|
{
|
|
|
|
gfc_expr *start;
|
|
|
|
gfc_expr *end;
|
|
|
|
gfc_ref *ref;
|
|
|
|
|
|
|
|
/* Substring references don't have the charlength set. */
|
|
|
|
ref = c->ref;
|
|
|
|
while (ref && ref->type != REF_SUBSTRING)
|
|
|
|
ref = ref->next;
|
|
|
|
|
|
|
|
gcc_assert (ref == NULL || ref->type == REF_SUBSTRING);
|
|
|
|
|
|
|
|
if (!ref)
|
2005-10-24 00:16:38 +02:00
|
|
|
{
|
2007-01-07 01:28:29 +01:00
|
|
|
/* Check that the argument is length one. Non-constant lengths
|
2006-05-28 19:56:58 +02:00
|
|
|
can't be checked here, so assume they are ok. */
|
2009-08-13 21:46:46 +02:00
|
|
|
if (c->ts.u.cl && c->ts.u.cl->length)
|
2005-10-24 00:16:38 +02:00
|
|
|
{
|
|
|
|
/* If we already have a length for this expression then use it. */
|
2009-08-13 21:46:46 +02:00
|
|
|
if (c->ts.u.cl->length->expr_type != EXPR_CONSTANT)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2009-08-13 21:46:46 +02:00
|
|
|
i = mpz_get_si (c->ts.u.cl->length->value.integer);
|
2005-10-24 00:16:38 +02:00
|
|
|
}
|
2012-12-20 01:15:00 +01:00
|
|
|
else
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-10-24 00:16:38 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
start = ref->u.ss.start;
|
|
|
|
end = ref->u.ss.end;
|
2005-04-25 02:09:11 +02:00
|
|
|
|
2005-10-24 00:16:38 +02:00
|
|
|
gcc_assert (start);
|
|
|
|
if (end == NULL || end->expr_type != EXPR_CONSTANT
|
|
|
|
|| start->expr_type != EXPR_CONSTANT)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-04-25 02:09:11 +02:00
|
|
|
|
2005-10-24 00:16:38 +02:00
|
|
|
i = mpz_get_si (end->value.integer) + 1
|
2007-01-07 01:28:29 +01:00
|
|
|
- mpz_get_si (start->value.integer);
|
2005-10-24 00:16:38 +02:00
|
|
|
}
|
2005-04-25 02:09:11 +02:00
|
|
|
}
|
|
|
|
else
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-04-25 02:09:11 +02:00
|
|
|
|
|
|
|
if (i != 1)
|
|
|
|
{
|
2012-12-20 01:15:00 +01:00
|
|
|
gfc_error ("Argument of %s at %L must be of length one",
|
2005-04-25 02:09:11 +02:00
|
|
|
gfc_current_intrinsic, &c->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2005-04-25 02:09:11 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-04-25 02:09:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_idnint (gfc_expr *a)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!double_check (a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ieor (gfc_expr *i, gfc_expr *j)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (j, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-12-12 22:09:09 +01:00
|
|
|
if (i->ts.kind != j->ts.kind)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
|
|
|
|
&i->where))
|
|
|
|
return false;
|
2004-12-12 22:09:09 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_index (gfc_expr *string, gfc_expr *substring, gfc_expr *back,
|
|
|
|
gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (string, 0, BT_CHARACTER)
|
|
|
|
|| !type_check (substring, 1, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (back != NULL && !type_check (back, 2, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 3, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
if (string->ts.kind != substring->ts.kind)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be the same "
|
|
|
|
"kind as %qs", gfc_current_intrinsic_arg[1]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &substring->where,
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_int (gfc_expr *x, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (x, 0))
|
|
|
|
return false;
|
2005-02-19 21:07:47 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 1, BT_INTEGER))
|
|
|
|
return false;
|
2005-02-19 21:07:47 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_intconv (gfc_expr *x)
|
intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
* intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG,
LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
(add_subroutines): Add LSTAT intrinsic subroutine.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2,
GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK
and GFC_ISYM_MCLOCK8.
* iresolve.c (gfc_resolve_int2, gfc_resolve_int8,
gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock,
gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions.
* check.c (gfc_check_intconv): New function.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
the added GFC_ISYM_*.
* simplify.c (gfc_simplify_intconv, gfc_simplify_int2,
gfc_simplify_int8, gfc_simplify_long): New functions.
* intrinsic.h (gfc_check_intconv, gfc_simplify_int2,
gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2,
gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat,
gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub):
Add prototypes.
* gfortran.dg/mclock.f90: New test.
* gfortran.dg/int_conv_1.f90: New test.
* gfortran.dg/stat_1.f90: New test.
* gfortran.dg/stat_2.f90: New test.
* configure.ac: Check for function clock.
* Makefile.am: Compile new file intrinsics/clock.c.
* intrinsics/clock.c: New file.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.h.in: Regenerate.
* intrinsics/stat.c: Rename the old stat_i?_sub functions to
helper functions stat_i?_sub_0, and use them for both STAT and
LSTAT.
From-SVN: r115754
2006-07-26 13:58:48 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (x, 0))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
* intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG,
LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
(add_subroutines): Add LSTAT intrinsic subroutine.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2,
GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK
and GFC_ISYM_MCLOCK8.
* iresolve.c (gfc_resolve_int2, gfc_resolve_int8,
gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock,
gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions.
* check.c (gfc_check_intconv): New function.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
the added GFC_ISYM_*.
* simplify.c (gfc_simplify_intconv, gfc_simplify_int2,
gfc_simplify_int8, gfc_simplify_long): New functions.
* intrinsic.h (gfc_check_intconv, gfc_simplify_int2,
gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2,
gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat,
gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub):
Add prototypes.
* gfortran.dg/mclock.f90: New test.
* gfortran.dg/int_conv_1.f90: New test.
* gfortran.dg/stat_1.f90: New test.
* gfortran.dg/stat_2.f90: New test.
* configure.ac: Check for function clock.
* Makefile.am: Compile new file intrinsics/clock.c.
* intrinsics/clock.c: New file.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.h.in: Regenerate.
* intrinsics/stat.c: Rename the old stat_i?_sub functions to
helper functions stat_i?_sub_0, and use them for both STAT and
LSTAT.
From-SVN: r115754
2006-07-26 13:58:48 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG, LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
* intrinsic.c (add_functions): Add INT2, SHORT, INT8, LONG,
LSTAT, MCLOCK and MCLOCK8 intrinsic functions.
(add_subroutines): Add LSTAT intrinsic subroutine.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_INT2,
GFC_ISYM_INT8, GFC_ISYM_LONG, GFC_ISYM_LSTAT, GFC_ISYM_MCLOCK
and GFC_ISYM_MCLOCK8.
* iresolve.c (gfc_resolve_int2, gfc_resolve_int8,
gfc_resolve_long, gfc_resolve_lstat, gfc_resolve_mclock,
gfc_resolve_mclock8, gfc_resolve_lstat_sub): New functions.
* check.c (gfc_check_intconv): New function.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
the added GFC_ISYM_*.
* simplify.c (gfc_simplify_intconv, gfc_simplify_int2,
gfc_simplify_int8, gfc_simplify_long): New functions.
* intrinsic.h (gfc_check_intconv, gfc_simplify_int2,
gfc_simplify_int8, gfc_simplify_long, gfc_resolve_int2,
gfc_resolve_int8, gfc_resolve_long, gfc_resolve_lstat,
gfc_resolve_mclock, gfc_resolve_mclock8, gfc_resolve_lstat_sub):
Add prototypes.
* gfortran.dg/mclock.f90: New test.
* gfortran.dg/int_conv_1.f90: New test.
* gfortran.dg/stat_1.f90: New test.
* gfortran.dg/stat_2.f90: New test.
* configure.ac: Check for function clock.
* Makefile.am: Compile new file intrinsics/clock.c.
* intrinsics/clock.c: New file.
* Makefile.in: Regenerate.
* configure: Regenerate.
* config.h.in: Regenerate.
* intrinsics/stat.c: Rename the old stat_i?_sub functions to
helper functions stat_i?_sub_0, and use them for both STAT and
LSTAT.
From-SVN: r115754
2006-07-26 13:58:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ior (gfc_expr *i, gfc_expr *j)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (j, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-12-12 22:09:09 +01:00
|
|
|
if (i->ts.kind != j->ts.kind)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_notify_std (GFC_STD_GNU, "Different type kinds at %L",
|
|
|
|
&i->where))
|
|
|
|
return false;
|
2004-12-12 22:09:09 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ishft (gfc_expr *i, gfc_expr *shift)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER)
|
|
|
|
|| !type_check (shift, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize1 ("I", i, NULL, shift, true))
|
|
|
|
return false;
|
2011-10-20 20:07:10 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ishftc (gfc_expr *i, gfc_expr *shift, gfc_expr *size)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER)
|
|
|
|
|| !type_check (shift, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2012-12-20 01:15:00 +01:00
|
|
|
if (size != NULL)
|
2011-10-20 20:07:10 +02:00
|
|
|
{
|
|
|
|
int i2, i3;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (size, 2, BT_INTEGER))
|
|
|
|
return false;
|
2011-10-20 20:07:10 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize1 ("I", i, "SIZE", size, true))
|
|
|
|
return false;
|
2011-10-20 20:07:10 +02:00
|
|
|
|
2011-10-22 00:48:39 +02:00
|
|
|
if (size->expr_type == EXPR_CONSTANT)
|
2011-10-20 20:07:10 +02:00
|
|
|
{
|
2011-10-22 00:48:39 +02:00
|
|
|
gfc_extract_int (size, &i3);
|
|
|
|
if (i3 <= 0)
|
|
|
|
{
|
|
|
|
gfc_error ("SIZE at %L must be positive", &size->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-10-22 00:48:39 +02:00
|
|
|
}
|
2011-10-20 20:07:10 +02:00
|
|
|
|
2011-10-22 00:48:39 +02:00
|
|
|
if (shift->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
gfc_extract_int (shift, &i2);
|
|
|
|
if (i2 < 0)
|
|
|
|
i2 = -i2;
|
|
|
|
|
|
|
|
if (i2 > i3)
|
|
|
|
{
|
re PR fortran/44054 (Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color)
gcc/fortran/ChangeLog:
2015-05-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR fortran/44054
* gfortran.h (struct gfc_error_buf): Rename as
gfc_error_buffer. Move closer to push, pop and free
methods. Reimplement using an output_buffer.
* error.c (errors, warnings, warning_buffer, cur_error_buffer):
Delete everywhere in this file.
(error_char): Delete all contents.
(gfc_increment_error_count): Delete.
(gfc_error_now): Update comment. Set error_buffer.flag.
(gfc_warning_check): Do not handle warning_buffer.
(gfc_error_1): Delete.
(gfc_error_now_1): Delete.
(gfc_error_check): Simplify.
(gfc_move_error_buffer_from_to): Renamed from
gfc_move_output_buffer_from_to.
(gfc_push_error): Handle only gfc_error_buffer.
(gfc_pop_error): Likewise.
(gfc_free_error): Likewise.
(gfc_get_errors): Remove warnings and errors.
(gfc_diagnostics_init): Use static error_buffer.
(gfc_error_1,gfc_error_now_1): Delete declarations.
* symbol.c, decl.c, trans-common.c, data.c, expr.c, expr.c,
frontend-passes.c, resolve.c, match.c, parse.c: Replace
gfc_error_1 with gfc_error and gfc_error_now_1 with gfc_error_1
everywhere.
* f95-lang.c (gfc_be_parse_file): Do not update errorcount and
warningcount here.
* primary.c (match_complex_constant): Replace gfc_error_buf and
output_buffer with gfc_error_buffer.
From-SVN: r223614
2015-05-24 01:02:52 +02:00
|
|
|
gfc_error ("The absolute value of SHIFT at %L must be less "
|
|
|
|
"than or equal to SIZE at %L", &shift->where,
|
|
|
|
&size->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-10-22 00:48:39 +02:00
|
|
|
}
|
|
|
|
}
|
2011-10-20 20:07:10 +02:00
|
|
|
}
|
|
|
|
}
|
2013-04-10 23:36:58 +02:00
|
|
|
else if (!less_than_bitsize1 ("I", i, NULL, shift, true))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_kill (gfc_expr *pid, gfc_expr *sig)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (pid, 0, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (sig, 1, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_kill_sub (gfc_expr *pid, gfc_expr *sig, gfc_expr *status)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (pid, 0, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (pid, 0))
|
|
|
|
return false;
|
2007-01-05 02:40:06 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (sig, 1, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (sig, 1))
|
|
|
|
return false;
|
2007-01-05 02:40:06 +01:00
|
|
|
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_kind (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-22 19:15:08 +01:00
|
|
|
if (x->ts.type == BT_DERIVED || x->ts.type == BT_CLASS)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-22 19:15:08 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of "
|
|
|
|
"intrinsic type", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2014-12-22 19:15:08 +01:00
|
|
|
if (x->ts.type == BT_PROCEDURE)
|
|
|
|
{
|
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a data entity",
|
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&x->where);
|
|
|
|
return false;
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, array, 1))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 2, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
gfc_check_lcobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind)
|
|
|
|
{
|
2014-12-17 07:29:30 +01:00
|
|
|
if (flag_coarray == GFC_FCOARRAY_NONE)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
{
|
error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
2014-11-15 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
(gfc_fatal_error): Add; uses common diagnostics.
* array.c (gfc_match_array_ref, gfc_match_array_spec): Use
%< %>.
* check.c (check_co_collective, gfc_check_lcobound,
gfc_check_image_index, gfc_check_num_images,
gfc_check_this_image, gfc_check_ucobound): Ditto.
* cpp.c (gfc_cpp_post_options): Ditto.
(gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
* gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
* gfortran.h (gfc_fatal_error_1): Add.
* match.c (gfc_match_name, gfc_match_critical,
lock_unlock_statement, sync_statement): Add %< %>.
* module.c (bad_module, gfc_dump_module, gfc_use_module): Change
%s to %qs.
* options.c (gfc_handle_module_path_options,
* gfc_handle_fpe_option,
gfc_handle_coarray_option, gfc_handle_runtime_check_option,
gfc_handle_option): Add %< %>.
* simplify.c (gfc_simplify_num_images): Ditto.
* trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
* trans-array.c (gfc_conv_array_initializer): Ditto.
* trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
of fatal_error; add %< %> quotations.
gcc/testsuite/
* gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
* gfortran.dg/coarray_9.f90: Ditto.
* gfortran.dg/empty_label.f: Ditto.
* gfortran.dg/empty_label.f90: Ditto.
From-SVN: r217600
2014-11-15 12:06:07 +01:00
|
|
|
gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!coarray_check (coarray, 0))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
|
|
|
if (dim != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_corank_check (dim, coarray))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 2, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_len_lentrim (gfc_expr *s, gfc_expr *kind)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (s, 0, BT_CHARACTER))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 1, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
intrinsic.c (char_conversions, ncharconv): New static variables.
* intrinsic.c (char_conversions, ncharconv): New static variables.
(find_char_conv): New function.
(add_functions): Add simplification functions for ADJUSTL and
ADJUSTR. Don't check the kind of their argument. Add checking for
LGE, LLE, LGT and LLT.
(add_subroutines): Fix argument type for SLEEP. Fix argument name
for SYSTEM.
(add_char_conversions): New function.
(gfc_intrinsic_init_1): Call add_char_conversions.
(gfc_intrinsic_done_1): Free char_conversions.
(check_arglist): Use kind == 0 as a signal that we don't want
the kind value to be checked.
(do_simplify): Also simplify character functions.
(gfc_convert_chartype): New function
* trans-array.c (gfc_trans_array_ctor_element): Don't force the
use of default character type.
(gfc_trans_array_constructor_value): Likewise.
(get_array_ctor_var_strlen): Use integer kind to build an integer
instead of a character kind!
(gfc_build_constant_array_constructor): Don't force the use of
default character type.
(gfc_conv_loop_setup): Likewise.
* trans-expr.c (gfc_conv_string_tmp): Don't force the use of
default character type. Allocate enough memory for wide strings.
(gfc_conv_concat_op): Make sure operand kind are the same.
(string_to_single_character): Remove gfc_ prefix. Reindent.
Don't force the use of default character type.
(gfc_conv_scalar_char_value): Likewise.
(gfc_build_compare_string): Call string_to_single_character.
(fill_with_spaces): New function
(gfc_trans_string_copy): Add kind arguments. Use them to deal
with wide character kinds.
(gfc_conv_statement_function): Whitespace fix. Call
gfc_trans_string_copy with new kind arguments.
(gfc_conv_substring_expr): Call gfc_build_wide_string_const
instead of using gfc_widechar_to_char.
(gfc_conv_string_parameter): Don't force the use of default
character type.
(gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy.
* intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant,
gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes.
* decl.c (gfc_set_constant_character_len): Don't assert the
existence of a single character kind.
* trans-array.h (gfc_trans_string_copy): New prototype.
* gfortran.h (gfc_check_character_range, gfc_convert_chartype):
New prototypes.
* error.c (print_wide_char_into_buffer): New function lifting
code from gfc_print_wide_char. Fix order to output '\x??' instead
of 'x\??'.
(gfc_print_wide_char): Call print_wide_char_into_buffer.
(show_locus): Call print_wide_char_into_buffer with buffer local
to this function.
* trans-const.c (gfc_build_wide_string_const): New function.
(gfc_conv_string_init): Deal with wide characters strings
constructors.
(gfc_conv_constant_to_tree): Call gfc_build_wide_string_const.
* trans-stmt.c (gfc_trans_label_assign): Likewise.
(gfc_trans_character_select): Deal with wide strings.
* expr.c (gfc_check_assign): Allow conversion between character
kinds on assignment.
* trans-const.h (gfc_build_wide_string_const): New prototype.
* trans-types.c (gfc_get_character_type_len_for_eltype,
gfc_get_character_type_len): Create too variants of the old
gfc_get_character_type_len, one getting kind argument and the
other one directly taking a type tree.
* trans.h (gfor_fndecl_select_string_char4,
gfor_fndecl_convert_char1_to_char4,
gfor_fndecl_convert_char4_to_char1): New prototypes.
* trans-types.h (gfc_get_character_type_len_for_eltype): New
prototype.
* resolve.c (resolve_operator): Exit early when kind mismatches
are detected, because that makes us issue an error message later.
(validate_case_label_expr): Fix wording of error message.
* iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New
functions.
(gfc_resolve_pack): Call _char4 variants of library function
when dealing with wide characters.
(gfc_resolve_reshape): Likewise.
(gfc_resolve_spread): Likewise.
(gfc_resolve_transpose): Likewise.
(gfc_resolve_unpack): Likewise.
* target-memory.c (size_character): Take character kind bit size
correctly into account (not that it changes anything for now, but
it's more generic).
(gfc_encode_character): Added gfc_ prefix. Encoding each
character of a string by calling native_encode_expr for the
corresponding unsigned integer.
(gfc_target_encode_expr): Add gfc_ prefix to encode_character.
* trans-decl.c (gfc_build_intrinsic_function_decls): Build
gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4
and gfor_fndecl_convert_char4_to_char1.
* target-memory.h (gfc_encode_character): New prototype.
* arith.c (gfc_check_character_range): New function.
(eval_intrinsic): Allow non-default character kinds.
* check.c (gfc_check_access_func): Only allow default
character kind arguments.
(gfc_check_chdir): Likewise.
(gfc_check_chdir_sub): Likewise.
(gfc_check_chmod): Likewise.
(gfc_check_chmod_sub): Likewise.
(gfc_check_lge_lgt_lle_llt): New function.
(gfc_check_link): Likewise.
(gfc_check_link_sub): Likewise.
(gfc_check_symlnk): Likewise.
(gfc_check_symlnk_sub): Likewise.
(gfc_check_rename): Likewise.
(gfc_check_rename_sub): Likewise.
(gfc_check_fgetputc_sub): Likewise.
(gfc_check_fgetput_sub): Likewise.
(gfc_check_stat): Likewise.
(gfc_check_stat_sub): Likewise.
(gfc_check_date_and_time): Likewise.
(gfc_check_ctime_sub): Likewise.
(gfc_check_fdate_sub): Likewise.
(gfc_check_gerror): Likewise.
(gfc_check_getcwd_sub): Likewise.
(gfc_check_getarg): Likewise.
(gfc_check_getlog): Likewise.
(gfc_check_hostnm): Likewise.
(gfc_check_hostnm_sub): Likewise.
(gfc_check_ttynam_sub): Likewise.
(gfc_check_perror): Likewise.
(gfc_check_unlink): Likewise.
(gfc_check_unlink_sub): Likewise.
(gfc_check_system_sub): Likewise.
* primary.c (got_delim): Perform correct character range checking
for all kinds.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate
calls to library functions convert_char4_to_char1 and
convert_char1_to_char4 for character conversions.
(gfc_conv_intrinsic_char): Allow all character kings.
(gfc_conv_intrinsic_strcmp): Fix whitespace.
(gfc_conv_intrinsic_repeat): Take care of all character kinds.
* intrinsic.texi: For all GNU intrinsics accepting character
arguments, mention that they're restricted to the default kind.
* simplify.c (simplify_achar_char): New function.
(gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char.
gfc_simplify_ichar): Don't error out for wide characters.
(gfc_convert_char_constant): New function.
* gfortran.dg/achar_3.f90: Adjust error messages.
* gfortran.dg/achar_5.f90: New test.
* gfortran.dg/achar_6.F90: New test.
* gfortran.dg/widechar_1.f90: New test.
* gfortran.dg/widechar_2.f90: New test.
* gfortran.dg/widechar_3.f90: New test.
* gfortran.dg/widechar_4.f90: New test.
* gfortran.dg/widechar_intrinsics_1.f90: New test.
* gfortran.dg/widechar_intrinsics_2.f90: New test.
* gfortran.dg/widechar_intrinsics_3.f90: New test.
* gfortran.dg/widechar_intrinsics_4.f90: New test.
* gfortran.dg/widechar_intrinsics_5.f90: New test.
* gfortran.dg/widechar_select_1.f90: New test.
* gfortran.dg/widechar_select_2.f90: New test.
From-SVN: r135515
2008-05-19 00:45:05 +02:00
|
|
|
gfc_check_lge_lgt_lle_llt (gfc_expr *a, gfc_expr *b)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (a, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (char_conversions, ncharconv): New static variables.
* intrinsic.c (char_conversions, ncharconv): New static variables.
(find_char_conv): New function.
(add_functions): Add simplification functions for ADJUSTL and
ADJUSTR. Don't check the kind of their argument. Add checking for
LGE, LLE, LGT and LLT.
(add_subroutines): Fix argument type for SLEEP. Fix argument name
for SYSTEM.
(add_char_conversions): New function.
(gfc_intrinsic_init_1): Call add_char_conversions.
(gfc_intrinsic_done_1): Free char_conversions.
(check_arglist): Use kind == 0 as a signal that we don't want
the kind value to be checked.
(do_simplify): Also simplify character functions.
(gfc_convert_chartype): New function
* trans-array.c (gfc_trans_array_ctor_element): Don't force the
use of default character type.
(gfc_trans_array_constructor_value): Likewise.
(get_array_ctor_var_strlen): Use integer kind to build an integer
instead of a character kind!
(gfc_build_constant_array_constructor): Don't force the use of
default character type.
(gfc_conv_loop_setup): Likewise.
* trans-expr.c (gfc_conv_string_tmp): Don't force the use of
default character type. Allocate enough memory for wide strings.
(gfc_conv_concat_op): Make sure operand kind are the same.
(string_to_single_character): Remove gfc_ prefix. Reindent.
Don't force the use of default character type.
(gfc_conv_scalar_char_value): Likewise.
(gfc_build_compare_string): Call string_to_single_character.
(fill_with_spaces): New function
(gfc_trans_string_copy): Add kind arguments. Use them to deal
with wide character kinds.
(gfc_conv_statement_function): Whitespace fix. Call
gfc_trans_string_copy with new kind arguments.
(gfc_conv_substring_expr): Call gfc_build_wide_string_const
instead of using gfc_widechar_to_char.
(gfc_conv_string_parameter): Don't force the use of default
character type.
(gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy.
* intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant,
gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes.
* decl.c (gfc_set_constant_character_len): Don't assert the
existence of a single character kind.
* trans-array.h (gfc_trans_string_copy): New prototype.
* gfortran.h (gfc_check_character_range, gfc_convert_chartype):
New prototypes.
* error.c (print_wide_char_into_buffer): New function lifting
code from gfc_print_wide_char. Fix order to output '\x??' instead
of 'x\??'.
(gfc_print_wide_char): Call print_wide_char_into_buffer.
(show_locus): Call print_wide_char_into_buffer with buffer local
to this function.
* trans-const.c (gfc_build_wide_string_const): New function.
(gfc_conv_string_init): Deal with wide characters strings
constructors.
(gfc_conv_constant_to_tree): Call gfc_build_wide_string_const.
* trans-stmt.c (gfc_trans_label_assign): Likewise.
(gfc_trans_character_select): Deal with wide strings.
* expr.c (gfc_check_assign): Allow conversion between character
kinds on assignment.
* trans-const.h (gfc_build_wide_string_const): New prototype.
* trans-types.c (gfc_get_character_type_len_for_eltype,
gfc_get_character_type_len): Create too variants of the old
gfc_get_character_type_len, one getting kind argument and the
other one directly taking a type tree.
* trans.h (gfor_fndecl_select_string_char4,
gfor_fndecl_convert_char1_to_char4,
gfor_fndecl_convert_char4_to_char1): New prototypes.
* trans-types.h (gfc_get_character_type_len_for_eltype): New
prototype.
* resolve.c (resolve_operator): Exit early when kind mismatches
are detected, because that makes us issue an error message later.
(validate_case_label_expr): Fix wording of error message.
* iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New
functions.
(gfc_resolve_pack): Call _char4 variants of library function
when dealing with wide characters.
(gfc_resolve_reshape): Likewise.
(gfc_resolve_spread): Likewise.
(gfc_resolve_transpose): Likewise.
(gfc_resolve_unpack): Likewise.
* target-memory.c (size_character): Take character kind bit size
correctly into account (not that it changes anything for now, but
it's more generic).
(gfc_encode_character): Added gfc_ prefix. Encoding each
character of a string by calling native_encode_expr for the
corresponding unsigned integer.
(gfc_target_encode_expr): Add gfc_ prefix to encode_character.
* trans-decl.c (gfc_build_intrinsic_function_decls): Build
gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4
and gfor_fndecl_convert_char4_to_char1.
* target-memory.h (gfc_encode_character): New prototype.
* arith.c (gfc_check_character_range): New function.
(eval_intrinsic): Allow non-default character kinds.
* check.c (gfc_check_access_func): Only allow default
character kind arguments.
(gfc_check_chdir): Likewise.
(gfc_check_chdir_sub): Likewise.
(gfc_check_chmod): Likewise.
(gfc_check_chmod_sub): Likewise.
(gfc_check_lge_lgt_lle_llt): New function.
(gfc_check_link): Likewise.
(gfc_check_link_sub): Likewise.
(gfc_check_symlnk): Likewise.
(gfc_check_symlnk_sub): Likewise.
(gfc_check_rename): Likewise.
(gfc_check_rename_sub): Likewise.
(gfc_check_fgetputc_sub): Likewise.
(gfc_check_fgetput_sub): Likewise.
(gfc_check_stat): Likewise.
(gfc_check_stat_sub): Likewise.
(gfc_check_date_and_time): Likewise.
(gfc_check_ctime_sub): Likewise.
(gfc_check_fdate_sub): Likewise.
(gfc_check_gerror): Likewise.
(gfc_check_getcwd_sub): Likewise.
(gfc_check_getarg): Likewise.
(gfc_check_getlog): Likewise.
(gfc_check_hostnm): Likewise.
(gfc_check_hostnm_sub): Likewise.
(gfc_check_ttynam_sub): Likewise.
(gfc_check_perror): Likewise.
(gfc_check_unlink): Likewise.
(gfc_check_unlink_sub): Likewise.
(gfc_check_system_sub): Likewise.
* primary.c (got_delim): Perform correct character range checking
for all kinds.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate
calls to library functions convert_char4_to_char1 and
convert_char1_to_char4 for character conversions.
(gfc_conv_intrinsic_char): Allow all character kings.
(gfc_conv_intrinsic_strcmp): Fix whitespace.
(gfc_conv_intrinsic_repeat): Take care of all character kinds.
* intrinsic.texi: For all GNU intrinsics accepting character
arguments, mention that they're restricted to the default kind.
* simplify.c (simplify_achar_char): New function.
(gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char.
gfc_simplify_ichar): Don't error out for wide characters.
(gfc_convert_char_constant): New function.
* gfortran.dg/achar_3.f90: Adjust error messages.
* gfortran.dg/achar_5.f90: New test.
* gfortran.dg/achar_6.F90: New test.
* gfortran.dg/widechar_1.f90: New test.
* gfortran.dg/widechar_2.f90: New test.
* gfortran.dg/widechar_3.f90: New test.
* gfortran.dg/widechar_4.f90: New test.
* gfortran.dg/widechar_intrinsics_1.f90: New test.
* gfortran.dg/widechar_intrinsics_2.f90: New test.
* gfortran.dg/widechar_intrinsics_3.f90: New test.
* gfortran.dg/widechar_intrinsics_4.f90: New test.
* gfortran.dg/widechar_intrinsics_5.f90: New test.
* gfortran.dg/widechar_select_1.f90: New test.
* gfortran.dg/widechar_select_2.f90: New test.
From-SVN: r135515
2008-05-19 00:45:05 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (b, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (b, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (char_conversions, ncharconv): New static variables.
* intrinsic.c (char_conversions, ncharconv): New static variables.
(find_char_conv): New function.
(add_functions): Add simplification functions for ADJUSTL and
ADJUSTR. Don't check the kind of their argument. Add checking for
LGE, LLE, LGT and LLT.
(add_subroutines): Fix argument type for SLEEP. Fix argument name
for SYSTEM.
(add_char_conversions): New function.
(gfc_intrinsic_init_1): Call add_char_conversions.
(gfc_intrinsic_done_1): Free char_conversions.
(check_arglist): Use kind == 0 as a signal that we don't want
the kind value to be checked.
(do_simplify): Also simplify character functions.
(gfc_convert_chartype): New function
* trans-array.c (gfc_trans_array_ctor_element): Don't force the
use of default character type.
(gfc_trans_array_constructor_value): Likewise.
(get_array_ctor_var_strlen): Use integer kind to build an integer
instead of a character kind!
(gfc_build_constant_array_constructor): Don't force the use of
default character type.
(gfc_conv_loop_setup): Likewise.
* trans-expr.c (gfc_conv_string_tmp): Don't force the use of
default character type. Allocate enough memory for wide strings.
(gfc_conv_concat_op): Make sure operand kind are the same.
(string_to_single_character): Remove gfc_ prefix. Reindent.
Don't force the use of default character type.
(gfc_conv_scalar_char_value): Likewise.
(gfc_build_compare_string): Call string_to_single_character.
(fill_with_spaces): New function
(gfc_trans_string_copy): Add kind arguments. Use them to deal
with wide character kinds.
(gfc_conv_statement_function): Whitespace fix. Call
gfc_trans_string_copy with new kind arguments.
(gfc_conv_substring_expr): Call gfc_build_wide_string_const
instead of using gfc_widechar_to_char.
(gfc_conv_string_parameter): Don't force the use of default
character type.
(gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy.
* intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant,
gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes.
* decl.c (gfc_set_constant_character_len): Don't assert the
existence of a single character kind.
* trans-array.h (gfc_trans_string_copy): New prototype.
* gfortran.h (gfc_check_character_range, gfc_convert_chartype):
New prototypes.
* error.c (print_wide_char_into_buffer): New function lifting
code from gfc_print_wide_char. Fix order to output '\x??' instead
of 'x\??'.
(gfc_print_wide_char): Call print_wide_char_into_buffer.
(show_locus): Call print_wide_char_into_buffer with buffer local
to this function.
* trans-const.c (gfc_build_wide_string_const): New function.
(gfc_conv_string_init): Deal with wide characters strings
constructors.
(gfc_conv_constant_to_tree): Call gfc_build_wide_string_const.
* trans-stmt.c (gfc_trans_label_assign): Likewise.
(gfc_trans_character_select): Deal with wide strings.
* expr.c (gfc_check_assign): Allow conversion between character
kinds on assignment.
* trans-const.h (gfc_build_wide_string_const): New prototype.
* trans-types.c (gfc_get_character_type_len_for_eltype,
gfc_get_character_type_len): Create too variants of the old
gfc_get_character_type_len, one getting kind argument and the
other one directly taking a type tree.
* trans.h (gfor_fndecl_select_string_char4,
gfor_fndecl_convert_char1_to_char4,
gfor_fndecl_convert_char4_to_char1): New prototypes.
* trans-types.h (gfc_get_character_type_len_for_eltype): New
prototype.
* resolve.c (resolve_operator): Exit early when kind mismatches
are detected, because that makes us issue an error message later.
(validate_case_label_expr): Fix wording of error message.
* iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New
functions.
(gfc_resolve_pack): Call _char4 variants of library function
when dealing with wide characters.
(gfc_resolve_reshape): Likewise.
(gfc_resolve_spread): Likewise.
(gfc_resolve_transpose): Likewise.
(gfc_resolve_unpack): Likewise.
* target-memory.c (size_character): Take character kind bit size
correctly into account (not that it changes anything for now, but
it's more generic).
(gfc_encode_character): Added gfc_ prefix. Encoding each
character of a string by calling native_encode_expr for the
corresponding unsigned integer.
(gfc_target_encode_expr): Add gfc_ prefix to encode_character.
* trans-decl.c (gfc_build_intrinsic_function_decls): Build
gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4
and gfor_fndecl_convert_char4_to_char1.
* target-memory.h (gfc_encode_character): New prototype.
* arith.c (gfc_check_character_range): New function.
(eval_intrinsic): Allow non-default character kinds.
* check.c (gfc_check_access_func): Only allow default
character kind arguments.
(gfc_check_chdir): Likewise.
(gfc_check_chdir_sub): Likewise.
(gfc_check_chmod): Likewise.
(gfc_check_chmod_sub): Likewise.
(gfc_check_lge_lgt_lle_llt): New function.
(gfc_check_link): Likewise.
(gfc_check_link_sub): Likewise.
(gfc_check_symlnk): Likewise.
(gfc_check_symlnk_sub): Likewise.
(gfc_check_rename): Likewise.
(gfc_check_rename_sub): Likewise.
(gfc_check_fgetputc_sub): Likewise.
(gfc_check_fgetput_sub): Likewise.
(gfc_check_stat): Likewise.
(gfc_check_stat_sub): Likewise.
(gfc_check_date_and_time): Likewise.
(gfc_check_ctime_sub): Likewise.
(gfc_check_fdate_sub): Likewise.
(gfc_check_gerror): Likewise.
(gfc_check_getcwd_sub): Likewise.
(gfc_check_getarg): Likewise.
(gfc_check_getlog): Likewise.
(gfc_check_hostnm): Likewise.
(gfc_check_hostnm_sub): Likewise.
(gfc_check_ttynam_sub): Likewise.
(gfc_check_perror): Likewise.
(gfc_check_unlink): Likewise.
(gfc_check_unlink_sub): Likewise.
(gfc_check_system_sub): Likewise.
* primary.c (got_delim): Perform correct character range checking
for all kinds.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate
calls to library functions convert_char4_to_char1 and
convert_char1_to_char4 for character conversions.
(gfc_conv_intrinsic_char): Allow all character kings.
(gfc_conv_intrinsic_strcmp): Fix whitespace.
(gfc_conv_intrinsic_repeat): Take care of all character kinds.
* intrinsic.texi: For all GNU intrinsics accepting character
arguments, mention that they're restricted to the default kind.
* simplify.c (simplify_achar_char): New function.
(gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char.
gfc_simplify_ichar): Don't error out for wide characters.
(gfc_convert_char_constant): New function.
* gfortran.dg/achar_3.f90: Adjust error messages.
* gfortran.dg/achar_5.f90: New test.
* gfortran.dg/achar_6.F90: New test.
* gfortran.dg/widechar_1.f90: New test.
* gfortran.dg/widechar_2.f90: New test.
* gfortran.dg/widechar_3.f90: New test.
* gfortran.dg/widechar_4.f90: New test.
* gfortran.dg/widechar_intrinsics_1.f90: New test.
* gfortran.dg/widechar_intrinsics_2.f90: New test.
* gfortran.dg/widechar_intrinsics_3.f90: New test.
* gfortran.dg/widechar_intrinsics_4.f90: New test.
* gfortran.dg/widechar_intrinsics_5.f90: New test.
* gfortran.dg/widechar_select_1.f90: New test.
* gfortran.dg/widechar_select_2.f90: New test.
From-SVN: r135515
2008-05-19 00:45:05 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (char_conversions, ncharconv): New static variables.
* intrinsic.c (char_conversions, ncharconv): New static variables.
(find_char_conv): New function.
(add_functions): Add simplification functions for ADJUSTL and
ADJUSTR. Don't check the kind of their argument. Add checking for
LGE, LLE, LGT and LLT.
(add_subroutines): Fix argument type for SLEEP. Fix argument name
for SYSTEM.
(add_char_conversions): New function.
(gfc_intrinsic_init_1): Call add_char_conversions.
(gfc_intrinsic_done_1): Free char_conversions.
(check_arglist): Use kind == 0 as a signal that we don't want
the kind value to be checked.
(do_simplify): Also simplify character functions.
(gfc_convert_chartype): New function
* trans-array.c (gfc_trans_array_ctor_element): Don't force the
use of default character type.
(gfc_trans_array_constructor_value): Likewise.
(get_array_ctor_var_strlen): Use integer kind to build an integer
instead of a character kind!
(gfc_build_constant_array_constructor): Don't force the use of
default character type.
(gfc_conv_loop_setup): Likewise.
* trans-expr.c (gfc_conv_string_tmp): Don't force the use of
default character type. Allocate enough memory for wide strings.
(gfc_conv_concat_op): Make sure operand kind are the same.
(string_to_single_character): Remove gfc_ prefix. Reindent.
Don't force the use of default character type.
(gfc_conv_scalar_char_value): Likewise.
(gfc_build_compare_string): Call string_to_single_character.
(fill_with_spaces): New function
(gfc_trans_string_copy): Add kind arguments. Use them to deal
with wide character kinds.
(gfc_conv_statement_function): Whitespace fix. Call
gfc_trans_string_copy with new kind arguments.
(gfc_conv_substring_expr): Call gfc_build_wide_string_const
instead of using gfc_widechar_to_char.
(gfc_conv_string_parameter): Don't force the use of default
character type.
(gfc_trans_scalar_assign): Pass kind args to gfc_trans_string_copy.
* intrinsic.h (gfc_check_lge_lgt_lle_llt, gfc_convert_char_constant,
gfc_resolve_adjustl, gfc_resolve_adjustr): New prototypes.
* decl.c (gfc_set_constant_character_len): Don't assert the
existence of a single character kind.
* trans-array.h (gfc_trans_string_copy): New prototype.
* gfortran.h (gfc_check_character_range, gfc_convert_chartype):
New prototypes.
* error.c (print_wide_char_into_buffer): New function lifting
code from gfc_print_wide_char. Fix order to output '\x??' instead
of 'x\??'.
(gfc_print_wide_char): Call print_wide_char_into_buffer.
(show_locus): Call print_wide_char_into_buffer with buffer local
to this function.
* trans-const.c (gfc_build_wide_string_const): New function.
(gfc_conv_string_init): Deal with wide characters strings
constructors.
(gfc_conv_constant_to_tree): Call gfc_build_wide_string_const.
* trans-stmt.c (gfc_trans_label_assign): Likewise.
(gfc_trans_character_select): Deal with wide strings.
* expr.c (gfc_check_assign): Allow conversion between character
kinds on assignment.
* trans-const.h (gfc_build_wide_string_const): New prototype.
* trans-types.c (gfc_get_character_type_len_for_eltype,
gfc_get_character_type_len): Create too variants of the old
gfc_get_character_type_len, one getting kind argument and the
other one directly taking a type tree.
* trans.h (gfor_fndecl_select_string_char4,
gfor_fndecl_convert_char1_to_char4,
gfor_fndecl_convert_char4_to_char1): New prototypes.
* trans-types.h (gfc_get_character_type_len_for_eltype): New
prototype.
* resolve.c (resolve_operator): Exit early when kind mismatches
are detected, because that makes us issue an error message later.
(validate_case_label_expr): Fix wording of error message.
* iresolve.c (gfc_resolve_adjustl, gfc_resolve_adjustr): New
functions.
(gfc_resolve_pack): Call _char4 variants of library function
when dealing with wide characters.
(gfc_resolve_reshape): Likewise.
(gfc_resolve_spread): Likewise.
(gfc_resolve_transpose): Likewise.
(gfc_resolve_unpack): Likewise.
* target-memory.c (size_character): Take character kind bit size
correctly into account (not that it changes anything for now, but
it's more generic).
(gfc_encode_character): Added gfc_ prefix. Encoding each
character of a string by calling native_encode_expr for the
corresponding unsigned integer.
(gfc_target_encode_expr): Add gfc_ prefix to encode_character.
* trans-decl.c (gfc_build_intrinsic_function_decls): Build
gfor_fndecl_select_string_char4, gfor_fndecl_convert_char1_to_char4
and gfor_fndecl_convert_char4_to_char1.
* target-memory.h (gfc_encode_character): New prototype.
* arith.c (gfc_check_character_range): New function.
(eval_intrinsic): Allow non-default character kinds.
* check.c (gfc_check_access_func): Only allow default
character kind arguments.
(gfc_check_chdir): Likewise.
(gfc_check_chdir_sub): Likewise.
(gfc_check_chmod): Likewise.
(gfc_check_chmod_sub): Likewise.
(gfc_check_lge_lgt_lle_llt): New function.
(gfc_check_link): Likewise.
(gfc_check_link_sub): Likewise.
(gfc_check_symlnk): Likewise.
(gfc_check_symlnk_sub): Likewise.
(gfc_check_rename): Likewise.
(gfc_check_rename_sub): Likewise.
(gfc_check_fgetputc_sub): Likewise.
(gfc_check_fgetput_sub): Likewise.
(gfc_check_stat): Likewise.
(gfc_check_stat_sub): Likewise.
(gfc_check_date_and_time): Likewise.
(gfc_check_ctime_sub): Likewise.
(gfc_check_fdate_sub): Likewise.
(gfc_check_gerror): Likewise.
(gfc_check_getcwd_sub): Likewise.
(gfc_check_getarg): Likewise.
(gfc_check_getlog): Likewise.
(gfc_check_hostnm): Likewise.
(gfc_check_hostnm_sub): Likewise.
(gfc_check_ttynam_sub): Likewise.
(gfc_check_perror): Likewise.
(gfc_check_unlink): Likewise.
(gfc_check_unlink_sub): Likewise.
(gfc_check_system_sub): Likewise.
* primary.c (got_delim): Perform correct character range checking
for all kinds.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion): Generate
calls to library functions convert_char4_to_char1 and
convert_char1_to_char4 for character conversions.
(gfc_conv_intrinsic_char): Allow all character kings.
(gfc_conv_intrinsic_strcmp): Fix whitespace.
(gfc_conv_intrinsic_repeat): Take care of all character kinds.
* intrinsic.texi: For all GNU intrinsics accepting character
arguments, mention that they're restricted to the default kind.
* simplify.c (simplify_achar_char): New function.
(gfc_simplify_achar, gfc_simplify_char): Call simplify_achar_char.
gfc_simplify_ichar): Don't error out for wide characters.
(gfc_convert_char_constant): New function.
* gfortran.dg/achar_3.f90: Adjust error messages.
* gfortran.dg/achar_5.f90: New test.
* gfortran.dg/achar_6.F90: New test.
* gfortran.dg/widechar_1.f90: New test.
* gfortran.dg/widechar_2.f90: New test.
* gfortran.dg/widechar_3.f90: New test.
* gfortran.dg/widechar_4.f90: New test.
* gfortran.dg/widechar_intrinsics_1.f90: New test.
* gfortran.dg/widechar_intrinsics_2.f90: New test.
* gfortran.dg/widechar_intrinsics_3.f90: New test.
* gfortran.dg/widechar_intrinsics_4.f90: New test.
* gfortran.dg/widechar_intrinsics_5.f90: New test.
* gfortran.dg/widechar_select_1.f90: New test.
* gfortran.dg/widechar_select_2.f90: New test.
From-SVN: r135515
2008-05-19 00:45:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_link (gfc_expr *path1, gfc_expr *path2)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path1, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path1, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path2, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path2, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_link_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path1, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path1, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path2, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path2, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2005-10-24 21:28:18 +02:00
|
|
|
gfc_check_loc (gfc_expr *expr)
|
|
|
|
{
|
re PR fortran/46484 (Should reject ALLOCATED(non-variable expression ))
2010-11-15 Tobias Burnus <burnus@net.b.de>
PR fortran/46484
* check.c (variable_check): Don't treat functions calls as
* variables;
optionally accept function themselves.
(gfc_check_all_any, gfc_check_loc, gfc_check_move_alloc,
gfc_check_null, gfc_check_present, gfc_check_cpu_time,
gfc_check_date_and_time, gfc_check_mvbits, gfc_check_random_number,
gfc_check_random_seed, gfc_check_system_clock,
gfc_check_dtime_etime, gfc_check_dtime_etime_sub,
gfc_check_itime_idate,gfc_check_ltime_gmtime): Update call.
2010-11-15 Tobias Burnus <burnus@net.b.de>
PR fortran/46484
* gfortran.dg/allocatable_scalar_11.f90: New.
* gfortran.dg/allocatable_scalar_5.f90: Make test case standard
* conform.
From-SVN: r166769
2010-11-15 21:44:26 +01:00
|
|
|
return variable_check (expr, 0, true);
|
2005-10-24 21:28:18 +02:00
|
|
|
}
|
|
|
|
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_symlnk (gfc_expr *path1, gfc_expr *path2)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path1, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path1, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path2, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path2, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_symlnk_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path1, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path1, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path2, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path2, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_logical (gfc_expr *a, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_LOGICAL))
|
|
|
|
return false;
|
|
|
|
if (!kind_check (kind, 1, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Min/max family. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2013-07-21 13:46:43 +02:00
|
|
|
min_max_args (gfc_actual_arglist *args)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-07-21 13:46:43 +02:00
|
|
|
gfc_actual_arglist *arg;
|
|
|
|
int i, j, nargs, *nlabels, nlabelless;
|
|
|
|
bool a1 = false, a2 = false;
|
|
|
|
|
|
|
|
if (args == NULL || args->next == NULL)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Intrinsic %qs at %L must have at least two arguments",
|
2004-05-13 08:41:07 +02:00
|
|
|
gfc_current_intrinsic, gfc_current_intrinsic_where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-07-21 13:46:43 +02:00
|
|
|
if (!args->name)
|
|
|
|
a1 = true;
|
|
|
|
|
|
|
|
if (!args->next->name)
|
|
|
|
a2 = true;
|
|
|
|
|
|
|
|
nargs = 0;
|
|
|
|
for (arg = args; arg; arg = arg->next)
|
|
|
|
if (arg->name)
|
|
|
|
nargs++;
|
|
|
|
|
|
|
|
if (nargs == 0)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
/* Note: Having a keywordless argument after an "arg=" is checked before. */
|
|
|
|
nlabelless = 0;
|
|
|
|
nlabels = XALLOCAVEC (int, nargs);
|
|
|
|
for (arg = args, i = 0; arg; arg = arg->next, i++)
|
|
|
|
if (arg->name)
|
|
|
|
{
|
|
|
|
int n;
|
|
|
|
char *endp;
|
|
|
|
|
|
|
|
if (arg->name[0] != 'a' || arg->name[1] < '1' || arg->name[1] > '9')
|
|
|
|
goto unknown;
|
|
|
|
n = strtol (&arg->name[1], &endp, 10);
|
|
|
|
if (endp[0] != '\0')
|
|
|
|
goto unknown;
|
|
|
|
if (n <= 0)
|
|
|
|
goto unknown;
|
|
|
|
if (n <= nlabelless)
|
|
|
|
goto duplicate;
|
|
|
|
nlabels[i] = n;
|
|
|
|
if (n == 1)
|
|
|
|
a1 = true;
|
|
|
|
if (n == 2)
|
|
|
|
a2 = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nlabelless++;
|
|
|
|
|
|
|
|
if (!a1 || !a2)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Missing %qs argument to the %s intrinsic at %L",
|
2013-07-21 13:46:43 +02:00
|
|
|
!a1 ? "a1" : "a2", gfc_current_intrinsic,
|
|
|
|
gfc_current_intrinsic_where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check for duplicates. */
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
for (j = i + 1; j < nargs; j++)
|
|
|
|
if (nlabels[i] == nlabels[j])
|
|
|
|
goto duplicate;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2013-07-21 13:46:43 +02:00
|
|
|
|
|
|
|
duplicate:
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Duplicate argument %qs at %L to intrinsic %s", arg->name,
|
2013-07-21 13:46:43 +02:00
|
|
|
&arg->expr->where, gfc_current_intrinsic);
|
|
|
|
return false;
|
|
|
|
|
|
|
|
unknown:
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Unknown argument %qs at %L to intrinsic %s", arg->name,
|
2013-07-21 13:46:43 +02:00
|
|
|
&arg->expr->where, gfc_current_intrinsic);
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-05-20 12:22:15 +02:00
|
|
|
check_rest (bt type, int kind, gfc_actual_arglist *arglist)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2007-05-20 12:22:15 +02:00
|
|
|
gfc_actual_arglist *arg, *tmp;
|
|
|
|
gfc_expr *x;
|
|
|
|
int m, n;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!min_max_args (arglist))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-05-20 12:22:15 +02:00
|
|
|
for (arg = arglist, n=1; arg; arg = arg->next, n++)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
x = arg->expr;
|
|
|
|
if (x->ts.type != type || x->ts.kind != kind)
|
|
|
|
{
|
2007-01-07 01:28:29 +01:00
|
|
|
if (x->ts.type == type)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_notify_std (GFC_STD_GNU, "Different type "
|
|
|
|
"kinds at %L", &x->where))
|
|
|
|
return false;
|
2007-01-07 01:28:29 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<a%d%> argument of %qs intrinsic at %L must be "
|
2007-01-07 01:28:29 +01:00
|
|
|
"%s(%d)", n, gfc_current_intrinsic, &x->where,
|
|
|
|
gfc_basic_typename (type), kind);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2007-01-07 01:28:29 +01:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2007-05-17 14:37:24 +02:00
|
|
|
|
2007-05-20 12:22:15 +02:00
|
|
|
for (tmp = arglist, m=1; tmp != arg; tmp = tmp->next, m++)
|
2014-12-13 00:12:06 +01:00
|
|
|
if (!gfc_check_conformance (tmp->expr, x,
|
2013-04-10 23:36:58 +02:00
|
|
|
"arguments 'a%d' and 'a%d' for "
|
2014-12-13 00:12:06 +01:00
|
|
|
"intrinsic '%s'", m, n,
|
2013-04-10 23:36:58 +02:00
|
|
|
gfc_current_intrinsic))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_min_max (gfc_actual_arglist *arg)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
gfc_expr *x;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!min_max_args (arg))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
x = arg->expr;
|
|
|
|
|
2007-08-06 22:47:17 +02:00
|
|
|
if (x->ts.type == BT_CHARACTER)
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
if (!gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with CHARACTER argument at %L",
|
|
|
|
gfc_current_intrinsic, &x->where))
|
|
|
|
return false;
|
2007-08-06 22:47:17 +02:00
|
|
|
}
|
|
|
|
else if (x->ts.type != BT_INTEGER && x->ts.type != BT_REAL)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<a1%> argument of %qs intrinsic at %L must be INTEGER, "
|
2007-08-06 22:47:17 +02:00
|
|
|
"REAL or CHARACTER", gfc_current_intrinsic, &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return check_rest (x->ts.type, x->ts.kind, arg);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_min_max_integer (gfc_actual_arglist *arg)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
gfortran.h (gfc_default_*_kind): Remove prototypes, add extern variable declaration of same name.
* gfortran.h (gfc_default_*_kind): Remove prototypes, add extern
variable declaration of same name.
* arith.c, check.c, decl.c, dump_parse_tree.c, expr.c,
intrinsic.c, io.c, iresolve.c, match.c, options.c, primary.c,
resolve.c, simplify.c, symbol.c, trans-const.c, trans-io.c:
Replace all calls to gfc_default_*_kind with variable accesses.
* trans-types.c: Same as above.
(gfc_default_*_kind_1): Rename to gfc_default_*_kind, remove
static qualifier. Replace all occurences.
(gfc_default_*_kind): Remove functions.
From-SVN: r86662
2004-08-27 16:49:35 +02:00
|
|
|
return check_rest (BT_INTEGER, gfc_default_integer_kind, arg);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_min_max_real (gfc_actual_arglist *arg)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
gfortran.h (gfc_default_*_kind): Remove prototypes, add extern variable declaration of same name.
* gfortran.h (gfc_default_*_kind): Remove prototypes, add extern
variable declaration of same name.
* arith.c, check.c, decl.c, dump_parse_tree.c, expr.c,
intrinsic.c, io.c, iresolve.c, match.c, options.c, primary.c,
resolve.c, simplify.c, symbol.c, trans-const.c, trans-io.c:
Replace all calls to gfc_default_*_kind with variable accesses.
* trans-types.c: Same as above.
(gfc_default_*_kind_1): Rename to gfc_default_*_kind, remove
static qualifier. Replace all occurences.
(gfc_default_*_kind): Remove functions.
From-SVN: r86662
2004-08-27 16:49:35 +02:00
|
|
|
return check_rest (BT_REAL, gfc_default_real_kind, arg);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_min_max_double (gfc_actual_arglist *arg)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
gfortran.h (gfc_default_*_kind): Remove prototypes, add extern variable declaration of same name.
* gfortran.h (gfc_default_*_kind): Remove prototypes, add extern
variable declaration of same name.
* arith.c, check.c, decl.c, dump_parse_tree.c, expr.c,
intrinsic.c, io.c, iresolve.c, match.c, options.c, primary.c,
resolve.c, simplify.c, symbol.c, trans-const.c, trans-io.c:
Replace all calls to gfc_default_*_kind with variable accesses.
* trans-types.c: Same as above.
(gfc_default_*_kind_1): Rename to gfc_default_*_kind, remove
static qualifier. Replace all occurences.
(gfc_default_*_kind): Remove functions.
From-SVN: r86662
2004-08-27 16:49:35 +02:00
|
|
|
return check_rest (BT_REAL, gfc_default_double_kind, arg);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* End of min/max family. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_malloc (gfc_expr *size)
|
2005-10-30 13:17:48 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (size, 0, BT_INTEGER))
|
|
|
|
return false;
|
2005-10-30 13:17:48 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (size, 0))
|
|
|
|
return false;
|
2005-10-30 13:17:48 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-10-30 13:17:48 +01:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-12-12 14:22:55 +01:00
|
|
|
if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_a->ts))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be numeric "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or LOGICAL", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &matrix_a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2008-12-12 14:22:55 +01:00
|
|
|
if ((matrix_b->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be numeric "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or LOGICAL", gfc_current_intrinsic_arg[1]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &matrix_b->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2008-12-12 14:22:55 +01:00
|
|
|
if ((matrix_a->ts.type == BT_LOGICAL && gfc_numeric_ts (&matrix_b->ts))
|
|
|
|
|| (gfc_numeric_ts (&matrix_a->ts) && matrix_b->ts.type == BT_LOGICAL))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Argument types of %qs intrinsic at %L must match (%s/%s)",
|
2008-12-12 14:22:55 +01:00
|
|
|
gfc_current_intrinsic, &matrix_a->where,
|
|
|
|
gfc_typename(&matrix_a->ts), gfc_typename(&matrix_b->ts));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2008-12-12 14:22:55 +01:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
switch (matrix_a->rank)
|
|
|
|
{
|
|
|
|
case 1:
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (matrix_b, 1, 2))
|
|
|
|
return false;
|
2006-02-04 23:11:57 +01:00
|
|
|
/* Check for case matrix_a has shape(m), matrix_b has shape (m, k). */
|
2007-01-07 01:28:29 +01:00
|
|
|
if (!identical_dimen_shape (matrix_a, 0, matrix_b, 0))
|
2006-02-04 23:11:57 +01:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Different shape on dimension 1 for arguments %qs "
|
|
|
|
"and %qs at %L for intrinsic matmul",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[1]->name, &matrix_a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2006-02-04 23:11:57 +01:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2006-02-04 23:11:57 +01:00
|
|
|
if (matrix_b->rank != 2)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (matrix_b, 1, 1))
|
|
|
|
return false;
|
2006-02-04 23:11:57 +01:00
|
|
|
}
|
|
|
|
/* matrix_b has rank 1 or 2 here. Common check for the cases
|
|
|
|
- matrix_a has shape (n,m) and matrix_b has shape (m, k)
|
|
|
|
- matrix_a has shape (n,m) and matrix_b has shape (m). */
|
2007-01-07 01:28:29 +01:00
|
|
|
if (!identical_dimen_shape (matrix_a, 1, matrix_b, 0))
|
2006-02-04 23:11:57 +01:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Different shape on dimension 2 for argument %qs and "
|
|
|
|
"dimension 1 for argument %qs at %L for intrinsic "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"matmul", gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[1]->name, &matrix_a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2006-02-04 23:11:57 +01:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of rank "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"1 or 2", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &matrix_a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Whoever came up with this interface was probably on something.
|
|
|
|
The possibilities for the occupation of the second and third
|
|
|
|
parameters are:
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
Arg #2 Arg #3
|
|
|
|
NULL NULL
|
|
|
|
DIM NULL
|
|
|
|
MASK NULL
|
|
|
|
NULL MASK minloc(array, mask=m)
|
|
|
|
DIM MASK
|
2004-06-14 17:56:50 +02:00
|
|
|
|
|
|
|
I.e. in the case of minloc(array,mask), mask will be in the second
|
|
|
|
position of the argument list and we'll have to fix that up. */
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2004-06-14 17:56:50 +02:00
|
|
|
gfc_expr *a, *m, *d;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-14 17:56:50 +02:00
|
|
|
a = ap->expr;
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (a, 0) || !array_check (a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-14 17:56:50 +02:00
|
|
|
d = ap->next->expr;
|
|
|
|
m = ap->next->next->expr;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-06-14 17:56:50 +02:00
|
|
|
if (m == NULL && d != NULL && d->ts.type == BT_LOGICAL
|
2005-02-24 19:26:27 +01:00
|
|
|
&& ap->next->name == NULL)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2004-06-14 17:56:50 +02:00
|
|
|
m = d;
|
|
|
|
d = NULL;
|
|
|
|
ap->next->expr = NULL;
|
|
|
|
ap->next->next->expr = m;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (d, 1, false))
|
|
|
|
return false;
|
2006-02-14 20:25:36 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (d, a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (m != NULL && !type_check (m, 2, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-06-07 15:45:47 +02:00
|
|
|
if (m != NULL
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_check_conformance (a, m,
|
|
|
|
"arguments '%s' and '%s' for intrinsic %s",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[2]->name,
|
|
|
|
gfc_current_intrinsic))
|
|
|
|
return false;
|
2006-01-31 23:52:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-08-19 17:31:37 +02:00
|
|
|
/* Similar to minloc/maxloc, the argument list might need to be
|
|
|
|
reordered for the MINVAL, MAXVAL, PRODUCT, and SUM intrinsics. The
|
|
|
|
difference is that MINLOC/MAXLOC take an additional KIND argument.
|
|
|
|
The possibilities are:
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
Arg #2 Arg #3
|
|
|
|
NULL NULL
|
|
|
|
DIM NULL
|
|
|
|
MASK NULL
|
|
|
|
NULL MASK minval(array, mask=m)
|
|
|
|
DIM MASK
|
2004-08-19 17:31:37 +02:00
|
|
|
|
|
|
|
I.e. in the case of minval(array,mask), mask will be in the second
|
|
|
|
position of the argument list and we'll have to fix that up. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
static bool
|
2007-01-07 01:28:29 +01:00
|
|
|
check_reduction (gfc_actual_arglist *ap)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2006-01-31 23:52:49 +01:00
|
|
|
gfc_expr *a, *m, *d;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2006-01-31 23:52:49 +01:00
|
|
|
a = ap->expr;
|
2004-08-19 17:31:37 +02:00
|
|
|
d = ap->next->expr;
|
|
|
|
m = ap->next->next->expr;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2004-08-19 17:31:37 +02:00
|
|
|
if (m == NULL && d != NULL && d->ts.type == BT_LOGICAL
|
2005-02-24 19:26:27 +01:00
|
|
|
&& ap->next->name == NULL)
|
2004-08-19 17:31:37 +02:00
|
|
|
{
|
|
|
|
m = d;
|
|
|
|
d = NULL;
|
|
|
|
ap->next->expr = NULL;
|
|
|
|
ap->next->next->expr = m;
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (d, 1, false))
|
|
|
|
return false;
|
2006-02-14 20:25:36 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (d, a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (m != NULL && !type_check (m, 2, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-06-07 15:45:47 +02:00
|
|
|
if (m != NULL
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_check_conformance (a, m,
|
|
|
|
"arguments '%s' and '%s' for intrinsic %s",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[2]->name,
|
|
|
|
gfc_current_intrinsic))
|
|
|
|
return false;
|
2006-01-31 23:52:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_minval_maxval (gfc_actual_arglist *ap)
|
2004-08-22 14:09:26 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (ap->expr, 0)
|
|
|
|
|| !array_check (ap->expr, 0))
|
|
|
|
return false;
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
|
2004-08-22 14:09:26 +02:00
|
|
|
return check_reduction (ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_product_sum (gfc_actual_arglist *ap)
|
2004-08-22 14:09:26 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (ap->expr, 0)
|
|
|
|
|| !array_check (ap->expr, 0))
|
|
|
|
return false;
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
|
2004-08-22 14:09:26 +02:00
|
|
|
return check_reduction (ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 07:55:10 +02:00
|
|
|
/* For IANY, IALL and IPARITY. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
gfc_check_mask (gfc_expr *i, gfc_expr *kind)
|
|
|
|
{
|
|
|
|
int k;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("I", i))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 1, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
|
|
|
if (kind)
|
|
|
|
gfc_extract_int (kind, &k);
|
|
|
|
else
|
|
|
|
k = gfc_default_integer_kind;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsizekind ("I", i, k))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 07:55:10 +02:00
|
|
|
gfc_check_transf_bit_intrins (gfc_actual_arglist *ap)
|
|
|
|
{
|
|
|
|
if (ap->expr->ts.type != BT_INTEGER)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be INTEGER",
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 07:55:10 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic, &ap->expr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 07:55:10 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (ap->expr, 0))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* intrinsic.c (add_functions): Support IALL, IANY, IPARITY.
(check_specific): Special case for those intrinsics.
* gfortran.h (gfc_isym_id): Add new intrinsics
* intrinsic.h (gfc_check_transf_bit_intrins,
gfc_simplify_iall, gfc_simplify_iany, gfc_simplify_iparity,
gfc_resolve_iall, gfc_resolve_iany, gfc_resolve_iparity):
New prototypes.
* iresolve.c (gfc_resolve_iall, gfc_resolve_iany,
gfc_resolve_iparity, resolve_transformational): New functions.
(gfc_resolve_product, gfc_resolve_sum,
gfc_resolve_parity): Use resolve_transformational.
* check.c (gfc_check_transf_bit_intrins): New function.
* simplify.c (gfc_simplify_iall, gfc_simplify_iany,
gfc_simplify_iparity, do_bit_any, do_bit_ior,
do_bit_xor, simplify_transformation): New functions.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_parity,
gfc_simplify_sum, gfc_simplify_product): Use simplify_transformation.
* trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function, gfc_is_intrinsic_libcall):
Handle IALL, IANY and IPARITY intrinsics.
* intrinsic.texi (IMAGE_INDEX): Move up to fix alphabetic
order.
(IALL, IANY, IPARITY): Document new intrinsics.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.dg/iall_iany_iparity_1.f90: New.
* gfortran.dg/iall_iany_iparity_2.f90: New.
2010-09-06 Tobias Burnus <burnus@net-b.de>
PR fortran/38282
* gfortran.map: Add new iany, iall and iparity intrinsics.
* Makefile.am: Ditto.
* m4/iany.m4: New.
* m4/iall.m4: New.
* m4/iparity.m4: New.
* Makefile.in: Regenerate.
* generated/iall_i1.c: Generate.
* generated/iall_i2.c: Generate.
* generated/iall_i4.c: Generate.
* generated/iall_i8.c: Generate.
* generated/iall_i16.c: Generate.
* generated/iany_i1.c: Generate.
* generated/iany_i2.c: Generate.
* generated/iany_i4.c: Generate.
* generated/iany_i8.c: Generate.
* generated/iany_i16.c: Generate.
* generated/iparity_i1.c: Generate.
* generated/iparity_i2.c: Generate.
* generated/iparity_i4.c: Generate.
* generated/iparity_i8.c: Generate.
* generated/iparity_i16.c: Generate.
From-SVN: r163898
2010-09-06 07:55:10 +02:00
|
|
|
|
|
|
|
return check_reduction (ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (tsource, 0, fsource, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 2, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-09-21 12:44:20 +02:00
|
|
|
if (tsource->ts.type == BT_CHARACTER)
|
2008-12-18 11:05:54 +01:00
|
|
|
return gfc_check_same_strlen (tsource, fsource, "MERGE intrinsic");
|
2007-09-21 12:44:20 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-09-21 12:44:20 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
gfc_check_merge_bits (gfc_expr *i, gfc_expr *j, gfc_expr *mask)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (j, 1, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 2, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (i, 0, j, 1))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (i, 0, mask, 2))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (from, 0, false))
|
|
|
|
return false;
|
|
|
|
if (!allocatable_check (from, 0))
|
|
|
|
return false;
|
2012-06-18 20:14:06 +02:00
|
|
|
if (gfc_is_coindexed (from))
|
|
|
|
{
|
|
|
|
gfc_error ("The FROM argument to MOVE_ALLOC at %L shall not be "
|
|
|
|
"coindexed", &from->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2012-06-18 20:14:06 +02:00
|
|
|
}
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (to, 1, false))
|
|
|
|
return false;
|
|
|
|
if (!allocatable_check (to, 1))
|
|
|
|
return false;
|
2012-06-18 20:14:06 +02:00
|
|
|
if (gfc_is_coindexed (to))
|
|
|
|
{
|
|
|
|
gfc_error ("The TO argument to MOVE_ALLOC at %L shall not be "
|
|
|
|
"coindexed", &to->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2012-06-18 20:14:06 +02:00
|
|
|
}
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
|
2011-12-03 12:03:30 +01:00
|
|
|
if (from->ts.type == BT_CLASS && to->ts.type == BT_DERIVED)
|
2011-11-29 10:57:40 +01:00
|
|
|
{
|
2011-12-03 12:03:30 +01:00
|
|
|
gfc_error ("The TO arguments in MOVE_ALLOC at %L must be "
|
|
|
|
"polymorphic if FROM is polymorphic",
|
2012-06-18 20:14:06 +02:00
|
|
|
&to->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-11-29 10:57:40 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (to, 1, from, 0))
|
|
|
|
return false;
|
2011-12-03 12:03:30 +01:00
|
|
|
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
if (to->rank != from->rank)
|
|
|
|
{
|
2012-06-18 20:14:06 +02:00
|
|
|
gfc_error ("The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L "
|
|
|
|
"must have the same rank %d/%d", &to->where, from->rank,
|
|
|
|
to->rank);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2012-06-18 20:14:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* IR F08/0040; cf. 12-006A. */
|
|
|
|
if (gfc_get_corank (to) != gfc_get_corank (from))
|
|
|
|
{
|
|
|
|
gfc_error ("The FROM and TO arguments of the MOVE_ALLOC intrinsic at %L "
|
|
|
|
"must have the same corank %d/%d", &to->where,
|
|
|
|
gfc_get_corank (from), gfc_get_corank (to));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
}
|
|
|
|
|
2012-12-28 12:22:14 +01:00
|
|
|
/* CLASS arguments: Make sure the vtab of from is present. */
|
|
|
|
if (to->ts.type == BT_CLASS && !UNLIMITED_POLY (from))
|
2013-12-18 23:00:53 +01:00
|
|
|
gfc_find_vtab (&from->ts);
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
[multiple changes]
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* interface.c (gfc_compare_derived_types): Add comparison of
the allocatable field.
* intrinsic.c (add_subroutines): Add MOVE_ALLOC.
* trans-expr.c (gfc_conv_aliased_arg, gfc_trans_subarray_assign,
gfc_trans_subcomponent_assign, gfc_conv_string_parameter,
gfc_trans_scalar_assign): Add extra arguments l_is_temp
and r_is_var to references to latter function.
(gfc_conv_function_call): Add enum for types of argument and
an associated variable parm_kind. Deallocate components of
INTENT(OUT) and non-variable arrays.
(gfc_trans_subcomponent_assign): Add block to assign arrays
to allocatable components.
(gfc_trans_scalar_assign): Add block to handle assignments of
derived types with allocatable components, using the above new
arguments to control allocation/deallocation of memory and the
copying of allocated arrays.
* trans-array.c (gfc_array_allocate): Remove old identification
of pointer and replace with that of an allocatable array. Add
nullify of structures with allocatable components.
(gfc_conv_array_initializer): Treat EXPR_NULL.
(gfc_conv_array_parameter): Deallocate allocatable components
of non-variable structures.
(gfc_trans_dealloc_allocated): Use second argument of library
deallocate to inhibit, without error, freeing NULL pointers.
(get_full_array_size): New function to return the size of a
full array.
(gfc_duplicate_allocatable): New function to allocate and copy
allocated data.
(structure_alloc_comps): New recursive function to deallocate,
nullify or copy allocatable components.
(gfc_nullify_alloc_comp, gfc_deallocate_alloc_comp,
gfc_copy_alloc_comp): New interface functions to call previous.
(gfc_trans_deferred_array): Add the code to nullify allocatable
components, when entering scope, and to deallocate them on
leaving. Do not call gfc_trans_static_array_pointer and return
for structures with allocatable components and default
initializers.
* symbol.c (gfc_set_component_attr): Set allocatable field.
(gfc_get_component_attr): Set the allocatable attribute.
* intrinsic.h : Prototype for gfc_check_move_alloc.
* decl.c (build_struct): Apply TR15581 constraints for
allocatable components.
(variable_decl): Default initializer is always NULL for
allocatable components.
(match_attr_spec): Allow, or not, allocatable components,
according to the standard in force.
* trans-array.h : Prototypes for gfc_nullify_alloc_comp,
gfc_deallocate_alloc_comp, gfc_copy_alloc_comp and
gfc_duplicate_allocatable.
* gfortran.texi : Add mention of TR15581 extensions.
* gfortran.h : Add attribute alloc_comp, add
gfc_components field allocatable and add the prototype
for gfc_expr_to_initialize.
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp, gfc_trans_where_assign,
gfc_trans_where_3): Add extra arguments to calls to
gfc_trans_scalar_assign and set appropriately.
(gfc_trans_allocate): Nullify allocatable components.
(gfc_trans_deallocate): Deallocate to ultimate allocatable
components but stop at ultimate pointer components.
* module.c (mio_symbol_attribute, mio_symbol_attribute,
mio_component): Add module support for allocatable
components.
* trans-types.c (gfc_get_derived_type): Treat allocatable
components.
* trans.h : Add two boolean arguments to
gfc_trans_scalar_assign.
* resolve.c (resolve_structure_cons): Check conformance of
constructor element and the component.
(resolve_allocate_expr): Add expression to nullify the
constructor expression for allocatable components.
(resolve_transfer): Inhibit I/O of derived types with
allocatable components.
(resolve_fl_derived): Skip check of bounds of allocatable
components.
* trans-decl.c (gfc_get_symbol_decl): Add derived types
with allocatable components to deferred variable.
(gfc_trans_deferred_vars): Make calls for derived types
with allocatable components to gfc_trans_deferred_array.
(gfc_generate_function_code): Nullify allocatable
component function result on entry.
* parse.c (parse_derived): Set symbol attr.allocatable if
allocatable components are present.
* check.c (gfc_check_allocated): Enforce attr.allocatable
for intrinsic arguments.
(gfc_check_move_alloc): Check arguments of move_alloc.
* primary.c (gfc_variable_attr): Set allocatable attribute.
* intrinsic.texi : Add index entry and section for
for move_alloc.
PR fortran/29115
* resolve.c (resolve_structure_cons): It is an error if the
pointer component elements of a derived type constructor are
not pointer or target.
PR fortran/29211
* trans-stmt.c (generate_loop_for_temp_to_lhs,
generate_loop_for_rhs_to_temp): Provide a string length for
the temporary by copying that of the other side of the scalar
assignment.
2006-10-05 Paul Thomas <pault@gcc.gnu.org>
Erik Edelmann <edelmann@gcc.gnu.org>
PR libgfortran/20541
* Makefile.in : Add move_alloc.
* intrinsics/move_alloc.c: New function.
* Makefile.am : Add move_alloc.
2006-10-05 Erik Edelmann <edelmann@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/20541
* gfortran.dg/alloc_comp_basics_1.f90: New test.
* gfortran.dg/alloc_comp_basics_2.f90: New test.
* gfortran.dg/alloc_comp_assign_1.f90: New test.
* gfortran.dg/alloc_comp_assign_2.f90: New test.
* gfortran.dg/alloc_comp_assign_3.f90: New test.
* gfortran.dg/alloc_comp_assign_4.f90: New test.
* gfortran.dg/alloc_comp_constraint_1.f90: New test.
* gfortran.dg/alloc_comp_constraint_2.f90: New test.
* gfortran.dg/alloc_comp_constraint_3.f90: New test.
* gfortran.dg/alloc_comp_constructor_1.f90: New test.
* gfortran.dg/alloc_comp_constructor_2.f90: New test.
* gfortran.dg/alloc_comp_initializer_1.f90: New test.
* gfortran.dg/alloc_comp_std.f90: New test.
* gfortran.dg/move_alloc.f90: New test.
PR fortran/29115
* gfortran.dg/derived_constructor_comps_2.f90: New test.
PR fortran/29211
* gfortran.dg/forall_char_dependencies_1.f90: New test.
From-SVN: r117558
2006-10-08 18:21:55 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_nearest (gfc_expr *x, gfc_expr *s)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (s, 1, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2011-10-28 17:15:25 +02:00
|
|
|
if (s->expr_type == EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
if (mpfr_sgn (s->value.real) == 0)
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("Argument %<S%> of NEAREST at %L shall not be zero",
|
2011-10-28 17:15:25 +02:00
|
|
|
&s->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-10-28 17:15:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_new_line (gfc_expr *a)
|
2006-10-08 15:21:42 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2006-10-08 15:21:42 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2006-10-08 15:21:42 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
gfc_check_norm2 (gfc_expr *array, gfc_expr *dim)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (array, 0, BT_REAL))
|
|
|
|
return false;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, array, false))
|
|
|
|
return false;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_null (gfc_expr *mold)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
|
|
|
|
|
|
|
if (mold == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (mold, 0, true))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
attr = gfc_variable_attr (mold, NULL);
|
|
|
|
|
2011-09-14 08:26:07 +02:00
|
|
|
if (!attr.pointer && !attr.proc_pointer && !attr.allocatable)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a POINTER, "
|
2011-09-14 08:26:07 +02:00
|
|
|
"ALLOCATABLE or procedure pointer",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
2011-05-27 23:29:19 +02:00
|
|
|
gfc_current_intrinsic, &mold->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-05-27 23:29:19 +02:00
|
|
|
}
|
|
|
|
|
2011-09-14 08:26:07 +02:00
|
|
|
if (attr.allocatable
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_F2003, "NULL intrinsic with "
|
|
|
|
"allocatable MOLD at %L", &mold->where))
|
|
|
|
return false;
|
2011-09-14 08:26:07 +02:00
|
|
|
|
2011-05-27 23:29:19 +02:00
|
|
|
/* F2008, C1242. */
|
|
|
|
if (gfc_is_coindexed (mold))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be "
|
2012-02-17 11:51:10 +01:00
|
|
|
"coindexed", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &mold->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 1, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_check_conformance (array, mask,
|
|
|
|
"arguments '%s' and '%s' for intrinsic '%s'",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[1]->name,
|
|
|
|
gfc_current_intrinsic))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (vector != NULL)
|
|
|
|
{
|
2009-06-06 20:51:29 +02:00
|
|
|
mpz_t array_size, vector_size;
|
|
|
|
bool have_array_size, have_vector_size;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (array, 0, vector, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (vector, 2, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-06-06 20:51:29 +02:00
|
|
|
/* VECTOR requires at least as many elements as MASK
|
|
|
|
has .TRUE. values. */
|
2013-04-10 23:36:58 +02:00
|
|
|
have_array_size = gfc_array_size(array, &array_size);
|
|
|
|
have_vector_size = gfc_array_size(vector, &vector_size);
|
2009-06-06 20:51:29 +02:00
|
|
|
|
|
|
|
if (have_vector_size
|
|
|
|
&& (mask->expr_type == EXPR_ARRAY
|
|
|
|
|| (mask->expr_type == EXPR_CONSTANT
|
|
|
|
&& have_array_size)))
|
|
|
|
{
|
|
|
|
int mask_true_values = 0;
|
|
|
|
|
|
|
|
if (mask->expr_type == EXPR_ARRAY)
|
|
|
|
{
|
2010-04-13 03:59:35 +02:00
|
|
|
gfc_constructor *mask_ctor;
|
|
|
|
mask_ctor = gfc_constructor_first (mask->value.constructor);
|
2009-06-06 20:51:29 +02:00
|
|
|
while (mask_ctor)
|
|
|
|
{
|
|
|
|
if (mask_ctor->expr->expr_type != EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
mask_true_values = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mask_ctor->expr->value.logical)
|
|
|
|
mask_true_values++;
|
|
|
|
|
2010-04-13 03:59:35 +02:00
|
|
|
mask_ctor = gfc_constructor_next (mask_ctor);
|
2009-06-06 20:51:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mask->expr_type == EXPR_CONSTANT && mask->value.logical)
|
|
|
|
mask_true_values = mpz_get_si (array_size);
|
|
|
|
|
|
|
|
if (mpz_get_si (vector_size) < mask_true_values)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must "
|
2009-06-06 20:51:29 +02:00
|
|
|
"provide at least as many elements as there "
|
2014-12-11 16:13:33 +01:00
|
|
|
"are .TRUE. values in %qs (%ld/%d)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[2]->name,
|
|
|
|
gfc_current_intrinsic, &vector->where,
|
|
|
|
gfc_current_intrinsic_arg[1]->name,
|
2009-06-06 20:51:29 +02:00
|
|
|
mpz_get_si (vector_size), mask_true_values);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-06 20:51:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (have_array_size)
|
|
|
|
mpz_clear (array_size);
|
|
|
|
if (have_vector_size)
|
|
|
|
mpz_clear (vector_size);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
gfc_check_parity (gfc_expr *mask, gfc_expr *dim)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 0, BT_LOGICAL))
|
|
|
|
return false;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (mask, 0))
|
|
|
|
return false;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, mask, false))
|
|
|
|
return false;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/33197 (Fortran 2008: math functions)
gcc/fortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/fortran/intrinsic.c (add_functions): Add norm2 and parity.
* gcc/fortran/intrinsic.h (gfc_check_norm2, gfc_check_parity):
gfc_simplify_norm2, gfc_simplify_parity, gfc_resolve_norm2,
gfc_resolve_parity): New prototypes.
* gcc/fortran/gfortran.h (gfc_isym_id): New enum items
GFC_ISYM_NORM2 and GFC_ISYM_PARITY.
* gcc/fortran/iresolve.c (gfc_resolve_norm2,
gfc_resolve_parity): New functions.
* gcc/fortran/check.c (gfc_check_norm2, gfc_check_parity):
New functions.
* gcc/fortran/trans-intrinsic.c (gfc_conv_intrinsic_arith,
gfc_conv_intrinsic_function): Handle NORM2 and PARITY.
* gcc/fortran/intrinsic.texi (NORM2, PARITY): Add.
* gcc/fortran/simplify.c (simplify_transformation_to_array):
Add post-processing opterator.
(gfc_simplify_all, gfc_simplify_any, gfc_simplify_count,
gfc_simplify_product, gfc_simplify_sum): Update call.
(add_squared, do_sqrt, gfc_simplify_norm2, do_xor,
gfc_simplify_parity): New functions.
gcc/testsuite/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* gcc/testsuite/gfortran.dg/norm2_1.f90: New.
* gcc/testsuite/gfortran.dg/norm2_2.f90: New.
* gcc/testsuite/gfortran.dg/norm2_3.f90: New.
* gcc/testsuite/gfortran.dg/norm2_4.f90: New.
* gcc/testsuite/gfortran.dg/parity_1.f90: New.
* gcc/testsuite/gfortran.dg/parity_2.f90: New.
* gcc/testsuite/gfortran.dg/parity_3.f90: New.
libgfortran/
2010-08-27 Tobias Burnus <burnus@net-b.de>
PR fortran/33197
* libgfortran/m4/ifunction.m4 (FINISH_ARRAY_FUNCTION,
ARRAY_FUNCTION): Allow expression after loop.
* libgfortran/m4/norm2.m4: New for _gfortran_norm2_r{4,8,10,16}.
* libgfortran/m4/parity.m4: New for
* _gfortran_parity_l{1,2,4,8,16}.
* libgfortran/gfortran.map: Add new functions.
* libgfortran/Makefile.am: Ditto.
* libgfortran/m4/minloc1.m4: Add empty argument for
* ARRAY_FUNCTION.
* libgfortran/m4/maxloc1.m4: Ditto.
* libgfortran/m4/all.m4: Ditto.
* libgfortran/m4/minval.m4: Ditto.
* libgfortran/m4/maxval.m4: Ditto.
* libgfortran/m4/count.m4: Ditto.
* libgfortran/m4/product.m4: Ditto.
* libgfortran/m4/any.m4: Ditto.
* Makefile.in: Regenerated.
* generated/minval_r8.c: Regenerated.
* generated/maxloc1_4_r8.c: Regenerated.
* generated/minloc1_16_r16.c: Regenerated.
* generated/norm2_r4.c: Regenerated.
* generated/sum_i8.c: Regenerated.
* generated/parity_l2.c: Regenerated.
* generated/any_l16.c: Regenerated.
* generated/maxval_i2.c: Regenerated.
* generated/any_l2.c: Regenerated.
* generated/product_r4.c: Regenerated.
* generated/maxloc1_8_i4.c: Regenerated.
* generated/parity_l16.c: Regenerated.
* generated/all_l1.c: Regenerated.
* generated/product_i2.c: Regenerated.
* generated/minloc1_8_r16.c: Regenerated.
* generated/maxloc1_8_r16.c: Regenerated.
* generated/sum_r16.c: Regenerated.
* generated/sum_i1.c: Regenerated.
* generated/minloc1_4_r8.c: Regenerated.
* generated/maxloc1_16_r16.c: Regenerated.
* generated/minloc1_16_i4.c: Regenerated.
* generated/maxloc1_16_i4.c: Regenerated.
* generated/maxval_r16.c: Regenerated.
* generated/product_c10.c: Regenerated.
* generated/minloc1_8_i4.c: Regenerated.
* generated/all_l2.c: Regenerated.
* generated/product_c4.c: Regenerated.
* generated/sum_r4.c: Regenerated.
* generated/all_l16.c: Regenerated.
* generated/minloc1_16_r10.c: Regenerated.
* generated/sum_i2.c: Regenerated.
* generated/maxloc1_8_r8.c: Regenerated.
* generated/minval_i16.c: Regenerated.
* generated/parity_l4.c: Regenerated.
* generated/maxval_i4.c: Regenerated.
* generated/any_l4.c: Regenerated.
* generated/minval_i8.c: Regenerated.
* generated/maxloc1_4_i8.c: Regenerated.
* generated/minloc1_4_i16.c: Regenerated.
* generated/maxloc1_4_i16.c: Regenerated.
* generated/minloc1_8_r10.c: Regenerated.
* generated/product_i4.c: Regenerated.
* generated/maxloc1_8_r10.c: Regenerated.
* generated/sum_c16.c: Regenerated.
* generated/minloc1_16_r8.c: Regenerated.
* generated/maxloc1_16_r8.c: Regenerated.
* generated/count_4_l.c: Regenerated.
* generated/sum_r10.c: Regenerated.
* generated/count_8_l.c: Regenerated.
* generated/sum_c4.c: Regenerated.
* generated/maxloc1_16_r10.c: Regenerated.
* generated/minloc1_8_r8.c: Regenerated.
* generated/maxval_r10.c: Regenerated.
* generated/minval_i1.c: Regenerated.
* generated/maxloc1_4_i1.c: Regenerated.
* generated/minloc1_4_i8.c: Regenerated.
* generated/product_i16.c: Regenerated.
* generated/all_l4.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/minval_r4.c: Regenerated.
* generated/maxloc1_4_r4.c: Regenerated.
* generated/sum_i4.c: Regenerated.
* generated/maxval_r8.c: Regenerated.
* generated/norm2_r8.c: Regenerated.
* generated/minloc1_4_i1.c: Regenerated.
* generated/minval_r16.c: Regenerated.
* generated/minval_i2.c: Regenerated.
* generated/maxloc1_4_i2.c: Regenerated.
* generated/product_r8.c: Regenerated.
* generated/maxloc1_8_i8.c: Regenerated.
* generated/sum_c10.c: Regenerated.
* generated/minloc1_4_r16.c: Regenerated.
* generated/maxloc1_4_r16.c: Regenerated.
* generated/count_1_l.c: Regenerated.
* generated/minloc1_4_r4.c: Regenerated.
* generated/minloc1_16_i8.c: Regenerated.
* generated/maxloc1_16_i8.c: Regenerated.
* generated/minloc1_4_i2.c: Regenerated.
* generated/maxloc1_8_i1.c: Regenerated.
* generated/minloc1_8_i8.c: Regenerated.
* generated/product_r16.c: Regenerated.
* generated/product_c8.c: Regenerated.
* generated/sum_r8.c: Regenerated.
* generated/norm2_r10.c: Regenerated.
* generated/minloc1_16_i16.c: Regenerated.
* generated/maxloc1_8_r4.c: Regenerated.
* generated/minloc1_16_i1.c: Regenerated.
* generated/maxloc1_16_i1.c: Regenerated.
* generated/minval_r10.c: Regenerated.
* generated/count_16_l.c: Regenerated.
* generated/parity_l8.c: Regenerated.
* generated/minloc1_8_i1.c: Regenerated.
* generated/minval_i4.c: Regenerated.
* generated/maxloc1_4_i4.c: Regenerated.
* generated/maxloc1_8_i2.c: Regenerated.
* generated/maxval_i8.c: Regenerated.
* generated/any_l8.c: Regenerated.
* generated/minloc1_4_r10.c: Regenerated.
* generated/minloc1_8_i16.c: Regenerated.
* generated/maxloc1_4_r10.c: Regenerated.
* generated/maxloc1_8_i16.c: Regenerated.
* generated/minloc1_16_r4.c: Regenerated.
* generated/maxloc1_16_r4.c: Regenerated.
* generated/product_i8.c: Regenerated.
* generated/sum_i16.c: Regenerated.
* generated/count_2_l.c: Regenerated.
* generated/maxloc1_16_i16.c: Regenerated.
* generated/minloc1_8_r4.c: Regenerated.
* generated/sum_c8.c: Regenerated.
* generated/minloc1_16_i2.c: Regenerated.
* generated/maxloc1_16_i2.c: Regenerated.
* generated/parity_l1.c: Regenerated.
* generated/maxval_i16.c: Regenerated.
* generated/maxval_i1.c: Regenerated.
* generated/minloc1_4_i4.c: Regenerated.
* generated/any_l1.c: Regenerated.
* generated/minloc1_8_i2.c: Regenerated.
* generated/product_c16.c: Regenerated.
* generated/product_r10.c: Regenerated.
* generated/product_i1.c: Regenerated.
* generated/all_l8.c: Regenerated.
* generated/maxval_r4.c: Regenerated.
From-SVN: r163595
2010-08-27 21:17:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_precision (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!real_or_complex_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_present (gfc_expr *a)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
gfc_symbol *sym;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (a, 0, true))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
sym = a->symtree->n.sym;
|
|
|
|
if (!sym->attr.dummy)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of a "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"dummy variable", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!sym->attr.optional)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"an OPTIONAL dummy variable",
|
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
/* 13.14.82 PRESENT(A)
|
|
|
|
......
|
|
|
|
Argument. A shall be the name of an optional dummy argument that is
|
|
|
|
accessible in the subprogram in which the PRESENT function reference
|
|
|
|
appears... */
|
2006-07-13 07:07:35 +02:00
|
|
|
|
|
|
|
if (a->ref != NULL
|
2007-01-07 01:28:29 +01:00
|
|
|
&& !(a->ref->next == NULL && a->ref->type == REF_ARRAY
|
2011-07-21 14:00:25 +02:00
|
|
|
&& (a->ref->u.ar.type == AR_FULL
|
|
|
|
|| (a->ref->u.ar.type == AR_ELEMENT
|
|
|
|
&& a->ref->u.ar.as->rank == 0))))
|
2006-07-13 07:07:35 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must not be a "
|
|
|
|
"subobject of %qs", gfc_current_intrinsic_arg[0]->name,
|
2006-07-13 07:07:35 +02:00
|
|
|
gfc_current_intrinsic, &a->where, sym->name);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2006-07-13 07:07:35 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_radix (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_range (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2011-05-27 20:51:31 +02:00
|
|
|
gfc_check_rank (gfc_expr *a ATTRIBUTE_UNUSED)
|
|
|
|
{
|
|
|
|
/* Any data object is allowed; a "data object" is a "constant (4.1.3),
|
|
|
|
variable (6), or subobject of a constant (2.4.3.2.3)" (F2008, 1.3.45). */
|
|
|
|
|
|
|
|
bool is_variable = true;
|
|
|
|
|
2014-09-20 13:48:00 +02:00
|
|
|
/* Functions returning pointers are regarded as variable, cf. F2008, R602. */
|
2012-12-20 01:15:00 +01:00
|
|
|
if (a->expr_type == EXPR_FUNCTION)
|
2011-05-27 20:51:31 +02:00
|
|
|
is_variable = a->value.function.esym
|
|
|
|
? a->value.function.esym->result->attr.pointer
|
|
|
|
: a->symtree->n.sym->result->attr.pointer;
|
|
|
|
|
|
|
|
if (a->expr_type == EXPR_OP || a->expr_type == EXPR_NULL
|
|
|
|
|| a->expr_type == EXPR_COMPCALL|| a->expr_type == EXPR_PPC
|
|
|
|
|| !is_variable)
|
|
|
|
{
|
|
|
|
gfc_error ("The argument of the RANK intrinsic at %L must be a data "
|
|
|
|
"object", &a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-05-27 20:51:31 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2011-05-27 20:51:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* real, float, sngl. */
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_real (gfc_expr *a, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!numeric_check (a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 1, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_rename (gfc_expr *path1, gfc_expr *path2)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path1, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path1, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path2, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path2, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_rename_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path1, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path1, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (path2, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (path2, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_repeat (gfc_expr *x, gfc_expr *y)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (y, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (y, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
|
|
|
|
gfc_expr *pad, gfc_expr *order)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
mpz_t size;
|
2006-11-10 22:06:42 +01:00
|
|
|
mpz_t nelems;
|
2009-06-04 23:52:32 +02:00
|
|
|
int shape_size;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (source, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (shape, 1, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (shape, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_array_size (shape, &size))
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<shape%> argument of %<reshape%> intrinsic at %L must be an "
|
2004-05-13 08:41:07 +02:00
|
|
|
"array of constant size", &shape->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2009-06-04 23:52:32 +02:00
|
|
|
shape_size = mpz_get_ui (size);
|
2004-05-13 08:41:07 +02:00
|
|
|
mpz_clear (size);
|
|
|
|
|
2009-06-04 23:52:32 +02:00
|
|
|
if (shape_size <= 0)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L is empty",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
2009-06-04 23:52:32 +02:00
|
|
|
&shape->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
}
|
|
|
|
else if (shape_size > GFC_MAX_DIMENSIONS)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<shape%> argument of %<reshape%> intrinsic at %L has more "
|
2005-09-17 20:58:01 +02:00
|
|
|
"than %d elements", &shape->where, GFC_MAX_DIMENSIONS);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2013-11-05 21:02:43 +01:00
|
|
|
else if (shape->expr_type == EXPR_ARRAY && gfc_is_constant_expr (shape))
|
2009-06-04 23:52:32 +02:00
|
|
|
{
|
|
|
|
gfc_expr *e;
|
|
|
|
int i, extent;
|
|
|
|
for (i = 0; i < shape_size; ++i)
|
|
|
|
{
|
2010-04-13 03:59:35 +02:00
|
|
|
e = gfc_constructor_lookup_expr (shape->value.constructor, i);
|
2009-06-04 23:52:32 +02:00
|
|
|
if (e->expr_type != EXPR_CONSTANT)
|
2010-04-13 03:59:35 +02:00
|
|
|
continue;
|
2009-06-04 23:52:32 +02:00
|
|
|
|
|
|
|
gfc_extract_int (e, &extent);
|
|
|
|
if (extent < 0)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L has "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"negative element (%d)",
|
|
|
|
gfc_current_intrinsic_arg[1]->name,
|
2009-06-04 23:52:32 +02:00
|
|
|
gfc_current_intrinsic, &e->where, extent);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-11-07 21:18:17 +01:00
|
|
|
else if (shape->expr_type == EXPR_VARIABLE && shape->ref
|
|
|
|
&& shape->ref->u.ar.type == AR_FULL && shape->ref->u.ar.dimen == 1
|
|
|
|
&& shape->ref->u.ar.as
|
|
|
|
&& shape->ref->u.ar.as->lower[0]->expr_type == EXPR_CONSTANT
|
|
|
|
&& shape->ref->u.ar.as->lower[0]->ts.type == BT_INTEGER
|
|
|
|
&& shape->ref->u.ar.as->upper[0]->expr_type == EXPR_CONSTANT
|
|
|
|
&& shape->ref->u.ar.as->upper[0]->ts.type == BT_INTEGER
|
|
|
|
&& shape->symtree->n.sym->attr.flavor == FL_PARAMETER)
|
|
|
|
{
|
|
|
|
int i, extent;
|
|
|
|
gfc_expr *e, *v;
|
|
|
|
|
|
|
|
v = shape->symtree->n.sym->value;
|
|
|
|
|
|
|
|
for (i = 0; i < shape_size; i++)
|
|
|
|
{
|
|
|
|
e = gfc_constructor_lookup_expr (v->value.constructor, i);
|
|
|
|
if (e == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
gfc_extract_int (e, &extent);
|
|
|
|
|
|
|
|
if (extent < 0)
|
|
|
|
{
|
|
|
|
gfc_error ("Element %d of actual argument of RESHAPE at %L "
|
|
|
|
"cannot be negative", i + 1, &shape->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
if (pad != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (source, 0, pad, 2))
|
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (pad, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2009-06-04 23:52:32 +02:00
|
|
|
if (order != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (order, 3))
|
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (order, 3, BT_INTEGER))
|
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
|
|
|
|
if (order->expr_type == EXPR_ARRAY)
|
|
|
|
{
|
|
|
|
int i, order_size, dim, perm[GFC_MAX_DIMENSIONS];
|
|
|
|
gfc_expr *e;
|
|
|
|
|
|
|
|
for (i = 0; i < GFC_MAX_DIMENSIONS; ++i)
|
|
|
|
perm[i] = 0;
|
|
|
|
|
|
|
|
gfc_array_size (order, &size);
|
|
|
|
order_size = mpz_get_ui (size);
|
|
|
|
mpz_clear (size);
|
|
|
|
|
|
|
|
if (order_size != shape_size)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L "
|
2012-12-20 01:15:00 +01:00
|
|
|
"has wrong number of elements (%d/%d)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[3]->name,
|
2009-06-04 23:52:32 +02:00
|
|
|
gfc_current_intrinsic, &order->where,
|
|
|
|
order_size, shape_size);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 1; i <= order_size; ++i)
|
|
|
|
{
|
2010-04-13 03:59:35 +02:00
|
|
|
e = gfc_constructor_lookup_expr (order->value.constructor, i-1);
|
2009-06-04 23:52:32 +02:00
|
|
|
if (e->expr_type != EXPR_CONSTANT)
|
2010-04-13 03:59:35 +02:00
|
|
|
continue;
|
2009-06-04 23:52:32 +02:00
|
|
|
|
|
|
|
gfc_extract_int (e, &dim);
|
|
|
|
|
|
|
|
if (dim < 1 || dim > order_size)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L "
|
2012-12-20 01:15:00 +01:00
|
|
|
"has out-of-range dimension (%d)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[3]->name,
|
2009-06-04 23:52:32 +02:00
|
|
|
gfc_current_intrinsic, &e->where, dim);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (perm[dim-1] != 0)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L has "
|
2009-06-04 23:52:32 +02:00
|
|
|
"invalid permutation of dimensions (dimension "
|
2015-12-12 19:55:25 +01:00
|
|
|
"%qd duplicated)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[3]->name,
|
2009-06-04 23:52:32 +02:00
|
|
|
gfc_current_intrinsic, &e->where, dim);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-04 23:52:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
perm[dim-1] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
if (pad == NULL && shape->expr_type == EXPR_ARRAY
|
|
|
|
&& gfc_is_constant_expr (shape)
|
|
|
|
&& !(source->expr_type == EXPR_VARIABLE && source->symtree->n.sym->as
|
|
|
|
&& source->symtree->n.sym->as->type == AS_ASSUMED_SIZE))
|
2006-11-10 22:06:42 +01:00
|
|
|
{
|
|
|
|
/* Check the match in size between source and destination. */
|
2013-04-10 23:36:58 +02:00
|
|
|
if (gfc_array_size (source, &nelems))
|
2006-11-10 22:06:42 +01:00
|
|
|
{
|
|
|
|
gfc_constructor *c;
|
|
|
|
bool test;
|
|
|
|
|
2012-12-20 01:15:00 +01:00
|
|
|
|
2006-11-10 22:06:42 +01:00
|
|
|
mpz_init_set_ui (size, 1);
|
2010-04-13 03:59:35 +02:00
|
|
|
for (c = gfc_constructor_first (shape->value.constructor);
|
|
|
|
c; c = gfc_constructor_next (c))
|
2006-11-10 22:06:42 +01:00
|
|
|
mpz_mul (size, size, c->expr->value.integer);
|
|
|
|
|
|
|
|
test = mpz_cmp (nelems, size) < 0 && mpz_cmp_ui (size, 0) > 0;
|
|
|
|
mpz_clear (nelems);
|
|
|
|
mpz_clear (size);
|
|
|
|
|
|
|
|
if (test)
|
|
|
|
{
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_error ("Without padding, there are not enough elements "
|
|
|
|
"in the intrinsic RESHAPE source at %L to match "
|
|
|
|
"the shape", &source->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2006-11-10 22:06:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
gfc_check_same_type_as (gfc_expr *a, gfc_expr *b)
|
|
|
|
{
|
|
|
|
if (a->ts.type != BT_DERIVED && a->ts.type != BT_CLASS)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L "
|
2012-12-20 01:15:00 +01:00
|
|
|
"cannot be of type %s",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic,
|
|
|
|
&a->where, gfc_typename (&a->ts));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
}
|
|
|
|
|
2012-12-20 01:15:00 +01:00
|
|
|
if (!(gfc_type_is_extensible (a->ts.u.derived) || UNLIMITED_POLY (a)))
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"must be of an extensible type",
|
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (b->ts.type != BT_DERIVED && b->ts.type != BT_CLASS)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L "
|
2012-12-20 01:15:00 +01:00
|
|
|
"cannot be of type %s",
|
|
|
|
gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic,
|
|
|
|
&b->where, gfc_typename (&b->ts));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
}
|
|
|
|
|
2012-12-20 01:15:00 +01:00
|
|
|
if (!(gfc_type_is_extensible (b->ts.u.derived) || UNLIMITED_POLY (b)))
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"must be of an extensible type",
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
&b->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/40996 ([F03] ALLOCATABLE scalars)
fortran/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* check.c (gfc_check_same_type_as): New function for checking
SAME_TYPE_AS and EXTENDS_TYPE_OF.
* decl.c (encapsulate_class_symbol): Set ABSTRACT attribute for class
container, if the contained type has it. Add an initializer for the
class container.
(add_init_expr_to_sym): Handle BT_CLASS.
(vindex_counter): New counter for setting vindices.
(gfc_match_derived_decl): Set vindex for all derived types, not only
those which are being extended.
* expr.c (gfc_check_assign_symbol): Handle NULL initialization of class
pointers.
* gfortran.h (gfc_isym_id): New values GFC_ISYM_SAME_TYPE_AS and
GFC_ISYM_EXTENDS_TYPE_OF.
(gfc_type_is_extensible): New prototype.
* intrinsic.h (gfc_check_same_type_as): New prototype.
* intrinsic.c (add_functions): Add SAME_TYPE_AS and EXTENDS_TYPE_OF.
* primary.c (gfc_expr_attr): Handle CLASS-valued functions.
* resolve.c (resolve_structure_cons): Handle BT_CLASS.
(type_is_extensible): Make non-static and rename to
'gfc_type_is_extensible.
(resolve_select_type): Renamed type_is_extensible.
(resolve_class_assign): Handle NULL pointers.
(resolve_fl_variable_derived): Renamed type_is_extensible.
(resolve_fl_derived): Ditto.
* trans-expr.c (gfc_trans_subcomponent_assign): Handle NULL
initialization of class pointer components.
(gfc_conv_structure): Handle BT_CLASS.
* trans-intrinsic.c (gfc_conv_same_type_as,gfc_conv_extends_type_of):
New functions.
(gfc_conv_intrinsic_function): Handle SAME_TYPE_AS and EXTENDS_TYPE_OF.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.h (type_selector, select_type_tmp): New global variables.
* match.c (type_selector, select_type_tmp): New global variables,
used for SELECT TYPE statements.
(gfc_match_select_type): Better error handling. Remember selector.
(gfc_match_type_is): Create temporary variable.
* module.c (ab_attribute): New value 'AB_IS_CLASS'.
(attr_bits): New string.
(mio_symbol_attribute): Handle 'is_class'.
* resolve.c (resolve_select_type): Insert pointer assignment statement,
to assign temporary to selector.
* symbol.c (gfc_get_ha_sym_tree): Replace selector by a temporary
in SELECT TYPE statements.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* dump-parse-tree.c (show_code_node): Renamed 'alloc_list'.
* gfortran.h (gfc_code): Rename 'alloc_list'. Add member 'ts'.
(gfc_expr_to_initialize): New prototype.
* match.c (alloc_opt_list): Correctly check type compatibility.
Renamed 'alloc_list'.
(dealloc_opt_list): Renamed 'alloc_list'.
* resolve.c (expr_to_initialize): Rename to 'gfc_expr_to_initialize'
and make it non-static.
(resolve_allocate_expr): Set vindex for CLASS variables correctly.
Move initialization code to gfc_trans_allocate. Renamed 'alloc_list'.
(resolve_allocate_deallocate): Renamed 'alloc_list'.
(check_class_pointer_assign): Rename to 'resolve_class_assign'. Change
argument type. Adjust to work with ordinary assignments.
(resolve_code): Call 'resolve_class_assign' for ordinary assignments.
Renamed 'check_class_pointer_assign'.
* st.c (gfc_free_statement): Renamed 'alloc_list'.
* trans-stmt.c (gfc_trans_allocate): Renamed 'alloc_list'. Handle
size determination and initialization of CLASS variables. Bugfix for
ALLOCATE statements with default initialization and SOURCE block.
(gfc_trans_deallocate): Renamed 'alloc_list'.
2009-09-30 Paul Thomas <pault@gcc.gnu.org>
* trans-expr.c (gfc_conv_procedure_call): Convert a derived
type actual to a class object if the formal argument is a
class.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* decl.c (build_struct): Handle allocatable scalar components.
* expr.c (gfc_add_component_ref): Correctly set typespec of expression,
after inserting component reference.
* match.c (gfc_match_type_is,gfc_match_class_is): Make sure that no
variables are being used uninitialized.
* primary.c (gfc_match_varspec): Handle CLASS array components.
* resolve.c (resolve_select_type): Transform EXEC_SELECT_TYPE to
EXEC_SELECT.
* trans-array.c (structure_alloc_comps,gfc_trans_deferred_array):
Handle allocatable scalar components.
* trans-expr.c (gfc_conv_component_ref): Ditto.
* trans-types.c (gfc_get_derived_type): Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* decl.c (encapsulate_class_symbol): Modify names of class container
components by prefixing with '$'.
(gfc_match_end): Handle COMP_SELECT_TYPE.
* expr.c (gfc_add_component_ref): Modify names of class container
components by prefixing with '$'.
* gfortran.h (gfc_statement): Add ST_SELECT_TYPE, ST_TYPE_IS and
ST_CLASS_IS.
(gfc_case): New field 'ts'.
(gfc_exec_op): Add EXEC_SELECT_TYPE.
(gfc_type_is_extension_of): New prototype.
* match.h (gfc_match_select_type,gfc_match_type_is,gfc_match_class_is):
New prototypes.
* match.c (match_derived_type_spec): New function.
(match_type_spec): Use 'match_derived_type_spec'.
(match_case_eos): Modify error message.
(gfc_match_select_type): New function.
(gfc_match_case): Modify error message.
(gfc_match_type_is): New function.
(gfc_match_class_is): Ditto.
* parse.h (gfc_compile_state): Add COMP_SELECT_TYPE.
* parse.c (decode_statement): Handle SELECT TYPE, TYPE IS and CLASS IS
statements.
(next_statement): Handle ST_SELECT_TYPE.
(gfc_ascii_statement): Handle ST_SELECT_TYPE, ST_TYPE_IS, ST_CLASS_IS.
(parse_select_type_block): New function.
(parse_executable): Handle ST_SELECT_TYPE.
* resolve.c (resolve_deallocate_expr): Handle BT_CLASS. Modify names of
class container components by prefixing with '$'.
(resolve_allocate_expr): Ditto.
(resolve_select_type): New function.
(gfc_resolve_blocks): Handle EXEC_SELECT_TYPE.
(check_class_pointer_assign): Modify names of class container
components by prefixing with '$'.
(resolve_code): Ditto.
* st.c (gfc_free_statement): Ditto.
* symbol.c (gfc_type_is_extension_of): New function.
(gfc_type_compatible): Use 'gfc_type_is_extension_of', plus a bugfix.
* trans.c (gfc_trans_code): Handel EXEC_SELECT_TYPE.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Arguments don't have to be arrays.
The second argument needs to be type-compatible with the first (not the
other way around, which makes a difference for CLASS entities).
* decl.c (encapsulate_class_symbol): New function.
(build_sym,build_struct): Handle BT_CLASS, call
'encapsulate_class_symbol'.
(gfc_match_decl_type_spec): Remove warning, use BT_CLASS.
(gfc_match_derived_decl): Set vindex;
* expr.c (gfc_add_component_ref): New function.
(gfc_copy_expr,gfc_check_pointer_assign,gfc_check_assign_symbol):
Handle BT_CLASS.
* dump-parse-tree.c (show_symbol): Print vindex.
* gfortran.h (bt): New basic type BT_CLASS.
(symbol_attribute): New field 'is_class'.
(gfc_typespec): Remove field 'is_class'.
(gfc_symbol): New field 'vindex'.
(gfc_get_ultimate_derived_super_type): New prototype.
(gfc_add_component_ref): Ditto.
* interface.c (gfc_compare_derived_types): Pointer equality check
moved here from gfc_compare_types.
(gfc_compare_types): Handle BT_CLASS and use
gfc_type_compatible.
* match.c (gfc_match_allocate,gfc_match_deallocate,gfc_match_call):
Handle BT_CLASS.
* misc.c (gfc_clear_ts): Removed is_class.
(gfc_basic_typename,gfc_typename): Handle BT_CLASS.
* module.c (bt_types,mio_typespec): Handle BT_CLASS.
(mio_symbol): Handle vindex.
* primary.c (gfc_match_varspec,gfc_variable_attr): Handle BT_CLASS.
* resolve.c (find_array_spec,check_typebound_baseobject):
Handle BT_CLASS.
(resolve_ppc_call,resolve_expr_ppc): Don't call 'gfc_is_proc_ptr_comp'
inside 'gcc_assert'.
(resolve_deallocate_expr,resolve_allocate_expr): Handle BT_CLASS.
(check_class_pointer_assign): New function.
(resolve_code): Handle BT_CLASS, call check_class_pointer_assign.
(resolve_fl_var_and_proc,type_is_extensible,resolve_fl_variable_derived,
resolve_fl_variable): Handle BT_CLASS.
(check_generic_tbp_ambiguity): Add special case.
(resolve_typebound_procedure,resolve_fl_derived): Handle BT_CLASS.
* symbol.c (gfc_get_ultimate_derived_super_type): New function.
(gfc_type_compatible): Handle BT_CLASS.
* trans-expr.c (conv_parent_component_references): Handle CLASS
containers.
(gfc_conv_initializer): Handle BT_CLASS.
* trans-types.c (gfc_typenode_for_spec,gfc_get_derived_type):
Handle BT_CLASS.
testsuite/
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/same_type_as_1.f03: New test.
* gfortran.dg/same_type_as_2.f03: Ditto.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/select_type_1.f03: Extended.
* gfortran.dg/select_type_3.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/class_allocate_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40996
* gfortran.dg/allocatable_scalar_3.f90: New test.
* gfortran.dg/select_type_2.f03: Ditto.
* gfortran.dg/typebound_proc_5.f03: Changed error messages.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/block_name_2.f90: Modified error message.
* gfortran.dg/select_6.f90: Ditto.
* gfortran.dg/select_type_1.f03: New test.
2009-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Remove -w option.
* gfortran.dg/class_1.f03: Ditto.
* gfortran.dg/class_2.f03: Ditto.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_call_9.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_operator_1.f03: Ditto.
* gfortran.dg/typebound_operator_2.f03: Ditto.
* gfortran.dg/typebound_operator_3.f03: Ditto.
* gfortran.dg/typebound_operator_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
From-SVN: r152345
2009-09-30 21:55:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_scale (gfc_expr *x, gfc_expr *i)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_scan (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (y, 1, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (z != NULL && !type_check (z, 2, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 3, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (x, 0, y, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_secnds (gfc_expr *r)
|
2005-11-01 06:53:29 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (r, 0, BT_REAL))
|
|
|
|
return false;
|
2005-11-01 06:53:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (r, 0, 4))
|
|
|
|
return false;
|
2005-11-01 06:53:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (r, 0))
|
|
|
|
return false;
|
2005-11-01 06:53:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-11-01 06:53:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2008-04-30 23:45:02 +02:00
|
|
|
gfc_check_selected_char_kind (gfc_expr *name)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2008-04-30 23:45:02 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
2008-04-30 23:45:02 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (name, 0))
|
|
|
|
return false;
|
2008-04-30 23:45:02 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2008-04-30 23:45:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_selected_int_kind (gfc_expr *r)
|
2005-02-19 21:29:05 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (r, 0, BT_INTEGER))
|
|
|
|
return false;
|
2005-02-19 21:29:05 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (r, 0))
|
|
|
|
return false;
|
2005-02-19 21:29:05 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-02-19 21:29:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2010-06-25 21:40:37 +02:00
|
|
|
gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r, gfc_expr *radix)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2010-06-25 21:40:37 +02:00
|
|
|
if (p == NULL && r == NULL
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_F2008, "SELECTED_REAL_KIND with"
|
2014-12-13 00:12:06 +01:00
|
|
|
" neither %<P%> nor %<R%> argument at %L",
|
2013-04-10 23:36:58 +02:00
|
|
|
gfc_current_intrinsic_where))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2010-06-09 23:36:33 +02:00
|
|
|
if (p)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (p, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (p, 0))
|
|
|
|
return false;
|
2010-06-09 23:36:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (r)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (r, 1, BT_INTEGER))
|
|
|
|
return false;
|
2010-06-09 23:36:33 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (r, 1))
|
|
|
|
return false;
|
2010-06-09 23:36:33 +02:00
|
|
|
}
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2010-06-25 21:40:37 +02:00
|
|
|
if (radix)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (radix, 1, BT_INTEGER))
|
|
|
|
return false;
|
2010-06-25 21:40:37 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (radix, 1))
|
|
|
|
return false;
|
2010-06-25 21:40:37 +02:00
|
|
|
|
2014-12-13 00:12:06 +01:00
|
|
|
if (!gfc_notify_std (GFC_STD_F2008, "%qs intrinsic with "
|
2013-04-10 23:36:58 +02:00
|
|
|
"RADIX argument at %L", gfc_current_intrinsic,
|
|
|
|
&radix->where))
|
|
|
|
return false;
|
2010-06-25 21:40:37 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_set_exponent (gfc_expr *x, gfc_expr *i)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2011-01-29 18:36:18 +01:00
|
|
|
gfc_check_shape (gfc_expr *source, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
gfc_array_ref *ar;
|
|
|
|
|
|
|
|
if (source->rank == 0 || source->expr_type != EXPR_VARIABLE)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
|
|
|
ar = gfc_find_array_ref (source);
|
|
|
|
|
2008-01-13 22:28:30 +01:00
|
|
|
if (ar->as && ar->as->type == AS_ASSUMED_SIZE && ar->type == AR_FULL)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<source%> argument of %<shape%> intrinsic at %L must not be "
|
2004-05-13 08:41:07 +02:00
|
|
|
"an assumed size array", &source->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 1, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
2011-01-29 18:36:18 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
gfc_check_shift (gfc_expr *i, gfc_expr *shift)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (shift, 0, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("SHIFT", shift))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize1 ("I", i, "SHIFT", shift, true))
|
|
|
|
return false;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38282 (Bit intrinsics: ILEN and IBCHNG)
PR fortran/38282
* intrinsic.c (add_functions): Add B{G,L}{E,T}, DSHIFT{L,R},
MASK{L,R}, MERGE_BITS and SHIFT{A,L,R}.
* gfortran.h: Define ISYM values for above intrinsics.
* intrinsic.h (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift,
gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr,
gfc_resolve_dshift, gfc_resolve_mask, gfc_resolve_merge_bits,
gfc_resolve_shift): New prototypes.
* iresolve.c (gfc_resolve_dshift, gfc_resolve_mask,
gfc_resolve_merge_bits, gfc_resolve_shift): New functions.
* check.c (gfc_check_bge_bgt_ble_blt, gfc_check_dshift,
gfc_check_mask, gfc_check_merge_bits, gfc_check_shift): New
functions.
* trans-intrinsic.c (gfc_conv_intrinsic_dshift,
gfc_conv_intrinsic_bitcomp, gfc_conv_intrinsic_shift,
gfc_conv_intrinsic_merge_bits, gfc_conv_intrinsic_mask): New
functions.
(gfc_conv_intrinsic_function): Call above static functions.
* intrinsic.texi: Document new intrinsics.
* simplify.c (gfc_simplify_bge, gfc_simplify_bgt, gfc_simplify_ble,
gfc_simplify_blt, gfc_simplify_dshiftl, gfc_simplify_dshiftr,
gfc_simplify_lshift, gfc_simplify_maskl, gfc_simplify_maskr,
gfc_simplify_merge_bits, gfc_simplify_rshift,
gfc_simplify_shifta, gfc_simplify_shiftl, gfc_simplify_shiftr):
New functions.
* gfortran.dg/bit_comparison_1.F90: New test.
* gfortran.dg/leadz_trailz_3.f90: New test.
* gfortran.dg/masklr_2.F90: New test.
* gfortran.dg/shiftalr_1.F90: New test.
* gfortran.dg/merge_bits_2.F90: New test.
* gfortran.dg/dshift_2.F90: New test.
* gfortran.dg/bit_comparison_2.F90: New test.
* gfortran.dg/masklr_1.F90: New test.
* gfortran.dg/merge_bits_1.F90: New test.
* gfortran.dg/dshift_1.F90: New test.
* gfortran.dg/shiftalr_2.F90: New test.
From-SVN: r164021
2010-09-08 21:35:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_sign (gfc_expr *a, gfc_expr *b)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_real_check (a, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (a, 0, b, 1))
|
|
|
|
return false;
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, true))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 2, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2011-10-20 00:05:23 +02:00
|
|
|
gfc_check_sizeof (gfc_expr *arg)
|
2007-05-29 11:03:03 +02:00
|
|
|
{
|
2011-10-20 00:05:23 +02:00
|
|
|
if (arg->ts.type == BT_PROCEDURE)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be a procedure",
|
2011-10-20 00:05:23 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&arg->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-10-20 00:05:23 +02:00
|
|
|
}
|
2013-03-27 11:45:58 +01:00
|
|
|
|
2014-07-26 11:49:00 +02:00
|
|
|
/* TYPE(*) is acceptable if and only if it uses an array descriptor. */
|
|
|
|
if (arg->ts.type == BT_ASSUMED
|
|
|
|
&& (arg->symtree->n.sym->as == NULL
|
|
|
|
|| (arg->symtree->n.sym->as->type != AS_ASSUMED_SHAPE
|
|
|
|
&& arg->symtree->n.sym->as->type != AS_DEFERRED
|
|
|
|
&& arg->symtree->n.sym->as->type != AS_ASSUMED_RANK)))
|
2013-03-27 11:45:58 +01:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be TYPE(*)",
|
2013-03-27 11:45:58 +01:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&arg->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2013-03-27 11:45:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (arg->rank && arg->expr_type == EXPR_VARIABLE
|
|
|
|
&& arg->symtree->n.sym->as != NULL
|
|
|
|
&& arg->symtree->n.sym->as->type == AS_ASSUMED_SIZE && arg->ref
|
|
|
|
&& arg->ref->type == REF_ARRAY && arg->ref->u.ar.type == AR_FULL)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be an "
|
2013-03-27 11:45:58 +01:00
|
|
|
"assumed-size array", gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic, &arg->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2013-03-27 11:45:58 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-05-29 11:03:03 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
/* Check whether an expression is interoperable. When returning false,
|
|
|
|
msg is set to a string telling why the expression is not interoperable,
|
|
|
|
otherwise, it is set to NULL. The msg string can be used in diagnostics.
|
2013-04-04 09:22:24 +02:00
|
|
|
If c_loc is true, character with len > 1 are allowed (cf. Fortran
|
|
|
|
2003corr5); additionally, assumed-shape/assumed-rank/deferred-shape
|
2013-07-08 21:05:16 +02:00
|
|
|
arrays are permitted. And if c_f_ptr is true, deferred-shape arrays
|
2014-09-20 13:48:00 +02:00
|
|
|
are permitted. */
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
|
|
|
static bool
|
2013-07-08 21:05:16 +02:00
|
|
|
is_c_interoperable (gfc_expr *expr, const char **msg, bool c_loc, bool c_f_ptr)
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
{
|
|
|
|
*msg = NULL;
|
|
|
|
|
|
|
|
if (expr->ts.type == BT_CLASS)
|
|
|
|
{
|
|
|
|
*msg = "Expression is polymorphic";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (expr->ts.type == BT_DERIVED && !expr->ts.u.derived->attr.is_bind_c
|
|
|
|
&& !expr->ts.u.derived->ts.is_iso_c)
|
|
|
|
{
|
|
|
|
*msg = "Expression is a noninteroperable derived type";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (expr->ts.type == BT_PROCEDURE)
|
|
|
|
{
|
|
|
|
*msg = "Procedure unexpected as argument";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gfc_notification_std (GFC_STD_GNU) && expr->ts.type == BT_LOGICAL)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; gfc_logical_kinds[i].kind; i++)
|
|
|
|
if (gfc_logical_kinds[i].kind == expr->ts.kind)
|
|
|
|
return true;
|
|
|
|
*msg = "Extension to use a non-C_Bool-kind LOGICAL";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gfc_notification_std (GFC_STD_GNU) && expr->ts.type == BT_CHARACTER
|
|
|
|
&& expr->ts.kind != 1)
|
|
|
|
{
|
|
|
|
*msg = "Extension to use a non-C_CHAR-kind CHARACTER";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (expr->ts.type == BT_CHARACTER) {
|
|
|
|
if (expr->ts.deferred)
|
|
|
|
{
|
|
|
|
/* TS 29113 allows deferred-length strings as dummy arguments,
|
2014-09-20 13:48:00 +02:00
|
|
|
but it is not an interoperable type. */
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
*msg = "Expression shall not be a deferred-length string";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (expr->ts.u.cl && expr->ts.u.cl->length
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_simplify_expr (expr, 0))
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
gfc_internal_error ("is_c_interoperable(): gfc_simplify_expr failed");
|
|
|
|
|
2013-04-04 09:22:24 +02:00
|
|
|
if (!c_loc && expr->ts.u.cl
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
&& (!expr->ts.u.cl->length
|
|
|
|
|| expr->ts.u.cl->length->expr_type != EXPR_CONSTANT
|
|
|
|
|| mpz_cmp_si (expr->ts.u.cl->length->value.integer, 1) != 0))
|
|
|
|
{
|
|
|
|
*msg = "Type shall have a character length of 1";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Note: The following checks are about interoperatable variables, Fortran
|
|
|
|
15.3.5/15.3.6. In intrinsics like C_LOC or in procedure interface, more
|
|
|
|
is allowed, e.g. assumed-shape arrays with TS 29113. */
|
|
|
|
|
|
|
|
if (gfc_is_coarray (expr))
|
|
|
|
{
|
|
|
|
*msg = "Coarrays are not interoperable";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-04-04 09:22:24 +02:00
|
|
|
if (!c_loc && expr->rank > 0 && expr->expr_type != EXPR_ARRAY)
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
{
|
|
|
|
gfc_array_ref *ar = gfc_find_array_ref (expr);
|
|
|
|
if (ar->type != AR_FULL)
|
|
|
|
{
|
|
|
|
*msg = "Only whole-arrays are interoperable";
|
|
|
|
return false;
|
|
|
|
}
|
2013-07-08 21:05:16 +02:00
|
|
|
if (!c_f_ptr && ar->as->type != AS_EXPLICIT
|
|
|
|
&& ar->as->type != AS_ASSUMED_SIZE)
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
{
|
|
|
|
*msg = "Only explicit-size and assumed-size arrays are interoperable";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2010-07-08 23:29:56 +02:00
|
|
|
gfc_check_c_sizeof (gfc_expr *arg)
|
|
|
|
{
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
const char *msg;
|
|
|
|
|
2013-07-08 21:05:16 +02:00
|
|
|
if (!is_c_interoperable (arg, &msg, false, false))
|
2010-07-08 23:29:56 +02:00
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be an "
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
"interoperable data entity: %s",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
&arg->where, msg);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-03-27 11:45:58 +01:00
|
|
|
if (arg->ts.type == BT_ASSUMED)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be "
|
2013-03-27 11:45:58 +01:00
|
|
|
"TYPE(*)",
|
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&arg->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2013-03-27 11:45:58 +01:00
|
|
|
}
|
|
|
|
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
if (arg->rank && arg->expr_type == EXPR_VARIABLE
|
|
|
|
&& arg->symtree->n.sym->as != NULL
|
|
|
|
&& arg->symtree->n.sym->as->type == AS_ASSUMED_SIZE && arg->ref
|
|
|
|
&& arg->ref->type == REF_ARRAY && arg->ref->u.ar.type == AR_FULL)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be an "
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
"assumed-size array", gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic, &arg->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
gfc_check_c_associated (gfc_expr *c_ptr_1, gfc_expr *c_ptr_2)
|
|
|
|
{
|
|
|
|
if (c_ptr_1->ts.type != BT_DERIVED
|
|
|
|
|| c_ptr_1->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING
|
|
|
|
|| (c_ptr_1->ts.u.derived->intmod_sym_id != ISOCBINDING_PTR
|
|
|
|
&& c_ptr_1->ts.u.derived->intmod_sym_id != ISOCBINDING_FUNPTR))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument C_PTR_1 at %L to C_ASSOCIATED shall have the "
|
|
|
|
"type TYPE(C_PTR) or TYPE(C_FUNPTR)", &c_ptr_1->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (c_ptr_1, 0))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
|
|
|
if (c_ptr_2
|
|
|
|
&& (c_ptr_2->ts.type != BT_DERIVED
|
|
|
|
|| c_ptr_2->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING
|
|
|
|
|| (c_ptr_1->ts.u.derived->intmod_sym_id
|
|
|
|
!= c_ptr_2->ts.u.derived->intmod_sym_id)))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument C_PTR_2 at %L to C_ASSOCIATED shall have the "
|
|
|
|
"same type as C_PTR_1: %s instead of %s", &c_ptr_1->where,
|
|
|
|
gfc_typename (&c_ptr_1->ts),
|
|
|
|
gfc_typename (&c_ptr_2->ts));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (c_ptr_2 && !scalar_check (c_ptr_2, 1))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
gfc_check_c_f_pointer (gfc_expr *cptr, gfc_expr *fptr, gfc_expr *shape)
|
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
|
|
|
const char *msg;
|
|
|
|
|
|
|
|
if (cptr->ts.type != BT_DERIVED
|
|
|
|
|| cptr->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING
|
|
|
|
|| cptr->ts.u.derived->intmod_sym_id != ISOCBINDING_PTR)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument CPTR at %L to C_F_POINTER shall have the "
|
|
|
|
"type TYPE(C_PTR)", &cptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (cptr, 0))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
|
|
|
attr = gfc_expr_attr (fptr);
|
|
|
|
|
|
|
|
if (!attr.pointer)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument FPTR at %L to C_F_POINTER must be a pointer",
|
|
|
|
&fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (fptr->ts.type == BT_CLASS)
|
|
|
|
{
|
|
|
|
gfc_error ("FPTR argument at %L to C_F_POINTER shall not be polymorphic",
|
|
|
|
&fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gfc_is_coindexed (fptr))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument FPTR at %L to C_F_POINTER shall not be "
|
|
|
|
"coindexed", &fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (fptr->rank == 0 && shape)
|
|
|
|
{
|
|
|
|
gfc_error ("Unexpected SHAPE argument at %L to C_F_POINTER with scalar "
|
|
|
|
"FPTR", &fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
else if (fptr->rank && !shape)
|
|
|
|
{
|
|
|
|
gfc_error ("Expected SHAPE argument to C_F_POINTER with array "
|
|
|
|
"FPTR at %L", &fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (shape && !rank_check (shape, 2, 1))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (shape && !type_check (shape, 2, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
|
|
|
if (shape)
|
|
|
|
{
|
|
|
|
mpz_t size;
|
2014-02-21 23:54:50 +01:00
|
|
|
if (gfc_array_size (shape, &size))
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
{
|
2014-02-21 23:54:50 +01:00
|
|
|
if (mpz_cmp_ui (size, fptr->rank) != 0)
|
|
|
|
{
|
|
|
|
mpz_clear (size);
|
|
|
|
gfc_error ("SHAPE argument at %L to C_F_POINTER must have the same "
|
|
|
|
"size as the RANK of FPTR", &shape->where);
|
|
|
|
return false;
|
|
|
|
}
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
mpz_clear (size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fptr->ts.type == BT_CLASS)
|
|
|
|
{
|
|
|
|
gfc_error ("Polymorphic FPTR at %L to C_F_POINTER", &fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-07-08 21:05:16 +02:00
|
|
|
if (!is_c_interoperable (fptr, &msg, false, true))
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable array FPTR "
|
|
|
|
"at %L to C_F_POINTER: %s", &fptr->where, msg);
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
gfc_check_c_f_procpointer (gfc_expr *cptr, gfc_expr *fptr)
|
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
|
|
|
|
|
|
|
if (cptr->ts.type != BT_DERIVED
|
|
|
|
|| cptr->ts.u.derived->from_intmod != INTMOD_ISO_C_BINDING
|
|
|
|
|| cptr->ts.u.derived->intmod_sym_id != ISOCBINDING_FUNPTR)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument CPTR at %L to C_F_PROCPOINTER shall have the "
|
|
|
|
"type TYPE(C_FUNPTR)", &cptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (cptr, 0))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
|
|
|
attr = gfc_expr_attr (fptr);
|
|
|
|
|
|
|
|
if (!attr.proc_pointer)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument FPTR at %L to C_F_PROCPOINTER shall be a procedure "
|
|
|
|
"pointer", &fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (gfc_is_coindexed (fptr))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument FPTR at %L to C_F_PROCPOINTER shall not be "
|
|
|
|
"coindexed", &fptr->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!attr.is_bind_c)
|
|
|
|
return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable procedure "
|
|
|
|
"pointer at %L to C_F_PROCPOINTER", &fptr->where);
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
gfc_check_c_funloc (gfc_expr *x)
|
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
|
|
|
|
|
|
|
if (gfc_is_coindexed (x))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument X at %L to C_FUNLOC shall not be "
|
|
|
|
"coindexed", &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2010-07-08 23:29:56 +02:00
|
|
|
}
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
|
|
|
attr = gfc_expr_attr (x);
|
|
|
|
|
|
|
|
if (attr.function && !attr.proc_pointer && x->expr_type == EXPR_VARIABLE
|
|
|
|
&& x->symtree->n.sym == x->symtree->n.sym->result)
|
|
|
|
{
|
|
|
|
gfc_namespace *ns = gfc_current_ns;
|
|
|
|
|
|
|
|
for (ns = gfc_current_ns; ns; ns = ns->parent)
|
|
|
|
if (x->symtree->n.sym == ns->proc_name)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Function result %qs at %L is invalid as X argument "
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
"to C_FUNLOC", x->symtree->n.sym->name, &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attr.flavor != FL_PROCEDURE)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument X at %L to C_FUNLOC shall be a procedure "
|
|
|
|
"or a procedure pointer", &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!attr.is_bind_c)
|
|
|
|
return gfc_notify_std (GFC_STD_F2008_TS, "Noninteroperable procedure "
|
|
|
|
"at %L to C_FUNLOC", &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
gfc_check_c_loc (gfc_expr *x)
|
|
|
|
{
|
|
|
|
symbol_attribute attr;
|
|
|
|
const char *msg;
|
|
|
|
|
|
|
|
if (gfc_is_coindexed (x))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument X at %L to C_LOC shall not be coindexed", &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (x->ts.type == BT_CLASS)
|
|
|
|
{
|
|
|
|
gfc_error ("X argument at %L to C_LOC shall not be polymorphic",
|
|
|
|
&x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
attr = gfc_expr_attr (x);
|
|
|
|
|
|
|
|
if (!attr.pointer
|
|
|
|
&& (x->expr_type != EXPR_VARIABLE || !attr.target
|
|
|
|
|| attr.flavor == FL_PARAMETER))
|
|
|
|
{
|
|
|
|
gfc_error ("Argument X at %L to C_LOC shall have either "
|
|
|
|
"the POINTER or the TARGET attribute", &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (x->ts.type == BT_CHARACTER
|
|
|
|
&& gfc_var_strlen (x) == 0)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument X at %L to C_LOC shall be not be a zero-sized "
|
|
|
|
"string", &x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
2013-07-08 21:05:16 +02:00
|
|
|
if (!is_c_interoperable (x, &msg, true, false))
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
{
|
|
|
|
if (x->ts.type == BT_CLASS)
|
|
|
|
{
|
|
|
|
gfc_error ("Argument at %L to C_LOC shall not be polymorphic",
|
|
|
|
&x->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (x->rank
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_F2008_TS,
|
|
|
|
"Noninteroperable array at %L as"
|
|
|
|
" argument to C_LOC: %s", &x->where, msg))
|
|
|
|
return false;
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
}
|
2013-04-04 09:22:24 +02:00
|
|
|
else if (x->rank > 0 && gfc_notification_std (GFC_STD_F2008))
|
|
|
|
{
|
|
|
|
gfc_array_ref *ar = gfc_find_array_ref (x);
|
|
|
|
|
|
|
|
if (ar->as->type != AS_EXPLICIT && ar->as->type != AS_ASSUMED_SIZE
|
|
|
|
&& !attr.allocatable
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_F2008,
|
|
|
|
"Array of interoperable type at %L "
|
|
|
|
"to C_LOC which is nonallocatable and neither "
|
|
|
|
"assumed size nor explicit size", &x->where))
|
|
|
|
return false;
|
2013-04-04 09:22:24 +02:00
|
|
|
else if (ar->type != AR_FULL
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_F2008, "Array section at %L "
|
|
|
|
"to C_LOC", &x->where))
|
|
|
|
return false;
|
2013-04-04 09:22:24 +02:00
|
|
|
}
|
re PR fortran/38536 (ICE with C_LOC in resolve.c due to not properly going through expr->ref)
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* check.c (gfc_var_strlen): Properly handle 0-sized string.
(gfc_check_c_sizeof): Use is_c_interoperable, add checks.
(is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
functions.
* expr.c (check_inquiry): Add c_sizeof, compiler_version and
compiler_options.
(gfc_check_pointer_assign): Refine function result check.
gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
GFC_ISYM_C_LOC.
(iso_fortran_env_symbol, iso_c_binding_symbol): Handle
NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Update prototype.
(get_iso_c_sym): Remove.
(gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
* intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
(gfc_intrinsic_sub_interface): Use it.
(add_functions, add_subroutines): Add missing C-binding intrinsics.
(gfc_intrinsic_func_interface): Add special case for c_loc.
gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
(gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
* intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
* iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
functions.
* iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
NAMED_FUNCTION.
* iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
* module.c (create_intrinsic_function): Support subroutines and
derived-type results.
(use_iso_fortran_env_module): Update calls.
(import_iso_c_binding_module): Ditto; update calls to
generate_isocbinding_symbol.
* resolve.c (find_arglists): Skip for intrinsic symbols.
(gfc_resolve_intrinsic): Find intrinsic subs via id.
(is_scalar_expr_ptr, gfc_iso_c_func_interface,
set_name_and_label, gfc_iso_c_sub_interface): Remove.
(resolve_function, resolve_specific_s0): Remove calls to those.
(resolve_structure_cons): Fix handling.
* symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
generation.
(gen_cptr_param, gen_fptr_param, gen_shape_param,
build_formal_args, get_iso_c_sym): Remove.
(std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
(generate_isocbinding_symbol): Support hidden symbols and
using c_ptr/c_funptr symtrees for nullptr defs.
* target-memory.c (gfc_target_encode_expr): Fix handling
of c_ptr/c_funptr.
* trans-expr.c (conv_isocbinding_procedure): Remove.
(gfc_conv_procedure_call): Remove call to it.
(gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
of c_ptr/c_funptr.
* trans-intrinsic.c (conv_isocbinding_function,
conv_isocbinding_subroutine): New.
(gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
Call them.
* trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
* trans-types.c (gfc_typenode_for_spec,
gfc_get_derived_type): Ditto.
(gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
2013-03-25 Tobias Burnus <burnus@net-b.de>
PR fortran/38536
PR fortran/38813
PR fortran/38894
PR fortran/39288
PR fortran/40963
PR fortran/45824
PR fortran/47023
PR fortran/47034
PR fortran/49023
PR fortran/50269
PR fortran/50612
PR fortran/52426
PR fortran/54263
PR fortran/55343
PR fortran/55444
PR fortran/55574
PR fortran/56079
PR fortran/56378
* gfortran.dg/c_assoc_2.f03: Update dg-error wording.
* gfortran.dg/c_f_pointer_shape_test.f90: Ditto.
* gfortran.dg/c_f_pointer_shape_tests_3.f03: Ditto.
* gfortran.dg/c_f_pointer_tests_5.f90: Ditto.
* gfortran.dg/c_funloc_tests_2.f03: Ditto.
* gfortran.dg/c_funloc_tests_5.f03: Ditto.
* gfortran.dg/c_funloc_tests_6.f90: Ditto.
* gfortran.dg/c_loc_tests_10.f03: Add -std=f2008.
* gfortran.dg/c_loc_tests_11.f03: Ditto, update dg-error.
* gfortran.dg/c_loc_tests_16.f90: Ditto.
* gfortran.dg/c_loc_tests_4.f03: Ditto.
* gfortran.dg/c_loc_tests_15.f90: Update dg-error wording.
* gfortran.dg/c_loc_tests_3.f03: Valid since F2003 TC5.
* gfortran.dg/c_loc_tests_8.f03: Ditto.
* gfortran.dg/c_ptr_tests_14.f90: Update scan-tree-dump-times.
* gfortran.dg/c_ptr_tests_15.f90: Ditto.
* gfortran.dg/c_sizeof_1.f90: Fix invalid code.
* gfortran.dg/iso_c_binding_init_expr.f03: Update dg-error wording.
* gfortran.dg/pr32601_1.f03: Ditto.
* gfortran.dg/storage_size_2.f08: Remove dg-error.
* gfortran.dg/blockdata_7.f90: New.
* gfortran.dg/c_assoc_4.f90: New.
* gfortran.dg/c_f_pointer_tests_6.f90: New.
* gfortran.dg/c_f_pointer_tests_7.f90: New.
* gfortran.dg/c_funloc_tests_8.f90: New.
* gfortran.dg/c_loc_test_17.f90: New.
* gfortran.dg/c_loc_test_18.f90: New.
* gfortran.dg/c_loc_test_19.f90: New.
* gfortran.dg/c_loc_test_20.f90: New.
* gfortran.dg/c_sizeof_5.f90: New.
* gfortran.dg/iso_c_binding_rename_3.f90: New.
* gfortran.dg/transfer_resolve_2.f90: New.
* gfortran.dg/transfer_resolve_3.f90: New.
* gfortran.dg/transfer_resolve_4.f90: New.
* gfortran.dg/pr32601.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_13.f03: Update dg-error.
* gfortran.dg/c_ptr_tests_9.f03: Fix test case.
From-SVN: r197053
2013-03-25 16:40:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-07-08 23:29:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_sleep_sub (gfc_expr *seconds)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (seconds, 0, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (seconds, 0))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2010-05-19 13:43:53 +02:00
|
|
|
gfc_check_sngl (gfc_expr *a)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (a, 0, BT_REAL))
|
|
|
|
return false;
|
2010-05-19 13:43:53 +02:00
|
|
|
|
|
|
|
if ((a->ts.kind != gfc_default_double_kind)
|
2013-04-10 23:36:58 +02:00
|
|
|
&& !gfc_notify_std (GFC_STD_GNU, "non double precision "
|
|
|
|
"REAL argument to %s intrinsic at %L",
|
|
|
|
gfc_current_intrinsic, &a->where))
|
|
|
|
return false;
|
2010-05-19 13:43:53 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-05-19 13:43:53 +02:00
|
|
|
}
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_spread (gfc_expr *source, gfc_expr *dim, gfc_expr *ncopies)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (source->rank >= GFC_MAX_DIMENSIONS)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be less "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"than rank %d", gfc_current_intrinsic_arg[0]->name,
|
re PR fortran/15586 (gfortran should support i18n in its compiler messages)
PR fortran/15586
* arith.c (gfc_arith_error): Change message to include locus.
(check_result, eval_intrinsic, gfc_int2int, gfc_real2real,
gfc_real2complex, gfc_complex2real, gfc_complex2complex): Use
the new gfc_arith_error.
(arith_error): Rewrite full error messages instead of building
them from pieces.
* check.c (must_be): Removed.
(type_check, numeric_check, int_or_real_check, real_or_complex_check,
kind_check, double_check, logical_array_check, array_check,
scalar_check, same_type_check, rank_check, kind_value_check,
variable_check, gfc_check_allocated, gfc_check_associated,
gfc_check_cmplx, gfc_check_dcmplx, gfc_check_dot_product,
gfc_check_index, gfc_check_kind, gfc_check_matmul, gfc_check_null,
gfc_check_pack, gfc_check_precision, gfc_check_present,
gfc_check_spread): Rewrite full error messages instead of
building them from pieces.
* decl.c (gfc_match_entry): Rewrite full error messages instead
of building them from pieces.
* parse.c (gfc_state_name): Remove.
* parse.h: Remove prototype for gfc_state_name.
From-SVN: r105844
2005-10-24 11:11:51 +02:00
|
|
|
gfc_current_intrinsic, &source->where, GFC_MAX_DIMENSIONS);
|
2005-09-17 20:58:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-09-12 12:30:22 +02:00
|
|
|
if (dim == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2007-09-12 12:30:22 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-06-07 19:33:34 +02:00
|
|
|
/* dim_rank_check() does not apply here. */
|
2012-12-20 01:15:00 +01:00
|
|
|
if (dim
|
2009-06-07 19:33:34 +02:00
|
|
|
&& dim->expr_type == EXPR_CONSTANT
|
|
|
|
&& (mpz_cmp_ui (dim->value.integer, 1) < 0
|
|
|
|
|| mpz_cmp_ui (dim->value.integer, source->rank + 1) > 0))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L is not a valid "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"dimension index", gfc_current_intrinsic_arg[1]->name,
|
2009-06-07 19:33:34 +02:00
|
|
|
gfc_current_intrinsic, &dim->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-07 19:33:34 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (ncopies, 2, BT_INTEGER))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (ncopies, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
/* Functions for checking FGETC, FPUTC, FGET and FPUT (subroutines and
|
|
|
|
functions). */
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fgetputc_sub (gfc_expr *unit, gfc_expr *c, gfc_expr *status)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (c, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (c, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER)
|
|
|
|
|| !kind_value_check (status, 2, gfc_default_integer_kind)
|
|
|
|
|| !scalar_check (status, 2))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fgetputc (gfc_expr *unit, gfc_expr *c)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
|
|
|
return gfc_check_fgetputc_sub (unit, c, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fgetput_sub (gfc_expr *c, gfc_expr *status)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (c, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (c, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 1, BT_INTEGER)
|
|
|
|
|| !kind_value_check (status, 1, gfc_default_integer_kind)
|
|
|
|
|| !scalar_check (status, 1))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fgetput (gfc_expr *c)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
|
|
|
return gfc_check_fgetput_sub (c, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-05-04 20:02:18 +02:00
|
|
|
gfc_check_fseek_sub (gfc_expr *unit, gfc_expr *offset, gfc_expr *whence, gfc_expr *status)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (offset, 1, BT_INTEGER))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (offset, 1))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (whence, 2, BT_INTEGER))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (whence, 2))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 3, BT_INTEGER))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (status, 3, 4))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 3))
|
|
|
|
return false;
|
2007-05-04 20:02:18 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-05-04 20:02:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fstat (gfc_expr *unit, gfc_expr *array)
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (array, 1, BT_INTEGER)
|
|
|
|
|| !kind_value_check (unit, 0, gfc_default_integer_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 1))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fstat_sub (gfc_expr *unit, gfc_expr *array, gfc_expr *status)
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (array, 1, BT_INTEGER)
|
|
|
|
|| !kind_value_check (array, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 1))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER)
|
|
|
|
|| !kind_value_check (status, 2, gfc_default_integer_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ftell (gfc_expr *unit)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ftell_sub (gfc_expr *unit, gfc_expr *offset)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (offset, 1, BT_INTEGER))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (offset, 1))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_stat (gfc_expr *name, gfc_expr *array)
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (array, 1, BT_INTEGER)
|
|
|
|
|| !kind_value_check (array, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 1))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_stat_sub (gfc_expr *name, gfc_expr *array, gfc_expr *status)
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (array, 1, BT_INTEGER)
|
|
|
|
|| !kind_value_check (array, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 1))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER)
|
|
|
|
|| !kind_value_check (array, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
gfc_check_image_index (gfc_expr *coarray, gfc_expr *sub)
|
|
|
|
{
|
2011-04-18 19:21:24 +02:00
|
|
|
mpz_t nelems;
|
|
|
|
|
2014-12-17 07:29:30 +01:00
|
|
|
if (flag_coarray == GFC_FCOARRAY_NONE)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
{
|
error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
2014-11-15 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
(gfc_fatal_error): Add; uses common diagnostics.
* array.c (gfc_match_array_ref, gfc_match_array_spec): Use
%< %>.
* check.c (check_co_collective, gfc_check_lcobound,
gfc_check_image_index, gfc_check_num_images,
gfc_check_this_image, gfc_check_ucobound): Ditto.
* cpp.c (gfc_cpp_post_options): Ditto.
(gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
* gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
* gfortran.h (gfc_fatal_error_1): Add.
* match.c (gfc_match_name, gfc_match_critical,
lock_unlock_statement, sync_statement): Add %< %>.
* module.c (bad_module, gfc_dump_module, gfc_use_module): Change
%s to %qs.
* options.c (gfc_handle_module_path_options,
* gfc_handle_fpe_option,
gfc_handle_coarray_option, gfc_handle_runtime_check_option,
gfc_handle_option): Add %< %>.
* simplify.c (gfc_simplify_num_images): Ditto.
* trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
* trans-array.c (gfc_conv_array_initializer): Ditto.
* trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
of fatal_error; add %< %> quotations.
gcc/testsuite/
* gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
* gfortran.dg/coarray_9.f90: Ditto.
* gfortran.dg/empty_label.f: Ditto.
* gfortran.dg/empty_label.f90: Ditto.
From-SVN: r217600
2014-11-15 12:06:07 +01:00
|
|
|
gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!coarray_check (coarray, 0))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
|
|
|
if (sub->rank != 1)
|
|
|
|
{
|
|
|
|
gfc_error ("%s argument to IMAGE_INDEX must be a rank one array at %L",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, &sub->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (gfc_array_size (sub, &nelems))
|
2011-04-18 19:21:24 +02:00
|
|
|
{
|
|
|
|
int corank = gfc_get_corank (coarray);
|
|
|
|
|
|
|
|
if (mpz_cmp_ui (nelems, corank) != 0)
|
|
|
|
{
|
|
|
|
gfc_error ("The number of array elements of the SUB argument to "
|
|
|
|
"IMAGE_INDEX at %L shall be %d (corank) not %d",
|
|
|
|
&sub->where, corank, (int) mpz_get_si (nelems));
|
|
|
|
mpz_clear (nelems);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-04-18 19:21:24 +02:00
|
|
|
}
|
|
|
|
mpz_clear (nelems);
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2014-05-25 07:24:12 +02:00
|
|
|
gfc_check_num_images (gfc_expr *distance, gfc_expr *failed)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
{
|
2014-12-17 07:29:30 +01:00
|
|
|
if (flag_coarray == GFC_FCOARRAY_NONE)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
{
|
error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
2014-11-15 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
(gfc_fatal_error): Add; uses common diagnostics.
* array.c (gfc_match_array_ref, gfc_match_array_spec): Use
%< %>.
* check.c (check_co_collective, gfc_check_lcobound,
gfc_check_image_index, gfc_check_num_images,
gfc_check_this_image, gfc_check_ucobound): Ditto.
* cpp.c (gfc_cpp_post_options): Ditto.
(gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
* gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
* gfortran.h (gfc_fatal_error_1): Add.
* match.c (gfc_match_name, gfc_match_critical,
lock_unlock_statement, sync_statement): Add %< %>.
* module.c (bad_module, gfc_dump_module, gfc_use_module): Change
%s to %qs.
* options.c (gfc_handle_module_path_options,
* gfc_handle_fpe_option,
gfc_handle_coarray_option, gfc_handle_runtime_check_option,
gfc_handle_option): Add %< %>.
* simplify.c (gfc_simplify_num_images): Ditto.
* trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
* trans-array.c (gfc_conv_array_initializer): Ditto.
* trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
of fatal_error; add %< %> quotations.
gcc/testsuite/
* gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
* gfortran.dg/coarray_9.f90: Ditto.
* gfortran.dg/empty_label.f: Ditto.
* gfortran.dg/empty_label.f90: Ditto.
From-SVN: r217600
2014-11-15 12:06:07 +01:00
|
|
|
gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2014-05-25 07:24:12 +02:00
|
|
|
if (distance)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
{
|
2014-05-25 07:24:12 +02:00
|
|
|
if (!type_check (distance, 0, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!nonnegative_check ("DISTANCE", distance))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!scalar_check (distance, 0))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_notify_std (GFC_STD_F2008_TS, "DISTANCE= argument to "
|
|
|
|
"NUM_IMAGES at %L", &distance->where))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (failed)
|
|
|
|
{
|
|
|
|
if (!type_check (failed, 1, BT_LOGICAL))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!scalar_check (failed, 1))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_notify_std (GFC_STD_F2008_TS, "FAILED= argument to "
|
|
|
|
"NUM_IMAGES at %L", &distance->where))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
gfc_check_this_image (gfc_expr *coarray, gfc_expr *dim, gfc_expr *distance)
|
|
|
|
{
|
2014-12-17 07:29:30 +01:00
|
|
|
if (flag_coarray == GFC_FCOARRAY_NONE)
|
2014-05-25 07:24:12 +02:00
|
|
|
{
|
error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
2014-11-15 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
(gfc_fatal_error): Add; uses common diagnostics.
* array.c (gfc_match_array_ref, gfc_match_array_spec): Use
%< %>.
* check.c (check_co_collective, gfc_check_lcobound,
gfc_check_image_index, gfc_check_num_images,
gfc_check_this_image, gfc_check_ucobound): Ditto.
* cpp.c (gfc_cpp_post_options): Ditto.
(gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
* gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
* gfortran.h (gfc_fatal_error_1): Add.
* match.c (gfc_match_name, gfc_match_critical,
lock_unlock_statement, sync_statement): Add %< %>.
* module.c (bad_module, gfc_dump_module, gfc_use_module): Change
%s to %qs.
* options.c (gfc_handle_module_path_options,
* gfc_handle_fpe_option,
gfc_handle_coarray_option, gfc_handle_runtime_check_option,
gfc_handle_option): Add %< %>.
* simplify.c (gfc_simplify_num_images): Ditto.
* trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
* trans-array.c (gfc_conv_array_initializer): Ditto.
* trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
of fatal_error; add %< %> quotations.
gcc/testsuite/
* gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
* gfortran.dg/coarray_9.f90: Ditto.
* gfortran.dg/empty_label.f: Ditto.
* gfortran.dg/empty_label.f90: Ditto.
From-SVN: r217600
2014-11-15 12:06:07 +01:00
|
|
|
gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2014-05-25 07:24:12 +02:00
|
|
|
if (coarray == NULL && dim == NULL && distance == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2014-05-25 07:24:12 +02:00
|
|
|
if (dim != NULL && coarray == NULL)
|
|
|
|
{
|
|
|
|
gfc_error ("DIM argument without COARRAY argument not allowed for "
|
|
|
|
"THIS_IMAGE intrinsic at %L", &dim->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (distance && (coarray || dim))
|
|
|
|
{
|
|
|
|
gfc_error ("The DISTANCE argument may not be specified together with the "
|
|
|
|
"COARRAY or DIM argument in intrinsic at %L",
|
|
|
|
&distance->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Assume that we have "this_image (distance)". */
|
|
|
|
if (coarray && !gfc_is_coarray (coarray) && coarray->ts.type == BT_INTEGER)
|
|
|
|
{
|
|
|
|
if (dim)
|
|
|
|
{
|
|
|
|
gfc_error ("Unexpected DIM argument with noncoarray argument at %L",
|
|
|
|
&coarray->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
distance = coarray;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (distance)
|
|
|
|
{
|
|
|
|
if (!type_check (distance, 2, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!nonnegative_check ("DISTANCE", distance))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!scalar_check (distance, 2))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (!gfc_notify_std (GFC_STD_F2008_TS, "DISTANCE= argument to "
|
|
|
|
"THIS_IMAGE at %L", &distance->where))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!coarray_check (coarray, 0))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
|
|
|
if (dim != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_corank_check (dim, coarray))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2011-08-05 23:51:59 +02:00
|
|
|
/* Calculate the sizes for transfer, used by gfc_check_transfer and also
|
2013-04-10 23:36:58 +02:00
|
|
|
by gfc_simplify_transfer. Return false if we cannot do so. */
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2011-08-05 23:51:59 +02:00
|
|
|
gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size,
|
|
|
|
size_t *source_size, size_t *result_size,
|
|
|
|
size_t *result_length_p)
|
|
|
|
{
|
|
|
|
size_t result_elt_size;
|
|
|
|
|
|
|
|
if (source->expr_type == EXPR_FUNCTION)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-08-05 23:51:59 +02:00
|
|
|
|
2012-06-17 21:30:29 +02:00
|
|
|
if (size && size->expr_type != EXPR_CONSTANT)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2012-06-17 21:30:29 +02:00
|
|
|
|
|
|
|
/* Calculate the size of the source. */
|
2011-08-05 23:51:59 +02:00
|
|
|
*source_size = gfc_target_expr_size (source);
|
2012-06-17 21:30:29 +02:00
|
|
|
if (*source_size == 0)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-08-05 23:51:59 +02:00
|
|
|
|
|
|
|
/* Determine the size of the element. */
|
2013-04-22 21:14:22 +02:00
|
|
|
result_elt_size = gfc_element_size (mold);
|
2011-08-05 23:51:59 +02:00
|
|
|
if (result_elt_size == 0)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2011-08-05 23:51:59 +02:00
|
|
|
|
|
|
|
if (mold->expr_type == EXPR_ARRAY || mold->rank || size)
|
|
|
|
{
|
|
|
|
int result_length;
|
|
|
|
|
|
|
|
if (size)
|
|
|
|
result_length = (size_t)mpz_get_ui (size->value.integer);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result_length = *source_size / result_elt_size;
|
|
|
|
if (result_length * result_elt_size < *source_size)
|
|
|
|
result_length += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
*result_size = result_length * result_elt_size;
|
|
|
|
if (result_length_p)
|
|
|
|
*result_length_p = result_length;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
*result_size = result_elt_size;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2011-08-05 23:51:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2011-08-05 23:51:59 +02:00
|
|
|
gfc_check_transfer (gfc_expr *source, gfc_expr *mold, gfc_expr *size)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2011-08-05 23:51:59 +02:00
|
|
|
size_t source_size;
|
|
|
|
size_t result_size;
|
|
|
|
|
2007-05-28 22:53:09 +02:00
|
|
|
if (mold->ts.type == BT_HOLLERITH)
|
|
|
|
{
|
2014-12-13 00:12:06 +01:00
|
|
|
gfc_error ("%<MOLD%> argument of %<TRANSFER%> intrinsic at %L must not be"
|
|
|
|
" %s", &mold->where, gfc_basic_typename (BT_HOLLERITH));
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2007-05-28 22:53:09 +02:00
|
|
|
}
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
if (size != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (size, 2, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (size, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonoptional_check (size, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
gfortran.h (gfc_option_t): Remove warn_aliasing,
2014-11-30 Tobias Burnus <burnus@net-b.de>
* gfortran.h (gfc_option_t): Remove warn_aliasing,
* warn_ampersand,
warn_function_elimination, warn_implicit_interface,
warn_implicit_procedure, warn_line_truncation,
warn_surprising, warn_underflow, warn_intrinsic_shadow,
warn_array_temp, warn_align_commons, warn_real_q_constant,
warn_unused_dummy_argument, warn_zerotrip, warn_realloc_lhs,
warn_realloc_lhs_all, warn_compare_reals, warn_target_lifetime.
* arith.c (check_result, gfc_real2real, gfc_real2complex,
gfc_complex2real, gfc_complex2complex): Honor changed
variable names.
* check.c (gfc_check_transfer): Ditto.
* expr.c (gfc_check_assign, gfc_check_pointer_assign): Ditto.
* interface.c (compare_parameter, gfc_procedure_use,
* gfc_ppc_use,
gfc_arglist_matches_symbol): Ditto.
* intrinsic.c (gfc_warn_intrinsic_shadow): Ditto.
* primary.c (match_real_constant, match_string_constant): Ditto.
* resolve.c (gfc_resolve_intrinsic, resolve_operator,
gfc_resolve_iterator, resolve_select, resolve_ordinary_assign,
resolve_charlen, gfc_resolve_finalizers): Ditto.
* scanner.c (gfc_next_char_literal): Ditto.
* simplify.c (simplify_achar_char, gfc_simplify_iachar): Ditto.
* trans-array.c (gfc_trans_create_temp_array,
gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Ditto.
* trans-common.c (translate_common):
* trans-decl.c (generate_local_decl): Ditto.
* trans-expr.c (realloc_lhs_warning): Ditto.
* trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
* decl.c (do_warn_intrinsic_shadow): Ditto. Renamed from
warn_intrinsic_shadow.
* frontend-passes.c (do_warn_function_elimination): Honor
changed variable names. Renamed from do_warn_function_elimination.
* invoke.texi (Wunderflow): Document that it is enabled by
* default.
* lang.opt (Waliasing, Walign-commons, Warray-temporaries,
Wcompare-reals, Wfunction-elimination, Wimplicit-interface,
Wimplicit-procedure, Wline-truncation, Wreal-q-constant, Wrealloc-lhs,
Wrealloc-lhs-all, Wtarget-lifetime, Wsurprising, Wunderflow,
Wintrinsic-shadow, Wunused-dummy-argument, Wzerotrip): Use Var(),
add Init() and LangEnabledBy() were required.
(Wmaybe-uninitialized, Wreturn-type, Wuninitialized): Add
LangEnabledBy.
* options.c (gfc_init_options, gfc_post_options,
* gfc_handle_option):
Remove options handled in lang.opt; handle renaming.
(set_Wall, set_Wextra): Remove.
From-SVN: r218188
2014-11-30 09:33:25 +01:00
|
|
|
if (!warn_surprising)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2011-08-05 23:51:59 +02:00
|
|
|
|
|
|
|
/* If we can't calculate the sizes, we cannot check any more.
|
2013-04-10 23:36:58 +02:00
|
|
|
Return true for that case. */
|
2011-08-05 23:51:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!gfc_calculate_transfer_sizes (source, mold, size, &source_size,
|
|
|
|
&result_size, NULL))
|
|
|
|
return true;
|
2011-08-05 23:51:59 +02:00
|
|
|
|
|
|
|
if (source_size < result_size)
|
Always pass 0 or option number to gfc_warning*.
Similar to the issue with fatal_error that I fixed in
<https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02690.html>, the
overloads of gfc_warning and gfc_warning_now (with and without a first
argument for an option number) also break gcc.pot regeneration because
xgettext expects the translated string argument to be in a fixed
position for a given function name. This patch applies the
corresponding fix of always passing a first argument (option number or
0), just like the core diagnostic functions warning and warning_at,
and removing the problem overloads without it.
Bootstrapped with no regressions on x86_64-unknown-linux-gnu.
* error.c (gfc_warning (const char *, ...), gfc_warning_now (const
char *, ...)): Remove functions.
* gfortran.h (gfc_warning (const char *, ...), gfc_warning_now
(const char *, ...)): Remove declarations.
* arith.c, check.c, data.c, decl.c, frontend-passes.c,
interface.c, intrinsic.c, io.c, matchexp.c, module.c, openmp.c,
options.c, parse.c, primary.c, resolve.c, scanner.c, symbol.c,
trans-common.c, trans-const.c, trans-stmt.c: All callers of
gfc_warning and gfc_warning_now changed to pass 0 or option number
as first argument.
From-SVN: r220313
2015-02-01 01:29:54 +01:00
|
|
|
gfc_warning (0, "Intrinsic TRANSFER at %L has partly undefined result: "
|
2014-12-03 18:50:06 +01:00
|
|
|
"source size %ld < result size %ld", &source->where,
|
|
|
|
(long) source_size, (long) result_size);
|
2011-08-05 23:51:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_transpose (gfc_expr *matrix)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (matrix, 0, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (array, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_rank_check (dim, array, 0))
|
|
|
|
return false;
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 2, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
gfc_check_ucobound (gfc_expr *coarray, gfc_expr *dim, gfc_expr *kind)
|
|
|
|
{
|
2014-12-17 07:29:30 +01:00
|
|
|
if (flag_coarray == GFC_FCOARRAY_NONE)
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
{
|
error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
2014-11-15 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* error.c (gfc_fatal_error_1): Renamed from gfc_fatal_error.
(gfc_fatal_error): Add; uses common diagnostics.
* array.c (gfc_match_array_ref, gfc_match_array_spec): Use
%< %>.
* check.c (check_co_collective, gfc_check_lcobound,
gfc_check_image_index, gfc_check_num_images,
gfc_check_this_image, gfc_check_ucobound): Ditto.
* cpp.c (gfc_cpp_post_options): Ditto.
(gfc_cpp_init_0, gfc_cpp_done): Change %s to %qs.
* gfc-diagnostic.def (DK_FATAL): Capitalize first letter.
* gfortran.h (gfc_fatal_error_1): Add.
* match.c (gfc_match_name, gfc_match_critical,
lock_unlock_statement, sync_statement): Add %< %>.
* module.c (bad_module, gfc_dump_module, gfc_use_module): Change
%s to %qs.
* options.c (gfc_handle_module_path_options,
* gfc_handle_fpe_option,
gfc_handle_coarray_option, gfc_handle_runtime_check_option,
gfc_handle_option): Add %< %>.
* simplify.c (gfc_simplify_num_images): Ditto.
* trans-stmt.c (gfc_trans_sync): Use gfc_fatal_error_1.
* trans-array.c (gfc_conv_array_initializer): Ditto.
* trans-types.c (gfc_init_kinds): Use gfc_fatal_error instead
of fatal_error; add %< %> quotations.
gcc/testsuite/
* gfortran.dg/binding_label_tests_4.f03: Add dg-excess-errors.
* gfortran.dg/coarray_9.f90: Ditto.
* gfortran.dg/empty_label.f: Ditto.
* gfortran.dg/empty_label.f90: Ditto.
From-SVN: r217600
2014-11-15 12:06:07 +01:00
|
|
|
gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable");
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!coarray_check (coarray, 0))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
|
|
|
if (dim != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_check (dim, 1, false))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!dim_corank_check (dim, coarray))
|
|
|
|
return false;
|
re PR fortran/18918 (Eventually support Fortran 2008's coarrays [co-arrays])
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* array.c (gfc_find_array_ref): Handle codimensions.
(gfc_match_array_spec,gfc_match_array_ref): Use gfc_fatal_error.
* check.c (is_coarray, dim_corank_check, gfc_check_lcobound,
gfc_check_image_index, gfc_check_this_image, gfc_check_ucobound):
New functions.
* gfortran.h (gfc_isym_id): Add GFC_ISYM_IMAGE_INDEX,
GFC_ISYM_LCOBOUND, GFC_ISYM_THIS_IMAGE,
GFC_ISYM_UCOBOUND.
* intrinsic.h (add_functions): Add this_image, image_index,
lcobound and ucobound intrinsics.
* intrinsic.c (gfc_check_lcobound,gfc_check_ucobound,
gfc_check_image_index, gfc_check_this_image,
gfc_simplify_image_index, gfc_simplify_lcobound,
gfc_simplify_this_image, gfc_simplify_ucobound):
New function prototypes.
* intrinsic.texi (IMAGE_INDEX, LCOBOUND, THIS_IMAGE
IMAGE_INDEX): Document new intrinsic functions.
* match.c (gfc_match_critical, sync_statement): Make
* -fcoarray=none
error fatal.
* simplify.c (simplify_bound_dim): Handle coarrays.
(simplify_bound): Update simplify_bound_dim call.
(gfc_simplify_num_images): Add -fcoarray=none check.
(simplify_cobound, gfc_simplify_lcobound, gfc_simplify_ucobound,
gfc_simplify_ucobound, gfc_simplify_ucobound): New functions.
2010-04-14 Tobias Burnus <burnus@net-b.de>
PR fortran/18918
* gfortran.dg/coarray_9.f90: Update dg-errors.
* gfortran.dg/coarray_10.f90: New test.
* gfortran.dg/coarray_11.f90: New test.
From-SVN: r158292
2010-04-14 07:43:30 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 2, BT_INTEGER))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2009-06-07 19:33:34 +02:00
|
|
|
mpz_t vector_size;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (vector, 0, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (mask, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 1, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (vector, 0, field, 2))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2009-06-07 19:33:34 +02:00
|
|
|
if (mask->expr_type == EXPR_ARRAY
|
2013-04-10 23:36:58 +02:00
|
|
|
&& gfc_array_size (vector, &vector_size))
|
2009-06-07 19:33:34 +02:00
|
|
|
{
|
|
|
|
int mask_true_count = 0;
|
2010-04-13 03:59:35 +02:00
|
|
|
gfc_constructor *mask_ctor;
|
|
|
|
mask_ctor = gfc_constructor_first (mask->value.constructor);
|
2009-06-07 19:33:34 +02:00
|
|
|
while (mask_ctor)
|
|
|
|
{
|
|
|
|
if (mask_ctor->expr->expr_type != EXPR_CONSTANT)
|
|
|
|
{
|
|
|
|
mask_true_count = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mask_ctor->expr->value.logical)
|
|
|
|
mask_true_count++;
|
|
|
|
|
2010-04-13 03:59:35 +02:00
|
|
|
mask_ctor = gfc_constructor_next (mask_ctor);
|
2009-06-07 19:33:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (mpz_get_si (vector_size) < mask_true_count)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must "
|
2009-06-07 19:33:34 +02:00
|
|
|
"provide at least as many elements as there "
|
2014-12-11 16:13:33 +01:00
|
|
|
"are .TRUE. values in %qs (%ld/%d)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&vector->where, gfc_current_intrinsic_arg[1]->name,
|
2009-06-07 19:33:34 +02:00
|
|
|
mpz_get_si (vector_size), mask_true_count);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2009-06-07 19:33:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mpz_clear (vector_size);
|
|
|
|
}
|
|
|
|
|
2008-07-19 19:20:26 +02:00
|
|
|
if (mask->rank != field->rank && field->rank != 0)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must have "
|
|
|
|
"the same rank as %qs or be a scalar",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[2]->name, gfc_current_intrinsic,
|
|
|
|
&field->where, gfc_current_intrinsic_arg[1]->name);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2008-07-19 19:20:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (mask->rank == field->rank)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < field->rank; i++)
|
|
|
|
if (! identical_dimen_shape (mask, i, field, i))
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs and %qs arguments of %qs intrinsic at %L "
|
2012-12-20 01:15:00 +01:00
|
|
|
"must have identical shape.",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[2]->name,
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
2009-06-07 19:33:34 +02:00
|
|
|
&field->where);
|
2008-07-19 19:20:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
gfc_check_verify (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (x, 0, y, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (z != NULL && !type_check (z, 2, BT_LOGICAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_check (kind, 3, BT_INTEGER))
|
|
|
|
return false;
|
2014-12-13 00:12:06 +01:00
|
|
|
if (kind && !gfc_notify_std (GFC_STD_F2003, "%qs intrinsic "
|
2013-04-10 23:36:58 +02:00
|
|
|
"with KIND argument at %L",
|
|
|
|
gfc_current_intrinsic, &kind->where))
|
|
|
|
return false;
|
re PR fortran/29600 ([F03] MINLOC and MAXLOC take an optional KIND argument)
PR fortran/29600
* intrinsic.c (add_functions): Add KIND arguments to COUNT,
IACHAR, ICHAR, INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND
and VERIFY.
* iresolve.c (gfc_resolve_count): Add kind argument.
(gfc_resolve_iachar): New function.
(gfc_resolve_ichar): Add kind argument.
(gfc_resolve_index_func): Likewise.
(gfc_resolve_lbound): Likewise.
(gfc_resolve_len): Likewise.
(gfc_resolve_len_trim): Likewise.
(gfc_resolve_scan): Likewise.
(gfc_resolve_size): New function.
(gfc_resolve_ubound): Add kind argument.
(gfc_resolve_verify): Likewise.
* trans-decl.c (gfc_get_extern_function_decl): Allow specific
intrinsics to have 4 arguments.
* check.c (gfc_check_count): Add kind argument.
(gfc_check_ichar_iachar): Likewise.
(gfc_check_index): Likewise.
(gfc_check_lbound): Likewise.
(gfc_check_len_lentrim): New function.
(gfc_check_scan): Add kind argument.
(gfc_check_size): Likewise.
(gfc_check_ubound): Likewise.
(gfc_check_verify): Likewise.
* intrinsic.texi: Update documentation for COUNT, IACHAR, ICHAR,
INDEX, LBOUND, LEN, LEN_TRIM, SCAN, SIZE, UBOUND and VERIFY.
* simplify.c (get_kind): Whitespace fix.
(int_expr_with_kind): New function.
(gfc_simplify_iachar): Add kind argument.
(gfc_simplify_iachar): Likewise.
(gfc_simplify_ichar): Likewise.
(gfc_simplify_index): Likewise.
(simplify_bound_dim): Likewise.
(simplify_bound): Likewise.
(gfc_simplify_lbound): Likewise.
(gfc_simplify_len): Likewise.
(gfc_simplify_len_trim): Likewise.
(gfc_simplify_scan): Likewise.
(gfc_simplify_shape): Pass NULL as kind argument to gfc_simplify_size.
(gfc_simplify_size): Add kind argument.
(gfc_simplify_ubound): Likewise.
(gfc_simplify_verify): Likewise.
* intrinsic.h: Update prototypes and add new ones.
* trans-intrinsic.c (gfc_conv_intrinsic_index): Rename into
gfc_conv_intrinsic_index_scan_verify.
(gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove.
(gfc_conv_intrinsic_function): Call
gfc_conv_intrinsic_index_scan_verify to translate the INDEX,
SCAN and VERIFY intrinsics.
* gfortran.dg/intrinsics_kind_argument_1.f90: New test.
* gfortran.dg/pure_dummy_length_1.f90: Adapt to new error wording.
From-SVN: r127380
2007-08-12 21:57:01 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_trim (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_CHARACTER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (x, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ttynam (gfc_expr *unit)
|
2005-11-05 09:34:07 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
2005-11-05 09:34:07 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
2005-11-05 09:34:07 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-11-05 09:34:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
/* Common check function for the half a dozen intrinsics that have a
|
|
|
|
single real argument. */
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_x (gfc_expr *x)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/************* Check functions for intrinsic subroutines *************/
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_cpu_time (gfc_expr *time)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (time, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (time, 0, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (time, 0, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_date_and_time (gfc_expr *date, gfc_expr *time,
|
|
|
|
gfc_expr *zone, gfc_expr *values)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
|
|
|
if (date != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (date, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (date, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (date, 0))
|
|
|
|
return false;
|
|
|
|
if (!variable_check (date, 0, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (time != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (time, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (time, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (time, 1))
|
|
|
|
return false;
|
|
|
|
if (!variable_check (time, 1, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (zone != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (zone, 2, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (zone, 2, gfc_default_character_kind))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (zone, 2))
|
|
|
|
return false;
|
|
|
|
if (!variable_check (zone, 2, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (values != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (values, 3, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!array_check (values, 3))
|
|
|
|
return false;
|
|
|
|
if (!rank_check (values, 3, 1))
|
|
|
|
return false;
|
|
|
|
if (!variable_check (values, 3, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_mvbits (gfc_expr *from, gfc_expr *frompos, gfc_expr *len,
|
|
|
|
gfc_expr *to, gfc_expr *topos)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (from, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (frompos, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (len, 2, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!same_type_check (from, 0, to, 3))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (to, 3, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (topos, 4, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("frompos", frompos))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("topos", topos))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!nonnegative_check ("len", len))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize2 ("from", from, "frompos", frompos, "len", len))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!less_than_bitsize2 ("to", to, "topos", topos, "len", len))
|
|
|
|
return false;
|
2010-06-09 18:24:59 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_random_number (gfc_expr *harvest)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (harvest, 0, BT_REAL))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (harvest, 0, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
|
2004-05-13 08:41:07 +02:00
|
|
|
{
|
2008-11-01 11:24:15 +01:00
|
|
|
unsigned int nargs = 0, kiss_size;
|
2007-08-12 22:45:29 +02:00
|
|
|
locus *where = NULL;
|
2009-01-05 20:34:02 +01:00
|
|
|
mpz_t put_size, get_size;
|
2008-11-01 11:24:15 +01:00
|
|
|
bool have_gfc_real_16; /* Try and mimic HAVE_GFC_REAL_16 in libgfortran. */
|
2007-08-12 22:45:29 +02:00
|
|
|
|
2008-11-01 11:24:15 +01:00
|
|
|
have_gfc_real_16 = gfc_validate_kind (BT_REAL, 16, true) != -1;
|
|
|
|
|
2009-01-05 20:34:02 +01:00
|
|
|
/* Keep the number of bytes in sync with kiss_size in
|
|
|
|
libgfortran/intrinsics/random.c. */
|
|
|
|
kiss_size = (have_gfc_real_16 ? 48 : 32) / gfc_default_integer_kind;
|
|
|
|
|
2004-05-13 08:41:07 +02:00
|
|
|
if (size != NULL)
|
|
|
|
{
|
2007-08-12 22:45:29 +02:00
|
|
|
if (size->expr_type != EXPR_VARIABLE
|
|
|
|
|| !size->symtree->n.sym->attr.optional)
|
|
|
|
nargs++;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (size, 0))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (size, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (size, 0, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (size, 0, gfc_default_integer_kind))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (put != NULL)
|
|
|
|
{
|
2007-08-12 22:45:29 +02:00
|
|
|
if (put->expr_type != EXPR_VARIABLE
|
|
|
|
|| !put->symtree->n.sym->attr.optional)
|
|
|
|
{
|
|
|
|
nargs++;
|
|
|
|
where = &put->where;
|
|
|
|
}
|
2004-05-23 13:06:09 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (put, 1))
|
|
|
|
return false;
|
2004-05-23 13:06:09 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (put, 1, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (put, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (put, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
2008-11-01 11:24:15 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (gfc_array_size (put, &put_size)
|
2008-11-01 11:24:15 +01:00
|
|
|
&& mpz_get_ui (put_size) < kiss_size)
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Size of %qs argument of %qs intrinsic at %L "
|
2009-01-05 20:34:02 +01:00
|
|
|
"too small (%i/%i)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
|
|
|
where, (int) mpz_get_ui (put_size), kiss_size);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (get != NULL)
|
|
|
|
{
|
2007-08-12 22:45:29 +02:00
|
|
|
if (get->expr_type != EXPR_VARIABLE
|
|
|
|
|| !get->symtree->n.sym->attr.optional)
|
|
|
|
{
|
|
|
|
nargs++;
|
|
|
|
where = &get->where;
|
|
|
|
}
|
2004-05-23 13:06:09 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (get, 2))
|
|
|
|
return false;
|
2004-05-23 13:06:09 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (get, 2, 1))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (get, 2, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (get, 2, false))
|
|
|
|
return false;
|
2004-05-13 08:41:07 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (get, 2, gfc_default_integer_kind))
|
|
|
|
return false;
|
2009-01-05 20:34:02 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (gfc_array_size (get, &get_size)
|
2009-01-05 20:34:02 +01:00
|
|
|
&& mpz_get_ui (get_size) < kiss_size)
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("Size of %qs argument of %qs intrinsic at %L "
|
2009-01-05 20:34:02 +01:00
|
|
|
"too small (%i/%i)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[2]->name, gfc_current_intrinsic,
|
|
|
|
where, (int) mpz_get_ui (get_size), kiss_size);
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
|
|
|
|
2007-08-12 22:45:29 +02:00
|
|
|
/* RANDOM_SEED may not have more than one non-optional argument. */
|
|
|
|
if (nargs > 1)
|
|
|
|
gfc_error ("Too many arguments to %s at %L", gfc_current_intrinsic, where);
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-13 08:41:07 +02:00
|
|
|
}
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2015-05-06 22:23:48 +02:00
|
|
|
bool
|
|
|
|
gfc_check_fe_runtime_error (gfc_actual_arglist *a)
|
|
|
|
{
|
|
|
|
gfc_expr *e;
|
|
|
|
int len, i;
|
|
|
|
int num_percent, nargs;
|
|
|
|
|
|
|
|
e = a->expr;
|
|
|
|
if (e->expr_type != EXPR_CONSTANT)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
len = e->value.character.length;
|
|
|
|
if (e->value.character.string[len-1] != '\0')
|
|
|
|
gfc_internal_error ("fe_runtime_error string must be null terminated");
|
|
|
|
|
|
|
|
num_percent = 0;
|
|
|
|
for (i=0; i<len-1; i++)
|
|
|
|
if (e->value.character.string[i] == '%')
|
|
|
|
num_percent ++;
|
|
|
|
|
|
|
|
nargs = 0;
|
|
|
|
for (; a; a = a->next)
|
|
|
|
nargs ++;
|
|
|
|
|
|
|
|
if (nargs -1 != num_percent)
|
|
|
|
gfc_internal_error ("fe_runtime_error: Wrong number of arguments (%d instead of %d)",
|
|
|
|
nargs, num_percent++);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_second_sub (gfc_expr *time)
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (time, 0))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (time, 0, BT_REAL))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (time, 0, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-15 18:58:53 +02:00
|
|
|
/* COUNT and COUNT_MAX of SYSTEM_CLOCK are scalar, default-kind integer
|
|
|
|
variables in Fortran 95. In Fortran 2003 and later, they can be of any
|
|
|
|
kind, and COUNT_RATE can be of type real. Note, count, count_rate, and
|
|
|
|
count_max are all optional arguments */
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_system_clock (gfc_expr *count, gfc_expr *count_rate,
|
|
|
|
gfc_expr *count_max)
|
2004-05-22 14:47:42 +02:00
|
|
|
{
|
|
|
|
if (count != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (count, 0))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (count, 0, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2014-06-15 18:58:53 +02:00
|
|
|
if (count->ts.kind != gfc_default_integer_kind
|
|
|
|
&& !gfc_notify_std (GFC_STD_F2003, "COUNT argument to "
|
|
|
|
"SYSTEM_CLOCK at %L has non-default kind",
|
|
|
|
&count->where))
|
|
|
|
return false;
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (count, 0, false))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (count_rate != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (count_rate, 1))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (count_rate, 1, false))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2014-06-15 18:58:53 +02:00
|
|
|
if (count_rate->ts.type == BT_REAL)
|
|
|
|
{
|
|
|
|
if (!gfc_notify_std (GFC_STD_F2003, "Real COUNT_RATE argument to "
|
|
|
|
"SYSTEM_CLOCK at %L", &count_rate->where))
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!type_check (count_rate, 1, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (count_rate->ts.kind != gfc_default_integer_kind
|
|
|
|
&& !gfc_notify_std (GFC_STD_F2003, "COUNT_RATE argument to "
|
|
|
|
"SYSTEM_CLOCK at %L has non-default kind",
|
|
|
|
&count_rate->where))
|
|
|
|
return false;
|
|
|
|
}
|
2004-05-22 14:47:42 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count_max != NULL)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (count_max, 2))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (count_max, 2, BT_INTEGER))
|
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2014-06-15 18:58:53 +02:00
|
|
|
if (count_max->ts.kind != gfc_default_integer_kind
|
|
|
|
&& !gfc_notify_std (GFC_STD_F2003, "COUNT_MAX argument to "
|
|
|
|
"SYSTEM_CLOCK at %L has non-default kind",
|
|
|
|
&count_max->where))
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2014-06-15 18:58:53 +02:00
|
|
|
if (!variable_check (count_max, 2, false))
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
arith.c (arctangent2, [...]): Fix whitespace issues.
* arith.c (arctangent2, gfc_arith_init_1, gfc_arith_done_1,
gfc_constant_result, gfc_range_check, gfc_arith_power,
eval_type_intrinsic0, eval_intrinsic_f2, gfc_real2real,
gfc_real2complex, gfc_complex2int, gfc_complex2real,
gfc_complex2complex): Fix whitespace issues.
check.c (must_be, type_check, numeric_check, int_or_real_check,
logical_array_check, array_check, scalar_check, nonoptional_check,
variable_check, dim_check, check_a_kind, gfc_check_a_ikind,
gfc_check_a_xkind, gfc_check_abs, gfc_check_all_any,
gfc_check_allocated, gfc_check_a_p, gfc_check_besn,
gfc_check_btest, gfc_check_char, gfc_check_cmplx, gfc_check_count,
gfc_check_cshift, gfc_check_dcmplx, gfc_check_dble,
gfc_check_digits, gfc_check_dot_product, gfc_check_eoshift,
gfc_check_fnum, gfc_check_g77_math1, gfc_check_huge, gfc_check_i,
gfc_check_iand, gfc_check_ibclr, gfc_check_ibits, gfc_check_ibset,
gfc_check_idnint, gfc_check_ieor, gfc_check_index, gfc_check_int,
gfc_check_ior, gfc_check_ishft, gfc_check_ishftc, gfc_check_kind,
gfc_check_lbound, gfc_check_logical, min_max_args,
gfc_check_min_max_integer, gfc_check_min_max_real,
gfc_check_min_max_double, gfc_check_matmul,
gfc_check_minval_maxval, gfc_check_merge, gfc_check_nearest,
gfc_check_pack, gfc_check_precision, gfc_check_radix,
gfc_check_range, gfc_check_real, gfc_check_repeat,
gfc_check_scale, gfc_check_scan, gfc_check_selected_real_kind,
gfc_check_set_exponent): Fix formatting issues.
(gfc_check_size, gfc_check_sign): Alphabetize function order,
remove whitespace-only line.
(gfc_check_fstat, gfc_check_fstat_sub, gfc_check_stat,
gfc_check_stat_sub, gfc_check_transfer, gfc_check_transpose,
gfc_check_ubound, gfc_check_unpack, gfc_check_verify, gfc_check_x,
gfc_check_cpu_time, gfc_check_date_and_time, gfc_check_mvbits,
gfc_check_random_number, gfc_check_random_seed,
gfc_check_second_sub, gfc_check_system_clock,
gfc_check_getcwd_sub, gfc_check_exit, gfc_check_flush,
gfc_check_umask, gfc_check_umask_sub, gfc_check_unlink,
gfc_check_unlink_sub): Fix formatting issues.
From-SVN: r93093
2005-01-08 23:40:47 +01:00
|
|
|
}
|
2004-05-22 14:47:42 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-05-22 14:47:42 +02:00
|
|
|
}
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_irand (gfc_expr *x)
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
{
|
2004-10-30 16:18:34 +02:00
|
|
|
if (x == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-10-30 16:18:34 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (x, 0))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (x, 0, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
}
|
|
|
|
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_alarm_sub (gfc_expr *seconds, gfc_expr *handler, gfc_expr *status)
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (seconds, 0))
|
|
|
|
return false;
|
|
|
|
if (!type_check (seconds, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_proc_check (handler, 1))
|
|
|
|
return false;
|
|
|
|
if (handler->ts.type == BT_INTEGER && !scalar_check (handler, 1))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (status, 2, gfc_default_integer_kind))
|
|
|
|
return false;
|
2007-03-08 22:45:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_rand (gfc_expr *x)
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
{
|
2004-10-30 16:18:34 +02:00
|
|
|
if (x == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-10-30 16:18:34 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (x, 0))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (x, 0, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_srand (gfc_expr *x)
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (x, 0))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (x, 0, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ctime_sub (gfc_expr *time, gfc_expr *result)
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (time, 0))
|
|
|
|
return false;
|
|
|
|
if (!type_check (time, 0, BT_INTEGER))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (result, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (result, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-12-25 11:41:44 +01:00
|
|
|
gfc_check_dtime_etime (gfc_expr *x)
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (x, 0))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (x, 0, 1))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (x, 0, false))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (x, 0, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
}
|
|
|
|
|
2007-01-07 01:28:29 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-12-25 11:41:44 +01:00
|
|
|
gfc_check_dtime_etime_sub (gfc_expr *values, gfc_expr *time)
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (values, 0))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (values, 0, 1))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (values, 0, false))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (values, 0, BT_REAL))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (values, 0, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (time, 1))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (time, 1, BT_REAL))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (time, 1, 4))
|
|
|
|
return false;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_second_sub, [...]): New functions.
* check.c (gfc_check_second_sub, gfc_check_irand, gfc_check_rand
gfc_check_srand, gfc_check_etime, gfc_check_etime_sub): New functions.
* gfortran.h (gfc_generic_isym_id): New symbols GFC_ISYM_ETIME,
GFC_ISYM_IRAND, GFC_ISYM_RAND, GFC_ISYM_SECOND.
* trans-intrinsic.c: Use symbols.
* intrinsic.c (add_sym_2s): New function.
* intrinsic.c: Add etime, dtime, irand, rand, second, srand.
* intrinsic.h: Function prototypes.
* iresolve.c (gfc_resolve_etime_sub, gfc_resolve_second_sub
gfc_resolve_srand): New functions.
libgfortran
* Makefile.am: Add rand.c and etime.c
* Makefile.in: Regenerated.
* aclocal.in: Regenerated.
* cpu_time.c (second_sub, second): New functions.
* rand.c (irand, rand, srand): New file.
* etime.c (etime_sub, etime): New file.
From-SVN: r83034
2004-06-12 19:34:47 +02:00
|
|
|
}
|
2004-09-15 16:09:17 +02:00
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_fdate_sub (gfc_expr *date)
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (date, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (date, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ctime and fdate intrinsics.
* intrinsic.c (add_functions): Add ctime and fdate intrinsics.
(add_subroutines): Likewise.
* intrinsic.h: Prototypes for gfc_check_ctime,
gfc_check_ctime_sub, gfc_check_fdate_sub, gfc_resolve_ctime,
gfc_resolve_fdate, gfc_resolve_ctime_sub, gfc_resolve_fdate_sub.
* gfortran.h: Add GFC_ISYM_CTIME and GFC_ISYM_FDATE.
* iresolve.c (gfc_resolve_ctime, gfc_resolve_fdate,
gfc_resolve_ctime_sub, gfc_resolve_fdate_sub): New functions.
* trans-decl.c (gfc_build_intrinsic_function_decls): Add
gfor_fndecl_fdate and gfor_fndecl_ctime.
* check.c (gfc_check_ctime, gfc_check_ctime_sub,
gfc_check_fdate_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate): New functions.
(gfc_conv_intrinsic_function): Add cases for GFC_ISYM_CTIME
and GFC_ISYM_FDATE.
* intrinsic.texi: Documentation for the new CTIME and FDATE
intrinsics.
* trans.h: Declarations for gfor_fndecl_ctime and gfor_fndecl_fdate.
* intrinsics/ctime.c: New file.
* configure.ac: Add check for ctime.
* Makefile.am: Add ctime.c
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r106558
2005-11-06 11:17:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_gerror (gfc_expr *msg)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (msg, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (msg, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_getcwd_sub (gfc_expr *cwd, gfc_expr *status)
|
2004-09-15 16:09:17 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (cwd, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (cwd, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
2004-09-15 16:09:17 +02:00
|
|
|
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 1))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 1, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-08-29 17:22:55 +02:00
|
|
|
gfc_check_getarg (gfc_expr *pos, gfc_expr *value)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (pos, 0, BT_INTEGER))
|
|
|
|
return false;
|
2007-08-29 17:22:55 +02:00
|
|
|
|
|
|
|
if (pos->ts.kind > gfc_default_integer_kind)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be of a kind "
|
2007-08-29 17:22:55 +02:00
|
|
|
"not wider than the default kind (%d)",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
2007-08-29 17:22:55 +02:00
|
|
|
&pos->where, gfc_default_integer_kind);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2007-08-29 17:22:55 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (value, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (value, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
2007-08-29 17:22:55 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-08-29 17:22:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_getlog (gfc_expr *msg)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (msg, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (msg, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_exit (gfc_expr *status)
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
{
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 0))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_flush (gfc_expr *unit)
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
{
|
|
|
|
if (unit == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 05:10:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_free (gfc_expr *i)
|
2005-10-30 13:17:48 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (i, 0, BT_INTEGER))
|
|
|
|
return false;
|
2005-10-30 13:17:48 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (i, 0))
|
|
|
|
return false;
|
2005-10-30 13:17:48 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-10-30 13:17:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_hostnm (gfc_expr *name)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_hostnm_sub (gfc_expr *name, gfc_expr *status)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 1))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 1, BT_INTEGER))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_itime_idate (gfc_expr *values)
|
2006-07-04 13:39:46 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (values, 0))
|
|
|
|
return false;
|
2006-07-04 13:39:46 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (values, 0, 1))
|
|
|
|
return false;
|
2006-07-04 13:39:46 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (values, 0, false))
|
|
|
|
return false;
|
2006-07-04 13:39:46 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (values, 0, BT_INTEGER))
|
|
|
|
return false;
|
2006-07-04 13:39:46 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (values, 0, gfc_default_integer_kind))
|
|
|
|
return false;
|
2006-07-04 13:39:46 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2006-07-04 13:39:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ltime_gmtime (gfc_expr *time, gfc_expr *values)
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (time, 0, BT_INTEGER))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (time, 0, gfc_default_integer_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (time, 0))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!array_check (values, 1))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!rank_check (values, 1, 1))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!variable_check (values, 1, false))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (values, 1, BT_INTEGER))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (values, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
* intrinsic.c (add_functions): Add ACCESS, CHMOD, RSHIFT, LSHIFT.
(add_subroutines): Add LTIME, GMTIME and CHMOD.
* intrinsic.h (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime, gfc_simplify_rshift,
gfc_simplify_lshift, gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): Add prototypes.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_ACCESS,
GFC_ISYM_CHMOD, GFC_ISYM_LSHIFT, GFC_ISYM_RSHIFT.
* iresolve.c (gfc_resolve_access, gfc_resolve_chmod,
gfc_resolve_rshift, gfc_resolve_lshift, gfc_resolve_chmod_sub,
gfc_resolve_gmtime, gfc_resolve_ltime): New functions.
* check.c (gfc_check_access_func, gfc_check_chmod,
gfc_check_chmod_sub, gfc_check_ltime_gmtime): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_rlshift): New function.
(gfc_conv_intrinsic_function): Add cases for the new GFC_ISYM_*.
* intrinsics/date_and_time.c: Add functions for GMTIME and LTIME.
* intrinsics/access.c: New file.
* intrinsics/chmod.c: New file.
* configure.ac: Add checks for <sys/wait.h>, access, fork,execl
and wait.
* Makefile.am: Add new files intrinsics/access.c and
intrinsics/chmod.c.
* configure: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
* gcc/testsuite/gfortran.dg/chmod_3.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_1.f90: New test.
* gcc/testsuite/gfortran.dg/ltime_gmtime_2.f90: New test.
* gcc/testsuite/gfortran.dg/lrshift_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_1.f90: New test.
* gcc/testsuite/gfortran.dg/chmod_2.f90: New test.
From-SVN: r115825
2006-07-30 22:48:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_ttynam_sub (gfc_expr *unit, gfc_expr *name)
|
2005-08-09 19:33:17 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
2005-08-09 19:33:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
2005-08-09 19:33:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 1, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 1, gfc_default_character_kind))
|
|
|
|
return false;
|
2005-08-09 19:33:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-08-09 19:33:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_isatty (gfc_expr *unit)
|
2005-08-09 19:33:17 +02:00
|
|
|
{
|
|
|
|
if (unit == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2005-08-09 19:33:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (unit, 0, BT_INTEGER))
|
|
|
|
return false;
|
2005-08-09 19:33:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (unit, 0))
|
|
|
|
return false;
|
2005-08-09 19:33:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2005-08-09 19:33:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-08-05 12:18:38 +02:00
|
|
|
gfc_check_isnan (gfc_expr *x)
|
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (x, 0, BT_REAL))
|
|
|
|
return false;
|
2007-08-05 12:18:38 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2007-08-05 12:18:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_perror (gfc_expr *string)
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (string, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (string, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
Makefile.am: Added new files.
* Makefile.am: Added new files.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure.ac: add checks for signal.h headers file, as well as
following functions: chdir, strerror, getlogin, gethostname, kill,
link, symlink, perror, sleep, time.
* configure: Regenerate.
* intrinsics/chdir.c, intrinsics/gerror.c, intrinsics/getlog.c,
intrinsics/hostnm.c, intrinsics/ierrno.c, intrinsics/kill.c,
intrinsics/link.c, intrinsics/perror.c, intrinsics/rename.c,
intrinsics/sleep.c, intrinsics/symlnk.c, intrinsics/time.c: Newly
implementend g77 intrinsics.
* check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
gfc_check_perror): new functions to check newly implemented
g77 intrinsics.
* gfortran.h: adding symbols for new intrinsics.
* intrinsic.c (add_functions): adding new intrinsics.
(add_subroutines): adding new intrinsics.
* intrinsic.h: prototype for all checking and resolving
functions.
* iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub,
gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill,
gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk,
gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub,
gfc_resolve_kill_sub, gfc_resolve_link_sub,
gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub,
gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub,
gfc_resolve_perror): new functions to resolve intrinsics.
* trans-intrinsic.c (gfc_conv_intrinsic_function): add case
for new symbols.
* g77_intrinsics_funcs.f: New test.
* g77_intrinsics_sub.f: New test.
From-SVN: r96893
2005-03-22 23:08:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_umask (gfc_expr *mask)
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (mask, 0))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_umask_sub (gfc_expr *mask, gfc_expr *old)
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (mask, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (mask, 0))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
|
|
|
if (old == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (old, 1))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (old, 1, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_unlink (gfc_expr *name)
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_unlink_sub (gfc_expr *name, gfc_expr *status)
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (name, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (name, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_getcwd_sub): Fix seg fault.
* check.c (gfc_check_exit,gfc_check_umask,gfc_check_umask_sub,
gfc_check_unlink,gfc_check_unlink_sub): New functions
* gfortran.h (GFC_ISYM_UMASK,GFC_ISYM_UNLINK): New symbols
* intrinsic.c (add_functions,add_subroutines): Add umask, unlink,
exit to intrinsics symbol tables.
* intrinsic.h (gfc_check_umask,gfc_check_unlink,gfc_check_exit,
gfc_check_umask_sub,gfc_check_unlink_sub,gfc_resolve_umask,
gfc_resolve_unlink,gfc_resolve_exit,gfc_resolve_umask_sub,
gfc_resolve_unlink_sub): Add and sort prototypes.
* iresolve.c (gfc_resolve_umask,gfc_resolve_unlink,gfc_resolve_exit,
gfc_resolve_umask_sub,gfc_resolve_unlink_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Use symbols
libgfortran/
* Makefile.am: Add intrinsics/{umask.c,unlink.c,exit.c}
* Makefile.in: Regenerated
* intrinsics/umask.c: New file
* intrinsics/unlink.c: ditto
* intrinsics/exit.c: ditto
From-SVN: r90949
2004-11-20 02:44:49 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 1))
|
|
|
|
return false;
|
2004-09-15 16:09:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-09-15 16:09:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-09-15 16:09:17 +02:00
|
|
|
}
|
2004-10-04 23:30:32 +02:00
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_signal (gfc_expr *number, gfc_expr *handler)
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (number, 0))
|
|
|
|
return false;
|
|
|
|
if (!type_check (number, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_proc_check (handler, 1))
|
|
|
|
return false;
|
|
|
|
if (handler->ts.type == BT_INTEGER && !scalar_check (handler, 1))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_signal_sub (gfc_expr *number, gfc_expr *handler, gfc_expr *status)
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (number, 0))
|
|
|
|
return false;
|
|
|
|
if (!type_check (number, 0, BT_INTEGER))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!int_or_proc_check (handler, 1))
|
|
|
|
return false;
|
|
|
|
if (handler->ts.type == BT_INTEGER && !scalar_check (handler, 1))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
|
|
|
if (status == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 2, BT_INTEGER))
|
|
|
|
return false;
|
|
|
|
if (!scalar_check (status, 2))
|
|
|
|
return false;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
check.c (gfc_check_alarm_sub, [...]): New functions.
* check.c (gfc_check_alarm_sub, gfc_check_signal,
gfc_check_signal_sub): New functions.
* gfortran.h (gfc_generic_isym_id): Add GFC_ISYM_SIGNAL.
* intrinsic.c (add_functions): Add signal intrinsic.
(add_subroutines): Add signal and alarm intrinsics.
* intrinsic.texi: Document the new intrinsics.
* iresolve.c (gfc_resolve_signal, gfc_resolve_alarm_sub,
gfc_resolve_signal_sub): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add case
for GFC_ISYM_SIGNAL.
* intrinsic.h: Add prototypes for gfc_check_alarm_sub,
gfc_check_signal, gfc_check_signal_sub, gfc_resolve_signal,
gfc_resolve_alarm_sub, gfc_resolve_signal_sub.
* Makefile.am (intrinsics): Add signal.c.
* Makefile.in: Regenerate.
* configure.ac: Checks for signal and alarm.
* config.h.in: Regenerate.
* configure: Regenerate.
* intrinsics/signal.c: New file for SIGNAL and ALARM intrinsics.
From-SVN: r105967
2005-10-28 23:16:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_system_sub (gfc_expr *cmd, gfc_expr *status)
|
2004-10-04 23:30:32 +02:00
|
|
|
{
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (cmd, 0, BT_CHARACTER))
|
|
|
|
return false;
|
|
|
|
if (!kind_value_check (cmd, 0, gfc_default_character_kind))
|
|
|
|
return false;
|
2004-10-04 23:30:32 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (status, 1))
|
|
|
|
return false;
|
2004-10-04 23:30:32 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (status, 1, BT_INTEGER))
|
|
|
|
return false;
|
2004-10-04 23:30:32 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!kind_value_check (status, 1, gfc_default_integer_kind))
|
|
|
|
return false;
|
2004-10-04 23:30:32 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2004-10-04 23:30:32 +02:00
|
|
|
}
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* This is used for the GNU intrinsics AND, OR and XOR. */
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_check_and (gfc_expr *i, gfc_expr *j)
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
{
|
|
|
|
if (i->ts.type != BT_INTEGER && i->ts.type != BT_LOGICAL)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be INTEGER "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or LOGICAL", gfc_current_intrinsic_arg[0]->name,
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_current_intrinsic, &i->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (j->ts.type != BT_INTEGER && j->ts.type != BT_LOGICAL)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be INTEGER "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"or LOGICAL", gfc_current_intrinsic_arg[1]->name,
|
2007-01-07 01:28:29 +01:00
|
|
|
gfc_current_intrinsic, &j->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (i->ts.type != j->ts.type)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs and %qs arguments of %qs intrinsic at %L must "
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
"have the same type", gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
&j->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (i, 0))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (j, 1))
|
|
|
|
return false;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
fget.c: New file.
* intrinsics/fget.c: New file.
* intrinsics/ftell.c: New file.
* io/unix.c (stream_offset): New function.
* io/io.h: Add prototype for stream_offset.
* Makefile.am: Add intrinsics/fget.c and intrinsics/ftell.c.
* Makefile.in: Regenerate.
* intrinsic.c (add_functions): Add COMPLEX, FTELL, FGETC, FGET,
FPUTC, FPUT, AND, XOR and OR intrinsic functions.
(add_subroutines): Add FGETC, FGET, FPUTC, FPUT and FTELL intrinsic
subroutines.
* gfortran.h: Add GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET,
GFC_ISYM_FGETC, GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL,
GFC_ISYM_OR, GFC_ISYM_XOR.
* iresolve.c (gfc_resolve_and, gfc_resolve_complex,
gfc_resolve_or, gfc_resolve_fgetc, gfc_resolve_fget,
gfc_resolve_fputc, gfc_resolve_fput, gfc_resolve_ftell,
gfc_resolve_xor, gfc_resolve_fgetc_sub, gfc_resolve_fget_sub,
gfc_resolve_fputc_sub, gfc_resolve_fput_sub, gfc_resolve_ftell_sub):
New functions.
* check.c (gfc_check_complex, gfc_check_fgetputc_sub,
gfc_check_fgetputc, gfc_check_fgetput_sub, gfc_check_fgetput,
gfc_check_ftell, gfc_check_ftell_sub, gfc_check_and): New functions.
* simplify.c (gfc_simplify_and, gfc_simplify_complex, gfc_simplify_or,
gfc_simplify_xor): New functions.
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add cases for
GFC_ISYM_AND, GFC_ISYM_COMPLEX, GFC_ISYM_FGET, GFC_ISYM_FGETC,
GFC_ISYM_FPUT, GFC_ISYM_FPUTC, GFC_ISYM_FTELL, GFC_ISYM_OR and
GFC_ISYM_XOR.
* intrinsic.h: Add prototypes for all functions added to iresolve.c,
simplify.c and check.c.
* gfortran.dg/complex_intrinsic_1.f90: New test.
* gfortran.dg/complex_intrinsic_2.f90: New test.
* gfortran.dg/fgetc_1.f90: New test.
* gfortran.dg/fgetc_2.f90: New test.
* gfortran.dg/fgetc_3.f90: New test.
* gfortran.dg/ftell_1.f90: New test.
* gfortran.dg/ftell_2.f90: New test.
* gfortran.dg/gnu_logical_1.F: New test.
* gfortran.dg/gnu_logical_2.f90: New test.
From-SVN: r106859
2005-11-13 10:33:19 +01:00
|
|
|
}
|
2010-07-08 23:29:56 +02:00
|
|
|
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
bool
|
2013-03-27 11:45:58 +01:00
|
|
|
gfc_check_storage_size (gfc_expr *a, gfc_expr *kind)
|
2010-07-08 23:29:56 +02:00
|
|
|
{
|
2015-05-18 23:52:03 +02:00
|
|
|
|
|
|
|
if (a->expr_type == EXPR_NULL)
|
|
|
|
{
|
|
|
|
gfc_error ("Intrinsic function NULL at %L cannot be an actual "
|
|
|
|
"argument to STORAGE_SIZE, because it returns a "
|
|
|
|
"disassociated pointer", &a->where);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2013-03-27 11:45:58 +01:00
|
|
|
if (a->ts.type == BT_ASSUMED)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be TYPE(*)",
|
2013-03-27 11:45:58 +01:00
|
|
|
gfc_current_intrinsic_arg[0]->name, gfc_current_intrinsic,
|
|
|
|
&a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2013-03-27 11:45:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (a->ts.type == BT_PROCEDURE)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L shall not be a "
|
2013-03-27 11:45:58 +01:00
|
|
|
"procedure", gfc_current_intrinsic_arg[0]->name,
|
|
|
|
gfc_current_intrinsic, &a->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2013-03-27 11:45:58 +01:00
|
|
|
}
|
|
|
|
|
2010-07-08 23:29:56 +02:00
|
|
|
if (kind == NULL)
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-07-08 23:29:56 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!type_check (kind, 1, BT_INTEGER))
|
|
|
|
return false;
|
2010-07-08 23:29:56 +02:00
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
if (!scalar_check (kind, 1))
|
|
|
|
return false;
|
2010-07-08 23:29:56 +02:00
|
|
|
|
|
|
|
if (kind->expr_type != EXPR_CONSTANT)
|
|
|
|
{
|
2014-12-11 16:13:33 +01:00
|
|
|
gfc_error ("%qs argument of %qs intrinsic at %L must be a constant",
|
re PR fortran/44595 (INTENT of arguments to intrinsic procedures not checked)
2010-08-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/44595
* intrinsic.c (gfc_current_intrinsic_arg): Change type from 'char' to
'gfc_intrinsic_arg'.
(check_arglist,check_specific): Add reference to 'name' field.
(init_arglist): Remove reference to 'name' field.
* intrinsic.h (gfc_current_intrinsic_arg): Modify prototype.
* check.c (variable_check): Reverse order of checks. Respect intent of
formal arg.
(int_or_proc_check): New function.
(coarray_check): New function.
(allocatable_check): New function.
(gfc_check_allocated,gfc_check_move_alloc): Use 'allocatable_check'.
(gfc_check_complex): Use 'int_or_real_check'.
(gfc_check_lcobound,gfc_check_image_index,gfc_check_this_image,
gfc_check_ucobound): Use 'coarray_check'.
(gfc_check_pack): Use 'real_or_complex_check'.
(gfc_check_alarm_sub,gfc_check_signal,gfc_check_signal_sub): Use
'int_or_proc_check'.
(scalar_check,type_check,numeric_check,int_or_real_check,
real_or_complex_check,kind_check,double_check,logical_array_check,
array_check,same_type_check,rank_check,nonoptional_check,
kind_value_check,gfc_check_a_p,gfc_check_associated,gfc_check_cmplx,
gfc_check_cshift,gfc_check_dcmplx,gfc_check_dot_product,gfc_check_dprod,
gfc_check_eoshift,gfc_check_fn_rc2008,gfc_check_index,gfc_check_kind,
gfc_check_matmul,gfc_check_minloc_maxloc,check_reduction,gfc_check_null,
gfc_check_present,gfc_check_reshape,gfc_check_same_type_as,
gfc_check_spread,gfc_check_unpack,gfc_check_random_seed,
gfc_check_getarg,gfc_check_and,gfc_check_storage_size): Add reference
to 'name' field.
2010-08-11 Janus Weil <janus@gcc.gnu.org>
Steve Kargl <kargl@gcc.gnu.org>
PR fortran/44595
* gfortran.dg/move_alloc_3.f90: New.
* gfortran.dg/random_seed_2.f90: New.
Co-Authored-By: Steve Kargl <kargl@gcc.gnu.org>
From-SVN: r163096
2010-08-11 12:49:56 +02:00
|
|
|
gfc_current_intrinsic_arg[1]->name, gfc_current_intrinsic,
|
2010-07-08 23:29:56 +02:00
|
|
|
&kind->where);
|
2013-04-10 23:36:58 +02:00
|
|
|
return false;
|
2010-07-08 23:29:56 +02:00
|
|
|
}
|
|
|
|
|
2013-04-10 23:36:58 +02:00
|
|
|
return true;
|
2010-07-08 23:29:56 +02:00
|
|
|
}
|