re PR fortran/19777 (-fbounds-check catches non-existent bounds violation)

PR fortran/19777

	* trans-array.c (gfc_conv_array_ref): Don't perform out-of-bounds
	checking for assumed-size arrrays.

	* gfortran.dg/bounds_check_2.f: New test.

From-SVN: r114153
This commit is contained in:
Francois-Xavier Coudert 2006-05-27 11:41:42 +02:00 committed by François-Xavier Coudert
parent 59c0928b6a
commit 7936f3e337
4 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-05-27 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/19777
* trans-array.c (gfc_conv_array_ref): Don't perform out-of-bounds
checking for assumed-size arrrays.
2006-05-27 Paul Thomas <pault@gcc.gnu.org>
* trans-intrinsic.c (gfc_conv_associated): If pointer in first

View File

@ -1948,7 +1948,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar)
gfc_conv_expr_type (&indexse, ar->start[n], gfc_array_index_type);
gfc_add_block_to_block (&se->pre, &indexse.pre);
if (flag_bounds_check)
if (flag_bounds_check && ar->as->type != AS_ASSUMED_SIZE)
{
/* Check array bounds. */
tree cond;

View File

@ -1,3 +1,8 @@
2006-05-27 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/19777
* gfortran.dg/bounds_check_2.f: New test.
2006-05-27 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.dg/hollerith_f95.f90: Add -fall-intrinsics.

View File

@ -0,0 +1,23 @@
! { dg-do run }
! { dg-options "-fbounds-check" }
! PR fortran/19777
implicit none
integer npts
parameter (npts=10)
double precision v(npts)
external init1
call init1 (npts, v)
end
subroutine init1 (npts, v)
implicit none
integer npts
double precision v(*)
integer i
do 10 i = 1, npts
v(i) = 0
10 continue
end