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: [Patch, fortran] PR25289 Cannot handle record numbers large than huge(0_4)


In libgfortran you can see that gfc_offset is defined in terms of off_t and it is 64 bits there. However, at the point of interest in trans-io.c, off_t is int4 and not int8.

I found this out trying gfc_get_int_type (sizeof(off_t)) which fails miserably and in -fdump-tree-original you can see that rec is assigned (int4) n, with the int4 cast.
[...]
> If I use gfc_get_int_type (sizeof(off64_t)) all appears to work fine.
> Is it safe to assume off64_t is defined for all targets of interest?

You cannot do that kind of things anyhow, because the host off64_t (which will be used when the front-end is compiled) might not have the same size as the target off64_t (which will be used for the library). On that topic, you can e.g. read the thread that lead to http://gcc.gnu.org/ml/fortran/2005-12/msg00136.html According to Richard Henderson, that problem is solvable (http://gcc.gnu.org/ml/fortran/2005-12/msg00142.html), but I'm not sure if he's in possession of a constructive proof of existence ;-)

One possibility it to define a gfc_large_int to be integer(kind=8) if it exists, and integer(kind=4) otherwise (and do the same in the library).

FX


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