aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-array.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2011-04-12 19:14:49 +0000
committerPaul Thomas <pault@gcc.gnu.org>2011-04-12 19:14:49 +0000
commit99ee02511431124acbfded6350ce5f857664560d (patch)
treee65aeb8351493c87a966a5a0d5d79d45115bb6e0 /gcc/fortran/trans-array.c
parenteb345401a1a2f6408fddd8538466be1143a95177 (diff)
downloadgcc-99ee02511431124acbfded6350ce5f857664560d.zip
gcc-99ee02511431124acbfded6350ce5f857664560d.tar.gz
gcc-99ee02511431124acbfded6350ce5f857664560d.tar.bz2
re PR fortran/48360 (ICE on array assignment statement with allocatable LHS)
2011-04-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/48360 PR fortran/48456 * trans-array.c (get_std_lbound): For derived type variables return array valued component lbound. 2011-04-12 Paul Thomas <pault@gcc.gnu.org> PR fortran/48360 PR fortran/48456 * gfortran.dg/realloc_on_assign_6.f03: New test. From-SVN: r172339
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r--gcc/fortran/trans-array.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index f8e26b0..7c34b98 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -6810,6 +6810,8 @@ get_std_lbound (gfc_expr *expr, tree desc, int dim, bool assumed_size)
tree stride;
tree cond, cond1, cond3, cond4;
tree tmp;
+ gfc_ref *ref;
+
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc)))
{
tmp = gfc_rank_cst[dim];
@@ -6843,6 +6845,14 @@ get_std_lbound (gfc_expr *expr, tree desc, int dim, bool assumed_size)
else if (expr->expr_type == EXPR_VARIABLE)
{
tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl);
+ for (ref = expr->ref; ref; ref = ref->next)
+ {
+ if (ref->type == REF_COMPONENT
+ && ref->u.c.component->as
+ && ref->next
+ && ref->next->u.ar.type == AR_FULL)
+ tmp = TREE_TYPE (ref->u.c.component->backend_decl);
+ }
return GFC_TYPE_ARRAY_LBOUND(tmp, dim);
}
else if (expr->expr_type == EXPR_FUNCTION)