Bug 34318 - Modules: Infinity/NaN parameters read as 0.0
Summary: Modules: Infinity/NaN parameters read as 0.0
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-02 23:21 UTC by Tobias Burnus
Modified: 2007-12-04 10:33 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2007-12-02 23:21:23 UTC
Split off of PR 34230.

Compile the following with -fno-range-check:

   module except
   real, parameter :: inf = 1./0., nan = 0./0.
   end module

   program a
     use except
     print *, inf, nan
   end program a

This prints:
   0.0000000       0.0000000

The .mod shows:
  (CONSTANT (REAL 4 0 0 REAL ()) 0 '0.@Inf@@47231941137967')
and                                 ^^^^^^^^
  (CONSTANT (REAL 4 0 0 REAL ()) 0 '0.@NaN@@47231941137967')
                                    ^^^^^^^^
Comment 1 patchapp@dberlin.org 2007-12-04 10:23:34 UTC
Subject: Bug number PR34318

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00097.html
Comment 2 Tobias Burnus 2007-12-04 10:32:18 UTC
Subject: Bug 34318

Author: burnus
Date: Tue Dec  4 10:32:04 2007
New Revision: 130600

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130600
Log:
2007-12-04  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34318
        * module.c (mio_gmp_real): Properly write NaN and Infinity.

2007-12-04  Tobias Burnus  <burnus@net-b.de>

        PR fortran/34318
        * gfortran.dg/module_nan.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/module_nan.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/module.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Tobias Burnus 2007-12-04 10:33:26 UTC
FIXED on the trunk (4.3.0).