[MacPorts] #36229: gfortran return values of type real(kind=8) or real(kind-10) are mangled

MacPorts noreply at macports.org
Wed Sep 19 16:40:34 PDT 2012


#36229: gfortran return values of type real(kind=8) or real(kind-10) are mangled
----------------------+--------------------------------
 Reporter:  me@…      |      Owner:  macports-tickets@…
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:  2.1.2
 Keywords:  gfortran  |       Port:  gcc45
----------------------+--------------------------------
 The output should be one number twice and a second number twice.  With
 kind=8 or kind=10, passing a value into the function works (the first
 number is repeated correctly), but returning a value out of the function
 does not (the second number is not repeated correctly).

 output with kind=4:
 {{{
    1.2345679
    1.2345679
   0.34567890
   0.34567890
 }}}

 output with kind=8:
 {{{
    1.2345678806304932
    1.2345678806304932
   0.34567889571189880
   3.68934881474191032E+019
 }}}

 output with kind=10:
 {{{
    1.2345678806304931641
    1.2345678806304931641
   0.34567889571189880371
  -3.74416264051907754506E-0013
 }}}

 code with kind=10:
 {{{#!fortran
 program bugtest
 real(kind=10) :: test = 1.234567890123456789012345678901
   print *, test
   test = check(test)
   print *, test
 end program bugtest

 function check(x)
 real(kind=10) :: x, check
   check = 0.345678901234567890123456789012
   print *, x
   print *, check
 end
 }}}

 environment:
 {{{
 $ system_profiler SPSoftwareDataType
 Software:

     System Software Overview:

       System Version: Mac OS X 10.7.4 (11E53)
       Kernel Version: Darwin 11.4.0
       Boot Volume: Macintosh HD
       Boot Mode: Normal
       Computer Name: Shad Sterling’s MacBook
       User Name: Shad Sterling (polyergic)
       Secure Virtual Memory: Enabled
       64-bit Kernel and Extensions: No
       Time since boot: 5 days 13:13

 $ port version
 Version: 2.1.2
 $ which gfortran
 /opt/local/bin/gfortran
 [2012-Sep-19-Wed 19:33:59] polyergic at laconic : ~/Documents/2012/MATH 4610
 - Numerical Analysis 1/Homework 2 $ ls -l `which gfortran`
 lrwxr-xr-x 1 root admin 30 Sep 19 12:05 /opt/local/bin/gfortran ->
 /opt/local/bin/gfortran-mp-4.5
 [2012-Sep-19-Wed 19:34:18] polyergic at laconic : ~/Documents/2012/MATH 4610
 - Numerical Analysis 1/Homework 2 $ gfortran --version
 GNU Fortran (MacPorts gcc45 4.5.4_4) 4.5.4
 Copyright (C) 2010 Free Software Foundation, Inc.

 GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
 You may redistribute copies of GNU Fortran
 under the terms of the GNU General Public License.
 For more information about these matters, see the file named COPYING
 }}}
 (I don't understand the "64-bit Kernel and Extensions: No"; Activity
 Monitor shows mostly 64-bit processes, including every instance of bash.)

-- 
Ticket URL: <https://trac.macports.org/ticket/36229>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list