[patch, fortran] Fix PR 30814, bounds checking for pack

Thomas Koenig tkoenig@alice-dsl.net
Thu Jul 19 22:01:00 GMT 2007


Hello world,

the attached patch introduces bounds checking for pack.

As this operation is potentially expensive, it is only done
if -fbounds-check is passed in compilation to the main
program.  The changes for this are also included in the
patch.

As a future project, we could also make other intrinsics
aware of bounds-checking.

The test case passes; otherwise, the patch is currently
regression-testing on i686-pc-linux-gnu.

OK for trunk if it passes?
	Thomas

2007-07-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/30814
	* trans-decl.c (generate_function_code):  Add argument
	for flag_bounds_check to the array for set_options.

2007-07-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/30814
	* libgfortran.h:  Add bounds_check to compile_options_t.
	* runtime/compile_options.c (set_options):  Add handling
	of compile_options.bounds_check.
	* intrinsics/pack_generic.c (pack_internal):  Also determine
	the number of elements if compile_options.bounds_check is
	true.  Raise runtime error if a different array shape is
	detected.

2007-07-20  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/30814
	* gfortran.dg/pack_bounds_1.f90:  New test case.
	
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pack-range.diff
Type: text/x-patch
Size: 3853 bytes
Desc: 
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070719/4babca40/attachment.bin>


More information about the Fortran mailing list