aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-12-15 15:53:55 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2011-12-15 15:53:55 +0100
commit492792ed9b7a3b6ce5f595b2dc848eb2dae8116f (patch)
tree64b1cf86d7267525f4882d22ee8dde0a6c359b88 /gcc/fortran/primary.c
parent9d69847d6ea68145f1b065d5d4a1cafadebf0d37 (diff)
downloadgcc-492792ed9b7a3b6ce5f595b2dc848eb2dae8116f.zip
gcc-492792ed9b7a3b6ce5f595b2dc848eb2dae8116f.tar.gz
gcc-492792ed9b7a3b6ce5f595b2dc848eb2dae8116f.tar.bz2
primary.c (gfc_match_varspec): Match array spec for polymorphic coarrays.
2011-12-15 Tobias Burnus <burnus@net-b.de> * primary.c (gfc_match_varspec): Match array spec for polymorphic coarrays. (gfc_match_rvalue): If a symbol of unknown flavor has a codimension, mark it as a variable. * simplify.c (gfc_simplify_image_index): Directly call simplify_cobound. * trans-intrinsic.c (trans_this_image): Fix handling of corank = 1 arrays. 2011-12-15 Tobias Burnus <burnus@net-b.de> * gfortran.dg/coarray/poly_run_3.f90: New. * gfortran.dg/coarray/poly_run_2.f90: Enable comment-out test. From-SVN: r182371
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 75c7e137..afc4684 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1821,7 +1821,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
&& !(gfc_matching_procptr_assignment
&& sym->attr.flavor == FL_PROCEDURE))
|| (sym->ts.type == BT_CLASS && sym->attr.class_ok
- && CLASS_DATA (sym)->attr.dimension))
+ && (CLASS_DATA (sym)->attr.dimension
+ || CLASS_DATA (sym)->attr.codimension)))
{
/* In EQUIVALENCE, we don't know yet whether we are seeing
an array, character variable or array of character
@@ -2894,10 +2895,10 @@ gfc_match_rvalue (gfc_expr **result)
&& gfc_get_default_type (sym->name, sym->ns)->type == BT_DERIVED)
gfc_set_default_type (sym, 0, sym->ns);
- /* If the symbol has a dimension attribute, the expression is a
+ /* If the symbol has a (co)dimension attribute, the expression is a
variable. */
- if (sym->attr.dimension)
+ if (sym->attr.dimension || sym->attr.codimension)
{
if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
sym->name, NULL) == FAILURE)
@@ -2913,7 +2914,9 @@ gfc_match_rvalue (gfc_expr **result)
break;
}
- if (sym->ts.type == BT_CLASS && CLASS_DATA (sym)->attr.dimension)
+ if (sym->ts.type == BT_CLASS
+ && (CLASS_DATA (sym)->attr.dimension
+ || CLASS_DATA (sym)->attr.codimension))
{
if (gfc_add_flavor (&sym->attr, FL_VARIABLE,
sym->name, NULL) == FAILURE)