This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] commited, patch for PR 24685


On Wed, Feb 15, 2006 at 10:22:41AM +0100, Fran?ois-Xavier Coudert wrote:
> > The above number is properly sscanf/strtolded as inf, as it is (tiny bit)
> > bigger than __LDBL_MAX__.
> 
> Here is the error. huge() is supposed to be the largest finite number
> of the chosen model (for an explanation about the difference between
> that number and the largest finite number for the corresponding C
> type, see http://gcc.gnu.org/ml/fortran/2005-11/msg00170.html and
> references herein).
> 
> But I believe here that huge() is right, but writing huge() leads to a
> rounded-up value, which when it is read again is then infinite. So

I looked at assembly and
  b(:) = huge(0.0_k)
sets b(1) as well as b(2) to:
        .long   2147418111
        .long   4294967295
        .long   4294967295
        .long   4294967295
which is __LDBL_MAX__.
And pointer to the correct values is passed to _gfortran_transfer_array:

  b[0] = 1.18973149535723176508575932662800701619646905264169404553e+4932;
  b[1] = 1.18973149535723176508575932662800701619646905264169404553e+4932;
  dt_parm.1.common.filename = "large_real_kind_form_io_2.f90";
  dt_parm.1.common.line = 8;
  dt_parm.1.internal_unit = &tmp;
  dt_parm.1.internal_unit_len = 180;
  dt_parm.1.internal_unit_desc = 0B;
  dt_parm.1.common.unit = 0;
  dt_parm.1.common.flags = 16512;
  _gfortran_st_write (&dt_parm.1);
  parm.2.dtype = 1049;
  parm.2.dim[0].lbound = 1;
  parm.2.dim[0].ubound = 2;
  parm.2.dim[0].stride = 1;
  D.711 = (real16[0:] *) &b[0];
  parm.2.data = D.711;
  parm.2.offset = 0;
  _gfortran_transfer_array (&dt_parm.1, &parm.2, 16, 0);
  _gfortran_st_write_done (&dt_parm.1);

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]