Commit 9724eac3 by Steven G. Kargl

re PR fortran/85687 (ICE in gfc_sym_identifier, at fortran/trans-decl.c:351)

2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85687
	* check.c (gfc_check_rank): Check that the argument is a data object.

2018-05-10  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/85687
	* gfortran.dg/pr85687.f90: new test.

From-SVN: r260141
parent aa90c676
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org> 2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85687
* check.c (gfc_check_rank): Check that the argument is a data object.
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521 PR fortran/85521
* array.c (gfc_resolve_character_array_constructor): Substrings * array.c (gfc_resolve_character_array_constructor): Substrings
with upper bound smaller than lower bound are zero length strings. with upper bound smaller than lower bound are zero length strings.
......
...@@ -3886,8 +3886,11 @@ gfc_check_rank (gfc_expr *a) ...@@ -3886,8 +3886,11 @@ gfc_check_rank (gfc_expr *a)
? a->value.function.esym->result->attr.pointer ? a->value.function.esym->result->attr.pointer
: a->symtree->n.sym->result->attr.pointer; : a->symtree->n.sym->result->attr.pointer;
if (a->expr_type == EXPR_OP || a->expr_type == EXPR_NULL if (a->expr_type == EXPR_OP
|| a->expr_type == EXPR_COMPCALL|| a->expr_type == EXPR_PPC || a->expr_type == EXPR_NULL
|| a->expr_type == EXPR_COMPCALL
|| a->expr_type == EXPR_PPC
|| a->ts.type == BT_PROCEDURE
|| !is_variable) || !is_variable)
{ {
gfc_error ("The argument of the RANK intrinsic at %L must be a data " gfc_error ("The argument of the RANK intrinsic at %L must be a data "
......
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org> 2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85687
* gfortran.dg/pr85687.f90: new test.
2018-05-10 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85521 PR fortran/85521
* gfortran.dg/pr85521_1.f90: New test. * gfortran.dg/pr85521_1.f90: New test.
* gfortran.dg/pr85521_2.f90: New test. * gfortran.dg/pr85521_2.f90: New test.
......
! { dg-do compile }
! PR fortran/85687
! Code original contributed by Gerhard Steinmetz gscfq at t-oline dot de
program p
type t
end type
print *, rank(t) ! { dg-error "must be a data object" }
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment