diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-12-19 16:30:23 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-12-19 16:30:23 +0100 |
commit | cd99c23ca41f9fb6792e39f0e91a950cf1e531aa (patch) | |
tree | 2d37421d992c8c2c8df7d5e8606294c36915d130 /gcc/fortran/match.c | |
parent | 6a9ceb1703fcf307cdeb4abab80e535d98857122 (diff) | |
download | gcc-cd99c23ca41f9fb6792e39f0e91a950cf1e531aa.zip gcc-cd99c23ca41f9fb6792e39f0e91a950cf1e531aa.tar.gz gcc-cd99c23ca41f9fb6792e39f0e91a950cf1e531aa.tar.bz2 |
re PR fortran/51605 (internal compiler error gfc_trans_block_construct, at fortran/trans-stmt.c:984)
2011-12-19 Tobias Burnus <burnus@net-b.de>
PR fortran/51605
* match.c (gfc_match_select_type): Handle
scalar polymophic coarrays.
(select_type_set_tmp, ): Ditto; avoid segfault if !class_ok.
* primary.c (gfc_match_rvalue): Avoid segfault if !class_ok.
* resolve.c (resolve_select_type): Ditto.
(resolve_assoc_var): Fix setting the TARGET attribute for
polymorphic selectors which are pointers.
2011-12-19 Tobias Burnus <burnus@net-b.de>
PR fortran/51605
* gfortran.dg/select_type_25.f90: New.
From-SVN: r182484
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 0e12730..fd91921 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -5154,19 +5154,27 @@ select_type_set_tmp (gfc_typespec *ts) /* Copy across the array spec to the selector, taking care as to whether or not it is a class object or not. */ - if (select_type_stack->selector->ts.type == BT_CLASS && - CLASS_DATA (select_type_stack->selector)->attr.dimension) + if (select_type_stack->selector->ts.type == BT_CLASS + && select_type_stack->selector->attr.class_ok + && (CLASS_DATA (select_type_stack->selector)->attr.dimension + || CLASS_DATA (select_type_stack->selector)->attr.codimension)) { if (ts->type == BT_CLASS) { - CLASS_DATA (tmp->n.sym)->attr.dimension = 1; + CLASS_DATA (tmp->n.sym)->attr.dimension + = CLASS_DATA (select_type_stack->selector)->attr.dimension; + CLASS_DATA (tmp->n.sym)->attr.codimension + = CLASS_DATA (select_type_stack->selector)->attr.codimension; CLASS_DATA (tmp->n.sym)->as = gfc_get_array_spec (); CLASS_DATA (tmp->n.sym)->as = CLASS_DATA (select_type_stack->selector)->as; } else { - tmp->n.sym->attr.dimension = 1; + tmp->n.sym->attr.dimension + = CLASS_DATA (select_type_stack->selector)->attr.dimension; + tmp->n.sym->attr.codimension + = CLASS_DATA (select_type_stack->selector)->attr.codimension; tmp->n.sym->as = gfc_get_array_spec (); tmp->n.sym->as = CLASS_DATA (select_type_stack->selector)->as; } @@ -5248,7 +5256,8 @@ gfc_match_select_type (void) && expr1->ts.type != BT_UNKNOWN && CLASS_DATA (expr1) && (strcmp (CLASS_DATA (expr1)->name, "_data") == 0) - && CLASS_DATA (expr1)->attr.dimension + && (CLASS_DATA (expr1)->attr.dimension + || CLASS_DATA (expr1)->attr.codimension) && expr1->ref && expr1->ref->type == REF_ARRAY && expr1->ref->next == NULL; |