[Patch, Fortran] Print floating-point exception status after STOP/ERROR STOP

Tobias Burnus burnus@net-b.de
Sun Jun 16 17:33:00 GMT 2013


* PING *

Minor change: Jakub suggested to print no exception status with older 
gfortran programs. Hence, the library now defaults to 0. (Older programs 
do not pass this argument to the library.) - I also updated 
gfortran.texi for that change.

Tobias


On June 12, 2013 17:50, Tobias Burnus wrote:
> Updated version:
> * Uros suggestions are incorporated
> * Changed from -f(no-)underflow-warning to 
> -ffpe-summary=[none,all,underflow,...]
>
> Tobias Burnus wrote:
>> The attached patch causes gfortran-compiled programs to print 
>> warnings like
> Note: The following floating-point exception are signalling: 
> IEEE_DIVIDE_BY_ZERO
>> when STOP / ERROR STOP is invoked. That's required by Fortran 2008 
>> (8.4 STOP and ERROR STOP statements):
>>
>> "If any exception (14) is signaling on that image, the processor 
>> shall issue a warning indicating which exceptions are signaling; this 
>> warning shall be on the unit identified by the named constant ERROR 
>> UNIT (13.8.2.8)."
>
>> One surely could extend it to allow to completely disable the warning 
>> - or to make it more fine grained like "none", "all" plus all single 
>> flags (including underflow, denormal and inexact, where by default 
>> one leaves out inexact).
>
> Thinking about it, I think that's the better solution: It makes 
> (optionally) inexact available and also allows to fully disable the 
> feature. I am sure that there are users who would like to have that 
> choice. Hence, I update the argument handling and libgfortran's stop.c.
>
> Additions from the J3 list:
> * IBM's "XLF compiler has an option to report fp exceptions including 
> underflow and inexact.  It is default OFF."
> (which matches ifort)
>
>> Build and regtested on x86-64-gnu-linux.
>> OK for the trunk?
>
> Tobias
>
> PS: I filled PR 57598 to track the warning handling for coarrays.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: except-stat-v3.diff
Type: text/x-patch
Size: 21442 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130616/8aea2681/attachment.bin>


More information about the Fortran mailing list