Commit bef6486a by Mikael Morin

re PR fortran/45745 (ICE in gfc_conv_array_stride)

2010-09-23  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/45745
	PR fortran/45648
	* trans-array.c (gfc_conv_expr_descriptor): Handle 
	ss->type == GFC_SS_INTRINSIC (for {l,u}bound intrinsics) case. 

2010-09-23  Mikael Morin  <mikael@gcc.gnu.org>

	PR fortran/45745
	PR fortran/45648
	* gfortran.dg/vector_subscript_bound_1.f90: New.

From-SVN: r164558
parent dca26746
2010-09-23 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45745
PR fortran/45648
* trans-array.c (gfc_conv_expr_descriptor): Handle
ss->type == GFC_SS_INTRINSIC (for {l,u}bound intrinsics) case.
2010-09-23 Tobias Burnus <burnus@net-b.de> 2010-09-23 Tobias Burnus <burnus@net-b.de>
* intrinsic.texi (OpenMP modules): Add named constants of * intrinsic.texi (OpenMP modules): Add named constants of
......
...@@ -5290,13 +5290,17 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) ...@@ -5290,13 +5290,17 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
return; return;
} }
if (ss->expr != expr) if (ss->expr != expr || ss->type != GFC_SS_FUNCTION)
{ {
/* Elemental function. */ if (ss->expr != expr)
gcc_assert ((expr->value.function.esym != NULL /* Elemental function. */
&& expr->value.function.esym->attr.elemental) gcc_assert ((expr->value.function.esym != NULL
|| (expr->value.function.isym != NULL && expr->value.function.esym->attr.elemental)
&& expr->value.function.isym->elemental)); || (expr->value.function.isym != NULL
&& expr->value.function.isym->elemental));
else
gcc_assert (ss->type == GFC_SS_INTRINSIC);
need_tmp = 1; need_tmp = 1;
if (expr->ts.type == BT_CHARACTER if (expr->ts.type == BT_CHARACTER
&& expr->ts.u.cl->length->expr_type != EXPR_CONSTANT) && expr->ts.u.cl->length->expr_type != EXPR_CONSTANT)
......
2010-09-23 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/45745
PR fortran/45648
* gfortran.dg/vector_subscript_bound_1.f90: New.
2010-09-23 Richard Guenther <rguenther@suse.de> 2010-09-23 Richard Guenther <rguenther@suse.de>
PR middle-end/45750 PR middle-end/45750
......
! { dg-do compile }
!
! PR fortran/45745
! ICE with {L,U}BOUND intrinsic function as vector subscript on derived
! type component.
!
! Original test by Joost Van de Vondele <Joost.VandeVondele@pci.uzh.ch>
MODULE pw_types
TYPE pw_type
REAL, DIMENSION ( : ), POINTER :: cr
END TYPE pw_type
CONTAINS
SUBROUTINE pw_write(pw)
TYPE(pw_type), INTENT(in) :: pw
PRINT *, pw%cr(LBOUND(pw%cr))
PRINT *, pw%cr(UBOUND(pw%cr))
END SUBROUTINE pw_write
END MODULE
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