public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
@ 2015-06-09 23:35 ` nicolasbock at gmail dot com
  2015-06-10  0:18 ` nicolasbock at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nicolasbock at gmail dot com @ 2015-06-09 23:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

--- Comment #1 from Nicolas Bock <nicolasbock at gmail dot com> ---
gcc-4.7.4 fails just the same.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact
@ 2015-06-09 23:35 nicolasbock at gmail dot com
  2015-06-09 23:35 ` [Bug fortran/66480] " nicolasbock at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nicolasbock at gmail dot com @ 2015-06-09 23:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

            Bug ID: 66480
           Summary: FPE calling cpu_time() with -ffpe-trap=inexact
           Product: gcc
           Version: 4.8.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nicolasbock at gmail dot com
  Target Milestone: ---

Created attachment 35733
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35733&action=edit
The test program

The attached code, compiled with

$ gfortran -ffpe-trap=inexact test.F90 

results in a SIGFPE:

$ ./a.out 

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic
operation.

Backtrace for this error:
#0  0x7FA644B29757
#1  0x7FA644B29D5E
#2  0x7FA644059EEF
#3  0x7FA644BF8D82
#4  0x4008A8 in MAIN__ at test.F90:?
Floating point exception


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
  2015-06-09 23:35 ` [Bug fortran/66480] " nicolasbock at gmail dot com
@ 2015-06-10  0:18 ` nicolasbock at gmail dot com
  2015-06-10  4:43 ` jvdelisle at charter dot net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nicolasbock at gmail dot com @ 2015-06-10  0:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

--- Comment #2 from Nicolas Bock <nicolasbock at gmail dot com> ---
gcc-4.9.2 fails as well.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
  2015-06-09 23:35 ` [Bug fortran/66480] " nicolasbock at gmail dot com
  2015-06-10  0:18 ` nicolasbock at gmail dot com
@ 2015-06-10  4:43 ` jvdelisle at charter dot net
  2015-06-10  4:48 ` kargl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at charter dot net @ 2015-06-10  4:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

jvdelisle at charter dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at charter dot net

--- Comment #3 from jvdelisle at charter dot net ---
It occurs here:

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff7bb291a in _gfortrani_cpu_time_4 (time=0x7fffffffde7c)
    at ../../../trunk/libgfortran/intrinsics/cpu_time.c:53
53        *time = sec + usec * GFC_REAL_4_LITERAL(1.e-6);


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
                   ` (2 preceding siblings ...)
  2015-06-10  4:43 ` jvdelisle at charter dot net
@ 2015-06-10  4:48 ` kargl at gcc dot gnu.org
  2015-06-10 17:21 ` nicolasbock at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kargl at gcc dot gnu.org @ 2015-06-10  4:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |kargl at gcc dot gnu.org
         Resolution|---                         |WONTFIX

--- Comment #4 from kargl at gcc dot gnu.org ---
It is almost impossible to do any floating point
computation where an FE_INEXACT exception will 
not be raised.  The workaround is don't use
the option that you used.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
                   ` (3 preceding siblings ...)
  2015-06-10  4:48 ` kargl at gcc dot gnu.org
@ 2015-06-10 17:21 ` nicolasbock at gmail dot com
  2015-06-10 17:29 ` sgk at troutmask dot apl.washington.edu
  2015-06-10 18:24 ` nicolasbock at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: nicolasbock at gmail dot com @ 2015-06-10 17:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

--- Comment #5 from Nicolas Bock <nicolasbock at gmail dot com> ---
Thanks for the comments. I should have understood this exception better before
posting this as a bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
                   ` (4 preceding siblings ...)
  2015-06-10 17:21 ` nicolasbock at gmail dot com
@ 2015-06-10 17:29 ` sgk at troutmask dot apl.washington.edu
  2015-06-10 18:24 ` nicolasbock at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2015-06-10 17:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

--- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Wed, Jun 10, 2015 at 05:20:58PM +0000, nicolasbock at gmail dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480
> 
> --- Comment #5 from Nicolas Bock <nicolasbock at gmail dot com> ---
> Thanks for the comments. I should have understood this exception
> better before posting this as a bug.
> 

We would rather see a bug report and then simply close it
than to get no bug reports at all.  It is unlikely that
one can avoid an inexact FPE in code involving floating
point unless the algorithm is specifically designed to
avoid it.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/66480] FPE calling cpu_time() with -ffpe-trap=inexact
  2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
                   ` (5 preceding siblings ...)
  2015-06-10 17:29 ` sgk at troutmask dot apl.washington.edu
@ 2015-06-10 18:24 ` nicolasbock at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: nicolasbock at gmail dot com @ 2015-06-10 18:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480

--- Comment #7 from Nicolas Bock <nicolasbock at gmail dot com> ---
(In reply to Steve Kargl from comment #6)
> On Wed, Jun 10, 2015 at 05:20:58PM +0000, nicolasbock at gmail dot com wrote:
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66480
> > 
> > --- Comment #5 from Nicolas Bock <nicolasbock at gmail dot com> ---
> > Thanks for the comments. I should have understood this exception
> > better before posting this as a bug.
> > 
> 
> We would rather see a bug report and then simply close it
> than to get no bug reports at all.  It is unlikely that
> one can avoid an inexact FPE in code involving floating
> point unless the algorithm is specifically designed to
> avoid it.

Thanks :) I agree with you, from it's definition, the inexact result exception
is going to be raised for most operations. Why would one want to trap it?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-10 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-09 23:35 [Bug fortran/66480] New: FPE calling cpu_time() with -ffpe-trap=inexact nicolasbock at gmail dot com
2015-06-09 23:35 ` [Bug fortran/66480] " nicolasbock at gmail dot com
2015-06-10  0:18 ` nicolasbock at gmail dot com
2015-06-10  4:43 ` jvdelisle at charter dot net
2015-06-10  4:48 ` kargl at gcc dot gnu.org
2015-06-10 17:21 ` nicolasbock at gmail dot com
2015-06-10 17:29 ` sgk at troutmask dot apl.washington.edu
2015-06-10 18:24 ` nicolasbock at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).