re PR fortran/37411 (ICE (segfault) in trans-array.c)

2008-09-09  Daniel Kraft  <d@domob.eu>

	PR fortran/37411
	* trans-array.c (gfc_conv_array_parameter): Added assertion that the
	symbol has an array spec.

2008-09-09  Daniel Kraft  <d@domob.eu>

	PR fortran/37411
	* gfortran.dg/array_function_4.f90: New test.

From-SVN: r140141
This commit is contained in:
Daniel Kraft 2008-09-09 11:46:51 +02:00 committed by Daniel Kraft
parent 108faf872d
commit 18b0679f09
4 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-09-09 Daniel Kraft <d@domob.eu>
PR fortran/37411
* trans-array.c (gfc_conv_array_parameter): Added assertion that the
symbol has an array spec.
2008-09-08 Daniel Kraft <d@domob.eu>
PR fortran/37199

View File

@ -5155,6 +5155,9 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77,
&& expr->ref->u.ar.type == AR_FULL);
sym = full_array_var ? expr->symtree->n.sym : NULL;
/* The symbol should have an array specification. */
gcc_assert (!sym || sym->as);
if (expr->expr_type == EXPR_ARRAY && expr->ts.type == BT_CHARACTER)
{
get_array_ctor_strlen (&se->pre, expr->value.constructor, &tmp);

View File

@ -1,3 +1,8 @@
2008-09-09 Daniel Kraft <d@domob.eu>
PR fortran/37411
* gfortran.dg/array_function_4.f90: New test.
2008-09-08 Daniel Jacobowitz <dan@codesourcery.com>
Mark Mitchell <mark@codesourcery.com>

View File

@ -0,0 +1,29 @@
! { dg-do compile }
! PR fortran/37411
! This used to cause an ICE because of a missing array spec after interface
! mapping.
! Contributed by Kristjan Jonasson <jonasson@hi.is>
MODULE B1
CONTAINS
subroutine sub()
integer :: x(1)
character(3) :: st
st = fun(x)
end subroutine sub
function fun(x) result(st)
integer, intent(in) :: x(1)
character(lenf(x)) :: st
st = 'abc'
end function fun
pure integer function lenf(x)
integer, intent(in) :: x(1)
lenf = x(1)
end function lenf
END MODULE B1
! { dg-final { cleanup-modules "B1" } }