With -fdefault-integer-8 the following code: program test_rrspacing real x x = 3.0 x = rrspacing(x) print *, x, spacing(x), spacing(3.0) x = 3.0 x = spacing(x) print *, x end gives: 0.7500000 1.6777216E+07 2.3841858E-07 1.6777216E+07 instead of 1.2582912E+07 1.000000 2.3841858E-07 2.3841858E-07 Note that like PR32933 the code does not involve directly integers and as in the original test of PR32770 it seems to be linked to bigendian platforms (PPC here).
I Know how to fix the problems with spacing and rrspacing. Patch is forthcoming.
Subject: Bug 32969 Author: kargl Date: Sat Aug 4 16:48:50 2007 New Revision: 127205 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127205 Log: 2008-08-04 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/32968 * gfortran.dg/selected_kind_1.f90: New test. 2008-08-04 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/32969 * iresolve.c (gfc_resolve_rrspacing): Convert argument(s) to expected KIND. (gfc_resolve_scale): Ditto. (gfc_resolve_set_exponent): Ditto. (gfc_resolve_spacing): Ditto. PR fortran/32968 * trans-intrinsic.c (gfc_conv_intrinsic_si_kind, gfc_conv_intrinsic_sr_kind): Convert the argument(s) to the expected KIND, and fold the result to the expected KIND. Added: trunk/gcc/testsuite/gfortran.dg/selected_kind_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/iresolve.c trunk/gcc/fortran/trans-intrinsic.c trunk/gcc/testsuite/ChangeLog
Should be fixed on trunk. No back port.