+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>
* intrinsic.texi (OpenMP modules): Add named constants of
return;
}
- if (ss->expr != expr)
+ if (ss->expr != expr || ss->type != GFC_SS_FUNCTION)
{
- /* Elemental function. */
- gcc_assert ((expr->value.function.esym != NULL
- && expr->value.function.esym->attr.elemental)
- || (expr->value.function.isym != NULL
- && expr->value.function.isym->elemental));
+ if (ss->expr != expr)
+ /* Elemental function. */
+ gcc_assert ((expr->value.function.esym != NULL
+ && expr->value.function.esym->attr.elemental)
+ || (expr->value.function.isym != NULL
+ && expr->value.function.isym->elemental));
+ else
+ gcc_assert (ss->type == GFC_SS_INTRINSIC);
+
need_tmp = 1;
if (expr->ts.type == BT_CHARACTER
&& 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>
PR middle-end/45750
--- /dev/null
+! { 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