Commit f8df0eb8 by Daniel Franke Committed by Daniel Franke

check.c (dim_rank_check): Fixed checking of dimension argument if array is of type EXPR_ARRAY.

gcc/fortran:
2008-12-31  Daniel Franke  <franke.daniel@gmail.com>

        * check.c (dim_rank_check): Fixed checking of dimension argument
        if array is of type EXPR_ARRAY.

gcc/testsuite:
2008-12-31  Daniel Franke  <franke.daniel@gmail.com>

	* gfortran.dg/mapping_2.f90: Fixed testcase.

From-SVN: r142981
parent 261b8381
2008-12-31 Daniel Franke <franke.daniel@gmail.com>
* check.c (dim_rank_check): Fixed checking of dimension argument
if array is of type EXPR_ARRAY.
2008-12-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38602
......
......@@ -339,16 +339,21 @@ dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
gfc_array_ref *ar;
int rank;
if (dim->expr_type != EXPR_CONSTANT || array->expr_type != EXPR_VARIABLE)
if (dim->expr_type != EXPR_CONSTANT
|| (array->expr_type != EXPR_VARIABLE
&& array->expr_type != EXPR_ARRAY))
return SUCCESS;
ar = gfc_find_array_ref (array);
rank = array->rank;
if (ar->as->type == AS_ASSUMED_SIZE
&& !allow_assumed
&& ar->type != AR_ELEMENT
&& ar->type != AR_SECTION)
rank--;
if (array->expr_type == EXPR_VARIABLE)
{
ar = gfc_find_array_ref (array);
if (ar->as->type == AS_ASSUMED_SIZE
&& !allow_assumed
&& ar->type != AR_ELEMENT
&& ar->type != AR_SECTION)
rank--;
}
if (mpz_cmp_ui (dim->value.integer, 1) < 0
|| mpz_cmp_ui (dim->value.integer, rank) > 0)
......
2008-12-31 Daniel Franke <franke.daniel@gmail.com>
* gfortran.dg/mapping_2.f90: Fixed testcase.
2008-12-31 Jakub Jelinek <jakub@redhat.com>
PR c++/38647
......
......@@ -11,7 +11,7 @@ module test
function my_string(x)
integer i
real, intent(in) :: x(:)
character(0) h4(1:minval([(i,i=30,32)],15))
character(0) h4(1:minval([(i,i=30,32), 15]))
character(0) sv1(size(x,1):size(h4))
character(0) sv2(2*lbound(sv1,1):size(h4))
character(lbound(sv2,1)-3) my_string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment