public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38810]  New: Floating point exception
@ 2009-01-12  8:07 martin dot weterings at rws dot nl
  2009-01-12  9:14 ` [Bug fortran/38810] " dfranke at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: martin dot weterings at rws dot nl @ 2009-01-12  8:07 UTC (permalink / raw)
  To: gcc-bugs

Hello,

  I have a fortran program compiled with the gfortran compiler (gfortran -v =>
gcc version 4.1.2) and build with the gcc compiler.
The program directly crashed with a floating point exception and gives the
message "Fortran runtime warning: IEEE 'denormal number' exception not
supported" with an without the compiler option -ffpe-trap.
The same program functions well if compiled with the intell fortran compiler
ifort.

OS : linux (i686) release 2.6.16.54-0.2.5-smp

I tried to find the error in the debugger kdbg, but before the first executable
statement was passed the program stopped with the floating point error.
Can someone tell what is the matter, and how it can be solved.

We want to use the gfortran compiler when it works well.


-- 
           Summary: Floating point exception
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: martin dot weterings at rws dot nl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38810


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

* [Bug fortran/38810] Floating point exception
  2009-01-12  8:07 [Bug fortran/38810] New: Floating point exception martin dot weterings at rws dot nl
@ 2009-01-12  9:14 ` dfranke at gcc dot gnu dot org
  2009-01-12 16:39 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-01-12  9:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dfranke at gcc dot gnu dot org  2009-01-12 09:13 -------
For one, 4.1.2 is slightly outdated by now, try updating to 4.3.x (or
trunk/4.4.0 if you want to use the latest development sources). Depending on
your platform, you might want to try the binaries available from the wiki:
http://gcc.gnu.org/wiki/GFortranBinaries.

If this doesn't help, we would need a self-contained code example to reproduce
(and maybe fix) the problem.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
           Severity|blocker                     |normal
             Status|UNCONFIRMED                 |WAITING
            Summary|Floating point exception    |Floating point exception


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38810


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

* [Bug fortran/38810] Floating point exception
  2009-01-12  8:07 [Bug fortran/38810] New: Floating point exception martin dot weterings at rws dot nl
  2009-01-12  9:14 ` [Bug fortran/38810] " dfranke at gcc dot gnu dot org
@ 2009-01-12 16:39 ` burnus at gcc dot gnu dot org
  2009-01-12 23:36 ` pinskia at gcc dot gnu dot org
  2009-03-28  9:38 ` fxcoudert at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-01-12 16:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-01-12 16:39 -------
For quick reading, skip next part and continue below the * * *.
---------------
I think this applies still (at least partially) as libgfortran/config/fpu*.h's
set_cpu() still has the line. For GLIBC one finds:

/* glibc does never have a FE_DENORMAL.  */
  if (options.fpe & GFC_FPE_DENORMAL)
#ifdef FE_DENORMAL
    feenableexcept (FE_DENORMAL);
#else
    st_printf ("Fortran runtime warning: IEEE 'denormal number' "
               "exception not supported.\n");
#endif

NOTE: The FE_* are defined in the system's fenv.h file and POSIX (SUSv3) does
not specify FE_DENORMAL only: FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW
and FE_UNDERFLOW. And also on my system (glibc-devel-2.9-4.18) fenv.h does not
have FE_DENORMAL.

However, fpu-387.h has support for it:

  if (options.fpe & GFC_FPE_DENORMAL) cw &= ~_FPU_MASK_DM;
[...]
  if (has_sse())
[...]
      if (options.fpe & GFC_FPE_DENORMAL) cw_sse &= ~(_FPU_MASK_DM << 7);

Thus the question is whether for "linux (i686) release" the fpu-387.h should
have been applied instead?

 * * *

For the reported problem:

> gives the message "Fortran runtime warning: IEEE 'denormal number' exception 
> not supported" without the compiler option -ffpe-trap.

It does not make sense that the message is printed without -ffpe-trap=. I don't
see how this could happen (with the current code).

> The program directly crashed with a floating point exception

I some doubt that the FPE crash is related to denormal numbers as they are
usually handled gracefully and are not serious. Especially since the warning
explicitly states that they are not supported for trapping. For the crash it is
extremely unlikely that it happens while printing the warning message.

> I tried to find the error in the debugger kdbg, but before the first 
> executable statement was passed the program stopped with the floating point 
> error.

There is a serious lack of information here - for instance you are missing the
compiler options. Stab into the dark: You are not using by chance
-malign-double or -mno-align-double? If you do, please remove it! (If you
don't, don't use it.)

We need:
1. If possible a minimal program which shows the bug, seemingly something like
     print *, 'Hello World'
     end
   is enough if the crash happens before the actual program is executed
2. The exact command line used to compile the program
3. More information about the compiler, i.e. my 4.1 compiler shows:
     gcc version 4.1.3 20080612 (prerelease) (SUSE Linux)
     Target: x86_64-suse-linux
   What does yours show for "gfortran -v"?

And best is to update to a newer gfortran version. 4.1.x is pretty old and the
4.1.x series is no longer maintained. 4.3.x and the currently developed 4.4 are
maintained (and 4.2.x is still maintained for a couple of weeks). Thus it would
be best if you could update to 4.3.x or 4.4.

As Daniel mentioned: Build instruction and pre-build binaries are available at
http://gcc.gnu.org/wiki/GFortranBinaries


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38810


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

* [Bug fortran/38810] Floating point exception
  2009-01-12  8:07 [Bug fortran/38810] New: Floating point exception martin dot weterings at rws dot nl
  2009-01-12  9:14 ` [Bug fortran/38810] " dfranke at gcc dot gnu dot org
  2009-01-12 16:39 ` burnus at gcc dot gnu dot org
@ 2009-01-12 23:36 ` pinskia at gcc dot gnu dot org
  2009-03-28  9:38 ` fxcoudert at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-12 23:36 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38810


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

* [Bug fortran/38810] Floating point exception
  2009-01-12  8:07 [Bug fortran/38810] New: Floating point exception martin dot weterings at rws dot nl
                   ` (2 preceding siblings ...)
  2009-01-12 23:36 ` pinskia at gcc dot gnu dot org
@ 2009-03-28  9:38 ` fxcoudert at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2009-03-28  9:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2009-03-28 09:38 -------
Closing this report for now. Please reopen it with additional information if
the bug is still there for you after the advice given by Tobias in comment #2.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38810


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

end of thread, other threads:[~2009-03-28  9:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-12  8:07 [Bug fortran/38810] New: Floating point exception martin dot weterings at rws dot nl
2009-01-12  9:14 ` [Bug fortran/38810] " dfranke at gcc dot gnu dot org
2009-01-12 16:39 ` burnus at gcc dot gnu dot org
2009-01-12 23:36 ` pinskia at gcc dot gnu dot org
2009-03-28  9:38 ` fxcoudert at gcc dot gnu dot org

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).