Commit 37639728 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/32669 ("Actual argument contains too few elements for dummy…

re PR fortran/32669 ("Actual argument contains too few elements for dummy argument" is triggered for valid code)

2007-07-08  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32669
	* interface.c (get_expr_storage_size): Properly obtain lower bound.
	(compare_actual_formal): Add space before parenthesis.

2007-07-08  Tobias Burnus  <burnus@net-b.de>

	PR fortran/32669
	* gfortran.dg/argument_checking_6.f90: New.

From-SVN: r126467
parent 83b2e4e8
2007-07-08 Tobias Burnus <burnus@net-b.de>
PR fortran/32669
* interface.c (get_expr_storage_size): Properly obtain lower bound.
(compare_actual_formal): Add space before parenthesis.
2007-07-08 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25094
......
......@@ -1374,7 +1374,7 @@ get_expr_storage_size (gfc_expr *e)
{
long int start, end, stride;
stride = 1;
start = 1;
if (ref->u.ar.stride[i])
{
if (ref->u.ar.stride[i]->expr_type == EXPR_CONSTANT)
......@@ -1390,6 +1390,11 @@ get_expr_storage_size (gfc_expr *e)
else
return 0;
}
else if (ref->u.ar.as->lower[i]
&& ref->u.ar.as->lower[i]->expr_type == EXPR_CONSTANT)
start = mpz_get_si (ref->u.ar.as->lower[i]->value.integer);
else
return 0;
if (ref->u.ar.end[i])
{
......@@ -1595,8 +1600,8 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
}
}
actual_size = get_expr_storage_size(a->expr);
formal_size = get_sym_storage_size(f->sym);
actual_size = get_expr_storage_size (a->expr);
formal_size = get_sym_storage_size (f->sym);
if (actual_size != 0 && actual_size < formal_size)
{
if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where)
......
2007-07-08 Tobias Burnus <burnus@net-b.de>
PR fortran/32669
* gfortran.dg/argument_checking_6.f90: New.
2007-07-08 Daniel Franke <franke.daniel@gmail.com>
PR fortran/25094
! { dg-do compile }
! PR fortran/32669
!
! Contributed by Janus Weil <jaydub66@gmail.com>
!
program tfe
implicit none
real,dimension(-1:1) :: w
real,dimension(1:4) :: x
real,dimension(0:3) :: y
real,dimension(-1:2) :: z
call sub(x(:))
call sub(y(:))
call sub(z(:))
call sub(w(:)) ! { dg-error "too few elements" }
contains
subroutine sub(a)
implicit none
real,dimension(1:4) :: a
end subroutine sub
end program tfe
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