From 61b6bed7e7e5821e58a0565ce68d001063b83197 Mon Sep 17 00:00:00 2001 From: Mikael Morin Date: Fri, 28 Mar 2014 20:04:01 +0000 Subject: [PATCH] re PR fortran/60576 (FAIL: gfortran.dg/assumed_rank_7.f90) 2014-03-28 Mikael Morin Tobias Burnus PR fortran/60576 * trans-expr.c (gfc_conv_derived_to_class): Avoid generation of out-of-bounds range expr. Co-Authored-By: Tobias Burnus From-SVN: r208918 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans-expr.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 1bd4e475b35..ed9593a142a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2014-03-28 Mikael Morin + Tobias Burnus + + PR fortran/ + * trans-expr.c (gfc_conv_derived_to_class): Avoid + generation of out-of-bounds range expr. + 2014-03-28 Mikael Morin PR fortran/60677 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 9a6b40c5c58..30931a364c4 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -426,7 +426,11 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e, gfc_conv_expr_descriptor (parmse, e); if (e->rank != class_ts.u.derived->components->as->rank) - class_array_data_assign (&block, ctree, parmse->expr, true); + { + gcc_assert (class_ts.u.derived->components->as->type + == AS_ASSUMED_RANK); + class_array_data_assign (&block, ctree, parmse->expr, false); + } else { if (gfc_expr_attr (e).codimension)