[patch,fortran] Fix PR19310 unnecessary error for overflowing results

Jerry DeLisle jvdelisle@verizon.net
Fri Jun 9 05:48:00 GMT 2006


:ADDPATCH fortran:

The attached patch puts in place a -fno-range-check feature for gfortran so that 
if desired, compile time range checking can be disabled and allow things like this:

   a = exp(1000)

I also expanded the error message for range_check to include underflow, 
overflow, and other 'range' errors.

This patch puts in place the infrastructure needed to take care of PR19904 which 
  is an error for things like this:

   double precision, parameter :: zero=0, nan=0/zero

I will be following with another patch for PR19904.  (I may have run into some 
mpfr bugs.  I am getting an assert error in the mpfr library when dividing by 
zero.  I am exploring mpfr for the first time so it may just be a learning 
curve. ;)  )

Bootstrapped and regression tested.

Is this patch OK for Trunk?

I will generate a test case and test before I commit.

Regards,

Jerry

2006-06-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/19310
	* gfortran.h (gfc_option_t): Add new flag.
	* invoke.texi: Document new flag.
	* lang.opt: Add option -fno-range-check.
	* options.c (gfc_init_options): Initialize new flag.
	(gfc_handle_options): Set flag if invoked.
	* simplify.c (range_check): Return result if -fno-range-check.
	Add error messages for overflow, underflow, and other errors.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr19310.diff
Type: text/x-patch
Size: 4855 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060609/ae8d7943/attachment.bin>


More information about the Gcc-patches mailing list