mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-22 00:01:10 +08:00
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:
parent
59c0928b6a
commit
7936f3e337
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
23
gcc/testsuite/gfortran.dg/bounds_check_2.f
Normal file
23
gcc/testsuite/gfortran.dg/bounds_check_2.f
Normal 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
|
Loading…
x
Reference in New Issue
Block a user