Commit c970dc04 by Janus Weil

re PR fortran/57285 ([OOP] ICE on invalid: "gfc_array_dimen_size(): Bad…

re PR fortran/57285 ([OOP] ICE on invalid: "gfc_array_dimen_size(): Bad dimension" due to SIZE intrinsic with invalid dim on CLASS dummy)

2013-07-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/57285
	* check.c (dim_rank_check): Re-enable this check for CLASS arrays.

2013-07-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/57285
	* gfortran.dg/class_array_19.f90: New.

From-SVN: r201284
parent 538e2a82
2013-07-27 Janus Weil <janus@gcc.gnu.org>
PR fortran/57285
* check.c (dim_rank_check): Re-enable this check for CLASS arrays.
2013-07-25 Janus Weil <janus@gcc.gnu.org> 2013-07-25 Janus Weil <janus@gcc.gnu.org>
PR fortran/57966 PR fortran/57966
......
...@@ -608,9 +608,6 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed) ...@@ -608,9 +608,6 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
if (dim->expr_type != EXPR_CONSTANT) if (dim->expr_type != EXPR_CONSTANT)
return true; return true;
if (array->ts.type == BT_CLASS)
return true;
if (array->expr_type == EXPR_FUNCTION && array->value.function.isym if (array->expr_type == EXPR_FUNCTION && array->value.function.isym
&& array->value.function.isym->id == GFC_ISYM_SPREAD) && array->value.function.isym->id == GFC_ISYM_SPREAD)
rank = array->rank + 1; rank = array->rank + 1;
......
2013-07-27 Janus Weil <janus@gcc.gnu.org>
PR fortran/57285
* gfortran.dg/class_array_19.f90: New.
2013-07-27 Eric Botcazou <ebotcazou@adacore.com> 2013-07-27 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/vect/pr57705.c: Adjust for a !vect_pack_trunc target. * gcc.dg/vect/pr57705.c: Adjust for a !vect_pack_trunc target.
......
! { dg-do compile }
!
! PR 57285: [OOP] ICE on invalid: "gfc_array_dimen_size(): Bad dimension" due to SIZE intrinsic with invalid dim on CLASS dummy
!
! Contributed by Lorenz Hüdepohl <bugs@stellardeath.org>
type type_t
end type
contains
subroutine foo(a)
class(type_t), intent(in) :: a(:)
type(type_t) :: c(size(a,dim=2)) ! { dg-error "is not a valid dimension index" }
end subroutine
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