[patch, fortran] PR36515 Integer read value overflow for a invalid integer.

Jerry DeLisle jvdelisle@verizon.net
Sat Jun 14 05:55:00 GMT 2008


Hi folks,

To provide legacy compatibility with g77, this patch enables -fno-range-check at 
runtime. This is done by adding the range-check flag to the compile options 
array generated in trans-decl.c.  The flag is then used in read.c to ignore the 
overflow.

Regression tested on x86-64 and new test case provided.

OK for Trunk.  Thanks Steve Kargl for pointing out the place in read.c

Jerry

2008-06-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36515
	* trans-decl.c (gfc_generate_function_code): Add range_check to options
	array.

2008-06-14  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/36515
	* libgfortran.h (compile_options_t): Add int range_check to structure.
	* runtime/compile_options.c (set_options): Add range_check option.
	(init_compile_options): Likewise.
	*io/read.c (read_decimal): Change overflow checks to include
	range_check.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr36515.diff
Type: text/x-patch
Size: 2812 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080614/8ebcf6d9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_range_check_2.f90
Type: text/x-fortran
Size: 361 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080614/8ebcf6d9/attachment-0001.bin>


More information about the Fortran mailing list