From: kargl Date: Fri, 30 Oct 2015 16:46:20 +0000 (+0000) Subject: 2015-10-30 Steven G. Kargl X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e06323c9522c3c8b72479913b49fb6ca310c3e72;p=thirdparty%2Fgcc.git 2015-10-30 Steven G. Kargl PR fortran/36192 * interface.c (get_expr_storage_size): Check for INTEGER type before calling gmp routines. 2015-10-30 Steven G. Kargl PR fortran/36192 * gfortran.dg/pr36192_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229590 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 74cae2f0d825..f197ca9f0222 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,8 +1,15 @@ +2015-10-30 Steven G. Kargl + + PR fortran/36192 + * interface.c (get_expr_storage_size): Check for INTEGER type before + calling gmp routines. + 2015-10-30 Steven G. Kargl PR fortran/68154 * decl.c (add_init_expr_to_sym): if the char length in the typespec is NULL, check for and use a constructor. + 2015-10-30 Steven G. Kargl PR fortran/68054 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 2ea26304a24a..dcf3eae81e7b 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2455,7 +2455,9 @@ get_expr_storage_size (gfc_expr *e) { if (ref->u.ar.as->lower[i] && ref->u.ar.as->upper[i] && ref->u.ar.as->lower[i]->expr_type == EXPR_CONSTANT - && ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT) + && ref->u.ar.as->lower[i]->ts.type == BT_INTEGER + && ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT + && ref->u.ar.as->upper[i]->ts.type == BT_INTEGER) elements *= mpz_get_si (ref->u.ar.as->upper[i]->value.integer) - mpz_get_si (ref->u.ar.as->lower[i]->value.integer) + 1L; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5407db7f1be1..caa46c45f97c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-10-30 Steven G. Kargl + + PR fortran/36192 + * gfortran.dg/pr36192_1.f90: New test. + 2015-10-30 Steven G. Kargl PR fortran/68154 diff --git a/gcc/testsuite/gfortran.dg/pr36192_1.f90 b/gcc/testsuite/gfortran.dg/pr36192_1.f90 new file mode 100644 index 000000000000..77df31765ac8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr36192_1.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! PR fortran/36192 +program three_body + real, parameter :: n = 2, d = 2 + real, dimension(n,d) :: x_hq ! { dg-error "of INTEGER type|of INTEGER type" } + call step(x_hq) + contains + subroutine step(x) + real, dimension(:,:), intent(in) :: x + end subroutine step +end program three_body +! { dg-prune-output "must have constant shape" }