re PR fortran/50420 ([Coarray] lcobound doesn't accept coarray subcomponents)

PR fortran/50420
	* check.c (dim_corank_check): Use gfc_get_corank to get corank.

From-SVN: r180148
This commit is contained in:
Mikael Morin 2011-10-18 15:05:30 +00:00
parent 6cab5e07b0
commit 66b23e9399
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2011-10-18 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/50420
* check.c (dim_corank_check): Use gfc_get_corank to get corank.
2011-10-18 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/50420

View File

@ -511,7 +511,6 @@ dim_check (gfc_expr *dim, int n, bool optional)
static gfc_try
dim_corank_check (gfc_expr *dim, gfc_expr *array)
{
gfc_array_ref *ar;
int corank;
gcc_assert (array->expr_type == EXPR_VARIABLE);
@ -519,8 +518,7 @@ dim_corank_check (gfc_expr *dim, gfc_expr *array)
if (dim->expr_type != EXPR_CONSTANT)
return SUCCESS;
ar = gfc_find_array_ref (array);
corank = ar->as->corank;
corank = gfc_get_corank (array);
if (mpz_cmp_ui (dim->value.integer, 1) < 0
|| mpz_cmp_ui (dim->value.integer, corank) > 0)